Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/sctp_bsd_addr.c
Show First 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | sctp_init_vrf_list(int vrfid) | ||||
/* | /* | ||||
* Now we need to build all the ifn's for this vrf and there | * Now we need to build all the ifn's for this vrf and there | ||||
* addresses | * addresses | ||||
*/ | */ | ||||
sctp_init_ifns_for_vrf(vrfid); | sctp_init_ifns_for_vrf(vrfid); | ||||
} | } | ||||
void | void | ||||
sctp_addr_change(struct ifaddr *ifa, int cmd) | sctp_addr_change(void *arg __unused, struct ifaddr *ifa, int cmd) | ||||
{ | { | ||||
uint32_t ifa_flags = 0; | uint32_t ifa_flags = 0; | ||||
if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { | if (SCTP_BASE_VAR(sctp_pcb_initialized) == 0) { | ||||
return; | return; | ||||
} | } | ||||
/* | /* | ||||
* BSD only has one VRF, if this changes we will need to hook in the | * BSD only has one VRF, if this changes we will need to hook in the | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | if (cmd == RTM_ADD) { | ||||
/* | /* | ||||
* We don't bump refcount here so when it completes the | * We don't bump refcount here so when it completes the | ||||
* final delete will happen. | * final delete will happen. | ||||
*/ | */ | ||||
} | } | ||||
} | } | ||||
void | void | ||||
sctp_add_or_del_interfaces(int (*pred) (struct ifnet *), int add){ | sctp_add_or_del_interfaces(int (*pred) (struct ifnet *), int add) | ||||
{ | |||||
struct ifnet *ifn; | struct ifnet *ifn; | ||||
struct ifaddr *ifa; | struct ifaddr *ifa; | ||||
IFNET_RLOCK(); | IFNET_RLOCK(); | ||||
CK_STAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_link) { | CK_STAILQ_FOREACH(ifn, &MODULE_GLOBAL(ifnet), if_link) { | ||||
if (!(*pred) (ifn)) { | if (!(*pred) (ifn)) { | ||||
continue; | continue; | ||||
} | } | ||||
CK_STAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) { | CK_STAILQ_FOREACH(ifa, &ifn->if_addrhead, ifa_link) { | ||||
sctp_addr_change(ifa, add ? RTM_ADD : RTM_DELETE); | sctp_addr_change(NULL, ifa, add ? RTM_ADD : RTM_DELETE); | ||||
} | } | ||||
} | } | ||||
IFNET_RUNLOCK(); | IFNET_RUNLOCK(); | ||||
} | } | ||||
struct mbuf * | struct mbuf * | ||||
sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header, | sctp_get_mbuf_for_msg(unsigned int space_needed, int want_header, | ||||
int how, int allonebuf, int type) | int how, int allonebuf, int type) | ||||
▲ Show 20 Lines • Show All 170 Lines • Show Last 20 Lines |