Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/ifconfig/iflagg.c
Show First 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | lacp_format_peer(struct lacp_opreq *req, const char *sep) | ||||
return(lacpbuf); | return(lacpbuf); | ||||
} | } | ||||
static void | static void | ||||
lagg_status(int s) | lagg_status(int s) | ||||
{ | { | ||||
struct lagg_protos lpr[] = LAGG_PROTOS; | struct lagg_protos lpr[] = LAGG_PROTOS; | ||||
struct lagg_reqport rp, rpbuf[LAGG_MAX_PORTS]; | struct lagg_reqport rpbuf[LAGG_MAX_PORTS]; | ||||
struct lagg_reqall ra; | struct lagg_reqall ra; | ||||
struct lagg_reqopts ro; | struct lagg_reqopts ro; | ||||
struct lagg_reqflags rf; | struct lagg_reqflags rf; | ||||
struct lacp_opreq *lp; | struct lacp_opreq *lp; | ||||
const char *proto = "<unknown>"; | const char *proto = "<unknown>"; | ||||
int i, isport = 0; | int i; | ||||
bzero(&rp, sizeof(rp)); | |||||
bzero(&ra, sizeof(ra)); | bzero(&ra, sizeof(ra)); | ||||
bzero(&ro, sizeof(ro)); | bzero(&ro, sizeof(ro)); | ||||
strlcpy(rp.rp_ifname, name, sizeof(rp.rp_ifname)); | |||||
strlcpy(rp.rp_portname, name, sizeof(rp.rp_portname)); | |||||
if (ioctl(s, SIOCGLAGGPORT, &rp) == 0) | |||||
isport = 1; | |||||
strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname)); | strlcpy(ra.ra_ifname, name, sizeof(ra.ra_ifname)); | ||||
ra.ra_size = sizeof(rpbuf); | ra.ra_size = sizeof(rpbuf); | ||||
ra.ra_port = rpbuf; | ra.ra_port = rpbuf; | ||||
strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); | strlcpy(ro.ro_ifname, name, sizeof(ro.ro_ifname)); | ||||
ioctl(s, SIOCGLAGGOPTS, &ro); | ioctl(s, SIOCGLAGGOPTS, &ro); | ||||
strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); | strlcpy(rf.rf_ifname, name, sizeof(rf.rf_ifname)); | ||||
Show All 23 Lines | if (rf.rf_flags & LAGG_F_HASHMASK) { | ||||
printf("%sl3", sep); | printf("%sl3", sep); | ||||
sep = ","; | sep = ","; | ||||
} | } | ||||
if (rf.rf_flags & LAGG_F_HASHL4) { | if (rf.rf_flags & LAGG_F_HASHL4) { | ||||
printf("%sl4", sep); | printf("%sl4", sep); | ||||
sep = ","; | sep = ","; | ||||
} | } | ||||
} | } | ||||
if (isport) | |||||
printf(" laggdev %s", rp.rp_ifname); | |||||
putchar('\n'); | putchar('\n'); | ||||
if (verbose) { | if (verbose) { | ||||
printf("\tlagg options:\n"); | printf("\tlagg options:\n"); | ||||
printb("\t\tflags", ro.ro_opts, LAGG_OPT_BITS); | printb("\t\tflags", ro.ro_opts, LAGG_OPT_BITS); | ||||
putchar('\n'); | putchar('\n'); | ||||
printf("\t\tflowid_shift: %d\n", ro.ro_flowid_shift); | printf("\t\tflowid_shift: %d\n", ro.ro_flowid_shift); | ||||
if (ra.ra_proto == LAGG_PROTO_ROUNDROBIN) | if (ra.ra_proto == LAGG_PROTO_ROUNDROBIN) | ||||
printf("\t\trr_limit: %d\n", ro.ro_bkt); | printf("\t\trr_limit: %d\n", ro.ro_bkt); | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |