xref: /openbsd/usr.sbin/npppd/l2tp/l2tp.h (revision 3d8817e4)
1 /* $OpenBSD: l2tp.h,v 1.4 2010/09/24 14:50:30 yasuoka Exp $	*/
2 
3 /*-
4  * Copyright (c) 2009 Internet Initiative Japan Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28 #ifndef	L2TP_H
29 #define	L2TP_H 1
30 /*@file
31  * header file for the L2TP module
32  */
33 /* $Id: l2tp.h,v 1.4 2010/09/24 14:50:30 yasuoka Exp $ */
34 
35 /************************************************************************
36  * Protocol Constants
37  ************************************************************************/
38 
39 #define	L2TP_RFC2661_VERSION			1
40 #define	L2TP_RFC2661_REVISION			0
41 #define	L2TP_AVP_MAXSIZ				1024
42 
43 /* Header */
44 
45 #define	L2TP_HEADER_FLAG_TOM			0x8000
46 #define	L2TP_HEADER_FLAG_LENGTH			0x4000
47 #define	L2TP_HEADER_FLAG_SEQUENCE		0x0800
48 #define	L2TP_HEADER_FLAG_OFFSET			0x0200
49 #define	L2TP_HEADER_FLAG_PRIORITY		0x0100
50 #define	L2TP_HEADER_FLAG_VERSION_MASK		0x000f
51 #define	L2TP_HEADER_VERSION_RFC2661		0x02
52 
53 /* AVP Atrribute Types */
54 
55 /* RFC 2661 */
56 #define	L2TP_AVP_TYPE_MESSAGE_TYPE		0
57 #define	L2TP_AVP_TYPE_RESULT_CODE		1
58 #define	L2TP_AVP_TYPE_PROTOCOL_VERSION		2
59 #define	L2TP_AVP_TYPE_FRAMING_CAPABILITIES	3
60 #define	L2TP_AVP_TYPE_BEARER_CAPABILITIES	4
61 #define	L2TP_AVP_TYPE_TIE_BREAKER		5
62 #define	L2TP_AVP_TYPE_FIRMWARE_REVISION		6
63 #define	L2TP_AVP_TYPE_HOST_NAME			7
64 #define	L2TP_AVP_TYPE_VENDOR_NAME		8
65 #define	L2TP_AVP_TYPE_ASSINGED_TUNNEL_ID	9
66 #define	L2TP_AVP_TYPE_RECV_WINDOW_SIZE		10
67 #define	L2TP_AVP_TYPE_CHALLENGE			11
68 #define	L2TP_AVP_TYPE_CAUSE_CODE		12
69 #define	L2TP_AVP_TYPE_CHALLENGE_RESPONSE	13
70 #define	L2TP_AVP_TYPE_ASSIGNED_SESSION_ID	14
71 #define	L2TP_AVP_TYPE_CALL_SERIAL_NUMBER	15
72 #define	L2TP_AVP_TYPE_MINIMUM_BPS		16
73 #define	L2TP_AVP_TYPE_MAXIMUM_BPS		17
74 #define	L2TP_AVP_TYPE_BEARER_TYPE		18
75 #define	L2TP_AVP_TYPE_FRAMING_TYPE		19
76 #define	L2TP_AVP_TYPE_CALLED_NUMBER		21
77 #define	L2TP_AVP_TYPE_CALLING_NUMBER		22
78 #define	L2TP_AVP_TYPE_SUB_ADDRESS		23
79 #define	L2TP_AVP_TYPE_TX_CONNECT_SPEED		24
80 
81 #define	L2TP_AVP_TYPE_PHYSICAL_CHANNEL_ID	25
82 #define	L2TP_AVP_TYPE_INITIAL_RECV_LCP_CONFREQ	26
83 #define	L2TP_AVP_TYPE_LAST_SENT_LCP_CONFREQ	27
84 #define	L2TP_AVP_TYPE_LAST_RECV_LCP_CONFREQ	28
85 #define	L2TP_AVP_TYPE_PROXY_AUTHEN_TYPE		29
86 #define	L2TP_AVP_TYPE_PROXY_AUTHEN_NAME		30
87 #define	L2TP_AVP_TYPE_PROXY_AUTHEN_CHALLENGE	31
88 #define	L2TP_AVP_TYPE_PROXY_AUTHEN_ID		32
89 #define	L2TP_AVP_TYPE_PROXY_AUTHEN_RESPONSE	33
90 #define	L2TP_AVP_TYPE_CALL_ERRORS		34
91 #define	L2TP_AVP_TYPE_ACCM			35
92 #define	L2TP_AVP_TYPE_RANDOM_VECTOR		36
93 #define	L2TP_AVP_TYPE_PRIVATE_GROUP_ID		37
94 #define	L2TP_AVP_TYPE_RX_CONNECT_SPEED		38
95 #define	L2TP_AVP_TYPE_SEQUENCING_REQUIRED	39
96 
97 
98 /* RFC 3301 */
99 #define	L2TP_AVP_TYPE_TX_MINIMUM		40
100 #define	L2TP_AVP_TYPE_CALLING_SUB_ADDRESS	44
101 
102 /* RFC 3145 */
103 #define	L2TP_AVP_TYPE_PPP_DISCONNECT_CAUSE_CODE	46
104 
105 /* RFC 3308 */
106 #define	L2TP_AVP_TYPE_CCDS			47
107 #define	L2TP_AVP_TYPE_SDS			48
108 
109 /* RFC 3437 */
110 #define	L2TP_AVP_TYPE_LCP_WANT_OPTIONS		49
111 #define	L2TP_AVP_TYPE_LCP_ALLOW_OPTIONS		50
112 #define	L2TP_AVP_TYPE_LNS_LAST_SENT_LCP_CONFREQ	51
113 #define	L2TP_AVP_TYPE_LNS_LAST_RECV_LCP_CONFREQ	52
114 
115 /* RFC 3573 */
116 #define	L2TP_AVP_TYPE_MODEM_ON_HOLD_CAPABLE	53
117 #define	L2TP_AVP_TYPE_MODEM_ON_HOLD_STATUS	54
118 
119 /* RFC 3817 */
120 #define	L2TP_AVP_TYPE_PPPOE_RELAY		55
121 #define	L2TP_AVP_TYPE_PPPOE_RELAY_RESP_CAP	56
122 #define	L2TP_AVP_TYPE_PPPOE_RELAY_FORW_CAP	57
123 
124 /* No RFC yet */
125 #define	L2TP_AVP_TYPE_EXTENDED_VENDOR_ID	58
126 #define	L2TP_AVP_TYPE_PSEUDOWIRE_CAP_LIST	62
127 #define	L2TP_AVP_TYPE_LOCAL_SESSION_ID		63
128 #define	L2TP_AVP_TYPE_REMOTE_SESSION_ID		64
129 #define	L2TP_AVP_TYPE_ASSIGNED_COOKIE		65
130 #define	L2TP_AVP_TYPE_REMOTE_END_ID		66
131 #define	L2TP_AVP_TYPE_APPLICATION_CODE		67
132 #define	L2TP_AVP_TYPE_PSEUDOWIRE_TYPE		68
133 #define	L2TP_AVP_TYPE_L2_SPECIFIC_SUBLAYER	69
134 #define	L2TP_AVP_TYPE_DATA_SEQUENCING		70
135 #define	L2TP_AVP_TYPE_CIRCUIT_STATUS		71
136 #define	L2TP_AVP_TYPE_PREFERRED_LANGUAGE	72
137 #define	L2TP_AVP_TYPE_CTRL_MSG_AUTH_NONCE	73
138 /* #define	L2TP_AVP_TYPE_TX_CONNECT_SPEED		74 */
139 /* #define	L2TP_AVP_TYPE_RX_CONNECT_SPEED		75 */
140 #define	L2TP_AVP_TYPE_FAILOVER_CAPABILITY	76
141 #define	L2TP_AVP_TYPE_TUNNEL_RECOVERY		77
142 #define	L2TP_AVP_TYPE_SUGGESTED_CTRL_SEQUENCE	78
143 #define	L2TP_AVP_TYPE_FAILOVER_SESSION_STATE	79
144 
145 /* RFC 4045 */
146 #define	L2TP_AVP_TYPE_MULTICAST_CAPABILITY	80
147 #define	L2TP_AVP_TYPE_NEW_OUTGOING_SESSIONS	81
148 #define	L2TP_AVP_TYPE_NEW_OUTGOING_SESSIONS_ACK	82
149 #define	L2TP_AVP_TYPE_WITHDRAW_OUTGOING_SESSIONS 83
150 #define	L2TP_AVP_TYPE_MULTICAST_PACKETS_PRIORITY 84
151 
152 /* Control Message Type */
153 
154 #define	L2TP_AVP_MESSAGE_TYPE_SCCRQ		1
155 #define	L2TP_AVP_MESSAGE_TYPE_SCCRP		2
156 #define	L2TP_AVP_MESSAGE_TYPE_SCCCN		3
157 #define	L2TP_AVP_MESSAGE_TYPE_StopCCN		4
158 #define	L2TP_AVP_MESSAGE_TYPE_HELLO		6
159 #define	L2TP_AVP_MESSAGE_TYPE_OCRQ		7
160 #define	L2TP_AVP_MESSAGE_TYPE_OCRP		8
161 #define	L2TP_AVP_MESSAGE_TYPE_OCCN		9
162 #define	L2TP_AVP_MESSAGE_TYPE_ICRQ		10
163 #define	L2TP_AVP_MESSAGE_TYPE_ICRP		11
164 #define	L2TP_AVP_MESSAGE_TYPE_ICCN		12
165 #define	L2TP_AVP_MESSAGE_TYPE_CDN		14
166 
167 #define L2TP_FRAMING_CAP_FLAGS_SYNC	0x00000001
168 #define L2TP_FRAMING_CAP_FLAGS_ASYNC	0x00000002
169 #define	L2TP_BEARER_CAP_FLAGS_DIGITAL	0x00000001
170 #define	L2TP_BEARER_CAP_FLAGS_ANALOG	0x00000002
171 
172 /*
173  * Constants on pp.19-22 of RFC2661
174  * macro names may be inappropriate.
175  */
176 #define	L2TP_STOP_CCN_RCODE_GENERAL			1
177 #define	L2TP_STOP_CCN_RCODE_GENERAL_ERROR		2
178 #define	L2TP_STOP_CCN_RCODE_ALREADY_EXISTS		3
179 #define	L2TP_STOP_CCN_RCODE_UNAUTHORIZED		4
180 #define	L2TP_STOP_CCN_RCODE_BAD_PROTOCOL_VERSION	5
181 #define	L2TP_STOP_CCN_RCODE_SHUTTING_DOWN		6
182 #define	L2TP_STOP_CCN_RCODE_FSM_ERROR			7
183 
184 #define L2TP_CDN_RCODE_LOST_CARRIER			1
185 #define L2TP_CDN_RCODE_ERROR_CODE			2
186 #define L2TP_CDN_RCODE_ADMINISTRATIVE_REASON		3
187 #define L2TP_CDN_RCODE_TEMP_NOT_AVALIABLE		4
188 #define L2TP_CDN_RCODE_PERM_NOT_AVALIABLE		5
189 #define L2TP_CDN_RCODE_INVALID_DESTINATION		6
190 #define L2TP_CDN_RCODE_NO_CARRIER			7
191 #define L2TP_CDN_RCODE_BUSY				8
192 #define L2TP_CDN_RCODE_NO_DIALTONE			9
193 #define L2TP_CDN_RCODE_CALL_TIMEOUT_BY_LAC		10
194 #define L2TP_CDN_RCODE_NO_FRAMING_DETECTED		11
195 
196 #define L2TP_ECODE_NO_CONTROL_CONNECTION		1
197 #define L2TP_ECODE_WRONG_LENGTH				2
198 #define L2TP_ECODE_INVALID_MESSAGE			3
199 #define L2TP_ECODE_NO_RESOURCE				4
200 #define L2TP_ECODE_INVALID_SESSION_ID			5
201 #define L2TP_ECODE_GENERIC_ERROR			6
202 #define L2TP_ECODE_TRY_ANOTHER				7
203 #define L2TP_ECODE_UNKNOWN_MANDATORY_AVP		8
204 
205 /* Proxy Authen Type */
206 #define	L2TP_AUTH_TYPE_RESERVED				0
207 #define	L2TP_AUTH_TYPE_TEXUAL				1
208 #define	L2TP_AUTH_TYPE_PPP_CHAP				2
209 #define	L2TP_AUTH_TYPE_PPP_PAP				3
210 #define	L2TP_AUTH_TYPE_NO_AUTH				4
211 #define	L2TP_AUTH_TYPE_MS_CHAP_V1			5
212 
213 /************************************************************************
214  * Implementation Specific Constants
215  ************************************************************************/
216 
217 #define	L2TPD_BACKLOG				16
218 #define	L2TPD_TUNNEL_HASH_SIZ			127
219 #define L2TPD_SND_BUFSIZ			2048
220 #define	L2TPD_DEFAULT_SEND_WINSZ		4
221 #define	L2TPD_DEFAULT_LAYER2_LABEL		"L2TP"
222 #define	L2TPD_DIALIN_LAYER2_LABEL		"DialIn"
223 #define	L2TPD_CONFIG_BUFSIZ			65535
224 #define	L2TP_CTRL_WINDOW_SIZE			8
225 #ifndef	L2TPD_VENDOR_NAME
226 #define	L2TPD_VENDOR_NAME			"IIJ"
227 #endif
228 #define L2TPD_DEFAULT_UDP_PORT			1701
229 
230 /** maximum number of addresses we will listen on */
231 #ifndef	L2TP_NLISTENER
232 #define	L2TP_NLISTENER				6
233 #endif
234 
235 /*
236  * state of daemon
237  */
238 #define	L2TPD_STATE_INIT			0
239 #define	L2TPD_STATE_RUNNING			1
240 #define	L2TPD_STATE_SHUTTING_DOWN		2
241 #define	L2TPD_STATE_STOPPED			3
242 
243 /*
244  * state of a control connection
245  */
246 #define	L2TP_CTRL_STATE_IDLE			0
247 #define	L2TP_CTRL_STATE_WAIT_CTL_CONN		1
248 #define	L2TP_CTRL_STATE_WAIT_CTL_REPLY		2
249 #define	L2TP_CTRL_STATE_ESTABLISHED		3
250 #define	L2TP_CTRL_STATE_CLEANUP_WAIT		4
251 
252 /*
253  * state of a call
254  */
255 #define	L2TP_CALL_STATE_IDLE			0
256 #define	L2TP_CALL_STATE_WAIT_CONN		1
257 #define	L2TP_CALL_STATE_ESTABLISHED		2
258 #define	L2TP_CALL_STATE_CLEANUP_WAIT		3
259 
260 /*
261  * timeout
262  */
263 #define	L2TP_CTRL_CTRL_PKT_TIMEOUT		12
264 /** wait time for the first call */
265 #define	L2TP_CTRL_WAIT_CALL_TIMEOUT		16
266 #define	L2TP_CTRL_CLEANUP_WAIT_TIME		3
267 #define	L2TP_CTRL_DEFAULT_HELLO_INTERVAL	60
268 #define	L2TP_CTRL_DEFAULT_HELLO_TIMEOUT		30
269 
270 #define	L2TPD_SHUTDOWN_TIMEOUT			5
271 
272 /** returns whether an L2TP daemon is stopped */
273 #define	l2tpd_is_stopped(l2tpd)					\
274 	(((l2tpd)->state != L2TPD_STATE_SHUTTING_DOWN &&	\
275 	    (l2tpd)->state != L2TPD_STATE_RUNNING)? 1 : 0)
276 
277 /** returns whether an L2TP daemon is going to shutdown */
278 #define	l2tpd_is_shutting_down(l2tpd)				\
279 	(((l2tpd)->state == L2TPD_STATE_SHUTTING_DOWN)? 1 : 0)
280 
281 /** macro to retrieve a physical layer label from l2tp_ctrl */
282 #define	L2TP_CTRL_LISTENER_LABEL(ctrl)	\
283 	((l2tpd_listener *)slist_get(&(ctrl)->l2tpd->listener, \
284 	    (ctrl)->listener_index))->phy_label
285 
286 
287 /** datatype represents L2TP daemon */
288 struct _l2tpd;
289 
290 typedef struct _l2tpd_listener {
291 	/** event context */
292 	struct event ev_sock;
293 	/** L2TPD itself */
294 	struct _l2tpd	*self;
295 	/** index number */
296 	uint16_t	index;
297 	/** enable/disable */
298 	uint16_t	enabled;
299 	/** listening socket */
300 	int		sock;
301 	/** listening socket address for UDP packets */
302 	union {
303 		struct sockaddr_in	sin4;
304 		struct sockaddr_in6	sin6;
305 	} bind;
306 	/** physical layer label */
307 	char	phy_label[16];
308 } l2tpd_listener;
309 
310 /** datatype represents L2TP daemon */
311 typedef struct _l2tpd {
312 	/** timeout event context */
313 	struct event ev_timeout;
314 	/** instance ID */
315 	unsigned id;
316 	/** listener list */
317 	slist listener;
318 	/** state */
319 	int state;
320 	/** mappings from tunnel ID to {@link ::_l2tp_ctrl L2TP control} */
321 	hash_table *ctrl_map;
322 	/** unique and free Session-ID list */
323 	slist free_session_id_list;
324 
325 	/** IPv4 network addresses allowed to connect */
326 	struct in_addr_range *ip4_allow;
327 
328 	/** default hostname */
329 	char default_hostname[80];
330 
331 	/** configuration */
332 	struct properties *config;
333 
334 	/** flags */
335 	uint32_t
336 	    require_ipsec:1,
337 	    purge_ipsec_sa:1,
338 	    ctrl_in_pktdump:1,
339 	    ctrl_out_pktdump:1,
340 	    data_in_pktdump:1,
341 	    data_out_pktdump:1,
342 	    phy_label_with_ifname:1;
343 } l2tpd;
344 
345 /** datatype represents L2TP control connection */
346 typedef struct _l2tp_ctrl {
347 	struct event ev_timeout;
348 	/** ID */
349 	unsigned id;
350 	/** parent L2TPD */
351 	l2tpd 	*l2tpd;
352 	/** listener index number */
353 	uint16_t	listener_index;
354 	/** state */
355 	int	state;
356 	/** tunnel Id */
357 	int	tunnel_id;
358 	/** window size */
359 	int	winsz;
360 	/** peer's tunnel Id */
361 	int	peer_tunnel_id;
362 	/** peer's window size */
363 	int	peer_winsz;
364 	/** next acknowledgement number */
365 	uint16_t	snd_una;
366 	/** next send sequence number */
367 	uint16_t	snd_nxt;
368 	/** receive sequence number */
369 	uint16_t	rcv_nxt;
370 	/** peer's IP address */
371 	struct	sockaddr_storage peer;
372 	/** my IP address */
373 	struct	sockaddr_storage sock;
374 	/** IPSEC NAT-T SA cookie */
375 	void	*sa_cookie;
376 	/** physical layer label (copied) */
377 	char	phy_label[16];
378 
379 	/** list of L2TP calls */
380 	slist	call_list;
381 	/*
382 	 * Note about send window:
383 	 * 	pos == lim when buffer is full.
384 	 * 	pos == -1, lim == 0 when buffer is empty.
385 	 */
386 	/** bytes available in send buffer.  it is a list of length #winsz */
387 	bytebuffer **snd_buffers;
388 	/** sending buffer for ZLB */
389 	bytebuffer *zlb_buffer;
390 
391 	/** the time when last control message sent */
392 	time_t	last_snd_ctrl;
393 	/** the time when last packet received */
394 	time_t	last_rcv;
395 
396 	/**
397 	 * If we are on active close and have not sent a StopCCN message yet,
398 	 * active_closing has the result code to be in the StopCCN message.
399 	 */
400 	int	active_closing;
401 
402 	/**
403 	 * delay between transition to idle state and sending HELLO in seconds.
404 	 * invalid if less than or equal to zero.
405 	 */
406 	int hello_interval;
407 	/** HELLO timeout */
408 	int hello_timeout;
409 	/** time when the last HELLO packet was sent */
410 	time_t	hello_io_time;
411 	/** number of calls established */
412 	int	ncalls;
413 
414 	int
415 	    /** use sequence number in L2TP Data Message? */
416 	    data_use_seq:1,
417 	    /** waiting to acknowledge HELLO? */
418 	    hello_wait_ack:1;
419 
420 } l2tp_ctrl;
421 
422 /**
423  * datatype represents a L2TP call
424  */
425 typedef struct _l2tp_call {
426 	/** ID */
427 	unsigned	id;
428 	/** state */
429 	int		state;
430 	/** parent control connection */
431 	l2tp_ctrl 	*ctrl;
432 	/** bound {@link ::_npppd_ppp ppp} */
433 	void		*ppp;
434 	/** session ID */
435 	int		session_id;
436 	/** peer's session ID */
437 	int		peer_session_id;
438 	/** next sequence number  */
439 	uint16_t	snd_nxt;
440 	/** receiving sequence number */
441 	uint16_t	rcv_nxt;
442 	/** calling number */
443 	char		calling_number[32];
444 
445 	uint32_t	/** Sequencing required */
446 			seq_required:1,
447 			/** Use sequencing in the data connection */
448 			use_seq:1;
449 } l2tp_call;
450 
451 #ifdef __cplusplus
452 extern "C" {
453 #endif
454 
455 l2tp_call        *l2tp_call_create (void);
456 int              l2tp_call_init (l2tp_call *, l2tp_ctrl *);
457 void             l2tp_call_destroy (l2tp_call *, int);
458 void             l2tp_call_admin_disconnect(l2tp_call *);
459 int              l2tp_call_recv_packet (l2tp_ctrl *, l2tp_call *, int, u_char *, int);
460 void             l2tp_call_ppp_input (l2tp_call *, u_char *, int);
461 
462 void             l2tp_ctrl_destroy (l2tp_ctrl *);
463 l2tp_ctrl        *l2tp_ctrl_create (void);
464 void             l2tp_ctrl_input (l2tpd *, int, struct sockaddr *, struct sockaddr *, void *, u_char *, int);
465 int              l2tp_ctrl_send(l2tp_ctrl *, const void *, int);
466 int              l2tp_ctrl_send_packet(l2tp_ctrl *, int, bytebuffer *, int);
467 int               l2tp_ctrl_stop (l2tp_ctrl *, int);
468 bytebuffer       *l2tp_ctrl_prepare_snd_buffer (l2tp_ctrl *, int);
469 void             l2tp_ctrl_log (l2tp_ctrl *, int, const char *, ...) __attribute__((__format__ (__printf__, 3, 4)));
470 int              l2tpd_init (l2tpd *);
471 void             l2tpd_uninit (l2tpd *);
472 int              l2tpd_assign_call (l2tpd *, l2tp_call *);
473 void             l2tpd_release_call (l2tpd *, l2tp_call *);
474 int              l2tpd_start (l2tpd *);
475 void             l2tpd_stop (l2tpd *);
476 void             l2tpd_stop_immediatly (l2tpd *);
477 l2tp_ctrl        *l2tpd_get_ctrl (l2tpd *, int);
478 void             l2tpd_add_ctrl (l2tpd *, l2tp_ctrl *);
479 void             l2tpd_ctrl_finished_notify(l2tpd *);
480 void             l2tpd_remove_ctrl (l2tpd *, int);
481 int              l2tpd_add_listener (l2tpd *, int, const char *, struct sockaddr *);
482 void             l2tpd_log (l2tpd *, int, const char *, ...) __attribute__((__format__ (__printf__, 3, 4)));
483 
484 const char   *l2tp_ctrl_config_str (l2tp_ctrl *, const char *);
485 int          l2tp_ctrl_config_int (l2tp_ctrl *, const char *, int);
486 int          l2tp_ctrl_config_str_equal (l2tp_ctrl *, const char *, const char *, int);
487 int          l2tp_ctrl_config_str_equali (l2tp_ctrl *, const char *, const char *, int);
488 const char   *l2tpd_config_str (l2tpd *, const char *);
489 int          l2tpd_config_int (l2tpd *, const char *, int);
490 int          l2tpd_config_str_equal (l2tpd *, const char *, const char *, int);
491 int          l2tpd_config_str_equali (l2tpd *, const char *, const char *, int);
492 int          l2tpd_reload(l2tpd *, struct properties *, const char *, int);
493 void         l2tpd_log_access_deny(l2tpd *, const char *, struct sockaddr *);
494 #ifdef __cplusplus
495 }
496 #endif
497 #endif
498