Deleted Added
full compact
ifmedia.c (50476) ifmedia.c (77217)
1/* $NetBSD: ifconfig.c,v 1.34 1997/04/21 01:17:58 lukem Exp $ */
1/* $NetBSD: ifconfig.c,v 1.34 1997/04/21 01:17:58 lukem Exp $ */
2/* $FreeBSD: head/sbin/ifconfig/ifmedia.c 50476 1999-08-28 00:22:10Z peter $ */
2/* $FreeBSD: head/sbin/ifconfig/ifmedia.c 77217 2001-05-26 09:27:08Z phk $ */
3
4/*
5 * Copyright (c) 1997 Jason R. Thorpe.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:

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

147
148 case IFM_FDDI:
149 case IFM_TOKEN:
150 if (ifmr.ifm_status & IFM_ACTIVE)
151 printf("inserted");
152 else
153 printf("no ring");
154 break;
3
4/*
5 * Copyright (c) 1997 Jason R. Thorpe.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:

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

147
148 case IFM_FDDI:
149 case IFM_TOKEN:
150 if (ifmr.ifm_status & IFM_ACTIVE)
151 printf("inserted");
152 else
153 printf("no ring");
154 break;
155 case IFM_IEEE80211:
156 /* XXX: Different value for adhoc? */
157 if (ifmr.ifm_status & IFM_ACTIVE)
158 printf("associated");
159 else
160 printf("no carrier");
161 break;
155 }
156 }
157
158 putchar('\n');
159
160 if (ifmr.ifm_count > 0) {
161 printf("\tsupported media:");
162 for (i = 0; i < ifmr.ifm_count; i++) {

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

313 IFM_SUBTYPE_FDDI_DESCRIPTIONS;
314
315static struct ifmedia_description ifm_subtype_fddi_aliases[] =
316 IFM_SUBTYPE_FDDI_ALIASES;
317
318static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] =
319 IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS;
320
162 }
163 }
164
165 putchar('\n');
166
167 if (ifmr.ifm_count > 0) {
168 printf("\tsupported media:");
169 for (i = 0; i < ifmr.ifm_count; i++) {

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

320 IFM_SUBTYPE_FDDI_DESCRIPTIONS;
321
322static struct ifmedia_description ifm_subtype_fddi_aliases[] =
323 IFM_SUBTYPE_FDDI_ALIASES;
324
325static struct ifmedia_description ifm_subtype_fddi_option_descriptions[] =
326 IFM_SUBTYPE_FDDI_OPTION_DESCRIPTIONS;
327
328static struct ifmedia_description ifm_subtype_ieee80211_descriptions[] =
329 IFM_SUBTYPE_IEEE80211_DESCRIPTIONS;
330
331static struct ifmedia_description ifm_subtype_ieee80211_aliases[] =
332 IFM_SUBTYPE_IEEE80211_ALIASES;
333
334static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] =
335 IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS;
336
321static struct ifmedia_description ifm_subtype_shared_descriptions[] =
322 IFM_SUBTYPE_SHARED_DESCRIPTIONS;
323
324static struct ifmedia_description ifm_subtype_shared_aliases[] =
325 IFM_SUBTYPE_SHARED_ALIASES;
326
327static struct ifmedia_description ifm_shared_option_descriptions[] =
328 IFM_SHARED_OPTION_DESCRIPTIONS;

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

345 { &ifm_subtype_shared_descriptions[0], 0 },
346 { &ifm_subtype_shared_aliases[0], 1 },
347 { &ifm_subtype_ethernet_descriptions[0], 0 },
348 { &ifm_subtype_ethernet_aliases[0], 1 },
349 { NULL, 0 },
350 },
351 {
352 { &ifm_shared_option_descriptions[0], 0 },
337static struct ifmedia_description ifm_subtype_shared_descriptions[] =
338 IFM_SUBTYPE_SHARED_DESCRIPTIONS;
339
340static struct ifmedia_description ifm_subtype_shared_aliases[] =
341 IFM_SUBTYPE_SHARED_ALIASES;
342
343static struct ifmedia_description ifm_shared_option_descriptions[] =
344 IFM_SHARED_OPTION_DESCRIPTIONS;

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

361 { &ifm_subtype_shared_descriptions[0], 0 },
362 { &ifm_subtype_shared_aliases[0], 1 },
363 { &ifm_subtype_ethernet_descriptions[0], 0 },
364 { &ifm_subtype_ethernet_aliases[0], 1 },
365 { NULL, 0 },
366 },
367 {
368 { &ifm_shared_option_descriptions[0], 0 },
353 { &ifm_subtype_ethernet_option_descriptions[0], 1 },
369 { &ifm_subtype_ethernet_option_descriptions[0], 0 },
354 { NULL, 0 },
355 },
356 },
357 {
358 {
359 { &ifm_subtype_shared_descriptions[0], 0 },
360 { &ifm_subtype_shared_aliases[0], 1 },
361 { &ifm_subtype_tokenring_descriptions[0], 0 },
362 { &ifm_subtype_tokenring_aliases[0], 1 },
363 { NULL, 0 },
364 },
365 {
366 { &ifm_shared_option_descriptions[0], 0 },
370 { NULL, 0 },
371 },
372 },
373 {
374 {
375 { &ifm_subtype_shared_descriptions[0], 0 },
376 { &ifm_subtype_shared_aliases[0], 1 },
377 { &ifm_subtype_tokenring_descriptions[0], 0 },
378 { &ifm_subtype_tokenring_aliases[0], 1 },
379 { NULL, 0 },
380 },
381 {
382 { &ifm_shared_option_descriptions[0], 0 },
367 { &ifm_subtype_tokenring_option_descriptions[0], 1 },
383 { &ifm_subtype_tokenring_option_descriptions[0], 0 },
368 { NULL, 0 },
369 },
370 },
371 {
372 {
373 { &ifm_subtype_shared_descriptions[0], 0 },
374 { &ifm_subtype_shared_aliases[0], 1 },
375 { &ifm_subtype_fddi_descriptions[0], 0 },
376 { &ifm_subtype_fddi_aliases[0], 1 },
377 { NULL, 0 },
378 },
379 {
380 { &ifm_shared_option_descriptions[0], 0 },
384 { NULL, 0 },
385 },
386 },
387 {
388 {
389 { &ifm_subtype_shared_descriptions[0], 0 },
390 { &ifm_subtype_shared_aliases[0], 1 },
391 { &ifm_subtype_fddi_descriptions[0], 0 },
392 { &ifm_subtype_fddi_aliases[0], 1 },
393 { NULL, 0 },
394 },
395 {
396 { &ifm_shared_option_descriptions[0], 0 },
381 { &ifm_subtype_fddi_option_descriptions[0], 1 },
397 { &ifm_subtype_fddi_option_descriptions[0], 0 },
382 { NULL, 0 },
383 },
384 },
398 { NULL, 0 },
399 },
400 },
401 {
402 {
403 { &ifm_subtype_shared_descriptions[0], 0 },
404 { &ifm_subtype_shared_aliases[0], 1 },
405 { &ifm_subtype_ieee80211_descriptions[0], 0 },
406 { &ifm_subtype_ieee80211_aliases[0], 1 },
407 { NULL, 0 },
408 },
409 {
410 { &ifm_shared_option_descriptions[0], 0 },
411 { &ifm_subtype_ieee80211_option_descriptions[0], 0 },
412 { NULL, 0 },
413 },
414 },
385};
386
387static int
388get_media_subtype(type, val)
389 int type;
390 const char *val;
391{
392 struct ifmedia_description *desc;

--- 137 unchanged lines hidden ---
415};
416
417static int
418get_media_subtype(type, val)
419 int type;
420 const char *val;
421{
422 struct ifmedia_description *desc;

--- 137 unchanged lines hidden ---