ppp_defs.h revision a0b85df49408b3ff0ca3c0780974f13a7b485ae3
/* $Id: ppp_defs.h,v 1.14 1999/08/13 01:55:40 paulus Exp $ */
/*
* ppp_defs.h - PPP definitions.
*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 1994 The Australian National University.
* All rights reserved.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation is hereby granted, provided that the above copyright
* notice appears in all copies. This software is provided without any
* warranty, express or implied. The Australian National University
* makes no representations about the suitability of this software for
* any purpose.
*
* IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
* PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
* THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
* OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
* OR MODIFICATIONS.
*/
#ifndef _PPP_DEFS_H_
#define _PPP_DEFS_H_
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* The basic PPP frame.
*/
/*
* Packet sizes
*/
#define PPP_MINMTU 64
#define PPP_MINMRU 128
#define PPP_ADDRESS(p) (((uchar_t *)(p))[0])
/*
* Significant octet values.
*/
/*
* Protocol field values.
*/
/*
* Values for FCS calculations.
*/
#define PPPINITFCS16 PPP_INITFCS
#define PPPGOODFCS16 PPP_GOODFCS
#define PPPINITFCS32 0xfffffffful
#define PPPGOODFCS32 0xdebb20e3ul
/* Marker values shared between pppdump and pppd. */
#define RECMARK_STARTSEND 1
#define RECMARK_STARTRECV 2
#define RECMARK_ENDSEND 3
#define RECMARK_ENDRECV 4
#define RECMARK_TIMEDELTA32 5
#define RECMARK_TIMEDELTA8 6
#define RECMARK_TIMESTART 7
/*
* A 32-bit unsigned integral type.
*/
#if !defined(__BIT_TYPES_DEFINED__) && !defined(_BITYPES) && \
#ifdef UINT32_T
#else
typedef unsigned int u_int32_t;
typedef unsigned short u_int16_t;
#endif
#endif
/* Backward compatibility */
typedef unsigned long uintptr_t;
#define _UINT32_T
#endif
/*
* Extended asyncmap - allows any character to be escaped.
*/
/*
* What to do with network protocol (NP) packets.
*/
enum NPmode {
NPMODE_PASS, /* pass the packet through */
NPMODE_DROP, /* silently drop the packet */
NPMODE_ERROR, /* return an error */
NPMODE_QUEUE /* save it up for later. */
};
/*
* Statistics.
*/
struct pppstat {
};
struct vjstat {
};
struct ppp_stats {
struct pppstat p; /* basic PPP statistics */
};
#ifdef SOL2
#define PPP_COUNTER_F "llu"
typedef uint64_t ppp_counter_t;
struct pppstat64 {
};
struct ppp_stats64 {
struct pppstat64 p;
};
#else
#define PPP_COUNTER_F "u"
typedef u_int32_t ppp_counter_t;
#endif
struct compstat {
};
struct ppp_comp_stats {
struct compstat c; /* packet compression statistics */
struct compstat d; /* packet decompression statistics */
};
/*
* The following structure records the time in seconds since
* the last NP packet was sent or received.
*/
struct ppp_idle {
/*
* Fix the length of these fields to be 32-bit, since
* otherwise, a time_t (long) is 64-bit in kernel while 32-bit
* in userland when running on a 64-bit CPU with a 64-bit OS.
*/
};
enum LSstat {
PPP_LINKSTAT_NEEDUP, /* link is down and needs to be up */
PPP_LINKSTAT_IPV4_UNBOUND, /* DL_UNBIND received on IPv4 stream */
PPP_LINKSTAT_IPV6_UNBOUND, /* DL_UNBIND received on IPv6 stream */
PPP_LINKSTAT_IPV4_BOUND, /* DL_BIND received on IPv4 stream */
PPP_LINKSTAT_IPV6_BOUND, /* DL_BIND received on IPv6 stream */
PPP_LINKSTAT_UP /* Integrated driver; hardware is up */
};
#define PPPLSMAGIC 0x53505050
struct ppp_ls {
};
#ifndef __P
#ifdef __STDC__
#define __P(x) x
#else
#define __P(x) ()
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* _PPP_DEFS_H_ */