Annotation of embedaddon/libpdel/ppp/ppp_auth_radius.h, revision 1.1
1.1 ! misho 1:
! 2: /*
! 3: * Copyright (c) 2001-2002 Packet Design, LLC.
! 4: * All rights reserved.
! 5: *
! 6: * Subject to the following obligations and disclaimer of warranty,
! 7: * use and redistribution of this software, in source or object code
! 8: * forms, with or without modifications are expressly permitted by
! 9: * Packet Design; provided, however, that:
! 10: *
! 11: * (i) Any and all reproductions of the source or object code
! 12: * must include the copyright notice above and the following
! 13: * disclaimer of warranties; and
! 14: * (ii) No rights are granted, in any manner or form, to use
! 15: * Packet Design trademarks, including the mark "PACKET DESIGN"
! 16: * on advertising, endorsements, or otherwise except as such
! 17: * appears in the above copyright notice or in the software.
! 18: *
! 19: * THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND
! 20: * TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO
! 21: * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING
! 22: * THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED
! 23: * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
! 24: * OR NON-INFRINGEMENT. PACKET DESIGN DOES NOT WARRANT, GUARANTEE,
! 25: * OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS
! 26: * OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY,
! 27: * RELIABILITY OR OTHERWISE. IN NO EVENT SHALL PACKET DESIGN BE
! 28: * LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE
! 29: * OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT,
! 30: * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL
! 31: * DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF
! 32: * USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY THEORY OF
! 33: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
! 34: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
! 35: * THE USE OF THIS SOFTWARE, EVEN IF PACKET DESIGN IS ADVISED OF
! 36: * THE POSSIBILITY OF SUCH DAMAGE.
! 37: *
! 38: * Author: Archie Cobbs <archie@freebsd.org>
! 39: */
! 40:
! 41: #ifndef _PDEL_PPP_AUTH_RADIUS_H_
! 42: #define _PDEL_PPP_AUTH_RADIUS_H_
! 43:
! 44: /*
! 45: * Support for PPP authentication via RADIUS.
! 46: */
! 47:
! 48: /************************************************************************
! 49: PUBLIC DECLARATIONS
! 50: ************************************************************************/
! 51:
! 52: struct ppp_auth_cred;
! 53: struct ppp_auth_resp;
! 54:
! 55: /* Attributes returned by server (or NULL if not present in server reply) */
! 56: struct ppp_auth_radius_info {
! 57: struct in_addr *ip;
! 58: struct in_addr *netmask;
! 59: char *filter_id;
! 60: u_int32_t *session_timeout;
! 61: u_int32_t *mtu;
! 62: u_int32_t *routing;
! 63: u_int32_t *vjc;
! 64: char **routes; /* NULL terminated list */
! 65: char *reply_message;
! 66: char *mschap_error;
! 67: char *mschap2_success;
! 68: u_int32_t *mppe_policy;
! 69: u_int32_t *mppe_types;
! 70: };
! 71:
! 72: __BEGIN_DECLS
! 73:
! 74: /*
! 75: * Perform RADIUS authentication using the supplied 'struct rad_handle',
! 76: * which must already be configured (see libradius(3)).
! 77: *
! 78: * 'log' may be NULL, otherwise it's used for logging.
! 79: *
! 80: * If 'rip' is non-NULL, then all fields in *rip will be initialized to NULL
! 81: * and then filled in with whichever attributes are returned by the RADIUS
! 82: * server. The fields in 'rip' should eventually be free'd by calling the
! 83: * ppp_auth_radius_info_reset() function. Note: 'rip' fields are filled in
! 84: * even if the server rejects authentication.
! 85: *
! 86: * This function is async cancel-safe.
! 87: *
! 88: * Returns:
! 89: * 0 Credentials are valid
! 90: * -1 Credentials can't be validated; resp->errmsg contains message
! 91: * and 'rip' has not been modified.
! 92: */
! 93: extern int ppp_auth_radius_check(struct rad_handle *rad,
! 94: struct ppp_log *log, const struct ppp_auth_cred *creds,
! 95: struct ppp_auth_resp *resp,
! 96: struct ppp_auth_radius_info *rip);
! 97:
! 98: /*
! 99: * Free memory allocated for fields in a 'struct ppp_auth_radius_info'
! 100: * and set them all to NULL.
! 101: */
! 102: extern void ppp_auth_radius_info_reset(struct ppp_auth_radius_info *rip);
! 103:
! 104: __END_DECLS
! 105:
! 106: #endif /* _PDEL_PPP_AUTH_RADIUS_H_ */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>