Deleted Added
full compact
libradius.3 (50476) libradius.3 (52709)
1.\" Copyright 1998 Juniper Networks, Inc.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 8 unchanged lines hidden (view full) ---

17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
1.\" Copyright 1998 Juniper Networks, Inc.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 8 unchanged lines hidden (view full) ---

17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD: head/lib/libradius/libradius.3 50476 1999-08-28 00:22:10Z peter $
25.\" $FreeBSD: head/lib/libradius/libradius.3 52709 1999-10-31 04:47:59Z jdp $
26.\"
26.\"
27.Dd July 29, 1998
27.Dd October 30, 1999
28.Dt LIBRADIUS 3
29.Os FreeBSD
30.Sh NAME
31.Nm libradius
32.Nd RADIUS client library
33.Sh SYNOPSIS
34.Fd #include <radlib.h>
28.Dt LIBRADIUS 3
29.Os FreeBSD
30.Sh NAME
31.Nm libradius
32.Nd RADIUS client library
33.Sh SYNOPSIS
34.Fd #include <radlib.h>
35.Ft struct rad_handle *
36.Fn rad_acct_open "void"
35.Ft int
36.Fn rad_add_server "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries"
37.Ft int
38.Fn rad_add_server "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries"
39.Ft struct rad_handle *
40.Fn rad_auth_open "void"
37.Ft void
38.Fn rad_close "struct rad_handle *h"
39.Ft int
40.Fn rad_config "struct rad_handle *h" "const char *file"
41.Ft int
42.Fn rad_continue_send_request "struct rad_handle *h" "int selected" "int *fd" "struct timeval *tv"
43.Ft int
44.Fn rad_create_request "struct rad_handle *h" "int code"
45.Ft struct in_addr
46.Fn rad_cvt_addr "const void *data"
47.Ft u_int32_t
48.Fn rad_cvt_int "const void *data"
49.Ft char *
50.Fn rad_cvt_string "const void *data" "size_t len"
51.Ft int
52.Fn rad_get_attr "struct rad_handle *h" "const void **data" "size_t *len"
53.Ft int
54.Fn rad_init_send_request "struct rad_handle *h" "int *fd" "struct timeval *tv"
41.Ft void
42.Fn rad_close "struct rad_handle *h"
43.Ft int
44.Fn rad_config "struct rad_handle *h" "const char *file"
45.Ft int
46.Fn rad_continue_send_request "struct rad_handle *h" "int selected" "int *fd" "struct timeval *tv"
47.Ft int
48.Fn rad_create_request "struct rad_handle *h" "int code"
49.Ft struct in_addr
50.Fn rad_cvt_addr "const void *data"
51.Ft u_int32_t
52.Fn rad_cvt_int "const void *data"
53.Ft char *
54.Fn rad_cvt_string "const void *data" "size_t len"
55.Ft int
56.Fn rad_get_attr "struct rad_handle *h" "const void **data" "size_t *len"
57.Ft int
58.Fn rad_init_send_request "struct rad_handle *h" "int *fd" "struct timeval *tv"
55.Ft struct rad_handle *
56.Fn rad_open "void"
57.Ft int
58.Fn rad_put_addr "struct rad_handle *h" "int type" "struct in_addr addr"
59.Ft int
60.Fn rad_put_attr "struct rad_handle *h" "int type" "const void *data" "size_t len"
61.Ft int
62.Fn rad_put_int "struct rad_handle *h" "int type" "u_int32_t value"
63.Ft int
64.Fn rad_put_string "struct rad_handle *h" "int type" "const char *str"
65.Ft int
66.Fn rad_send_request "struct rad_handle *h"
67.Ft const char *
68.Fn rad_strerror "struct rad_handle *h"
69.Sh DESCRIPTION
70The
71.Nm
59.Ft int
60.Fn rad_put_addr "struct rad_handle *h" "int type" "struct in_addr addr"
61.Ft int
62.Fn rad_put_attr "struct rad_handle *h" "int type" "const void *data" "size_t len"
63.Ft int
64.Fn rad_put_int "struct rad_handle *h" "int type" "u_int32_t value"
65.Ft int
66.Fn rad_put_string "struct rad_handle *h" "int type" "const char *str"
67.Ft int
68.Fn rad_send_request "struct rad_handle *h"
69.Ft const char *
70.Fn rad_strerror "struct rad_handle *h"
71.Sh DESCRIPTION
72The
73.Nm
72library implements the client side of the Remote Authentication
73Dial In User Service (RADIUS). RADIUS, defined in RFC 2138, allows
74clients to perform authentication by means of network requests to
75remote authentication servers.
74library implements the client side of the Remote Authentication Dial
75In User Service (RADIUS). RADIUS, defined in RFCs 2138 and 2139,
76allows clients to perform authentication and accounting by means of
77network requests to remote servers.
76.Sh INITIALIZATION
77To use the library, an application must first call
78.Sh INITIALIZATION
79To use the library, an application must first call
78.Fn rad_open
80.Fn rad_auth_open
81or
82.Fn rad_acct_open
79to obtain a
80.Va struct rad_handle * ,
81which provides the context for subsequent operations.
83to obtain a
84.Va struct rad_handle * ,
85which provides the context for subsequent operations.
86The former function is used for RADIUS authentication and the
87latter is used for RADIUS accounting.
82Calls to
88Calls to
83.Fn rad_open
89.Fn rad_auth_open
90and
91.Fn rad_acct_open
84always succeed unless insufficient virtual memory is available. If
92always succeed unless insufficient virtual memory is available. If
85the necessary memory cannot be allocated,
86.Fn rad_open
87returns
93the necessary memory cannot be allocated, the functions return
88.Dv NULL .
94.Dv NULL .
95For compatibility with earlier versions of this library,
96.Fn rad_open
97is provided as a synonym for
98.Fn rad_auth_open .
89.Pp
90Before issuing any RADIUS requests, the library must be made aware
91of the servers it can contact. The easiest way to configure the
92library is to call
93.Fn rad_config .
94.Fn rad_config
95causes the library to read a configuration file whose format is
96described in

--- 17 unchanged lines hidden (view full) ---

114parameter specifies the server host, either as a fully qualified
115domain name or as a dotted-quad IP address in text form.
116The
117.Va port
118parameter specifies the UDP port to contact on the server. If
119.Va port
120is given as 0, the library looks up the
121.Ql radius/udp
99.Pp
100Before issuing any RADIUS requests, the library must be made aware
101of the servers it can contact. The easiest way to configure the
102library is to call
103.Fn rad_config .
104.Fn rad_config
105causes the library to read a configuration file whose format is
106described in

--- 17 unchanged lines hidden (view full) ---

124parameter specifies the server host, either as a fully qualified
125domain name or as a dotted-quad IP address in text form.
126The
127.Va port
128parameter specifies the UDP port to contact on the server. If
129.Va port
130is given as 0, the library looks up the
131.Ql radius/udp
132or
133.Ql radacct/udp
122service in the network services database, and uses the port found
134service in the network services database, and uses the port found
123there. If no entry is found, the library uses port 1812, the standard
124RADIUS port. The shared secret for the server host is passed to the
135there. If no entry is found, the library uses the standard RADIUS
136ports, 1812 for authentication and 1813 for accounting.
137The shared secret for the server host is passed to the
125.Va secret
126parameter.
127It may be any NUL-terminated string of bytes. The RADIUS protocol
128ignores all but the leading 128 bytes of the shared secret.
129The timeout for receiving replies from the server is passed to the
130.Va timeout
131parameter, in units of seconds. The maximum number of repeated
132requests to make before giving up is passed into the

--- 208 unchanged lines hidden (view full) ---

341.No non- Ns Dv NULL
342pointer on success. If they are unable to allocate sufficient
343virtual memory, they return
344.Dv NULL ,
345without recording an error message.
346.Pp
347.Bl -item -offset indent -compact
348.It
138.Va secret
139parameter.
140It may be any NUL-terminated string of bytes. The RADIUS protocol
141ignores all but the leading 128 bytes of the shared secret.
142The timeout for receiving replies from the server is passed to the
143.Va timeout
144parameter, in units of seconds. The maximum number of repeated
145requests to make before giving up is passed into the

--- 208 unchanged lines hidden (view full) ---

354.No non- Ns Dv NULL
355pointer on success. If they are unable to allocate sufficient
356virtual memory, they return
357.Dv NULL ,
358without recording an error message.
359.Pp
360.Bl -item -offset indent -compact
361.It
349.Fn rad_cvt_string
362.Fn rad_acct_open
350.It
363.It
351.Fn rad_open
364.Fn rad_auth_open
365.It
366.Fn rad_cvt_string
352.El
353.Sh FILES
354.Pa /etc/radius.conf
355.Sh SEE ALSO
356.Xr radius.conf 5
357.Rs
358.%A C. Rigney, et al
359.%T Remote Authentication Dial In User Service (RADIUS)
360.%O RFC 2138
361.Re
367.El
368.Sh FILES
369.Pa /etc/radius.conf
370.Sh SEE ALSO
371.Xr radius.conf 5
372.Rs
373.%A C. Rigney, et al
374.%T Remote Authentication Dial In User Service (RADIUS)
375.%O RFC 2138
376.Re
377.Rs
378.%A C. Rigney
379.%T RADIUS Accounting
380.%O RFC 2139
381.Re
362.Sh AUTHORS
382.Sh AUTHORS
363This software was written by
383This software was originally written by
364.An John Polstra ,
365and donated to the FreeBSD project by Juniper Networks, Inc.
384.An John Polstra ,
385and donated to the FreeBSD project by Juniper Networks, Inc.
386Oleg Semyonov subsequently added the ability to perform RADIUS
387accounting.