ifmedia.c (138593) | ifmedia.c (139494) |
---|---|
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 138593 2004-12-08 19:18:07Z sam $ */ | 2/* $FreeBSD: head/sbin/ifconfig/ifmedia.c 139494 2004-12-31 19:46:27Z sam $ */ |
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: --- 87 unchanged lines hidden (view full) --- 98static void print_media_word_ifconfig(int); 99 100static struct ifmedia_description *get_toptype_desc(int); 101static struct ifmedia_type_to_subtype *get_toptype_ttos(int); 102static struct ifmedia_description *get_subtype_desc(int, 103 struct ifmedia_type_to_subtype *ttos); 104 105static void | 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: --- 87 unchanged lines hidden (view full) --- 98static void print_media_word_ifconfig(int); 99 100static struct ifmedia_description *get_toptype_desc(int); 101static struct ifmedia_type_to_subtype *get_toptype_ttos(int); 102static struct ifmedia_description *get_subtype_desc(int, 103 struct ifmedia_type_to_subtype *ttos); 104 105static void |
106media_status(int s, const struct rt_addrinfo *info __unused) | 106media_status(int s) |
107{ 108 struct ifmediareq ifmr; 109 int *media_list, i; 110 111 (void) memset(&ifmr, 0, sizeof(ifmr)); 112 (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); 113 114 if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { --- 667 unchanged lines hidden (view full) --- 782 DEF_CMD_ARG("media", setmedia), 783 DEF_CMD_ARG("mode", setmediamode), 784 DEF_CMD_ARG("mediaopt", setmediaopt), 785 DEF_CMD_ARG("-mediaopt",unsetmediaopt), 786}; 787static struct afswtch af_media = { 788 .af_name = "af_media", 789 .af_af = AF_UNSPEC, | 107{ 108 struct ifmediareq ifmr; 109 int *media_list, i; 110 111 (void) memset(&ifmr, 0, sizeof(ifmr)); 112 (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name)); 113 114 if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) { --- 667 unchanged lines hidden (view full) --- 782 DEF_CMD_ARG("media", setmedia), 783 DEF_CMD_ARG("mode", setmediamode), 784 DEF_CMD_ARG("mediaopt", setmediaopt), 785 DEF_CMD_ARG("-mediaopt",unsetmediaopt), 786}; 787static struct afswtch af_media = { 788 .af_name = "af_media", 789 .af_af = AF_UNSPEC, |
790 .af_status = media_status, | 790 .af_other_status = media_status, |
791}; 792 793static __constructor void 794ifmedia_ctor(void) 795{ 796#define N(a) (sizeof(a) / sizeof(a[0])) 797 int i; 798 799 for (i = 0; i < N(media_cmds); i++) 800 cmd_register(&media_cmds[i]); 801 af_register(&af_media); 802#undef N 803} | 791}; 792 793static __constructor void 794ifmedia_ctor(void) 795{ 796#define N(a) (sizeof(a) / sizeof(a[0])) 797 int i; 798 799 for (i = 0; i < N(media_cmds); i++) 800 cmd_register(&media_cmds[i]); 801 af_register(&af_media); 802#undef N 803} |