version 1.1, 2012/02/21 23:32:47
|
version 1.1.1.2, 2021/03/17 00:39:23
|
Line 64
|
Line 64
|
static void Ipv6cpLayerDown(Fsm fp); |
static void Ipv6cpLayerDown(Fsm fp); |
static void Ipv6cpFailure(Fsm fp, enum fsmfail reason); |
static void Ipv6cpFailure(Fsm fp, enum fsmfail reason); |
|
|
static int Ipv6cpSetCommand(Context ctx, int ac, char *av[], void *arg); | static int Ipv6cpSetCommand(Context ctx, int ac, const char *const av[], const void *arg); |
|
|
void CreateInterfaceID(u_char *intid, int random); |
void CreateInterfaceID(u_char *intid, int random); |
/* |
/* |
Line 84
|
Line 84
|
Ipv6cpSetCommand, NULL, 2, (void *) SET_YES}, |
Ipv6cpSetCommand, NULL, 2, (void *) SET_YES}, |
{ "no [opt ...]", "Disable and deny option", |
{ "no [opt ...]", "Disable and deny option", |
Ipv6cpSetCommand, NULL, 2, (void *) SET_NO}, |
Ipv6cpSetCommand, NULL, 2, (void *) SET_NO}, |
{ NULL }, | { NULL, NULL, NULL, NULL, 0, NULL }, |
}; |
}; |
|
|
/* |
/* |
Line 94
|
Line 94
|
static const struct fsmoptinfo gIpv6cpConfOpts[] = { |
static const struct fsmoptinfo gIpv6cpConfOpts[] = { |
{ "INTIDENT", TY_INTIDENT, 8, 8, TRUE }, |
{ "INTIDENT", TY_INTIDENT, 8, 8, TRUE }, |
{ "COMPPROTO", TY_COMPPROTO, 4, 4, FALSE }, |
{ "COMPPROTO", TY_COMPPROTO, 4, 4, FALSE }, |
{ NULL } | { NULL, 0, 0, 0, 0 } |
}; |
}; |
|
|
static const struct confinfo gConfList[] = { |
static const struct confinfo gConfList[] = { |
Line 124
|
Line 124
|
Ipv6cpFailure, |
Ipv6cpFailure, |
NULL, |
NULL, |
NULL, |
NULL, |
NULL, | NULL, NULL, NULL, NULL |
}; |
}; |
|
|
/* |
/* |
Line 132
|
Line 132
|
*/ |
*/ |
|
|
int |
int |
Ipv6cpStat(Context ctx, int ac, char *av[], void *arg) | Ipv6cpStat(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
Ipv6cpState const ipv6cp = &ctx->bund->ipv6cp; |
Ipv6cpState const ipv6cp = &ctx->bund->ipv6cp; |
Fsm fp = &ipv6cp->fsm; |
Fsm fp = &ipv6cp->fsm; |
|
|
|
(void)ac; |
|
(void)av; |
|
(void)arg; |
|
|
Printf("[%s] %s [%s]\r\n", Pref(fp), Fsm(fp), FsmStateName(fp->state)); |
Printf("[%s] %s [%s]\r\n", Pref(fp), Fsm(fp), FsmStateName(fp->state)); |
Printf("Interface identificators:\r\n"); |
Printf("Interface identificators:\r\n"); |
Printf("\tSelf: %02x%02x:%02x%02x:%02x%02x:%02x%02x\r\n", |
Printf("\tSelf: %02x%02x:%02x%02x:%02x%02x:%02x%02x\r\n", |
Line 177 CreateInterfaceID(u_char *intid, int r)
|
Line 181 CreateInterfaceID(u_char *intid, int r)
|
} |
} |
|
|
srandomdev(); |
srandomdev(); |
((u_int32_t*)intid)[0]=(((u_int32_t)random()) % 0xFFFFFFFF) + 1; | ((u_int32_t*)(void*)intid)[0]=(((u_int32_t)random()) % 0xFFFFFFFF) + 1; |
((u_int32_t*)intid)[1]=(((u_int32_t)random()) % 0xFFFFFFFF) + 1; | ((u_int32_t*)(void*)intid)[1]=(((u_int32_t)random()) % 0xFFFFFFFF) + 1; |
intid[0] &= 0xfd; |
intid[0] &= 0xfd; |
|
|
} |
} |
Line 236 Ipv6cpConfigure(Fsm fp)
|
Line 240 Ipv6cpConfigure(Fsm fp)
|
static void |
static void |
Ipv6cpUnConfigure(Fsm fp) |
Ipv6cpUnConfigure(Fsm fp) |
{ |
{ |
|
(void)fp; |
} |
} |
|
|
/* |
/* |
Line 445 Ipv6cpDecodeConfig(Fsm fp, FsmOption list, int num, in
|
Line 450 Ipv6cpDecodeConfig(Fsm fp, FsmOption list, int num, in
|
opt->data[0], opt->data[1], opt->data[2], opt->data[3], |
opt->data[0], opt->data[1], opt->data[2], opt->data[3], |
opt->data[4], opt->data[5], opt->data[6], opt->data[7])); |
opt->data[4], opt->data[5], opt->data[6], opt->data[7])); |
switch (mode) { |
switch (mode) { |
|
u_int32_t *ui32p; |
case MODE_REQ: |
case MODE_REQ: |
if ((((u_int32_t*)opt->data)[0]==0) && (((u_int32_t*)opt->data)[1]==0)) { | ui32p = (u_int32_t *)(void *)opt->data; |
| if ((ui32p[0]==0) && (ui32p[1]==0)) { |
Log(LG_IPV6CP2, ("[%s] Empty INTIDENT, propose our.", b->name)); |
Log(LG_IPV6CP2, ("[%s] Empty INTIDENT, propose our.", b->name)); |
CreateInterfaceID(ipv6cp->hisintid, 1); |
CreateInterfaceID(ipv6cp->hisintid, 1); |
memcpy(opt->data, ipv6cp->hisintid, 8); |
memcpy(opt->data, ipv6cp->hisintid, 8); |
Line 496 Ipv6cpInput(Bund b, Mbuf bp)
|
Line 503 Ipv6cpInput(Bund b, Mbuf bp)
|
*/ |
*/ |
|
|
static int |
static int |
Ipv6cpSetCommand(Context ctx, int ac, char *av[], void *arg) | Ipv6cpSetCommand(Context ctx, int ac, const char *const av[], const void *arg) |
{ |
{ |
Ipv6cpState const ipv6cp = &ctx->bund->ipv6cp; |
Ipv6cpState const ipv6cp = &ctx->bund->ipv6cp; |
|
|