30#ifndef KERNEL_NET_INTERFACE_H
31#define KERNEL_NET_INTERFACE_H
34#include <kernel/types.h>
#define LLIST_NODE(_name)
Declare an intrusive list node.
Definition: linked_list.h:64
const struct subnet * net_interface_find_subnet(__be ipv4_t)
Find the first subnet that contains the specified address.
Definition: interface.c:79
struct net_interface * net_interface_find(__be ipv4_t)
Find the interface by source IP address.
Definition: interface.c:98
struct net_interface * net_interface_new(struct ethernet_device *, const char *)
Create a new network interface.
Definition: interface.c:15
error_t net_interface_add_subnet(struct net_interface *, __be ipv4_t, uint8_t cidr)
Add a new subnet to a network interface.
Definition: interface.c:33
An ethernet device.
Definition: ethernet.h:50
The head of a doubly linked list.
Definition: linked_list.h:43
A network interface.
Definition: interface.h:39
struct ethernet_device * netdev
The name of this interface.
Definition: interface.h:41
llist_t subnets
The interface's network device.
Definition: interface.h:42
LLIST_NODE(this)
The subnets registered under this interface.
An interface subnet.
Definition: interface.h:47
uint8_t cidr
source ip used when interacting with this subnet
Definition: interface.h:51
__be ipv4_t ip
The subnet's containing interface.
Definition: interface.h:50