]> git.ozlabs.org Git - ppp.git/blob - pppd/pppd.h
add add_fd and remove_fd, remove wait_loop_output and wait_time
[ppp.git] / pppd / pppd.h
1 /*
2  * pppd.h - PPP daemon global declarations.
3  *
4  * Copyright (c) 1989 Carnegie Mellon University.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms are permitted
8  * provided that the above copyright notice and this paragraph are
9  * duplicated in all such forms and that any documentation,
10  * advertising materials, and other materials related to such
11  * distribution and use acknowledge that the software was developed
12  * by Carnegie Mellon University.  The name of the
13  * University may not be used to endorse or promote products derived
14  * from this software without specific prior written permission.
15  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  * $Id: pppd.h,v 1.30 1999/03/16 02:51:06 paulus Exp $
20  */
21
22 /*
23  * TODO:
24  */
25
26 #ifndef __PPPD_H__
27 #define __PPPD_H__
28
29 #include <stdio.h>              /* for FILE */
30 #include <sys/param.h>          /* for MAXPATHLEN and BSD4_4, if defined */
31 #include <sys/types.h>          /* for u_int32_t, if defined */
32 #include <sys/time.h>           /* for struct timeval */
33 #include <net/ppp_defs.h>
34
35 #if __STDC__
36 #include <stdarg.h>
37 #define __V(x)  x
38 #else
39 #include <varargs.h>
40 #define __V(x)  (va_alist) va_dcl
41 #define const
42 #endif
43
44 /*
45  * Limits.
46  */
47
48 #define NUM_PPP         1       /* One PPP interface supported (per process) */
49 #define MAXWORDLEN      1024    /* max length of word in file (incl null) */
50 #define MAXARGS         1       /* max # args to a command */
51 #define MAXNAMELEN      256     /* max length of hostname or name for auth */
52 #define MAXSECRETLEN    256     /* max length of password or secret */
53
54 /*
55  * Option descriptor structure.
56  */
57
58 typedef unsigned char   bool;
59
60 enum opt_type {
61         o_special_noarg = 0,
62         o_special = 1,
63         o_bool,
64         o_int,
65         o_uint32,
66         o_string,
67 };
68
69 typedef struct {
70         char    *name;          /* name of the option */
71         enum opt_type type;
72         void    *addr;
73         char    *description;
74         int     flags;
75         void    *addr2;
76         int     upper_limit;
77         int     lower_limit;
78 } option_t;
79
80 /* Values for flags */
81 #define OPT_VALUE       0xff    /* mask for presupplied value */
82 #define OPT_HEX         0x100   /* int option is in hex */
83 #define OPT_NOARG       0x200   /* option doesn't take argument */
84 #define OPT_OR          0x400   /* OR in argument to value */
85 #define OPT_INC         0x800   /* increment value */
86 #define OPT_PRIV        0x1000  /* privileged option */
87 #define OPT_STATIC      0x2000  /* string option goes into static array */
88 #define OPT_LLIMIT      0x4000  /* check value against lower limit */
89 #define OPT_ULIMIT      0x8000  /* check value against upper limit */
90 #define OPT_LIMITS      (OPT_LLIMIT|OPT_ULIMIT)
91 #define OPT_ZEROOK      0x10000 /* 0 value is OK even if not within limits */
92 #define OPT_NOINCR      0x20000 /* value mustn't be increased */
93 #define OPT_ZEROINF     0x40000 /* with OPT_NOINCR, 0 == infinity */
94 #define OPT_A2INFO      0x100000 /* addr2 -> option_info to update */
95 #define OPT_A2COPY      0x200000 /* addr2 -> second location to rcv value */
96 #define OPT_ENABLE      0x400000 /* use *addr2 as enable for option */
97 #define OPT_PRIVFIX     0x800000 /* can't be overridden if noauth */
98
99 #define OPT_VAL(x)      ((x) & OPT_VALUE)
100
101 #ifndef GIDSET_TYPE
102 #define GIDSET_TYPE     gid_t
103 #endif
104
105 /*
106  * Global variables.
107  */
108
109 extern int      hungup;         /* Physical layer has disconnected */
110 extern int      ifunit;         /* Interface unit number */
111 extern char     ifname[];       /* Interface name */
112 extern int      ttyfd;          /* Serial device file descriptor */
113 extern char     hostname[];     /* Our hostname */
114 extern u_char   outpacket_buf[]; /* Buffer for outgoing packets */
115 extern int      phase;          /* Current state of link - see values below */
116 extern int      baud_rate;      /* Current link speed in bits/sec */
117 extern char     *progname;      /* Name of this program */
118 extern int      redirect_stderr;/* Connector's stderr should go to file */
119 extern char     peer_authname[];/* Authenticated name of peer */
120 extern int      privileged;     /* We were run by real-uid root */
121 extern int      need_holdoff;   /* Need holdoff period after link terminates */
122 extern char     **script_env;   /* Environment variables for scripts */
123 extern int      detached;       /* Have detached from controlling tty */
124 extern GIDSET_TYPE groups[NGROUPS_MAX]; /* groups the user is in */
125 extern int      ngroups;        /* How many groups valid in groups */
126
127 /*
128  * Variables set by command-line options.
129  */
130
131 extern int      debug;          /* Debug flag */
132 extern int      kdebugflag;     /* Tell kernel to print debug messages */
133 extern int      default_device; /* Using /dev/tty or equivalent */
134 extern char     devnam[MAXPATHLEN];     /* Device name */
135 extern int      crtscts;        /* Use hardware flow control */
136 extern bool     modem;          /* Use modem control lines */
137 extern int      inspeed;        /* Input/Output speed requested */
138 extern u_int32_t netmask;       /* IP netmask to set on interface */
139 extern bool     lockflag;       /* Create lock file to lock the serial dev */
140 extern bool     nodetach;       /* Don't detach from controlling tty */
141 extern bool     updetach;       /* Detach from controlling tty when link up */
142 extern char     *connector;     /* Script to establish physical link */
143 extern char     *disconnector;  /* Script to disestablish physical link */
144 extern char     *welcomer;      /* Script to welcome client after connection */
145 extern int      maxconnect;     /* Maximum connect time (seconds) */
146 extern char     user[MAXNAMELEN];/* Our name for authenticating ourselves */
147 extern char     passwd[MAXSECRETLEN];   /* Password for PAP */
148 extern bool     auth_required;  /* Peer is required to authenticate */
149 extern bool     persist;        /* Reopen link after it goes down */
150 extern bool     uselogin;       /* Use /etc/passwd for checking PAP */
151 extern char     our_name[MAXNAMELEN];/* Our name for authentication purposes */
152 extern char     remote_name[MAXNAMELEN]; /* Peer's name for authentication */
153 extern int      explicit_remote;/* remote_name specified with remotename opt */
154 extern bool     demand;         /* Do dial-on-demand */
155 extern char     *ipparam;       /* Extra parameter for ip up/down scripts */
156 extern bool     cryptpap;       /* Others' PAP passwords are encrypted */
157 extern int      idle_time_limit;/* Shut down link if idle for this long */
158 extern int      holdoff;        /* Dead time before restarting */
159
160 #ifdef PPP_FILTER
161 extern struct   bpf_program pass_filter;   /* Filter for pkts to pass */
162 extern struct   bpf_program active_filter; /* Filter for link-active pkts */
163 #endif
164
165 char *current_option;           /* the name of the option being parsed */
166 int  privileged_option;         /* set iff the current option came from root */
167 char *option_source;            /* string saying where the option came from */
168
169 #ifdef MSLANMAN
170 extern bool     ms_lanman;      /* Use LanMan password instead of NT */
171                                 /* Has meaning only with MS-CHAP challenges */
172 #endif
173
174 /*
175  * Values for phase.
176  */
177 #define PHASE_DEAD              0
178 #define PHASE_INITIALIZE        1
179 #define PHASE_DORMANT           2
180 #define PHASE_ESTABLISH         3
181 #define PHASE_AUTHENTICATE      4
182 #define PHASE_CALLBACK          5
183 #define PHASE_NETWORK           6
184 #define PHASE_TERMINATE         7
185 #define PHASE_HOLDOFF           8
186
187 /*
188  * The following struct gives the addresses of procedures to call
189  * for a particular protocol.
190  */
191 struct protent {
192     u_short protocol;           /* PPP protocol number */
193     /* Initialization procedure */
194     void (*init) __P((int unit));
195     /* Process a received packet */
196     void (*input) __P((int unit, u_char *pkt, int len));
197     /* Process a received protocol-reject */
198     void (*protrej) __P((int unit));
199     /* Lower layer has come up */
200     void (*lowerup) __P((int unit));
201     /* Lower layer has gone down */
202     void (*lowerdown) __P((int unit));
203     /* Open the protocol */
204     void (*open) __P((int unit));
205     /* Close the protocol */
206     void (*close) __P((int unit, char *reason));
207     /* Print a packet in readable form */
208     int  (*printpkt) __P((u_char *pkt, int len,
209                           void (*printer) __P((void *, char *, ...)),
210                           void *arg));
211     /* Process a received data packet */
212     void (*datainput) __P((int unit, u_char *pkt, int len));
213     bool enabled_flag;          /* 0 iff protocol is disabled */
214     char *name;                 /* Text name of protocol */
215     option_t *options;          /* List of command-line options */
216     /* Check requested options, assign defaults */
217     void (*check_options) __P((void));
218     /* Configure interface for demand-dial */
219     int  (*demand_conf) __P((int unit));
220     /* Say whether to bring up link for this pkt */
221     int  (*active_pkt) __P((u_char *pkt, int len));
222 };
223
224 /* Table of pointers to supported protocols */
225 extern struct protent *protocols[];
226
227 /*
228  * Prototypes.
229  */
230
231 /* Procedures exported from main.c. */
232 void detach __P((void));        /* Detach from controlling tty */
233 void die __P((int));            /* Cleanup and exit */
234 void quit __P((void));          /* like die(1) */
235 void novm __P((char *));        /* Say we ran out of memory, and die */
236 void timeout __P((void (*func)(void *), void *arg, int t));
237                                 /* Call func(arg) after t seconds */
238 void untimeout __P((void (*func)(void *), void *arg));
239                                 /* Cancel call to func(arg) */
240 pid_t run_program __P((char *prog, char **args, int must_exist,
241                        void (*done)(void *), void *arg));
242                                 /* Run program prog with args in child */
243 void demuxprotrej __P((int, int));
244                                 /* Demultiplex a Protocol-Reject */
245 void format_packet __P((u_char *, int, void (*) (void *, char *, ...),
246                 void *));       /* Format a packet in human-readable form */
247 void log_packet __P((u_char *, int, char *, int));
248                                 /* Format a packet and log it with syslog */
249 void print_string __P((char *, int,  void (*) (void *, char *, ...),
250                 void *));       /* Format a string for output */
251 int slprintf __P((char *, int, char *, ...));           /* sprintf++ */
252 int vslprintf __P((char *, int, char *, va_list));      /* vsprintf++ */
253 void script_setenv __P((char *, char *));       /* set script env var */
254 void script_unsetenv __P((char *));             /* unset script env var */
255 void hangup_modem __P((int));   /* Make modem hang up */
256 void strlcpy __P((char *, size_t, const char *));       /* safe strcpy */
257 void strlcat __P((char *, size_t, const char *));       /* safe strncpy */
258 void dbglog __P((char *, ...)); /* log a debug message */
259 void info __P((char *, ...));   /* log an informational message */
260 void notice __P((char *, ...)); /* log a notice-level message */
261 void warn __P((char *, ...));   /* log a warning message */
262 void error __P((char *, ...));  /* log an error message */
263 void fatal __P((char *, ...));  /* log an error message and die(1) */
264
265 /* Procedures exported from auth.c */
266 void link_required __P((int));    /* we are starting to use the link */
267 void link_terminated __P((int));  /* we are finished with the link */
268 void link_down __P((int));        /* the LCP layer has left the Opened state */
269 void link_established __P((int)); /* the link is up; authenticate now */
270 void np_up __P((int, int));       /* a network protocol has come up */
271 void np_down __P((int, int));     /* a network protocol has gone down */
272 void np_finished __P((int, int)); /* a network protocol no longer needs link */
273 void auth_peer_fail __P((int, int));
274                                 /* peer failed to authenticate itself */
275 void auth_peer_success __P((int, int, char *, int));
276                                 /* peer successfully authenticated itself */
277 void auth_withpeer_fail __P((int, int));
278                                 /* we failed to authenticate ourselves */
279 void auth_withpeer_success __P((int, int));
280                                 /* we successfully authenticated ourselves */
281 void auth_check_options __P((void));
282                                 /* check authentication options supplied */
283 void auth_reset __P((int));     /* check what secrets we have */
284 int  check_passwd __P((int, char *, int, char *, int, char **, int *));
285                                 /* Check peer-supplied username/password */
286 int  get_secret __P((int, char *, char *, char *, int *, int));
287                                 /* get "secret" for chap */
288 int  auth_ip_addr __P((int, u_int32_t));
289                                 /* check if IP address is authorized */
290 int  bad_ip_adrs __P((u_int32_t));
291                                 /* check if IP address is unreasonable */
292 void check_access __P((FILE *, char *));
293                                 /* check permissions on secrets file */
294
295 /* Procedures exported from demand.c */
296 void demand_conf __P((void));   /* config interface(s) for demand-dial */
297 void demand_block __P((void));  /* set all NPs to queue up packets */
298 void demand_unblock __P((void)); /* set all NPs to pass packets */
299 void demand_discard __P((void)); /* set all NPs to discard packets */
300 void demand_rexmit __P((int));  /* retransmit saved frames for an NP */
301 int  loop_chars __P((unsigned char *, int)); /* process chars from loopback */
302 int  loop_frame __P((unsigned char *, int)); /* process frame from loopback */
303
304 /* Procedures exported from sys-*.c */
305 void sys_init __P((void));      /* Do system-dependent initialization */
306 void sys_cleanup __P((void));   /* Restore system state before exiting */
307 int  sys_check_options __P((void)); /* Check options specified */
308 void sys_close __P((void));     /* Clean up in a child before execing */
309 int  ppp_available __P((void)); /* Test whether ppp kernel support exists */
310 int  open_ppp_loopback __P((void)); /* Open loopback for demand-dialling */
311 int  establish_ppp __P((int));  /* Turn serial port into a ppp interface */
312 void restore_loop __P((void));  /* Transfer ppp unit back to loopback */
313 void disestablish_ppp __P((int)); /* Restore port to normal operation */
314 void clean_check __P((void));   /* Check if line was 8-bit clean */
315 void set_up_tty __P((int, int)); /* Set up port's speed, parameters, etc. */
316 void restore_tty __P((int));    /* Restore port's original parameters */
317 void setdtr __P((int, int));    /* Raise or lower port's DTR line */
318 void output __P((int, u_char *, int)); /* Output a PPP packet */
319 void wait_input __P((struct timeval *));
320                                 /* Wait for input, with timeout */
321 void add_fd __P((int));         /* Add fd to set to wait for */
322 void remove_fd __P((int));      /* Remove fd from set to wait for */
323 int  read_packet __P((u_char *)); /* Read PPP packet */
324 int  get_loop_output __P((void)); /* Read pkts from loopback */
325 void ppp_send_config __P((int, int, u_int32_t, int, int));
326                                 /* Configure i/f transmit parameters */
327 void ppp_set_xaccm __P((int, ext_accm));
328                                 /* Set extended transmit ACCM */
329 void ppp_recv_config __P((int, int, u_int32_t, int, int));
330                                 /* Configure i/f receive parameters */
331 int  ccp_test __P((int, u_char *, int, int));
332                                 /* Test support for compression scheme */
333 void ccp_flags_set __P((int, int, int));
334                                 /* Set kernel CCP state */
335 int  ccp_fatal_error __P((int)); /* Test for fatal decomp error in kernel */
336 int  get_idle_time __P((int, struct ppp_idle *));
337                                 /* Find out how long link has been idle */
338 int  sifvjcomp __P((int, int, int, int));
339                                 /* Configure VJ TCP header compression */
340 int  sifup __P((int));          /* Configure i/f up (for IP) */
341 int  sifnpmode __P((int u, int proto, enum NPmode mode));
342                                 /* Set mode for handling packets for proto */
343 int  sifdown __P((int));        /* Configure i/f down (for IP) */
344 int  sifaddr __P((int, u_int32_t, u_int32_t, u_int32_t));
345                                 /* Configure IP addresses for i/f */
346 int  cifaddr __P((int, u_int32_t, u_int32_t));
347                                 /* Reset i/f IP addresses */
348 int  sifdefaultroute __P((int, u_int32_t, u_int32_t));
349                                 /* Create default route through i/f */
350 int  cifdefaultroute __P((int, u_int32_t, u_int32_t));
351                                 /* Delete default route through i/f */
352 int  sifproxyarp __P((int, u_int32_t));
353                                 /* Add proxy ARP entry for peer */
354 int  cifproxyarp __P((int, u_int32_t));
355                                 /* Delete proxy ARP entry for peer */
356 u_int32_t GetMask __P((u_int32_t)); /* Get appropriate netmask for address */
357 int  lock __P((char *));        /* Create lock file for device */
358 void unlock __P((void));        /* Delete previously-created lock file */
359 int  daemon __P((int, int));    /* Detach us from terminal session */
360 void logwtmp __P((const char *, const char *, const char *));
361                                 /* Write entry to wtmp file */
362 int  get_host_seed __P((void)); /* Get host-dependent random number seed */
363 int  have_route_to __P((u_int32_t)); /* Check if route to addr exists */
364 #ifdef PPP_FILTER
365 int  set_filters __P((struct bpf_program *pass, struct bpf_program *active));
366                                 /* Set filter programs in kernel */
367 #endif
368 #ifdef IPX_CHANGE
369 int  sipxfaddr __P((int, unsigned long, unsigned char *));
370 int  cipxfaddr __P((int));
371 #endif
372
373 /* Procedures exported from options.c */
374 int  parse_args __P((int argc, char **argv));
375                                 /* Parse options from arguments given */
376 void usage __P((void));         /* Print a usage message */
377 int  options_from_file __P((char *filename, int must_exist, int check_prot,
378                             int privileged));
379                                 /* Parse options from an options file */
380 int  options_from_user __P((void)); /* Parse options from user's .ppprc */
381 int  options_for_tty __P((void)); /* Parse options from /etc/ppp/options.tty */
382 void scan_args __P((int argc, char **argv));
383                                 /* Look for tty name in command-line args */
384 int  getword __P((FILE *f, char *word, int *newlinep, char *filename));
385                                 /* Read a word from a file */
386 void option_error __P((char *fmt, ...));
387                                 /* Print an error message about an option */
388 int readable __P((int fd));     /* Is fd readable by real user? */
389 int number_option __P((char *, u_int32_t *, int));
390                                 /* Parse a numerical option */
391 int int_option __P((char *, int *));
392                                 /* Simplified number_option for decimal ints */
393
394 /*
395  * This structure is used to store information about certain
396  * options, such as where the option value came from (/etc/ppp/options,
397  * command line, etc.) and whether it came from a privileged source.
398  */
399
400 struct option_info {
401     int     priv;               /* was value set by sysadmin? */
402     char    *source;            /* where option came from */
403 };
404
405 extern struct option_info devnam_info;
406 extern struct option_info connector_info;
407 extern struct option_info disconnector_info;
408 extern struct option_info welcomer_info;
409
410 /*
411  * Inline versions of get/put char/short/long.
412  * Pointer is advanced; we assume that both arguments
413  * are lvalues and will already be in registers.
414  * cp MUST be u_char *.
415  */
416 #define GETCHAR(c, cp) { \
417         (c) = *(cp)++; \
418 }
419 #define PUTCHAR(c, cp) { \
420         *(cp)++ = (u_char) (c); \
421 }
422
423
424 #define GETSHORT(s, cp) { \
425         (s) = *(cp)++ << 8; \
426         (s) |= *(cp)++; \
427 }
428 #define PUTSHORT(s, cp) { \
429         *(cp)++ = (u_char) ((s) >> 8); \
430         *(cp)++ = (u_char) (s); \
431 }
432
433 #define GETLONG(l, cp) { \
434         (l) = *(cp)++ << 8; \
435         (l) |= *(cp)++; (l) <<= 8; \
436         (l) |= *(cp)++; (l) <<= 8; \
437         (l) |= *(cp)++; \
438 }
439 #define PUTLONG(l, cp) { \
440         *(cp)++ = (u_char) ((l) >> 24); \
441         *(cp)++ = (u_char) ((l) >> 16); \
442         *(cp)++ = (u_char) ((l) >> 8); \
443         *(cp)++ = (u_char) (l); \
444 }
445
446 #define INCPTR(n, cp)   ((cp) += (n))
447 #define DECPTR(n, cp)   ((cp) -= (n))
448
449 #undef  FALSE
450 #define FALSE   0
451 #undef  TRUE
452 #define TRUE    1
453
454 /*
455  * System dependent definitions for user-level 4.3BSD UNIX implementation.
456  */
457
458 #define DEMUXPROTREJ(u, p)      demuxprotrej(u, p)
459
460 #define TIMEOUT(r, f, t)        timeout((r), (f), (t))
461 #define UNTIMEOUT(r, f)         untimeout((r), (f))
462
463 #define BCOPY(s, d, l)          memcpy(d, s, l)
464 #define BZERO(s, n)             memset(s, 0, n)
465 #define EXIT(u)                 quit()
466
467 #define PRINTMSG(m, l)          { info("Remote message: %0.*v", l, m); }
468
469 /*
470  * MAKEHEADER - Add Header fields to a packet.
471  */
472 #define MAKEHEADER(p, t) { \
473     PUTCHAR(PPP_ALLSTATIONS, p); \
474     PUTCHAR(PPP_UI, p); \
475     PUTSHORT(t, p); }
476
477
478 #ifdef DEBUGALL
479 #define DEBUGMAIN       1
480 #define DEBUGFSM        1
481 #define DEBUGLCP        1
482 #define DEBUGIPCP       1
483 #define DEBUGUPAP       1
484 #define DEBUGCHAP       1
485 #endif
486
487 #ifndef LOG_PPP                 /* we use LOG_LOCAL2 for syslog by default */
488 #if defined(DEBUGMAIN) || defined(DEBUGFSM) || defined(DEBUGSYS) \
489   || defined(DEBUGLCP) || defined(DEBUGIPCP) || defined(DEBUGUPAP) \
490   || defined(DEBUGCHAP) || defined(DEBUG)
491 #define LOG_PPP LOG_LOCAL2
492 #else
493 #define LOG_PPP LOG_DAEMON
494 #endif
495 #endif /* LOG_PPP */
496
497 #ifdef DEBUGMAIN
498 #define MAINDEBUG(x)    if (debug) dbglog x
499 #else
500 #define MAINDEBUG(x)
501 #endif
502
503 #ifdef DEBUGSYS
504 #define SYSDEBUG(x)     if (debug) dbglog x
505 #else
506 #define SYSDEBUG(x)
507 #endif
508
509 #ifdef DEBUGFSM
510 #define FSMDEBUG(x)     if (debug) dbglog x
511 #else
512 #define FSMDEBUG(x)
513 #endif
514
515 #ifdef DEBUGLCP
516 #define LCPDEBUG(x)     if (debug) dbglog x
517 #else
518 #define LCPDEBUG(x)
519 #endif
520
521 #ifdef DEBUGIPCP
522 #define IPCPDEBUG(x)    if (debug) dbglog x
523 #else
524 #define IPCPDEBUG(x)
525 #endif
526
527 #ifdef DEBUGUPAP
528 #define UPAPDEBUG(x)    if (debug) dbglog x
529 #else
530 #define UPAPDEBUG(x)
531 #endif
532
533 #ifdef DEBUGCHAP
534 #define CHAPDEBUG(x)    if (debug) dbglog x
535 #else
536 #define CHAPDEBUG(x)
537 #endif
538
539 #ifdef DEBUGIPXCP
540 #define IPXCPDEBUG(x)   if (debug) dbglog x
541 #else
542 #define IPXCPDEBUG(x)
543 #endif
544
545 #ifndef SIGTYPE
546 #if defined(sun) || defined(SYSV) || defined(POSIX_SOURCE)
547 #define SIGTYPE void
548 #else
549 #define SIGTYPE int
550 #endif /* defined(sun) || defined(SYSV) || defined(POSIX_SOURCE) */
551 #endif /* SIGTYPE */
552
553 #ifndef MIN
554 #define MIN(a, b)       ((a) < (b)? (a): (b))
555 #endif
556 #ifndef MAX
557 #define MAX(a, b)       ((a) > (b)? (a): (b))
558 #endif
559
560 #endif /* __PPP_H__ */