version 1.1.1.1, 2012/02/21 17:26:12
|
version 1.1.1.2, 2012/10/09 09:22:28
|
Line 64 ospf6_set_pktinfo (void)
|
Line 64 ospf6_set_pktinfo (void)
|
} |
} |
|
|
void |
void |
|
ospf6_set_transport_class (void) |
|
{ |
|
#ifdef IPTOS_PREC_INTERNETCONTROL |
|
setsockopt_ipv6_tclass (ospf6_sock, IPTOS_PREC_INTERNETCONTROL); |
|
#endif |
|
} |
|
|
|
void |
ospf6_set_checksum (void) |
ospf6_set_checksum (void) |
{ |
{ |
int offset = 12; |
int offset = 12; |
Line 102 ospf6_serv_sock (void)
|
Line 110 ospf6_serv_sock (void)
|
#endif /*1*/ |
#endif /*1*/ |
ospf6_reset_mcastloop (); |
ospf6_reset_mcastloop (); |
ospf6_set_pktinfo (); |
ospf6_set_pktinfo (); |
|
ospf6_set_transport_class (); |
ospf6_set_checksum (); |
ospf6_set_checksum (); |
|
|
/* setup global in6_addr, allspf6 and alldr6 for later use */ |
/* setup global in6_addr, allspf6 and alldr6 for later use */ |
Line 111 ospf6_serv_sock (void)
|
Line 120 ospf6_serv_sock (void)
|
return 0; |
return 0; |
} |
} |
|
|
|
/* ospf6 set socket option */ |
void |
void |
ospf6_join_allspfrouters (u_int ifindex) | ospf6_sso (u_int ifindex, struct in6_addr *group, int option) |
{ |
{ |
struct ipv6_mreq mreq6; |
struct ipv6_mreq mreq6; |
int retval; | int ret; |
|
|
assert (ifindex); |
assert (ifindex); |
mreq6.ipv6mr_interface = ifindex; |
mreq6.ipv6mr_interface = ifindex; |
memcpy (&mreq6.ipv6mr_multiaddr, &allspfrouters6, | memcpy (&mreq6.ipv6mr_multiaddr, group, sizeof (struct in6_addr)); |
sizeof (struct in6_addr)); | |
|
|
retval = setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, | ret = setsockopt (ospf6_sock, IPPROTO_IPV6, option, |
&mreq6, sizeof (mreq6)); | &mreq6, sizeof (mreq6)); |
| if (ret < 0) |
if (retval < 0) | zlog_err ("Network: setsockopt (%d) on ifindex %d failed: %s", |
zlog_err ("Network: Join AllSPFRouters on ifindex %d failed: %s", | option, ifindex, safe_strerror (errno)); |
ifindex, safe_strerror (errno)); | |
#if 0 | |
else | |
zlog_debug ("Network: Join AllSPFRouters on ifindex %d", ifindex); | |
#endif | |
} | |
| |
void | |
ospf6_leave_allspfrouters (u_int ifindex) | |
{ | |
struct ipv6_mreq mreq6; | |
| |
assert (ifindex); | |
mreq6.ipv6mr_interface = ifindex; | |
memcpy (&mreq6.ipv6mr_multiaddr, &allspfrouters6, | |
sizeof (struct in6_addr)); | |
| |
if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP, | |
&mreq6, sizeof (mreq6)) < 0) | |
zlog_warn ("Network: Leave AllSPFRouters on ifindex %d Failed: %s", | |
ifindex, safe_strerror (errno)); | |
#if 0 | |
else | |
zlog_debug ("Network: Leave AllSPFRouters on ifindex %d", ifindex); | |
#endif | |
} | |
| |
void | |
ospf6_join_alldrouters (u_int ifindex) | |
{ | |
struct ipv6_mreq mreq6; | |
| |
assert (ifindex); | |
mreq6.ipv6mr_interface = ifindex; | |
memcpy (&mreq6.ipv6mr_multiaddr, &alldrouters6, | |
sizeof (struct in6_addr)); | |
| |
if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_JOIN_GROUP, | |
&mreq6, sizeof (mreq6)) < 0) | |
zlog_warn ("Network: Join AllDRouters on ifindex %d Failed: %s", | |
ifindex, safe_strerror (errno)); | |
#if 0 | |
else | |
zlog_debug ("Network: Join AllDRouters on ifindex %d", ifindex); | |
#endif | |
} | |
| |
void | |
ospf6_leave_alldrouters (u_int ifindex) | |
{ | |
struct ipv6_mreq mreq6; | |
| |
assert (ifindex); | |
mreq6.ipv6mr_interface = ifindex; | |
memcpy (&mreq6.ipv6mr_multiaddr, &alldrouters6, | |
sizeof (struct in6_addr)); | |
| |
if (setsockopt (ospf6_sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP, | |
&mreq6, sizeof (mreq6)) < 0) | |
zlog_warn ("Network: Leave AllDRouters on ifindex %d Failed", ifindex); | |
#if 0 | |
else | |
zlog_debug ("Network: Leave AllDRouters on ifindex %d", ifindex); | |
#endif | |
} |
} |
|
|
static int |
static int |