Annotation of embedaddon/libpdel/ppp/ppp_defs.h, revision 1.1.1.1
1.1 misho 1:
2: /*
3: * Copyright (c) 2001-2002 Packet Design, LLC.
4: * All rights reserved.
5: *
6: * Subject to the following obligations and disclaimer of warranty,
7: * use and redistribution of this software, in source or object code
8: * forms, with or without modifications are expressly permitted by
9: * Packet Design; provided, however, that:
10: *
11: * (i) Any and all reproductions of the source or object code
12: * must include the copyright notice above and the following
13: * disclaimer of warranties; and
14: * (ii) No rights are granted, in any manner or form, to use
15: * Packet Design trademarks, including the mark "PACKET DESIGN"
16: * on advertising, endorsements, or otherwise except as such
17: * appears in the above copyright notice or in the software.
18: *
19: * THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND
20: * TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO
21: * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING
22: * THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED
23: * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
24: * OR NON-INFRINGEMENT. PACKET DESIGN DOES NOT WARRANT, GUARANTEE,
25: * OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS
26: * OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY,
27: * RELIABILITY OR OTHERWISE. IN NO EVENT SHALL PACKET DESIGN BE
28: * LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE
29: * OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT,
30: * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL
31: * DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF
32: * USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY THEORY OF
33: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
35: * THE USE OF THIS SOFTWARE, EVEN IF PACKET DESIGN IS ADVISED OF
36: * THE POSSIBILITY OF SUCH DAMAGE.
37: *
38: * Author: Archie Cobbs <archie@freebsd.org>
39: */
40:
41: #ifndef _PDEL_PPP_PPP_DEFS_H_
42: #define _PDEL_PPP_PPP_DEFS_H_
43:
44: /************************************************************************
45: PPP PRIVATE DEFINITIONS
46: ************************************************************************/
47:
48: #include <sys/types.h>
49: #include <sys/param.h>
50: #include <sys/socket.h>
51: #include <netinet/in.h>
52: #include <arpa/inet.h>
53:
54: #include <netgraph/ng_message.h>
55: #include <netgraph/ng_ppp.h>
56: #include <netgraph/ng_vjc.h>
57:
58: #include <stdio.h>
59: #include <stdlib.h>
60: #include <stddef.h>
61: #include <stdarg.h>
62: #include <syslog.h>
63: #include <assert.h>
64: #include <string.h>
65: #include <unistd.h>
66: #include <fcntl.h>
67: #include <ctype.h>
68: #include <errno.h>
69: #include <time.h>
70: #include <pthread.h>
71: #include <netgraph.h>
72:
73: #include <openssl/ssl.h>
74:
75: #include "structs/structs.h"
76: #include "structs/type/array.h"
77:
78: #include "util/ghash.h"
79: #include "util/pevent.h"
80: #include "util/paction.h"
81: #include "util/mesg_port.h"
82: #include "util/typed_mem.h"
83:
84: #include "ppp/ppp_lib.h"
85:
86: /*
87: * PPP Protocols
88: */
89: #define PPP_PROTO_LCP 0xc021
90: #define PPP_PROTO_PAP 0xc023
91: #define PPP_PROTO_CHAP 0xc223
92: #define PPP_PROTO_MP 0x003d
93: #define PPP_PROTO_IPCP 0x8021
94: #define PPP_PROTO_IP 0x0021
95: #define PPP_PROTO_VJCOMP 0x002d
96: #define PPP_PROTO_VJUNCOMP 0x002f
97: #define PPP_PROTO_CCP 0x80fd
98: #define PPP_PROTO_COMPD 0x00fd
99:
100: #define PPP_PROTO_VALID(p) (((p) & 0x0101) == 0x0001)
101: #define PPP_PROTO_NETWORK_DATA(p) (((p) & 0xC000) == 0x0000)
102: #define PPP_PROTO_LOW_VOLUME(p) (((p) & 0xC000) == 0x4000)
103: #define PPP_PROTO_NETWORK_CTRL(p) (((p) & 0xC000) == 0x8000)
104: #define PPP_PROTO_LINK_LAYER(p) (((p) & 0xC000) == 0xC000)
105: #define PPP_PROTO_COMPRESSIBLE(p) (((p) & 0xFF00) == 0x0000)
106:
107: /*
108: * To get ppp internal stuff
109: */
110: #define _PDEL_PPP_PRIVATE_H_ 1
111:
112: /*
113: * Debugging
114: */
115: #define PPP_DEBUG 0
116:
117: /*
118: * Macro for logging
119: */
120: #if PPP_DEBUG
121: #define PPP_LOG(log, sev, fmt, args...) \
122: ppp_log_put(log, sev, "%s:%u: " fmt, \
123: __FUNCTION__, __LINE__ , ## args)
124: #else
125: #define PPP_LOG(log, sev, fmt, args...) \
126: ppp_log_put(log, sev, fmt , ## args)
127: #endif
128:
129: #endif /* _PDEL_PPP_PPP_DEFS_H_ */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>