Commit 78c852a0 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add EUI-64 parsing to filter code.

parent 622ca3d9
......@@ -121,6 +121,33 @@ getip(int c, unsigned char **ip_r, int *af_r, gnc_t gnc, void *closure)
return c;
}
static int
getid(int c, unsigned char **id_r, gnc_t gnc, void *closure)
{
char *t;
unsigned char *idp;
unsigned char id[8];
int rc;
c = getword(c, &t, gnc, closure);
if(c < -1)
return c;
rc = parse_eui64(t, id);
if(rc < 0) {
free(t);
return -2;
}
free(t);
idp = malloc(8);
if(idp == NULL) {
return -2;
}
memcpy(idp, id, 8);
*id_r = idp;
return c;
}
static int
getnet(int c, unsigned char **p_r, unsigned char *plen_r, int *af_r,
gnc_t gnc, void *closure)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment