Deleted Added
full compact
radlib_private.h (43662) radlib_private.h (52709)
1/*-
2 * Copyright 1998 Juniper Networks, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright 1998 Juniper Networks, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/lib/libradius/radlib_private.h 43662 1999-02-05 11:23:44Z brian $
26 * $FreeBSD: head/lib/libradius/radlib_private.h 52709 1999-10-31 04:47:59Z jdp $
27 */
28
29#ifndef RADLIB_PRIVATE_H
30#define RADLIB_PRIVATE_H
31
32#include <sys/types.h>
33#include <netinet/in.h>
34
35#include "radlib.h"
36
27 */
28
29#ifndef RADLIB_PRIVATE_H
30#define RADLIB_PRIVATE_H
31
32#include <sys/types.h>
33#include <netinet/in.h>
34
35#include "radlib.h"
36
37/* Handle types */
38#define RADIUS_AUTH 0 /* RADIUS authentication, default */
39#define RADIUS_ACCT 1 /* RADIUS accounting */
40
37/* Defaults */
38#define MAXTRIES 3
39#define PATH_RADIUS_CONF "/etc/radius.conf"
40#define RADIUS_PORT 1812
41/* Defaults */
42#define MAXTRIES 3
43#define PATH_RADIUS_CONF "/etc/radius.conf"
44#define RADIUS_PORT 1812
45#define RADACCT_PORT 1813
41#define TIMEOUT 3 /* In seconds */
42
43/* Limits */
44#define ERRSIZE 128 /* Maximum error message length */
45#define MAXCONFLINE 1024 /* Maximum config file line length */
46#define MAXSERVERS 10 /* Maximum number of servers to try */
47#define MSGSIZE 4096 /* Maximum RADIUS message */
48#define PASSSIZE 128 /* Maximum significant password chars */
49
50/* Positions of fields in RADIUS messages */
51#define POS_CODE 0 /* Message code */
52#define POS_IDENT 1 /* Identifier */
53#define POS_LENGTH 2 /* Message length */
54#define POS_AUTH 4 /* Authenticator */
55#define LEN_AUTH 16 /* Length of authenticator */
56#define POS_ATTRS 20 /* Start of attributes */
57
58struct rad_server {
59 struct sockaddr_in addr; /* Address of server */
60 char *secret; /* Shared secret */
61 int timeout; /* Timeout in seconds */
62 int max_tries; /* Number of tries before giving up */
63 int num_tries; /* Number of tries so far */
64};
65
66struct rad_handle {
67 int fd; /* Socket file descriptor */
68 struct rad_server servers[MAXSERVERS]; /* Servers to contact */
69 int num_servers; /* Number of valid server entries */
70 int ident; /* Current identifier value */
71 char errmsg[ERRSIZE]; /* Most recent error message */
72 unsigned char request[MSGSIZE]; /* Request to send */
73 int req_len; /* Length of request */
74 char pass[PASSSIZE]; /* Cleartext password */
75 int pass_len; /* Length of cleartext password */
76 int pass_pos; /* Position of scrambled password */
77 char chap_pass; /* Have we got a CHAP_PASSWORD ? */
78 unsigned char response[MSGSIZE]; /* Response received */
79 int resp_len; /* Length of response */
80 int resp_pos; /* Current position scanning attrs */
81 int total_tries; /* How many requests we'll send */
82 int try; /* How many requests we've sent */
83 int srv; /* Server number we did last */
46#define TIMEOUT 3 /* In seconds */
47
48/* Limits */
49#define ERRSIZE 128 /* Maximum error message length */
50#define MAXCONFLINE 1024 /* Maximum config file line length */
51#define MAXSERVERS 10 /* Maximum number of servers to try */
52#define MSGSIZE 4096 /* Maximum RADIUS message */
53#define PASSSIZE 128 /* Maximum significant password chars */
54
55/* Positions of fields in RADIUS messages */
56#define POS_CODE 0 /* Message code */
57#define POS_IDENT 1 /* Identifier */
58#define POS_LENGTH 2 /* Message length */
59#define POS_AUTH 4 /* Authenticator */
60#define LEN_AUTH 16 /* Length of authenticator */
61#define POS_ATTRS 20 /* Start of attributes */
62
63struct rad_server {
64 struct sockaddr_in addr; /* Address of server */
65 char *secret; /* Shared secret */
66 int timeout; /* Timeout in seconds */
67 int max_tries; /* Number of tries before giving up */
68 int num_tries; /* Number of tries so far */
69};
70
71struct rad_handle {
72 int fd; /* Socket file descriptor */
73 struct rad_server servers[MAXSERVERS]; /* Servers to contact */
74 int num_servers; /* Number of valid server entries */
75 int ident; /* Current identifier value */
76 char errmsg[ERRSIZE]; /* Most recent error message */
77 unsigned char request[MSGSIZE]; /* Request to send */
78 int req_len; /* Length of request */
79 char pass[PASSSIZE]; /* Cleartext password */
80 int pass_len; /* Length of cleartext password */
81 int pass_pos; /* Position of scrambled password */
82 char chap_pass; /* Have we got a CHAP_PASSWORD ? */
83 unsigned char response[MSGSIZE]; /* Response received */
84 int resp_len; /* Length of response */
85 int resp_pos; /* Current position scanning attrs */
86 int total_tries; /* How many requests we'll send */
87 int try; /* How many requests we've sent */
88 int srv; /* Server number we did last */
89 int type; /* Handle type */
84};
85
86#endif
90};
91
92#endif