1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright (c) 2001 by Sun Microsystems, Inc. 24*7c478bd9Sstevel@tonic-gate * All rights reserved. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifndef _SNOOP_PPP_H 28*7c478bd9Sstevel@tonic-gate #define _SNOOP_PPP_H 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate /* 31*7c478bd9Sstevel@tonic-gate * Control Protocol (LCP, IPCP, etc.) message code numbers. 32*7c478bd9Sstevel@tonic-gate */ 33*7c478bd9Sstevel@tonic-gate #define CODE_VENDOR 0 /* Vendor Specif Code */ 34*7c478bd9Sstevel@tonic-gate #define CODE_CONFREQ 1 /* Configuration Request */ 35*7c478bd9Sstevel@tonic-gate #define CODE_CONFACK 2 /* Configuration Ack */ 36*7c478bd9Sstevel@tonic-gate #define CODE_CONFNAK 3 /* Configuration Nak */ 37*7c478bd9Sstevel@tonic-gate #define CODE_CONFREJ 4 /* Configuration Reject */ 38*7c478bd9Sstevel@tonic-gate #define CODE_TERMREQ 5 /* Termination Request */ 39*7c478bd9Sstevel@tonic-gate #define CODE_TERMACK 6 /* Termination Ack */ 40*7c478bd9Sstevel@tonic-gate #define CODE_CODEREJ 7 /* Code Reject */ 41*7c478bd9Sstevel@tonic-gate /* 42*7c478bd9Sstevel@tonic-gate * LCP specific codes. 43*7c478bd9Sstevel@tonic-gate */ 44*7c478bd9Sstevel@tonic-gate #define CODE_PROTREJ 8 /* Protocol Reject */ 45*7c478bd9Sstevel@tonic-gate #define CODE_ECHOREQ 9 /* Echo Request */ 46*7c478bd9Sstevel@tonic-gate #define CODE_ECHOREP 10 /* Echo Reply */ 47*7c478bd9Sstevel@tonic-gate #define CODE_DISCREQ 11 /* Discard Request */ 48*7c478bd9Sstevel@tonic-gate #define CODE_IDENT 12 /* Identification */ 49*7c478bd9Sstevel@tonic-gate #define CODE_TIMEREMAIN 13 /* Time Remaining */ 50*7c478bd9Sstevel@tonic-gate /* 51*7c478bd9Sstevel@tonic-gate * CCP and ECP specific codes. 52*7c478bd9Sstevel@tonic-gate */ 53*7c478bd9Sstevel@tonic-gate #define CODE_RESETREQ 14 54*7c478bd9Sstevel@tonic-gate #define CODE_RESETACK 15 55*7c478bd9Sstevel@tonic-gate 56*7c478bd9Sstevel@tonic-gate /* 57*7c478bd9Sstevel@tonic-gate * CHAP codes. 58*7c478bd9Sstevel@tonic-gate */ 59*7c478bd9Sstevel@tonic-gate #define CODE_CHALLENGE 1 60*7c478bd9Sstevel@tonic-gate #define CODE_RESPONSE 2 61*7c478bd9Sstevel@tonic-gate #define CODE_SUCCESS 3 62*7c478bd9Sstevel@tonic-gate #define CODE_FAILURE 4 63*7c478bd9Sstevel@tonic-gate 64*7c478bd9Sstevel@tonic-gate /* 65*7c478bd9Sstevel@tonic-gate * PAP codes. 66*7c478bd9Sstevel@tonic-gate */ 67*7c478bd9Sstevel@tonic-gate #define CODE_AUTHREQ 1 68*7c478bd9Sstevel@tonic-gate #define CODE_AUTHACK 2 69*7c478bd9Sstevel@tonic-gate #define CODE_AUTHNAK 3 70*7c478bd9Sstevel@tonic-gate 71*7c478bd9Sstevel@tonic-gate /* 72*7c478bd9Sstevel@tonic-gate * Option types for various control protocols. 73*7c478bd9Sstevel@tonic-gate */ 74*7c478bd9Sstevel@tonic-gate #define OPT_LCP_VENDOR 0 75*7c478bd9Sstevel@tonic-gate #define OPT_LCP_MRU 1 76*7c478bd9Sstevel@tonic-gate #define OPT_LCP_ASYNCMAP 2 77*7c478bd9Sstevel@tonic-gate #define OPT_LCP_AUTHTYPE 3 78*7c478bd9Sstevel@tonic-gate #define OPT_LCP_QUALITY 4 79*7c478bd9Sstevel@tonic-gate #define OPT_LCP_MAGICNUMBER 5 80*7c478bd9Sstevel@tonic-gate #define OPT_LCP_PCOMPRESSION 7 81*7c478bd9Sstevel@tonic-gate #define OPT_LCP_ACCOMPRESSION 8 82*7c478bd9Sstevel@tonic-gate #define OPT_LCP_FCSALTERN 9 83*7c478bd9Sstevel@tonic-gate #define OPT_LCP_SELFDESCPAD 10 84*7c478bd9Sstevel@tonic-gate #define OPT_LCP_NUMBERED 11 85*7c478bd9Sstevel@tonic-gate #define OPT_LCP_MULTILINKPROC 12 86*7c478bd9Sstevel@tonic-gate #define OPT_LCP_CALLBACK 13 87*7c478bd9Sstevel@tonic-gate #define OPT_LCP_CONNECTTIME 14 88*7c478bd9Sstevel@tonic-gate #define OPT_LCP_COMPOUNDFRAMES 15 89*7c478bd9Sstevel@tonic-gate #define OPT_LCP_DATAENCAP 16 90*7c478bd9Sstevel@tonic-gate #define OPT_LCP_MRRU 17 91*7c478bd9Sstevel@tonic-gate #define OPT_LCP_SSNHF 18 92*7c478bd9Sstevel@tonic-gate #define OPT_LCP_EPDISC 19 93*7c478bd9Sstevel@tonic-gate #define OPT_LCP_DCEIDENT 21 94*7c478bd9Sstevel@tonic-gate #define OPT_LCP_MLPLUSPROC 22 95*7c478bd9Sstevel@tonic-gate #define OPT_LCP_LINKDISC 23 96*7c478bd9Sstevel@tonic-gate #define OPT_LCP_AUTH 24 97*7c478bd9Sstevel@tonic-gate #define OPT_LCP_COBS 25 98*7c478bd9Sstevel@tonic-gate #define OPT_LCP_PFXELISION 26 99*7c478bd9Sstevel@tonic-gate #define OPT_LCP_MPHDRFMT 27 100*7c478bd9Sstevel@tonic-gate #define OPT_LCP_I18N 28 101*7c478bd9Sstevel@tonic-gate #define OPT_LCP_SDL 29 102*7c478bd9Sstevel@tonic-gate #define OPT_LCP_MUXING 30 103*7c478bd9Sstevel@tonic-gate 104*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_ADDRS 1 105*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_COMPRESSTYPE 2 106*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_ADDR 3 107*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_MOBILEIPV4 4 108*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_DNS1 129 109*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_NBNS1 130 110*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_DNS2 131 111*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_NBNS2 132 112*7c478bd9Sstevel@tonic-gate #define OPT_IPCP_SUBNET 144 113*7c478bd9Sstevel@tonic-gate 114*7c478bd9Sstevel@tonic-gate #define OPT_IPV6CP_IFACEID 1 115*7c478bd9Sstevel@tonic-gate #define OPT_IPV6CP_COMPRESSTYPE 2 116*7c478bd9Sstevel@tonic-gate 117*7c478bd9Sstevel@tonic-gate #define OPT_CCP_PROPRIETARY 0 118*7c478bd9Sstevel@tonic-gate #define OPT_CCP_PREDICTOR1 1 119*7c478bd9Sstevel@tonic-gate #define OPT_CCP_PREDICTOR2 2 120*7c478bd9Sstevel@tonic-gate #define OPT_CCP_PUDDLEJUMP 3 121*7c478bd9Sstevel@tonic-gate #define OPT_CCP_HPPPC 16 122*7c478bd9Sstevel@tonic-gate #define OPT_CCP_STACLZS 17 123*7c478bd9Sstevel@tonic-gate #define OPT_CCP_MPPC 18 124*7c478bd9Sstevel@tonic-gate #define OPT_CCP_GANDALFFZA 19 125*7c478bd9Sstevel@tonic-gate #define OPT_CCP_V42BIS 20 126*7c478bd9Sstevel@tonic-gate #define OPT_CCP_BSDCOMP 21 127*7c478bd9Sstevel@tonic-gate #define OPT_CCP_LZSDCP 23 128*7c478bd9Sstevel@tonic-gate #define OPT_CCP_MAGNALINK 24 129*7c478bd9Sstevel@tonic-gate #define OPT_CCP_DEFLATE 26 130*7c478bd9Sstevel@tonic-gate 131*7c478bd9Sstevel@tonic-gate #define OPT_ECP_PROPRIETARY 0 132*7c478bd9Sstevel@tonic-gate #define OPT_ECP_DESE 1 133*7c478bd9Sstevel@tonic-gate #define OPT_ECP_3DESE 2 134*7c478bd9Sstevel@tonic-gate #define OPT_ECP_DESEBIS 3 135*7c478bd9Sstevel@tonic-gate 136*7c478bd9Sstevel@tonic-gate #define OPT_MUXCP_DEFAULTPID 1 137*7c478bd9Sstevel@tonic-gate 138*7c478bd9Sstevel@tonic-gate /* 139*7c478bd9Sstevel@tonic-gate * ppp_protoinfo_t's contain properties of PPP protocols which 140*7c478bd9Sstevel@tonic-gate * interpret_ppp() needs in order to properly decode the protocol data. 141*7c478bd9Sstevel@tonic-gate */ 142*7c478bd9Sstevel@tonic-gate typedef struct ppp_protoinfo { 143*7c478bd9Sstevel@tonic-gate uint16_t proto; /* protocol number */ 144*7c478bd9Sstevel@tonic-gate char *name; /* protocol name */ 145*7c478bd9Sstevel@tonic-gate int (*interpret_proto)(); /* interpret function */ 146*7c478bd9Sstevel@tonic-gate char *prefix; /* string printed on detail lines */ 147*7c478bd9Sstevel@tonic-gate char *description; /* string printed in detail header */ 148*7c478bd9Sstevel@tonic-gate } ppp_protoinfo_t; 149*7c478bd9Sstevel@tonic-gate 150*7c478bd9Sstevel@tonic-gate 151*7c478bd9Sstevel@tonic-gate /* 152*7c478bd9Sstevel@tonic-gate * cp_optinfo contains information on control protocol options. 153*7c478bd9Sstevel@tonic-gate */ 154*7c478bd9Sstevel@tonic-gate typedef void optformat_func_t(uchar_t *, uint8_t); 155*7c478bd9Sstevel@tonic-gate typedef struct cp_optinfo { 156*7c478bd9Sstevel@tonic-gate uint8_t opt_type; 157*7c478bd9Sstevel@tonic-gate char *opt_name; 158*7c478bd9Sstevel@tonic-gate uint8_t opt_minsize; /* min size of option, including type and len */ 159*7c478bd9Sstevel@tonic-gate optformat_func_t *opt_formatdata; 160*7c478bd9Sstevel@tonic-gate } cp_optinfo_t; 161*7c478bd9Sstevel@tonic-gate 162*7c478bd9Sstevel@tonic-gate 163*7c478bd9Sstevel@tonic-gate /* 164*7c478bd9Sstevel@tonic-gate * Packet format for PPP control and authentication protocols. 165*7c478bd9Sstevel@tonic-gate */ 166*7c478bd9Sstevel@tonic-gate typedef struct ppp_pkt { 167*7c478bd9Sstevel@tonic-gate uint8_t code; 168*7c478bd9Sstevel@tonic-gate uint8_t id; 169*7c478bd9Sstevel@tonic-gate uint16_t length; 170*7c478bd9Sstevel@tonic-gate } ppp_pkt_t; 171*7c478bd9Sstevel@tonic-gate 172*7c478bd9Sstevel@tonic-gate /* 173*7c478bd9Sstevel@tonic-gate * Structure of an LQR packet. 174*7c478bd9Sstevel@tonic-gate */ 175*7c478bd9Sstevel@tonic-gate typedef struct lqr_pkt { 176*7c478bd9Sstevel@tonic-gate uint32_t lqr_magic; 177*7c478bd9Sstevel@tonic-gate uint32_t lqr_lastoutlqrs; 178*7c478bd9Sstevel@tonic-gate uint32_t lqr_lastoutpackets; 179*7c478bd9Sstevel@tonic-gate uint32_t lqr_lastoutoctets; 180*7c478bd9Sstevel@tonic-gate uint32_t lqr_peerinlqrs; 181*7c478bd9Sstevel@tonic-gate uint32_t lqr_peerinpackets; 182*7c478bd9Sstevel@tonic-gate uint32_t lqr_peerindiscards; 183*7c478bd9Sstevel@tonic-gate uint32_t lqr_peerinerrors; 184*7c478bd9Sstevel@tonic-gate uint32_t lqr_peerinoctets; 185*7c478bd9Sstevel@tonic-gate uint32_t lqr_peeroutlqrs; 186*7c478bd9Sstevel@tonic-gate uint32_t lqr_peeroutpackets; 187*7c478bd9Sstevel@tonic-gate uint32_t lqr_peeroutoctets; 188*7c478bd9Sstevel@tonic-gate } lqr_pkt_t; 189*7c478bd9Sstevel@tonic-gate 190*7c478bd9Sstevel@tonic-gate #endif /* _SNOOP_PPP_H */ 191