11 #ifndef sr_INTERFACE_H 12 #define sr_INTERFACE_H 19 #include </usr/include/sys/int_types.h> 40 char name[sr_IFACE_NAMELEN];
41 unsigned char addr[ETHER_ADDR_LEN];
54 void sr_add_interface(
struct sr_instance*,
const char*);
55 void sr_set_ether_addr(
struct sr_instance*,
const unsigned char*);
56 void sr_set_ether_ip(
struct sr_instance*, uint32_t ip_nbo);
struct sr_if * next
The next interface in the linked list.
Definition: sr_if.h:44
char name[sr_IFACE_NAMELEN]
The name of the interface.
Definition: sr_if.h:40
struct sr_if * sr_get_interface(struct sr_instance *sr, const char *name)
Searches the interface list to find the interface with the given name.
Definition: sr_if.c:37
unsigned char addr[ETHER_ADDR_LEN]
The MAC address of the interface.
Definition: sr_if.h:41
uint32_t ip
The IP address of the interface.
Definition: sr_if.h:42
void sr_print_if(struct sr_if *)
Prints the given interface.
Definition: sr_if.c:180
A collection of macros, structs, and enums to represent packet types and headers. ...
A node in the interface list of the router.
Definition: sr_if.h:38
Struct which encapsulates all the state of a single router.
Definition: sr_router.h:59
void sr_print_if_list(struct sr_instance *)
Prints the interface list.
Definition: sr_if.c:151