Changeset View
Changeset View
Standalone View
Standalone View
contrib/bsnmp/snmp_mibII/mibII.c
Show First 20 Lines • Show All 840 Lines • ▼ Show 20 Lines | |||||
* This is called for new interfaces after we have fetched the interface | * This is called for new interfaces after we have fetched the interface | ||||
* MIB. If this is a broadcast interface try to guess the broadcast address | * MIB. If this is a broadcast interface try to guess the broadcast address | ||||
* depending on the interface type. | * depending on the interface type. | ||||
*/ | */ | ||||
static void | static void | ||||
check_llbcast(struct mibif *ifp) | check_llbcast(struct mibif *ifp) | ||||
{ | { | ||||
static u_char ether_bcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | static u_char ether_bcast[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | ||||
static u_char arcnet_bcast = 0; | |||||
struct mibrcvaddr *rcv; | struct mibrcvaddr *rcv; | ||||
if (!(ifp->mib.ifmd_flags & IFF_BROADCAST)) | if (!(ifp->mib.ifmd_flags & IFF_BROADCAST)) | ||||
return; | return; | ||||
switch (ifp->mib.ifmd_data.ifi_type) { | switch (ifp->mib.ifmd_data.ifi_type) { | ||||
case IFT_ETHER: | case IFT_ETHER: | ||||
case IFT_FDDI: | case IFT_FDDI: | ||||
case IFT_ISO88025: | case IFT_ISO88025: | ||||
case IFT_L2VLAN: | case IFT_L2VLAN: | ||||
if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL && | if (mib_find_rcvaddr(ifp->index, ether_bcast, 6) == NULL && | ||||
(rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL) | (rcv = mib_rcvaddr_create(ifp, ether_bcast, 6)) != NULL) | ||||
rcv->flags |= MIBRCVADDR_BCAST; | |||||
break; | |||||
case IFT_ARCNET: | |||||
if (mib_find_rcvaddr(ifp->index, &arcnet_bcast, 1) == NULL && | |||||
(rcv = mib_rcvaddr_create(ifp, &arcnet_bcast, 1)) != NULL) | |||||
rcv->flags |= MIBRCVADDR_BCAST; | rcv->flags |= MIBRCVADDR_BCAST; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
/* | /* | ||||
* Retrieve the current interface list from the system. | * Retrieve the current interface list from the system. | ||||
▲ Show 20 Lines • Show All 942 Lines • Show Last 20 Lines |