Merge branch 'common-cvs-git-upstream' into fdn-mods
[l2tpns.git] / l2tpns.h
index 5b68df7..8e3d26e 100644 (file)
--- a/l2tpns.h
+++ b/l2tpns.h
@@ -38,6 +38,7 @@
 #define PPPoE_MRU      1492            // maximum PPPoE MRU (rfc2516: 1500 less PPPoE header (6) and PPP protocol ID (2))
 #define MAXETHER       (MAXMTU+18)     // max packet we try sending to tun
 #define MAXTEL         96              // telephone number
+#define MAXHOSTNAME    256             // hostname
 #define MAXUSER                128             // username
 #define MAXPASS                128             // password
 #define MAXCLASS       128             // radius class attribute size
@@ -234,7 +235,7 @@ struct cli_tunnel_actions {
 typedef struct                 // route
 {
        in_addr_t ip;
-       in_addr_t mask;
+       int prefixlen;
 }
 routet;
 
@@ -242,7 +243,10 @@ typedef struct controls            // control message
 {
        struct controls *next;  // next in queue
        uint16_t length;        // length
-       uint8_t buf[MAXCONTROL];
+       union {
+               uint8_t buf[MAXCONTROL];
+               uint16_t buf16[MAXCONTROL/2];
+       } __attribute__ ((__transparent_union__));
 }
 controlt;
 
@@ -617,6 +621,10 @@ struct Tstats
 #define SET_STAT(x, y)
 #endif
 
+#ifndef IFNAMSIZ
+# define IFNAMSIZ 16
+#endif
+
 typedef struct
 {
        int             debug;                          // debugging level
@@ -632,7 +640,7 @@ typedef struct
        int             reload_config;                  // flag to re-read config (set by cli)
        int             multi_read_count;               // amount of packets to read per fd in processing loop
 
-       char            tundevice[10];                  // tun device name
+       char            tundevice[IFNAMSIZ];            // tun device name
        char            log_filename[128];
 
        char            l2tp_secret[64];                // L2TP shared secret
@@ -713,6 +721,8 @@ typedef struct
 
        int             cluster_master_min_adv;         // Master advertises routes while the number of up to date
                                                        // slaves is less than this value.
+       in_addr_t       cli_bind_address;               // bind address for CLI
+       char            hostname[MAXHOSTNAME];  // hostname (overridden by -h on command line)
        // Guest change
        char            guest_user[MAXUSER];            // Guest account username
 
@@ -724,7 +734,10 @@ typedef struct
                uint16_t as;
                int keepalive;
                int hold;
+               struct in_addr update_source;
        } neighbour[BGP_NUM_PEERS];
+       in_addr_t       nexthop_address;
+       struct in6_addr nexthop6_address;
 #endif
 } configt;
 
@@ -898,7 +911,8 @@ void become_master(void);   // We're the master; kick off any required master init
 
 
 // cli.c
-void init_cli(char *hostname);
+void init_cli();
+void cli_init_complete(char *hostname);
 void cli_do_file(FILE *fh);
 void cli_do(int sockfd);
 int cli_arg_help(struct cli_def *cli, int cr_ok, char *entry, ...);
@@ -936,6 +950,7 @@ struct event_data {
                FD_TYPE_DAE,
                FD_TYPE_RADIUS,
                FD_TYPE_BGP,
+               FD_TYPE_NETLINK,
        } type;
        int index; // for RADIUS, BGP
 };