📄 lcp.h
字号:
/*
* FILENAME: lcp.h
*
* Copyright 1997- 2000 By InterNiche Technologies Inc. All rights reserved
*
* Link Control Protocol definitions.
*
* MODULE: PPP
*
* PORTABLE: yes
*/
/* Additional Copyrights: */
/* Portions Copyright 1996 by NetPort Software.
* Portions Copyright (c) 1989 Carnegie Mellon University. All rights
* reserved. Redistribution and use in source and binary forms are
* permitted provided that the above copyright notice and this
* paragraph are duplicated in all such forms and that any
* documentation, advertising materials, and other materials related
* to such distribution and use acknowledge that the software was
* developed by Carnegie Mellon University. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission. THIS
* SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES
* OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef _LCP_H
#define _LCP_H 1
/*
* Options.
*/
#define CI_MRU 1 /* Maximum Receive Unit */
#define CI_ASYNCMAP 2 /* Async Control Character Map */
#define CI_AUTHTYPE 3 /* Authentication Type */
#define CI_QUALITY 4 /* Quality Protocol */
#define CI_MAGICNUMBER 5 /* Magic Number */
#define CI_KEEPALIVE 6 /* Keep Alive Parameters - OBSOLETE */
#define CI_PCOMPRESSION 7 /* Protocol Field Compression */
#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
#define CI_ML_MRU 17 /* Multilink MRU option */
#define CI_ML_SSN 18 /* Multilink Short Sequence Numbers */
#define CI_ML_ENDP 19 /* Multilink Endpoint ID */
#define CI_LCP_MAX 19 /* MAX legal value for LCP CI */
/*
* The state of options is described by an lcp_options structure.
*/
typedef struct lcp_options
{
int passive : 1; /* Don't die if we don't get a response */
int silent : 1; /* Wait for the other end to start first */
int restart : 1; /* Restart vs. exit after close */
int neg_mru : 1; /* Negotiate the MRU? */
int neg_asyncmap : 1; /* Negotiate the async map? */
int neg_upap : 1; /* Ask for UPAP authentication? */
int neg_chap : 1; /* Ask for CHAP authentication? */
int neg_magicnumber : 1; /* Ask for magic number? */
int neg_pcompression : 1; /* HDLC Protocol Field Compression? */
int neg_accompression : 1; /* HDLC Address/Control Field Compression? */
int neg_lqr : 1; /* Negotiate use of Link Quality Reports */
#ifdef PPP_MULTILINK
int neg_ml_mru : 1; /* Negotiate Multilink (MRU flags multlilink use) */
int neg_ml_ssn : 1; /* Negotiate Multilink Short Sequence Numbers */
int neg_ml_endp : 1; /* Negotiate Multilink Endpoint Descriminator */
u_short ml_mru; /* MRU for multilink datagram */
#endif /* PPP_MULTILINK */
u_long asyncmap; /* Value of async map */
u_long magicnumber;
int numloops; /* Number of loops during magic number neg. */
u_long lqr_period; /* Reporting period for link quality */
u_short mru; /* Value of link's MRU */
u_char chap_mdtype; /* which MD type (hashing algorithm) */
} lcp_options;
/* lcp func table routines (CI = Configuration Information) */
void lcp_resetci (M_PPP); /* Reset our CI */
int lcp_addci (M_PPP); /* Add our CI to pkt */
int lcp_ackci (M_PPP, u_char *, int); /* Peer ack'd our CI */
int lcp_nakci (M_PPP, u_char *, int); /* Peer nak'd our CI */
int lcp_rejci (M_PPP, u_char *, int); /* Peer rej'd our CI */
int lcp_reqci (M_PPP, u_char *, int *, int); /* Rcv peer CI */
void lcp_up (M_PPP); /* We're UP */
void lcp_down (M_PPP); /* We're DOWN */
void lcp_starting (M_PPP); /* We need lower layer up */
void lcp_finished (M_PPP); /* We need lower layer down */
int lcp_extcode (M_PPP, u_char, u_char, u_char *, int);
void lcp_rprotrej (M_PPP, u_char *, int);
#define MINMRU 128 /* No MRUs below this */
void lcp_init (M_PPP);
void lcp_open (M_PPP);
void lcp_close (M_PPP);
void lcp_lowerup (M_PPP);
void lcp_lowerdown (M_PPP);
void lcp_input (M_PPP, u_char *, int);
void lcp_protrej (M_PPP);
extern int lcp_warnloops; /* Warn about a loopback this often */
#define DEFWARNLOOPS 10 /* Default value for above */
/* The structure below is maintained for each Multilink bundle in the MASTER
* LINK ONLY. If the mppp->pppflags ML_IPCP bit is not set then the
* contents are meaningless and the bundle info is given by
* mppp->ml_ipcp->mlconf. This structure is in this file since most
* of it's info is negotiated by LCP.
*/
struct multilink_bundle
{
u_short mmru; /* multilink MRU */
u_char endp_class; /* class of Endpoint Descriminator */
u_char endp_length; /* length of endp descriminator */
u_char endp_desc[20]; /* the actual Endpoint Descriminator data */
int mlflags; /* see MF_ bits below */
};
#define MF_SHORTSEQ 1 /* Use short sequence header format */
#define MAXENDP 20 /* Max. legal length of endpoint descriminator */
extern u_short ml_endpclass;
extern int ml_endplen;
extern u_char ml_endp[MAXENDP]; /* opaque */
/* Multi Link Endpoint Descriptor classes */
#define MLEDCLASS_NULL 0 /* default descriptor */
#define MLEDCLASS_LOCAL 1 /* locally assigned descriptor */
#define MLEDCLASS_IP 2 /* descriptor is IP address */
#define MLEDCLASS_MAC 3 /* descriptor is MAC address */
#define MLEDCLASS_MAGIC 4 /* deprecated */
#endif /* _LCP_H */
/* end of file lcp.h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -