iflagg.c (a0ebb915045ed0056decec5f001471af4e999f61) iflagg.c (8b22242550c98d0a59b6589f2be0beb1dc2eac13)
1/*-
2 */
3
4#ifndef lint
5static const char rcsid[] =
6 "$FreeBSD$";
7#endif /* not lint */
8

--- 205 unchanged lines hidden (view full) ---

214
215 return(lacpbuf);
216}
217
218static void
219lagg_status(int s)
220{
221 struct lagg_protos protos[] = LAGG_PROTOS;
1/*-
2 */
3
4#ifndef lint
5static const char rcsid[] =
6 "$FreeBSD$";
7#endif /* not lint */
8

--- 205 unchanged lines hidden (view full) ---

214
215 return(lacpbuf);
216}
217
218static void
219lagg_status(int s)
220{
221 struct lagg_protos protos[] = LAGG_PROTOS;
222 ifconfig_handle_t *lifh;
223 struct ifconfig_lagg_status *lagg;
224 struct lagg_reqall *ra;
225 struct lagg_reqflags *rf;
226 struct lagg_reqopts *ro;
227 struct lagg_reqport *ports;
228 struct lacp_opreq *lp;
229 const char *proto;
230
222 struct ifconfig_lagg_status *lagg;
223 struct lagg_reqall *ra;
224 struct lagg_reqflags *rf;
225 struct lagg_reqopts *ro;
226 struct lagg_reqport *ports;
227 struct lacp_opreq *lp;
228 const char *proto;
229
231 lifh = ifconfig_open();
232 if (lifh == NULL)
230 if (ifconfig_lagg_get_lagg_status(lifh, name, &lagg) == -1)
233 return;
234
231 return;
232
235 if (ifconfig_lagg_get_lagg_status(lifh, name, &lagg) == -1)
236 goto close;
237
238 ra = lagg->ra;
239 rf = lagg->rf;
240 ro = lagg->ro;
241 ports = ra->ra_port;
242
243 proto = "<unknown>";
244 for (size_t i = 0; i < nitems(protos); ++i) {
245 if (ra->ra_proto == protos[i].lpr_proto) {

--- 46 unchanged lines hidden (view full) ---

292 printb(" state", lp->actor_state, LACP_STATE_BITS);
293 putchar('\n');
294 if (verbose && ra->ra_proto == LAGG_PROTO_LACP)
295 printf("\t\t%s\n",
296 lacp_format_peer(lp, "\n\t\t "));
297 }
298
299 ifconfig_lagg_free_lagg_status(lagg);
233 ra = lagg->ra;
234 rf = lagg->rf;
235 ro = lagg->ro;
236 ports = ra->ra_port;
237
238 proto = "<unknown>";
239 for (size_t i = 0; i < nitems(protos); ++i) {
240 if (ra->ra_proto == protos[i].lpr_proto) {

--- 46 unchanged lines hidden (view full) ---

287 printb(" state", lp->actor_state, LACP_STATE_BITS);
288 putchar('\n');
289 if (verbose && ra->ra_proto == LAGG_PROTO_LACP)
290 printf("\t\t%s\n",
291 lacp_format_peer(lp, "\n\t\t "));
292 }
293
294 ifconfig_lagg_free_lagg_status(lagg);
300close:
301 ifconfig_close(lifh);
302}
303
304static
305DECL_CMD_FUNC(setlaggtype, arg, d)
306{
307 static const struct lagg_types lt[] = LAGG_TYPES;
308 int i;
309

--- 53 unchanged lines hidden ---
295}
296
297static
298DECL_CMD_FUNC(setlaggtype, arg, d)
299{
300 static const struct lagg_types lt[] = LAGG_TYPES;
301 int i;
302

--- 53 unchanged lines hidden ---