/************************************************************************ ** * ** Copyright © 1996 Digital Equipment Corporation. * ** 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 Digital Equipment Corporation. The name of the * ** Corporation 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. * ** * ************************************************************************* **++ ** FACILITY: ** ** ppp_vci.h. ** ** ABSTRACT: ** ** Constant defintions and external defs of variables in ppp_vci.c ** ** AUTHORS: ** ** Patrick Crilly, Networks Engineering (Australia). ** ** CREATION DATE: ** ** 17-December-1996 Barry W. Kierstein ** Replaced the standard Digital copyright with ** one compatible with the CMU copyright. ** ** 24-July-1996 Barry W. Kierstein ** Corrected copyright notice. ** ** 27-November-1995 ** ** MODIFICATION HISTORY: ** ** 27-November-1995 Original version. ** **-- */ #ifndef _PPP_VCI_H_ #define _PPP_VCI_H_ /* ** ** import definitions: ** prototype macro ** types ** */ #ifndef _PPPD_H_ #include "pppd.h" #endif /* ** ** import definitions: ** fsm ** */ #ifndef _FSM_H_ #include "fsm.h" #endif /* ** ** import definitions: ** PPPBuffer ** */ #ifndef _PPP_BUF_H_ #include "ppp_buf.h" #endif /* ** ** import definitions: ** SS$_xxx ** */ #ifndef __SSDEF_LOADED #include "ssdef.h" #endif /* ** ** import definitions: ** vcrp ** */ #ifndef __VCRPDEF_LOADED #include "vcrpdef.h" #endif /* ** ** import definitions: ** vcibdef ** */ #ifndef _VCIBDEF_H_ #define _VCIBDEF_H_ #define VCIBDEF vcibdef /* work around broken vcibdef.h in V7.1 */ #include "vcibdef.h" #endif /* ** ** import definitions: ** vcibpppdef ** */ #ifndef __PPP_VCI_IF_LOADED #include "ppp_vci_if.h" #endif #define PPP_VERSION 1 /* Version of the PPP VCM */ /* ** Definitions for accessing fields in a PPPVcib structure */ #define VCIBPPPPortId vcib$a_ppp_port_id #define VCIBPPPFcsSize vcib$b_ppp_fcs_size #define VCIBPPPHdrSize vcib$b_ppp_hdr_size #define VCIBPPPMtu vcib$w_ppp_mtu /* ** Define Events that can be received from the line */ typedef enum _lineEvent { LCPDown, /* LCP has left the OPENED state */ LCPFinished, /* LCP no longer requires the comm. port */ LCPUp, /* LCP has entered the OPENED state */ DeviceFail, /* The comm. port has failed */ LineDeleted /* The PPP line has been deleted */ } lineEvent; /* ** Define Events that can be received from the state machine */ typedef enum _NCPEvent { NCPDown, /* NCP has left the OPENED state */ NCPFinished, /* NCP no longer requires the comm. port */ NCPUp, /* NCP has entered the OPENED state */ NCPStopped /* NCP has been stopped by Client */ } NCPEvent; /* ** Define Events that can be received from management */ typedef enum _mgmtEvent { MgmtDisable, /* The PPP line has been disabled */ MgmtEnable /* The PPP line has been enabled */ } mgmtEvent; /* ** Define the states a port can be in */ typedef enum _portState { Enabled, Disabled, DisablePending, Failed, Usable, Unusable } portState; /* ** Define a port structure. ** ** A port represents a single protocol running over a communications ** port. (e.g. IP over ASN2:) */ typedef struct PPPPort { struct PPPPort *next; /* Next port in linked list */ VCIBPPPDEF *vcib; /* Pointer to the vcib for this port */ fsm *fsmPtr; /* Pointer to the FSM for contol protocol */ u_int protocol; /* Protocol using this port */ lineId line; /* Identifier of line this port is using */ portState state; /* State of the port */ char NCPTerminated; /* TRUE if the NCP using the port has been stopped */ u_int writes; /* Count of outstanding writes */ struct vcrpdef *request; /* Queued client request */ } PPPPort; /* ** Declare VCI routines */ /* Create Port */ #pragma linkage VCICreatePortLnkg = (parameters(r4), preserved(r1,r2,r4,r5), nopreserve(r0)) #pragma use_linkage VCICreatePortLnkg (VCICreatePort) int VCICreatePort( VCIBPPPDEF *vcib ); /* Delete Port */ #pragma linkage VCIDeletePortLnkg = (parameters(r4), preserved(r1,r2,r4,r5), nopreserve(r0)) #pragma use_linkage VCIDeletePortLnkg (VCIDeletePort) int VCIDeletePort( VCIBPPPDEF *vcib ); /* Transmit Initiate */ #pragma linkage VCITransmitInitLnkg = (parameters(r4,r3), preserved(r2,r4,r5), nopreserve(r0,r1)) #pragma use_linkage VCITransmitInitLnkg (VCITransmitInit) void VCITransmitInit( VCIBPPPDEF *vcib, PPPBuffer *request ); /* PortMgmt Initiate */ #pragma linkage VCIPortMgmtInitLnkg = (parameters(r4,r3), preserved(r2,r4,r5), nopreserve(r0,r1)) #pragma use_linkage VCIPortMgmtInitLnkg (VCIPortMgmtInit) void VCIPortMgmtInit( VCIBPPPDEF *vcib, struct vcrpdef *request ); /* ** Prototypes */ void VCIDemuxprotrej( lineId line, u_short protocol); void VCIDisablePort( VCIBPPPDEF *vcib, struct vcrpdef *request ); void VCIDisablePortCompl( PPPPort *port, struct vcrpdef *request ); void VCIEnablePort( VCIBPPPDEF *vcib, struct vcrpdef *request ); void VCILineEvent( lineId line, lineEvent event ); void VCIMgmtEvent( lineId line, mgmtEvent event ); void VCINCPEvent( PPPPort *port, NCPEvent event ); int VCIReceive( lineId line, PPPBuffer *buf, u_short protocol ); void VCITransmitCompl( PPPBuffer *buf ); #endif /* _PPP_VCI_H */