FreeBSD/contrib/bsnmp/snmp_mibII/mibII.c
/*
 * Generate a link up/down trap
 */
Generate a link up/down trap
Generate a link up / down trap
static void
link_trap(struct mibif *ifp, int up)
{
	struct snmp_value ifindex;
	ifindex.var = oid_ifIndex;
	ifindex.var.subs[ifindex.var.len++] = ifp->index;
	ifindex.syntax = SNMP_SYNTAX_INTEGER;
	ifindex.v.integer = ifp->index;
	snmp_send_trap(up ? &oid_linkUp : &oid_linkDown, &ifindex,
	    (struct snmp_value *)NULL);
}
static void link_trap ( struct mibif * ifp , int up ) { struct snmp_value ifindex ; ifindex . var = oid_ifIndex ; ifindex . var . subs [ ifindex . var . len ++ ] = ifp -> index ; ifindex . syntax = SNMP_SYNTAX_INTEGER ; ifindex . v . integer = ifp -> index ; snmp_send_trap ( up ? & oid_linkUp : & oid_linkDown , & ifindex , ( struct snmp_value * ) NULL ) ; }
Generate a link up/down trap
Generate a link up / down trap