ネットワークデバイスはstruct net_deviceで管理される。ネットワークデバイスは登録されると、dev_baseリストにつながれる。dev_baseからnet_deviceのnextをたどることで全デバイスを参照することができる(図1)。

図1 net_device構造体
struct net_deviceはdev_baseリストの他にも、2種類のハッシュで管理される(表1)。
|
ハッシュテーブル |
説明 |
|---|---|
| dev_name_head[] |
eth0等のデバイス名で検索を行う。 struct net_deviceのname_hlistでたどることができる。 |
| dev_index_head[] |
デバイスのifindexで検索を行う。 struct net_deviceのindex_hlistでたどることができる。 |

図2 デバイスとIPアドレス