83420023d849bcea052febb0555fc58512781e1c
[l2tpns.git] / l2tpns.h
1 // L2TPNS Global Stuff
2 // $Id: l2tpns.h,v 1.47 2004-12-16 08:49:53 bodea Exp $
3
4 #ifndef __L2TPNS_H__
5 #define __L2TPNS_H__
6
7 #include <netinet/in.h>
8 #include <execinfo.h>
9 #include <stdio.h>
10 #include <signal.h>
11 #include <stdlib.h>
12 #include <netinet/in.h>
13 #include <sys/socket.h>
14 #include <arpa/inet.h>
15 #include <sys/types.h>
16 #include <libcli.h>
17
18 #define VERSION "2.0.13"
19
20 // Limits
21 #define MAXTUNNEL 500 // could be up to 65535
22 #define MAXSESSION 50000 // could be up to 65535
23 #define MAXTBFS 6000 // Maximum token bucket filters. Might need up to 2 * session.
24
25 #define RADIUS_SHIFT 5
26 #define RADIUS_MASK ((unsigned short)(((unsigned short)~0) >> (16 - RADIUS_SHIFT)))
27 #define MAXRADIUS ((unsigned long)(1L << RADIUS_SHIFT) * 255)
28
29 #define T_UNDEF (0xffff) // A tunnel ID that won't ever be used. Mark session as undefined.
30 #define T_FREE (0) // A tunnel ID that won't ever be used. Mark session as free.
31
32 #define MAXCONTROL 1000 // max length control message we ever send...
33 #define MAXETHER (1500+18) // max packet we try sending to tun
34 #define MAXTEL 96 // telephone number
35 #define MAXPLUGINS 20 // maximum number of plugins to load
36 #define MAXRADSERVER 10 // max radius servers
37 #define MAXROUTE 10 // max static routes per session
38 #define MAXIPPOOL 131072 // max number of ip addresses in pool
39 #define RINGBUFFER_SIZE 10000 // Number of ringbuffer entries to allocate
40 #define MAX_LOG_LENGTH 512 // Maximum size of log message
41 #define ECHO_TIMEOUT 60 // Time between last packet sent and LCP ECHO generation
42 #define IDLE_TIMEOUT 240 // Time between last packet sent and LCP ECHO generation
43 #define BUSY_WAIT_TIME 3000 // 5 minutes in 1/10th seconds to wait for radius to cleanup on shutdown
44
45 // Constants
46 #ifndef ETCDIR
47 #define ETCDIR "/etc/l2tpns"
48 #endif
49
50 #ifndef LIBDIR
51 #define LIBDIR "/usr/lib/l2tpns"
52 #endif
53
54 #ifndef STATEDIR
55 #define STATEDIR "/var/lib/l2tpns"
56 #endif
57
58 #ifndef PLUGINDIR
59 #define PLUGINDIR LIBDIR // Plugins
60 #endif
61
62 #ifndef PLUGINCONF
63 #define PLUGINCONF ETCDIR // Plugin config dir
64 #endif
65
66 #ifndef FLASHDIR
67 #define FLASHDIR ETCDIR
68 #endif
69
70 #ifndef DATADIR
71 #define DATADIR STATEDIR
72 #endif
73
74 #define TUNDEVICE "/dev/net/tun"
75 #define STATEFILE DATADIR "/state.dump" // State dump file
76 #define CONFIGFILE FLASHDIR "/startup-config" // Configuration file
77 #define CLIUSERS FLASHDIR "/users" // CLI Users file
78 #define IPPOOLFILE FLASHDIR "/ip_pool" // Address pool configuration
79 #define ACCT_TIME 3000 // 5 minute accounting interval
80 #define ACCT_SHUT_TIME 600 // 1 minute for counters of shutdown sessions
81 #define L2TPPORT 1701 // L2TP port
82 #define RADPORT 1645 // old radius port...
83 #define PKTARP 0x0806 // ARP packet type
84 #define PKTIP 0x0800 // IP packet type
85 #define PSEUDOMAC 0x0200 // pseudo MAC prefix (local significant MAC)
86 #define PPPPAP 0xC023
87 #define PPPCHAP 0xC223
88 #define PPPLCP 0xC021
89 #define PPPIPCP 0x8021
90 #define PPPCCP 0x80FD
91 #define PPPIP 0x0021
92 #define PPPMP 0x003D
93 #define MIN_IP_SIZE 0x19
94 enum
95 {
96 ConfigReq = 1,
97 ConfigAck,
98 ConfigNak,
99 ConfigRej,
100 TerminateReq,
101 TerminateAck,
102 CodeRej,
103 ProtocolRej,
104 EchoReq,
105 EchoReply,
106 DiscardRequest,
107 IdentRequest
108 };
109
110 // Types
111 typedef uint16_t sessionidt;
112 typedef uint16_t tunnelidt;
113 typedef uint32_t clockt;
114 typedef uint8_t hasht[16];
115
116 // CLI actions
117 struct cli_session_actions {
118 char action;
119 in_addr_t snoop_ip;
120 uint16_t snoop_port;
121 int throttle_in;
122 int throttle_out;
123 int filter_in;
124 int filter_out;
125 };
126
127 #define CLI_SESS_KILL 0x01
128 #define CLI_SESS_SNOOP 0x02
129 #define CLI_SESS_NOSNOOP 0x04
130 #define CLI_SESS_THROTTLE 0x08
131 #define CLI_SESS_NOTHROTTLE 0x10
132 #define CLI_SESS_FILTER 0x20
133 #define CLI_SESS_NOFILTER 0x40
134
135 struct cli_tunnel_actions {
136 char action;
137 };
138
139 #define CLI_TUN_KILL 0x01
140
141 // dump header: update number if internal format changes
142 #define DUMP_MAGIC "L2TPNS#" VERSION "#"
143
144 // structures
145 typedef struct // route
146 {
147 in_addr_t ip;
148 in_addr_t mask;
149 }
150 routet;
151
152 typedef struct controls // control message
153 {
154 struct controls *next; // next in queue
155 uint16_t length; // length
156 uint8_t buf[MAXCONTROL];
157 }
158 controlt;
159
160 typedef struct
161 {
162 sessionidt next; // next session in linked list
163 sessionidt far; // far end session ID
164 tunnelidt tunnel; // near end tunnel ID
165 in_addr_t ip; // IP of session set by RADIUS response (host byte order).
166 int ip_pool_index; // index to IP pool
167 unsigned long unique_id; // unique session id
168 uint16_t nr; // next receive
169 uint16_t ns; // next send
170 uint32_t magic; // ppp magic number
171 uint32_t cin, cout; // byte counts
172 uint32_t pin, pout; // packet counts
173 uint32_t total_cin; // This counter is never reset while a session is open
174 uint32_t total_cout; // This counter is never reset while a session is open
175 uint32_t id; // session id
176 uint16_t throttle_in; // upstream throttle rate (kbps)
177 uint16_t throttle_out; // downstream throttle rate
178 clockt opened; // when started
179 clockt die; // being closed, when to finally free
180 time_t last_packet; // Last packet from the user (used for idle timeouts)
181 in_addr_t dns1, dns2; // DNS servers
182 routet route[MAXROUTE]; // static routes
183 uint16_t radius; // which radius session is being used (0 for not waiting on authentication)
184 uint16_t mru; // maximum receive unit
185 uint16_t tbf_in; // filter bucket for throttling in from the user.
186 uint16_t tbf_out; // filter bucket for throttling out to the user.
187 uint8_t l2tp_flags; // various bit flags from the ICCN on the l2tp tunnel.
188 uint8_t reserved_old_snoop; // No longer used - remove at some time
189 uint8_t walled_garden; // is this session gardened?
190 uint8_t flags1; // additional flags (currently unused);
191 char random_vector[MAXTEL];
192 int random_vector_length;
193 char user[129]; // user (needed in seesion for radius stop messages) (can we reduce this? --mo)
194 char called[MAXTEL]; // called number
195 char calling[MAXTEL]; // calling number
196 uint32_t tx_connect_speed;
197 uint32_t rx_connect_speed;
198 uint32_t flags; // Various session flags.
199 in_addr_t snoop_ip; // Interception destination IP
200 uint16_t snoop_port; // Interception destination port
201 uint16_t sid; // near end session id.
202 uint8_t filter_in; // input filter index (to ip_filters[N-1]; 0 if none)
203 uint8_t filter_out; // output filter index
204 char reserved[18]; // Space to expand structure without changing HB_VERSION
205 }
206 sessiont;
207
208 #define SF_IPCP_ACKED 1 // Has this session seen an IPCP Ack?
209 #define SF_LCP_ACKED 2 // LCP negotiated
210 #define SF_CCP_ACKED 4 // CCP negotiated
211
212 typedef struct
213 {
214 uint32_t cin;
215 uint32_t cout;
216 } sessioncountt;
217
218 #define SESSIONPFC 1 // PFC negotiated flags
219 #define SESSIONACFC 2 // ACFC negotiated flags
220
221 // 168 bytes per tunnel
222 typedef struct
223 {
224 tunnelidt far; // far end tunnel ID
225 in_addr_t ip; // Ip for far end
226 uint16_t port; // port for far end
227 uint16_t window; // Rx window
228 uint16_t nr; // next receive
229 uint16_t ns; // next send
230 int state; // current state (tunnelstate enum)
231 clockt last; // when last control message sent (used for resend timeout)
232 clockt retry; // when to try resenting pending control
233 clockt die; // being closed, when to finally free
234 clockt lastrec; // when the last control message was received
235 char hostname[128]; // tunnel hostname
236 char vendor[128]; // LAC vendor
237 uint8_t try; // number of retrys on a control message
238 uint16_t controlc; // outstaind messages in queue
239 controlt *controls; // oldest message
240 controlt *controle; // newest message
241 }
242 tunnelt;
243
244 // 180 bytes per radius session
245 typedef struct // outstanding RADIUS requests
246 {
247 sessionidt session; // which session this applies to
248 hasht auth; // request authenticator
249 clockt retry; // when to try next
250 char calling[MAXTEL]; // calling number
251 char pass[129]; // password
252 uint8_t id; // ID for PPP response
253 uint8_t try; // which try we are on
254 uint8_t state; // state of radius requests
255 uint8_t chap; // set if CHAP used (is CHAP identifier)
256 }
257 radiust;
258
259 typedef struct
260 {
261 in_addr_t address; // Host byte order..
262 char assigned; // 1 if assigned, 0 if free
263 sessionidt session;
264 clockt last; // last used
265 char user[129]; // user (try to have ip addresses persistent)
266 }
267 ippoolt;
268
269 #ifdef RINGBUFFER
270 struct Tringbuffer
271 {
272 struct {
273 char level;
274 sessionidt session;
275 tunnelidt tunnel;
276 char message[MAX_LOG_LENGTH];
277 } buffer[RINGBUFFER_SIZE];
278 int head;
279 int tail;
280 };
281 #endif
282
283 /*
284 * Possible tunnel states
285 * TUNNELFREE -> TUNNELOPEN -> TUNNELDIE -> TUNNELFREE
286 */
287 enum
288 {
289 TUNNELFREE, // Not in use
290 TUNNELOPEN, // Active tunnel
291 TUNNELDIE, // Currently closing
292 TUNNELOPENING, // Busy opening
293 TUNNELUNDEF, // Undefined
294 };
295
296 enum
297 {
298 RADIUSNULL, // Not in use
299 RADIUSCHAP, // sending CHAP down PPP
300 RADIUSAUTH, // sending auth to RADIUS server
301 RADIUSIPCP, // sending IPCP to end user
302 RADIUSSTART, // sending start accounting to RADIUS server
303 RADIUSSTOP, // sending stop accounting to RADIUS server
304 RADIUSWAIT, // waiting timeout before available, in case delayed replies
305 RADIUSDEAD, // errored while talking to radius server.
306 };
307
308 struct Tstats
309 {
310 time_t start_time;
311 time_t last_reset;
312
313 unsigned long tun_rx_packets;
314 unsigned long tun_tx_packets;
315 unsigned long tun_rx_bytes;
316 unsigned long tun_tx_bytes;
317 unsigned long tun_rx_errors;
318 unsigned long tun_tx_errors;
319
320 unsigned long tunnel_rx_packets;
321 unsigned long tunnel_tx_packets;
322 unsigned long tunnel_rx_bytes;
323 unsigned long tunnel_tx_bytes;
324 unsigned long tunnel_rx_errors;
325 unsigned long tunnel_tx_errors;
326
327 unsigned long tunnel_retries;
328 unsigned long radius_retries;
329
330 unsigned long arp_sent;
331
332 unsigned long packets_snooped;
333
334 unsigned long tunnel_created;
335 unsigned long session_created;
336 unsigned long tunnel_timeout;
337 unsigned long session_timeout;
338 unsigned long radius_timeout;
339 unsigned long radius_overflow;
340 unsigned long tunnel_overflow;
341 unsigned long session_overflow;
342
343 unsigned long ip_allocated;
344 unsigned long ip_freed;
345
346 unsigned long c_forwarded;
347 unsigned long recv_forward;
348 #ifdef STATISTICS
349 unsigned long call_processtun;
350 unsigned long call_processipout;
351 unsigned long call_processudp;
352 unsigned long call_sessionbyip;
353 unsigned long call_sessionbyuser;
354 unsigned long call_sendarp;
355 unsigned long call_sendipcp;
356 unsigned long call_tunnelsend;
357 unsigned long call_sessionkill;
358 unsigned long call_sessionshutdown;
359 unsigned long call_tunnelkill;
360 unsigned long call_tunnelshutdown;
361 unsigned long call_assign_ip_address;
362 unsigned long call_free_ip_address;
363 unsigned long call_dump_acct_info;
364 unsigned long call_sessionsetup;
365 unsigned long call_processpap;
366 unsigned long call_processchap;
367 unsigned long call_processlcp;
368 unsigned long call_processipcp;
369 unsigned long call_processipin;
370 unsigned long call_processccp;
371 unsigned long call_sendchap;
372 unsigned long call_processrad;
373 unsigned long call_radiussend;
374 unsigned long call_radiusretry;
375 #endif
376 };
377
378 #ifdef STATISTICS
379
380 #ifdef STAT_CALLS
381 #define CSTAT(x) STAT(x)
382 #else
383 #define CSTAT(x)
384 #endif
385
386 #define STAT(x) (_statistics->x++)
387 #define INC_STAT(x,y) (_statistics->x += (y))
388 #define GET_STAT(x) (_statistics->x)
389 #define SET_STAT(x, y) (_statistics->x = (y))
390 #else
391 #define CSTAT(x)
392 #define STAT(x)
393 #define INC_STAT(x,y)
394 #define GET_STAT(x) 0
395 #define SET_STAT(x, y)
396 #endif
397
398 typedef struct
399 {
400 int debug; // debugging level
401 time_t start_time; // time when l2tpns was started
402 char bandwidth[256]; // current bandwidth
403 char pid_file[256]; // file to write PID to on startup
404 int wrote_pid;
405 clockt current_time; // 1/10ths of a second since the process started.
406 // means that we can only run a given process
407 // for 13 years without re-starting!
408
409 char config_file[128];
410 int reload_config; // flag to re-read config (set by cli)
411 int cleanup_interval; // interval between regular cleanups (in seconds)
412 int multi_read_count; // amount of packets to read per fd in processing loop
413
414 char tundevice[10]; // tun device name
415 char log_filename[128];
416 char l2tpsecret[64];
417
418 char radiussecret[64];
419 int radius_accounting;
420 in_addr_t radiusserver[MAXRADSERVER]; // radius servers
421 uint16_t radiusport[MAXRADSERVER]; // radius base ports
422 uint8_t numradiusservers; // radius server count
423 short num_radfds; // Number of radius filehandles allocated
424
425 in_addr_t default_dns1, default_dns2;
426
427 unsigned long rl_rate; // default throttle rate
428 int num_tbfs; // number of throttle buckets
429
430 int save_state;
431 char accounting_dir[128];
432 in_addr_t bind_address;
433 in_addr_t peer_address;
434 int send_garp; // Set to true to garp for vip address on startup
435
436 int target_uid;
437 int dump_speed;
438 char plugins[64][MAXPLUGINS];
439 char old_plugins[64][MAXPLUGINS];
440
441 int next_tbf; // Next HTB id available to use
442 int scheduler_fifo; // If the system has multiple CPUs, use FIFO scheduling policy for this process.
443 int lock_pages; // Lock pages into memory.
444 int icmp_rate; // Max number of ICMP unreachable per second to send>
445
446 in_addr_t cluster_address; // Multicast address of cluster.
447 // Send to this address to have everyone hear.
448 char cluster_interface[64]; // Which interface to listen for multicast on.
449 int cluster_iam_master; // Are we the cluster master???
450 int cluster_iam_uptodate; // Set if we've got a full set of state from the master.
451 in_addr_t cluster_master_address; // The network address of the cluster master.
452 // Zero if i am the cluster master.
453 int cluster_seq_number; // Sequence number of the next heartbeat we'll send out
454 // (or the seq number we're next expecting if we're a slave).
455 int cluster_undefined_sessions; // How many sessions we're yet to receive from the master.
456 int cluster_undefined_tunnels; // How many tunnels we're yet to receive from the master.
457 int cluster_highest_sessionid;
458 int cluster_highest_tunnelid;
459 clockt cluster_last_hb; // Last time we saw a heartbeat from the master.
460 int cluster_num_changes; // Number of changes queued.
461
462 int cluster_hb_interval; // How often to send a heartbeat.
463 int cluster_hb_timeout; // How many missed heartbeats trigger an election.
464 uint64_t cluster_table_version; // # state changes processed by cluster
465
466 #ifdef BGP
467 #define BGP_NUM_PEERS 2
468 uint16_t as_number;
469 struct {
470 char name[64];
471 uint16_t as;
472 int keepalive;
473 int hold;
474 } neighbour[BGP_NUM_PEERS];
475 #endif
476 } configt;
477
478 enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IP, MAC };
479 typedef struct
480 {
481 char *key;
482 int offset;
483 int size;
484 enum config_typet type;
485 } config_descriptt;
486
487 typedef struct
488 {
489 uint8_t op; // operation
490 #define FILTER_PORT_OP_NONE 0 // all ports match
491 #define FILTER_PORT_OP_EQ 1
492 #define FILTER_PORT_OP_NEQ 2
493 #define FILTER_PORT_OP_GT 3
494 #define FILTER_PORT_OP_LT 4
495 #define FILTER_PORT_OP_RANGE 5
496 uint16_t port; // port (host byte order)
497 uint16_t port2; // range
498 } ip_filter_portt;
499
500 typedef struct
501 {
502 int action; // permit/deny
503 #define FILTER_ACTION_DENY 1
504 #define FILTER_ACTION_PERMIT 2
505 uint8_t proto; // protocol: IPPROTO_* (netinet/in.h)
506 in_addr_t src_ip; // source ip (network byte order)
507 in_addr_t src_wild;
508 ip_filter_portt src_ports;
509 in_addr_t dst_ip; // dest ip
510 in_addr_t dst_wild;
511 ip_filter_portt dst_ports;
512 uint8_t frag; // apply to non-initial fragments
513 uint8_t tcp_flag_op; // match type: any, all, established
514 #define FILTER_FLAG_OP_ANY 1
515 #define FILTER_FLAG_OP_ALL 2
516 #define FILTER_FLAG_OP_EST 3
517 uint8_t tcp_sflags; // flags set
518 uint8_t tcp_cflags; // flags clear
519 uint32_t counter; // match count
520 } ip_filter_rulet;
521
522 #define TCP_FLAG_FIN 0x01
523 #define TCP_FLAG_SYN 0x02
524 #define TCP_FLAG_RST 0x04
525 #define TCP_FLAG_PSH 0x08
526 #define TCP_FLAG_ACK 0x10
527 #define TCP_FLAG_URG 0x20
528
529 #define MAXFILTER 32
530 #define MAXFILTER_RULES 32
531 typedef struct
532 {
533 char name[32]; // ACL name
534 int extended; // type: 0 = standard, 1 = extended
535 ip_filter_rulet rules[MAXFILTER_RULES];
536 int used; // session ref count
537 } ip_filtert;
538
539 // arp.c
540 void sendarp(int ifr_idx, const unsigned char* mac, in_addr_t ip);
541
542
543 // ppp.c
544 void processpap(tunnelidt t, sessionidt s, uint8_t *p, uint16_t l);
545 void processchap(tunnelidt t, sessionidt s, uint8_t *p, uint16_t l);
546 void processlcp(tunnelidt t, sessionidt s, uint8_t *p, uint16_t l);
547 void processipcp(tunnelidt t, sessionidt s, uint8_t *p, uint16_t l);
548 void processipin(tunnelidt t, sessionidt s, uint8_t *p, uint16_t l);
549 void processccp(tunnelidt t, sessionidt s, uint8_t *p, uint16_t l);
550 void sendchap(tunnelidt t, sessionidt s);
551 uint8_t *makeppp(uint8_t *b, int size, uint8_t *p, int l, tunnelidt t, sessionidt s, uint16_t mtype);
552 void initlcp(tunnelidt t, sessionidt s);
553 void send_ipin(sessionidt s, uint8_t *buf, int len);
554
555
556 // radius.c
557 void initrad(void);
558 void radiussend(uint16_t r, uint8_t state);
559 void processrad(uint8_t *buf, int len, char socket_index);
560 void radiusretry(uint16_t r);
561 uint16_t radiusnew(sessionidt s);
562 void radiusclear(uint16_t r, sessionidt s);
563
564
565 // l2tpns.c
566 clockt backoff(uint8_t try);
567 sessionidt sessionbyip(in_addr_t ip);
568 sessionidt sessionbyuser(char *username);
569 void sessionshutdown(sessionidt s, char *reason);
570 void send_garp(in_addr_t ip);
571 void tunnelsend(uint8_t *buf, uint16_t l, tunnelidt t);
572 void sendipcp(tunnelidt t, sessionidt s);
573 void processudp(uint8_t *buf, int len, struct sockaddr_in *addr);
574 void snoop_send_packet(char *packet, uint16_t size, in_addr_t destination, uint16_t port);
575 int ip_filter(uint8_t *buf, int len, uint8_t filter);
576 int cmd_show_ipcache(struct cli_def *cli, char *command, char **argv, int argc);
577 int cmd_show_hist_idle(struct cli_def *cli, char *command, char **argv, int argc);
578 int cmd_show_hist_open(struct cli_def *cli, char *command, char **argv, int argc);
579
580 #undef LOG
581 #undef LOG_HEX
582 #define LOG(D, s, t, f, ...) ({ if (D <= config->debug) _log(D, s, t, f, ## __VA_ARGS__); })
583 #define LOG_HEX(D, t, d, s) ({ if (D <= config->debug) _log_hex(D, t, d, s); })
584
585 void _log(int level, sessionidt s, tunnelidt t, const char *format, ...) __attribute__((format (printf, 4, 5)));
586 void _log_hex(int level, const char *title, const char *data, int maxsize);
587
588 int sessionsetup(tunnelidt t, sessionidt s);
589 int run_plugins(int plugin_type, void *data);
590 void rebuild_address_pool(void);
591 void throttle_session(sessionidt s, int rate_in, int rate_out);
592 int load_session(sessionidt, sessiont *);
593 void become_master(void); // We're the master; kick off any required master initializations.
594
595
596 // cli.c
597 void init_cli(char *hostname);
598 void cli_do_file(FILE *fh);
599 void cli_do(int sockfd);
600 int cli_arg_help(struct cli_def *cli, int cr_ok, char *entry, ...);
601
602
603 // icmp.c
604 void host_unreachable(in_addr_t destination, uint16_t id, in_addr_t source, char *packet, int packet_len);
605
606
607 extern tunnelt *tunnel;
608 extern sessiont *session;
609 extern sessioncountt *sess_count;
610 extern ippoolt *ip_address_pool;
611 #define sessionfree (session[0].next)
612
613 #define log_backtrace(count, max) \
614 if (count++ < max) { \
615 void *array[20]; \
616 char **strings; \
617 int size, i; \
618 LOG(0, 0, t, "Backtrace follows"); \
619 size = backtrace(array, 10); \
620 strings = backtrace_symbols(array, size); \
621 if (strings) for (i = 0; i < size; i++) \
622 { \
623 LOG(0, 0, t, "%s\n", strings[i]); \
624 } \
625 free(strings); \
626 }
627
628
629 extern configt *config;
630 extern time_t basetime; // Time when this process started.
631 extern time_t time_now; // Seconds since EPOCH.
632 extern uint32_t last_id;
633 extern struct Tstats *_statistics;
634 extern in_addr_t my_address;
635 extern int tun_write(uint8_t *data, int size);
636 extern int clifd;
637
638
639 #define TIME (config->current_time)
640
641 // macros for handling help in cli commands
642 #define CLI_HELP_REQUESTED (argc > 0 && argv[argc-1][strlen(argv[argc-1])-1] == '?')
643 #define CLI_HELP_NO_ARGS (argc > 1 || argv[0][1]) ? CLI_OK : cli_arg_help(cli, 1, NULL)
644
645 // CVS identifiers (for "show version file")
646 extern char const *cvs_id_arp;
647 extern char const *cvs_id_cli;
648 extern char const *cvs_id_cluster;
649 extern char const *cvs_id_constants;
650 extern char const *cvs_id_control;
651 extern char const *cvs_id_icmp;
652 extern char const *cvs_id_l2tpns;
653 extern char const *cvs_id_ll;
654 extern char const *cvs_id_md5;
655 extern char const *cvs_id_ppp;
656 extern char const *cvs_id_radius;
657 extern char const *cvs_id_tbf;
658 extern char const *cvs_id_util;
659
660 #endif /* __L2TPNS_H__ */