usbmodeswitch: Updated to v.1.2.6 from shibby's branch.
[tomato.git] / release / src / router / xl2tpd / misc.h
blobaafdc62f2870e540146bad7308f3b1a81aaed309
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 * Misc stuff...
15 #ifndef _MISC_H
16 #define _MISC_H
18 #include <syslog.h>
20 struct tunnel;
21 struct buffer
23 int type;
24 void *rstart;
25 void *rend;
26 void *start;
27 int len;
28 int maxlen;
29 #if 0
30 unsigned int addr;
31 int port;
32 #else
33 struct sockaddr_in peer;
34 #endif
35 struct tunnel *tunnel; /* Who owns this packet, if it's a control */
36 int retries; /* Again, if a control packet, how many retries? */
39 struct ppp_opts
41 char option[MAXSTRLEN];
42 struct ppp_opts *next;
45 #define IPADDY(a) inet_ntoa(*((struct in_addr *)&(a)))
47 #define DEBUG c ? c->debug || t->debug : t->debug
49 #ifdef USE_SWAPS_INSTEAD
50 #define SWAPS(a) ((((a) & 0xFF) << 8 ) | (((a) >> 8) & 0xFF))
51 #ifdef htons
52 #undef htons
53 #endif
54 #ifdef ntohs
55 #undef htons
56 #endif
57 #define htons(a) SWAPS(a)
58 #define ntohs(a) SWAPS(a)
59 #endif
61 #define halt() printf("Halted.\n") ; for(;;)
63 extern char hostname[];
64 extern void l2tp_log (int level, const char *fmt, ...);
65 extern struct buffer *new_buf (int);
66 extern void udppush_handler (int);
67 extern int addfcs (struct buffer *buf);
68 extern inline void swaps (void *, int);
69 extern void do_packet_dump (struct buffer *);
70 extern void status (const char *fmt, ...);
71 extern void status_handler (int signal);
72 extern int getPtyMaster(char *, int);
73 extern void do_control (void);
74 extern void recycle_buf (struct buffer *);
75 extern void safe_copy (char *, char *, int);
76 extern void opt_destroy (struct ppp_opts *);
77 extern struct ppp_opts *add_opt (struct ppp_opts *, char *, ...);
78 extern void process_signal (void);
79 #endif