📄 pppd.h
字号:
/* Wait for input, with timeout */void add_fd __P((int)); /* Add fd to set to wait for */void remove_fd __P((int)); /* Remove fd from set to wait for */int read_packet __P((u_char *)); /* Read PPP packet */int get_loop_output __P((void)); /* Read pkts from loopback */void tty_send_config __P((int, u_int32_t, int, int)); /* Configure i/f transmit parameters */void tty_set_xaccm __P((ext_accm)); /* Set extended transmit ACCM */void tty_recv_config __P((int, u_int32_t, int, int)); /* Configure i/f receive parameters */int ccp_test __P((int, u_char *, int, int)); /* Test support for compression scheme */void ccp_flags_set __P((int, int, int)); /* Set kernel CCP state */int ccp_fatal_error __P((int)); /* Test for fatal decomp error in kernel */int get_idle_time __P((int, struct ppp_idle *)); /* Find out how long link has been idle */int get_ppp_stats __P((int, struct pppd_stats *)); /* Return link statistics */void netif_set_mtu __P((int, int)); /* Set PPP interface MTU */int netif_get_mtu __P((int)); /* Get PPP interface MTU */int sifvjcomp __P((int, int, int, int)); /* Configure VJ TCP header compression */int sifup __P((int)); /* Configure i/f up for one protocol */int sifnpmode __P((int u, int proto, enum NPmode mode)); /* Set mode for handling packets for proto */int sifdown __P((int)); /* Configure i/f down for one protocol */int sifaddr __P((int, u_int32_t, u_int32_t, u_int32_t)); /* Configure IPv4 addresses for i/f */int cifaddr __P((int, u_int32_t, u_int32_t)); /* Reset i/f IP addresses */#ifdef INET6int sif6addr __P((int, eui64_t, eui64_t)); /* Configure IPv6 addresses for i/f */int cif6addr __P((int, eui64_t, eui64_t)); /* Remove an IPv6 address from i/f */#endifint sifdefaultroute __P((int, u_int32_t, u_int32_t)); /* Create default route through i/f */int cifdefaultroute __P((int, u_int32_t, u_int32_t)); /* Delete default route through i/f */int sifproxyarp __P((int, u_int32_t)); /* Add proxy ARP entry for peer */int cifproxyarp __P((int, u_int32_t)); /* Delete proxy ARP entry for peer */u_int32_t GetMask __P((u_int32_t)); /* Get appropriate netmask for address */int lock __P((char *)); /* Create lock file for device */int relock __P((int)); /* Rewrite lock file with new pid */void unlock __P((void)); /* Delete previously-created lock file */void logwtmp __P((const char *, const char *, const char *)); /* Write entry to wtmp file */int get_host_seed __P((void)); /* Get host-dependent random number seed */int have_route_to __P((u_int32_t)); /* Check if route to addr exists */#ifdef PPP_FILTERint set_filters __P((struct bpf_program *pass, struct bpf_program *active)); /* Set filter programs in kernel */#endif#ifdef IPX_CHANGEint sipxfaddr __P((int, unsigned long, unsigned char *));int cipxfaddr __P((int));#endifint get_if_hwaddr __P((u_char *addr, char *name));char *get_first_ethernet __P((void));/* Procedures exported from options.c */int setipaddr __P((char *, char **, int)); /* Set local/remote ip addresses */int parse_args __P((int argc, char **argv)); /* Parse options from arguments given */int options_from_file __P((char *filename, int must_exist, int check_prot, int privileged)); /* Parse options from an options file */int options_from_user __P((void)); /* Parse options from user's .ppprc */int options_for_tty __P((void)); /* Parse options from /etc/ppp/options.tty */int options_from_list __P((struct wordlist *, int privileged)); /* Parse options from a wordlist */int getword __P((FILE *f, char *word, int *newlinep, char *filename)); /* Read a word from a file */void option_error __P((char *fmt, ...)); /* Print an error message about an option */int int_option __P((char *, int *)); /* Simplified number_option for decimal ints */void add_options __P((option_t *)); /* Add extra options */void check_options __P((void)); /* check values after all options parsed */int override_value __P((const char *, int, const char *)); /* override value if permitted by priority */void print_options __P((void (*) __P((void *, char *, ...)), void *)); /* print out values of all options */int parse_dotted_ip __P((char *, u_int32_t *));/* * Hooks to enable plugins to change various things. */extern int (*new_phase_hook) __P((int));extern int (*idle_time_hook) __P((struct ppp_idle *));extern int (*holdoff_hook) __P((void));extern int (*pap_check_hook) __P((void));extern int (*pap_auth_hook) __P((char *user, char *passwd, char **msgp, struct wordlist **paddrs, struct wordlist **popts));extern void (*pap_logout_hook) __P((void));extern int (*pap_passwd_hook) __P((char *user, char *passwd));extern int (*allowed_address_hook) __P((u_int32_t addr));extern void (*ip_up_hook) __P((void));extern void (*ip_down_hook) __P((void));extern void (*ip_choose_hook) __P((u_int32_t *));extern int (*chap_check_hook) __P((void));extern int (*chap_passwd_hook) __P((char *user, char *passwd));/* Let a plugin snoop sent and received packets. Useful for L2TP */extern void (*snoop_recv_hook) __P((unsigned char *p, int len));extern void (*snoop_send_hook) __P((unsigned char *p, int len));/* * Inline versions of get/put char/short/long. * Pointer is advanced; we assume that both arguments * are lvalues and will already be in registers. * cp MUST be u_char *. */#define GETCHAR(c, cp) { \ (c) = *(cp)++; \}#define PUTCHAR(c, cp) { \ *(cp)++ = (u_char) (c); \}#define GETSHORT(s, cp) { \ (s) = *(cp)++ << 8; \ (s) |= *(cp)++; \}#define PUTSHORT(s, cp) { \ *(cp)++ = (u_char) ((s) >> 8); \ *(cp)++ = (u_char) (s); \}#define GETLONG(l, cp) { \ (l) = *(cp)++ << 8; \ (l) |= *(cp)++; (l) <<= 8; \ (l) |= *(cp)++; (l) <<= 8; \ (l) |= *(cp)++; \}#define PUTLONG(l, cp) { \ *(cp)++ = (u_char) ((l) >> 24); \ *(cp)++ = (u_char) ((l) >> 16); \ *(cp)++ = (u_char) ((l) >> 8); \ *(cp)++ = (u_char) (l); \}#define INCPTR(n, cp) ((cp) += (n))#define DECPTR(n, cp) ((cp) -= (n))/* * System dependent definitions for user-level 4.3BSD UNIX implementation. */#define TIMEOUT(r, f, t) timeout((r), (f), (t), 0)#define UNTIMEOUT(r, f) untimeout((r), (f))#define BCOPY(s, d, l) memcpy(d, s, l)#define BZERO(s, n) memset(s, 0, n)#define BCMP(s1, s2, l) memcmp(s1, s2, l)#define PRINTMSG(m, l) { info("Remote message: %0.*v", l, m); }/* * MAKEHEADER - Add Header fields to a packet. */#define MAKEHEADER(p, t) { \ PUTCHAR(PPP_ALLSTATIONS, p); \ PUTCHAR(PPP_UI, p); \ PUTSHORT(t, p); }/* * Exit status values. */#define EXIT_OK 0#define EXIT_FATAL_ERROR 1#define EXIT_OPTION_ERROR 2#define EXIT_NOT_ROOT 3#define EXIT_NO_KERNEL_SUPPORT 4#define EXIT_USER_REQUEST 5#define EXIT_LOCK_FAILED 6#define EXIT_OPEN_FAILED 7#define EXIT_CONNECT_FAILED 8#define EXIT_PTYCMD_FAILED 9#define EXIT_NEGOTIATION_FAILED 10#define EXIT_PEER_AUTH_FAILED 11#define EXIT_IDLE_TIMEOUT 12#define EXIT_CONNECT_TIME 13#define EXIT_CALLBACK 14#define EXIT_PEER_DEAD 15#define EXIT_HANGUP 16#define EXIT_LOOPBACK 17#define EXIT_INIT_FAILED 18#define EXIT_AUTH_TOPEER_FAILED 19#ifdef MAXOCTETS#define EXIT_TRAFFIC_LIMIT 20#endif#define EXIT_CNID_AUTH_FAILED 21/* * Debug macros. Slightly useful for finding bugs in pppd, not particularly * useful for finding out why your connection isn't being established. */#ifdef DEBUGALL#define DEBUGMAIN 1#define DEBUGFSM 1#define DEBUGLCP 1#define DEBUGIPCP 1#define DEBUGIPV6CP 1#define DEBUGUPAP 1#define DEBUGCHAP 1#endif#ifndef LOG_PPP /* we use LOG_LOCAL2 for syslog by default */#if defined(DEBUGMAIN) || defined(DEBUGFSM) || defined(DEBUGSYS) \ || defined(DEBUGLCP) || defined(DEBUGIPCP) || defined(DEBUGUPAP) \ || defined(DEBUGCHAP) || defined(DEBUG) || defined(DEBUGIPV6CP)#define LOG_PPP LOG_LOCAL2#else#define LOG_PPP LOG_DAEMON#endif#endif /* LOG_PPP */#ifdef DEBUGMAIN#define MAINDEBUG(x) if (debug) dbglog x#else#define MAINDEBUG(x)#endif#ifdef DEBUGSYS#define SYSDEBUG(x) if (debug) dbglog x#else#define SYSDEBUG(x)#endif#ifdef DEBUGFSM#define FSMDEBUG(x) if (debug) dbglog x#else#define FSMDEBUG(x)#endif#ifdef DEBUGLCP#define LCPDEBUG(x) if (debug) dbglog x#else#define LCPDEBUG(x)#endif#ifdef DEBUGIPCP#define IPCPDEBUG(x) if (debug) dbglog x#else#define IPCPDEBUG(x)#endif#ifdef DEBUGIPV6CP#define IPV6CPDEBUG(x) if (debug) dbglog x#else#define IPV6CPDEBUG(x)#endif#ifdef DEBUGUPAP#define UPAPDEBUG(x) if (debug) dbglog x#else#define UPAPDEBUG(x)#endif#ifdef DEBUGCHAP#define CHAPDEBUG(x) if (debug) dbglog x#else#define CHAPDEBUG(x)#endif#ifdef DEBUGIPXCP#define IPXCPDEBUG(x) if (debug) dbglog x#else#define IPXCPDEBUG(x)#endif#ifndef SIGTYPE#if defined(sun) || defined(SYSV) || defined(POSIX_SOURCE)#define SIGTYPE void#else#define SIGTYPE int#endif /* defined(sun) || defined(SYSV) || defined(POSIX_SOURCE) */#endif /* SIGTYPE */#ifndef MIN#define MIN(a, b) ((a) < (b)? (a): (b))#endif#ifndef MAX#define MAX(a, b) ((a) > (b)? (a): (b))#endif#ifndef offsetof#define offsetof(type, member) ((size_t) &((type *)0)->member)#endif#endif /* __PPP_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -