minidlna support now Samsung TV C550/C650 (thx amir909)
[tomato.git] / release / src / router / xl2tpd / file.h
blob14102c66fbc2a659dbccc12fbb1f854b3e19a74f
1 /*
2 * Layer Two Tunnelling Protocol Daemon
3 * Copyright (C) 1998 Adtran, Inc.
4 * Copyright (C) 2002 Jeff McAdams
6 * Mark Spencer
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
16 #ifndef _FILE_H
17 #define _FILE_H
19 #define STRLEN 80 /* Length of a string */
21 /* Definition of a keyword */
22 struct keyword
24 char *keyword;
25 int (*handler) (char *word, char *value, int context, void *item);
28 struct iprange
30 unsigned int start;
31 unsigned int end;
32 int sense;
33 struct iprange *next;
36 struct host
38 char hostname[STRLEN];
39 int port;
40 struct host *next;
44 #define CONTEXT_GLOBAL 1
45 #define CONTEXT_LNS 2
46 #define CONTEXT_LAC 3
47 #define CONTEXT_DEFAULT 256
49 #define SENSE_ALLOW -1
50 #define SENSE_DENY 0
52 #ifndef DEFAULT_AUTH_FILE
53 #define DEFAULT_AUTH_FILE "/etc/l2tp-secrets"
54 #endif
55 #ifndef DEFAULT_CONFIG_FILE
56 #define DEFAULT_CONFIG_FILE "/etc/xl2tpd.conf"
57 #endif
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 */
63 struct lns
65 struct lns *next;
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 */
102 struct lac
104 struct lac *next;
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 */
136 int debug;
137 struct tunnel *t; /* Our tunnel */
138 struct call *c; /* Our call */
141 struct global
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? */
159 int ipsecsaref;
162 extern struct global gconfig; /* Global configuration options */
164 extern struct lns *lnslist; /* All LNS entries */
165 extern struct lac *laclist; /* All LAC entries */
166 extern struct lns *deflns; /* Default LNS config */
167 extern struct lac *deflac; /* Default LAC config */
168 extern int init_config (); /* Read in the config file */
169 #endif