CS43 Lab7 - A Router Stack  1.2019
sr_rt.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2  * file: sr_rt.h
3  * date: Mon Oct 07 03:53:53 PDT 2002
4  * Author: casado@stanford.edu
5  *---------------------------------------------------------------------------*/
6 
7 /** \file
8  * Functions and data structures for handling the routing table
9  * */
10 
11 #ifndef sr_RT_H
12 #define sr_RT_H
13 
14 #ifdef _DARWIN_
15 #include <sys/types.h>
16 #endif
17 
18 #include <netinet/in.h>
19 
20 #include "sr_if.h"
21 
22 /* ----------------------------------------------------------------------------
23  * struct sr_rt
24  *
25  * Node in the routing table
26  *
27  * -------------------------------------------------------------------------- */
28 
29 struct sr_rt
30 {
31  struct in_addr dest;
32  struct in_addr gw;
33  struct in_addr mask;
34  char interface[sr_IFACE_NAMELEN];
35  struct sr_rt* next;
36 };
37 
38 
39 int sr_load_rt(struct sr_instance*,const char*);
40 void sr_add_rt_entry(struct sr_instance*, struct in_addr,struct in_addr,
41  struct in_addr, char*);
42 void sr_print_routing_table(struct sr_instance* sr);
43 void sr_print_routing_entry(struct sr_rt* entry);
44 
45 
46 #endif /* -- sr_RT_H -- */
Definition: sr_rt.h:29
Data structures and methods for handeling interfaces.
Struct which encapsulates all the state of a single router.
Definition: sr_router.h:59