source: rtems/cpukit/pppd/chap.h @ f26145b

4.104.114.84.95
Last change on this file since f26145b was 0286b9f, checked in by Joel Sherrill <joel.sherrill@…>, on 01/31/02 at 21:42:11

2001-01-31 Mike Siers <mikes@…>

  • Nice Update of PPPD support which eliminates the requiremetn that drivers be in the termios TASK_DRIVEN mode. Mike did significant testing and reports that it seems to be more stable and handle larger packets better. This patch replaces the termios tasks with more general pppd network driver tasks. The functions pppinput() and pppstart() get called from the interrupt service routine.
  • Makefile.am, configure.ac, net/Makefile.am, net/bpf.h, net/ethernet.h, net/if.c, net/if.h, net/if_arp.h, net/if_dl.h, net/if_ethersubr.c, net/if_llc.h, net/if_loop.c, net/if_ppp.h, net/if_pppvar.h, net/if_types.h, net/netisr.h, net/ppp-comp.h, net/ppp_defs.h, net/pppcompress.h, net/radix.c, net/radix.h, net/raw_cb.c, net/raw_cb.h, net/raw_usrreq.c, net/route.c, net/route.h, net/rtsock.c, pppd/Makefile.am, pppd/README, pppd/STATUS, pppd/auth.c, pppd/cbcp.c, pppd/ccp.c, pppd/ccp.h, pppd/chap.c, pppd/chap.h, pppd/chap_ms.c, pppd/chap_ms.h, pppd/chat.c, pppd/demand.c, pppd/fsm.c, pppd/fsm.h, pppd/ipcp.c, pppd/ipcp.h, pppd/ipxcp.c, pppd/ipxcp.h, pppd/lcp.c, pppd/lcp.h, pppd/magic.c, pppd/magic.h, pppd/options.c, pppd/patchlevel.h, pppd/pathnames.h, pppd/pppd.8, pppd/pppd.h, pppd/rtemsmain.c, pppd/rtemspppd.c, pppd/rtemspppd.h, pppd/sys-rtems.c, pppd/upap.c, pppd/upap.h, pppd/utils.c, pppd/example/README, pppd/example/netconfig.h, wrapup/Makefile.am: Modified.
  • net/bsd-comp.c, net/if_ppp.c, net/ppp-deflate.c, net/ppp.h, net/ppp_tty.c, net/pppcompress.c, net/zlib.c, net/zlib.h: New file.
  • modem/, modem/.cvsignore, modem/Makefile.am, modem/ppp.c, modem/ppp.h, modem/ppp_tty.c, modem/pppcompress.c: Subdirectory removed.
  • Property mode set to 100644
File size: 4.4 KB
Line 
1/*
2 * chap.h - Challenge Handshake Authentication Protocol definitions.
3 *
4 * Copyright (c) 1993 The Australian National University.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * advertising materials, and other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by the Australian National University.  The name of the University
13 * may not be used to endorse or promote products derived from this
14 * software without specific prior written permission.
15 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 *
19 * Copyright (c) 1991 Gregory M. Christy
20 * All rights reserved.
21 *
22 * Redistribution and use in source and binary forms are permitted
23 * provided that the above copyright notice and this paragraph are
24 * duplicated in all such forms and that any documentation,
25 * advertising materials, and other materials related to such
26 * distribution and use acknowledge that the software was developed
27 * by the author.
28 *
29 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
30 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
31 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32 *
33 * $Id$
34 */
35
36#ifndef __CHAP_INCLUDE__
37
38/* Code + ID + length */
39#define CHAP_HEADERLEN          4
40
41/*
42 * CHAP codes.
43 */
44
45#define CHAP_DIGEST_MD5         5       /* use MD5 algorithm */
46#define MD5_SIGNATURE_SIZE      16      /* 16 bytes in a MD5 message digest */
47#define CHAP_MICROSOFT          0x80    /* use Microsoft-compatible alg. */
48#define MS_CHAP_RESPONSE_LEN    49      /* Response length for MS-CHAP */
49
50#define CHAP_CHALLENGE          1
51#define CHAP_RESPONSE           2
52#define CHAP_SUCCESS            3
53#define CHAP_FAILURE            4
54
55/*
56 *  Challenge lengths (for challenges we send) and other limits.
57 */
58#define MIN_CHALLENGE_LENGTH    16
59#define MAX_CHALLENGE_LENGTH    24
60#define MAX_RESPONSE_LENGTH     64      /* sufficient for MD5 or MS-CHAP */
61
62/*
63 * Each interface is described by a chap structure.
64 */
65
66typedef struct chap_state {
67    int unit;                   /* Interface unit number */
68    int clientstate;            /* Client state */
69    int serverstate;            /* Server state */
70    u_char challenge[MAX_CHALLENGE_LENGTH]; /* last challenge string sent */
71    u_char chal_len;            /* challenge length */
72    u_char chal_id;             /* ID of last challenge */
73    u_char chal_type;           /* hash algorithm for challenges */
74    u_char id;                  /* Current id */
75    char *chal_name;            /* Our name to use with challenge */
76    int chal_interval;          /* Time until we challenge peer again */
77    int timeouttime;            /* Timeout time in seconds */
78    int max_transmits;          /* Maximum # of challenge transmissions */
79    int chal_transmits;         /* Number of transmissions of challenge */
80    int resp_transmits;         /* Number of transmissions of response */
81    u_char response[MAX_RESPONSE_LENGTH];       /* Response to send */
82    u_char resp_length;         /* length of response */
83    u_char resp_id;             /* ID for response messages */
84    u_char resp_type;           /* hash algorithm for responses */
85    char *resp_name;            /* Our name to send with response */
86} chap_state;
87
88
89/*
90 * Client (peer) states.
91 */
92#define CHAPCS_INITIAL          0       /* Lower layer down, not opened */
93#define CHAPCS_CLOSED           1       /* Lower layer up, not opened */
94#define CHAPCS_PENDING          2       /* Auth us to peer when lower up */
95#define CHAPCS_LISTEN           3       /* Listening for a challenge */
96#define CHAPCS_RESPONSE         4       /* Sent response, waiting for status */
97#define CHAPCS_OPEN             5       /* We've received Success */
98
99/*
100 * Server (authenticator) states.
101 */
102#define CHAPSS_INITIAL          0       /* Lower layer down, not opened */
103#define CHAPSS_CLOSED           1       /* Lower layer up, not opened */
104#define CHAPSS_PENDING          2       /* Auth peer when lower up */
105#define CHAPSS_INITIAL_CHAL     3       /* We've sent the first challenge */
106#define CHAPSS_OPEN             4       /* We've sent a Success msg */
107#define CHAPSS_RECHALLENGE      5       /* We've sent another challenge */
108#define CHAPSS_BADAUTH          6       /* We've sent a Failure msg */
109
110/*
111 * Timeouts.
112 */
113#define CHAP_DEFTIMEOUT         5       /* Timeout time in seconds */
114#define CHAP_DEFTRANSMITS       10      /* max # times to send challenge */
115
116extern chap_state chap[];
117
118void ChapAuthWithPeer __P((int, char *, int));
119void ChapAuthPeer __P((int, char *, int));
120
121extern struct protent chap_protent;
122
123#define __CHAP_INCLUDE__
124#endif /* __CHAP_INCLUDE__ */
Note: See TracBrowser for help on using the repository browser.