Annotation of embedaddon/mpd/src/ecp.h, revision 1.1
1.1 ! misho 1:
! 2: /*
! 3: * ecp.h
! 4: *
! 5: * Written by Archie Cobbs <archie@freebsd.org>
! 6: * Copyright (c) 1998-1999 Whistle Communications, Inc. All rights reserved.
! 7: * See ``COPYRIGHT.whistle''
! 8: */
! 9:
! 10: #ifndef _ECP_H_
! 11: #define _ECP_H_
! 12:
! 13: #include "defs.h"
! 14: #include "fsm.h"
! 15: #include "mbuf.h"
! 16: #include "encrypt.h"
! 17: #include "command.h"
! 18:
! 19: #ifdef ECP_DES
! 20: #include "ecp_dese.h"
! 21: #include "ecp_dese_bis.h"
! 22: #endif
! 23:
! 24: /*
! 25: * DEFINITIONS
! 26: */
! 27:
! 28: #define ECP_DIR_XMIT 1
! 29: #define ECP_DIR_RECV 2
! 30:
! 31: /* Encryption types */
! 32:
! 33: #define ECP_TY_OUI 0
! 34: #define ECP_TY_DESE 1
! 35: #define ECP_TY_3DESE 2
! 36: #define ECP_TY_DESE_bis 3
! 37:
! 38: /* Max supported key length */
! 39:
! 40: #define ECP_MAX_KEY 32
! 41:
! 42: /* ECP state */
! 43:
! 44: struct ecpstate
! 45: {
! 46: char key[ECP_MAX_KEY]; /* Encryption key */
! 47: EncType xmit; /* Xmit encryption type */
! 48: EncType recv; /* Recv encryption type */
! 49: uint32_t self_reject;
! 50: uint32_t peer_reject;
! 51: struct fsm fsm; /* PPP FSM */
! 52: struct optinfo options; /* Configured options */
! 53: #ifdef ECP_DES
! 54: struct desinfo des; /* DESE info */
! 55: struct desebisinfo desebis; /* DESE-bis info */
! 56: #endif
! 57: uint32_t xmit_resets; /* Number of ResetReq we have got from other side */
! 58: uint32_t recv_resets; /* Number of ResetReq we have sent to other side */
! 59: };
! 60: typedef struct ecpstate *EcpState;
! 61:
! 62: /*
! 63: * VARIABLES
! 64: */
! 65:
! 66: extern const struct cmdtab EcpSetCmds[];
! 67:
! 68: extern int gEcpCsock; /* Socket node control socket */
! 69: extern int gEcpDsock; /* Socket node data socket */
! 70:
! 71: /*
! 72: * FUNCTIONS
! 73: */
! 74:
! 75: extern void EcpInit(Bund b);
! 76: extern void EcpInst(Bund b, Bund bt);
! 77: extern void EcpUp(Bund b);
! 78: extern void EcpDown(Bund b);
! 79: extern void EcpOpen(Bund b);
! 80: extern void EcpClose(Bund b);
! 81: extern int EcpOpenCmd(Context ctx);
! 82: extern int EcpCloseCmd(Context ctx);
! 83: extern int EcpSubtractBloat(Bund b, int size);
! 84: extern void EcpInput(Bund b, Mbuf bp);
! 85: extern Mbuf EcpDataInput(Bund b, Mbuf bp);
! 86: extern Mbuf EcpDataOutput(Bund b, Mbuf bp);
! 87: extern void EcpSendResetReq(Fsm fp);
! 88: extern int EcpStat(Context ctx, int ac, char *av[], void *arg);
! 89:
! 90: extern int EcpsInit(void);
! 91: extern void EcpsShutdown(void);
! 92:
! 93: #endif
! 94:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>