Deleted Added
sdiff udiff text old ( 50476 ) new ( 52709 )
full compact
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 $
26.\"
27.Dd July 29, 1998
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 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 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"
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
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.
76.Sh INITIALIZATION
77To use the library, an application must first call
78.Fn rad_open
79to obtain a
80.Va struct rad_handle * ,
81which provides the context for subsequent operations.
82Calls to
83.Fn rad_open
84always succeed unless insufficient virtual memory is available. If
85the necessary memory cannot be allocated,
86.Fn rad_open
87returns
88.Dv NULL .
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
122service 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
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
349.Fn rad_cvt_string
350.It
351.Fn rad_open
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
362.Sh AUTHORS
363This software was written by
364.An John Polstra ,
365and donated to the FreeBSD project by Juniper Networks, Inc.