April 2012
Intermediate to advanced
352 pages
8h
English
An ifmedia structure catalogs every media type that is supported by a network interface (for example, 100BASE-TX, 1000BASE-SX, and so on). It is defined in the <net/if_media.h> header as follows:
struct ifmedia {
int ifm_mask; /* Mask of bits to ignore. */
int ifm_media; /* User-set media word. */
struct ifmedia_entry *ifm_cur; /* Currently selected media. */
/*
* Linked list containing every media type supported by
* an interface.
*/
LIST_HEAD(, ifmedia_entry) ifm_list;
ifm_change_cb_t ifm_change; /* Media change callback. */
ifm_stat_cb_t ifm_status; /* Media status callback. */
};