2 * Layer Two Tunnelling Protocol Daemon
3 * Copyright (C) 1998 Adtran, Inc.
4 * Copyright (C) 2002 Jeff McAdams
8 * This software is distributed under the terms
9 * of the GPL, which you should have received
10 * along with this source.
12 * File format handling header file
19 #define STRLEN 80 /* Length of a string */
21 /* Definition of a keyword */
25 int (*handler
) (char *word
, char *value
, int context
, void *item
);
38 char hostname
[STRLEN
];
44 #define CONTEXT_GLOBAL 1
47 #define CONTEXT_DEFAULT 256
49 #define SENSE_ALLOW -1
52 #ifndef DEFAULT_AUTH_FILE
53 #define DEFAULT_AUTH_FILE "/etc/l2tp-secrets"
55 #ifndef DEFAULT_CONFIG_FILE
56 #define DEFAULT_CONFIG_FILE "/etc/xl2tpd.conf"
58 #define ALT_DEFAULT_AUTH_FILE ""
59 #define ALT_DEFAULT_CONFIG_FILE ""
60 #define DEFAULT_PID_FILE "/var/run/xl2tpd.pid"
62 /* Definition of an LNS */
66 int exclusive
; /* Only one tunnel per host? */
67 int active
; /* Is this actively in use? */
68 unsigned int localaddr
; /* Local IP for PPP connections */
69 int tun_rws
; /* Receive window size (tunnel) */
70 int call_rws
; /* Call rws */
71 int rxspeed
; /* Tunnel rx speed */
72 int txspeed
; /* Tunnel tx speed */
73 int hbit
; /* Permit hidden AVP's? */
74 int lbit
; /* Use the length field? */
75 int challenge
; /* Challenge authenticate the peer? */
76 int authpeer
; /* Authenticate our peer? */
77 int authself
; /* Authenticate ourselves? */
78 char authname
[STRLEN
]; /* Who we authenticate as */
79 char peername
[STRLEN
]; /* Force peer name to this */
80 char hostname
[STRLEN
]; /* Hostname to report */
81 char entname
[STRLEN
]; /* Name of this entry */
82 struct iprange
*lacs
; /* Hosts permitted to connect */
83 struct iprange
*range
; /* Range of IP's we provide */
84 int assign_ip
; /* Do we actually provide IP addresses? */
85 int passwdauth
; /* Authenticate by passwd file? (or PAM) */
86 int pap_require
; /* Require PAP auth for PPP */
87 int chap_require
; /* Require CHAP auth for PPP */
88 int pap_refuse
; /* Refuse PAP authentication for us */
89 int chap_refuse
; /* Refuse CHAP authentication for us */
90 int idle
; /* Idle timeout in seconds */
91 unsigned int pridns
; /* Primary DNS server */
92 unsigned int secdns
; /* Secondary DNS server */
93 unsigned int priwins
; /* Primary WINS server */
94 unsigned int secwins
; /* Secondary WINS server */
95 int proxyarp
; /* Use proxy-arp? */
96 int proxyauth
; /* Allow proxy authentication? */
97 int debug
; /* Debug PPP? */
98 char pppoptfile
[STRLEN
]; /* File containing PPP options */
99 struct tunnel
*t
; /* Tunnel of this, if it's ready */
105 struct host
*lns
; /* LNS's we can connect to */
106 struct schedule_entry
*rsched
;
107 int tun_rws
; /* Receive window size (tunnel) */
108 int call_rws
; /* Call rws */
109 int rxspeed
; /* Tunnel rx speed */
110 int txspeed
; /* Tunnel tx speed */
111 int active
; /* Is this connection in active use? */
112 int hbit
; /* Permit hidden AVP's? */
113 int lbit
; /* Use the length field? */
114 int challenge
; /* Challenge authenticate the peer? */
115 unsigned int localaddr
; /* Local IP address */
116 unsigned int remoteaddr
; /* Force remote address to this */
117 char authname
[STRLEN
]; /* Who we authenticate as */
118 char password
[STRLEN
]; /* Password to authenticate with */
119 char peername
[STRLEN
]; /* Force peer name to this */
120 char hostname
[STRLEN
]; /* Hostname to report */
121 char entname
[STRLEN
]; /* Name of this entry */
122 int authpeer
; /* Authenticate our peer? */
123 int authself
; /* Authenticate ourselves? */
124 int pap_require
; /* Require PAP auth for PPP */
125 int chap_require
; /* Require CHAP auth for PPP */
126 int pap_refuse
; /* Refuse PAP authentication for us */
127 int chap_refuse
; /* Refuse CHAP authentication for us */
128 int idle
; /* Idle timeout in seconds */
129 int autodial
; /* Try to dial immediately? */
130 int defaultroute
; /* Use as default route? */
131 int redial
; /* Redial if disconnected */
132 int rmax
; /* Maximum # of consecutive redials */
133 int rtries
; /* # of tries so far */
134 int rtimeout
; /* Redial every this many # of seconds */
135 char pppoptfile
[STRLEN
]; /* File containing PPP options */
137 struct tunnel
*t
; /* Our tunnel */
138 struct call
*c
; /* Our call */
143 unsigned int listenaddr
; /* IP address to bind to */
144 int port
; /* Port number to listen to */
145 char authfile
[STRLEN
]; /* File containing authentication info */
146 char altauthfile
[STRLEN
]; /* File containing authentication info */
147 char configfile
[STRLEN
]; /* File containing configuration info */
148 char altconfigfile
[STRLEN
]; /* File containing configuration info */
149 char pidfile
[STRLEN
]; /* File containing the pid number*/
150 char controlfile
[STRLEN
]; /* Control file name (named pipe) */
151 int daemon
; /* Use daemon mode? */
152 int accesscontrol
; /* Use access control? */
153 int forceuserspace
; /* Force userspace? */
154 int packet_dump
; /* Dump (print) all packets? */
155 int debug_avp
; /* Print AVP debugging info? */
156 int debug_network
; /* Print network debugging info? */
157 int debug_tunnel
; /* Print tunnel debugging info? */
158 int debug_state
; /* Print FSM debugging info? */
160 int sarefnum
; /* Value of IPSEC_REFINFO used by kernel
161 * (we used to pick 22, but 2.6.36+ took that, so now we pick 30)
162 * Changed in SAref patch in openswan 2.6.36 for linux 2.6.36+ */
165 extern struct global gconfig
; /* Global configuration options */
167 extern struct lns
*lnslist
; /* All LNS entries */
168 extern struct lac
*laclist
; /* All LAC entries */
169 extern struct lns
*deflns
; /* Default LNS config */
170 extern struct lac
*deflac
; /* Default LAC config */
171 extern int init_config (); /* Read in the config file */
173 /* Tries to apply _word_ option with _value_ to _item_ in _context_ */
174 extern int parse_one_option (char *word
, char *value
, int context
, void *item
);
175 /* Allocate memory and filled up new lac */
176 extern struct lac
*new_lac ();