CS43 Lab7 - A Router Stack  1.2019
Classes | Functions
sr_if.h File Reference

Data structures and methods for handeling interfaces. More...

#include "sr_protocol.h"
Include dependency graph for sr_if.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sr_if
 A node in the interface list of the router. More...
 

Functions

struct sr_ifsr_get_interface (struct sr_instance *sr, const char *name)
 Searches the interface list to find the interface with the given name. More...
 
void sr_add_interface (struct sr_instance *, const char *)
 
void sr_set_ether_addr (struct sr_instance *, const unsigned char *)
 
void sr_set_ether_ip (struct sr_instance *, uint32_t ip_nbo)
 
void sr_print_if_list (struct sr_instance *)
 Prints the interface list.
 
void sr_print_if (struct sr_if *)
 Prints the given interface.
 

Detailed Description

Data structures and methods for handeling interfaces.

Function Documentation

◆ sr_get_interface()

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.

If no such interface exists, returns NULL.

Parameters
srThe router instance.
nameThe name of the requested interface.