Annotation of embedaddon/libpdel/ppp/ppp_link.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_PPP_LINK_H_
        !            42: #define _PDEL_PPP_PPP_LINK_H_
        !            43: 
        !            44: /************************************************************************
        !            45:                        PUBLIC DECLARATIONS
        !            46: ************************************************************************/
        !            47: 
        !            48: struct ppp_link;
        !            49: struct ppp_bundle;
        !            50: struct ppp_engine;
        !            51: struct ppp_auth_config;
        !            52: struct ppp_lcp_req;
        !            53: struct ppp_channel;
        !            54: 
        !            55: /* Link states */
        !            56: enum ppp_link_state {
        !            57:        PPP_LINK_DOWN = 0,
        !            58:        PPP_LINK_AUTH,
        !            59:        PPP_LINK_UP,
        !            60: };
        !            61: 
        !            62: /*
        !            63:  * PPP link configuration
        !            64:  */
        !            65: struct ppp_link_config {
        !            66:        struct ppp_auth_config  auth;           /* auth config */
        !            67:        u_int16_t               min_peer_mru;   /* min peer mru */
        !            68:        u_int16_t               max_self_mru;   /* max self mru */
        !            69:        u_int16_t               min_peer_mrru;  /* min peer mrru */
        !            70:        u_int16_t               max_self_mrru;  /* max self mrru */
        !            71:        u_char                  multilink;      /* enable multilink */
        !            72:        struct ppp_eid          eid;            /* endpoint discriminator */
        !            73: };
        !            74: 
        !            75: __BEGIN_DECLS
        !            76: 
        !            77: /* Functions */
        !            78: extern int     ppp_link_create(struct ppp_engine *engine,
        !            79:                        struct ppp_channel *device,
        !            80:                        struct ppp_link_config *conf, struct ppp_log *log);
        !            81: extern void    ppp_link_destroy(struct ppp_link **linkp);
        !            82: extern void    ppp_link_close(struct ppp_link *link);
        !            83: extern const   char *ppp_link_get_authname(struct ppp_link *link, int dir);
        !            84: extern void    ppp_link_get_eid(struct ppp_link *link,
        !            85:                        int dir, struct ppp_eid *eid);
        !            86: extern struct  ppp_channel *ppp_link_get_device(struct ppp_link *link);
        !            87: extern int     ppp_link_get_origination(struct ppp_link *link);
        !            88: extern enum    ppp_link_state ppp_link_get_state(struct ppp_link *link);
        !            89: extern struct  ppp_bundle *ppp_link_get_bundle(struct ppp_link *link);
        !            90: extern void    ppp_link_get_lcp_req(struct ppp_link *link,
        !            91:                        struct ppp_lcp_req *req);
        !            92: 
        !            93: __END_DECLS
        !            94: 
        !            95: /************************************************************************
        !            96:                        PRIVATE DECLARATIONS
        !            97: ************************************************************************/
        !            98: 
        !            99: #ifdef _PDEL_PPP_PRIVATE_H_
        !           100: 
        !           101: struct ppp_auth_cred;
        !           102: 
        !           103: typedef void   ppp_link_auth_finish_t(void *arg,
        !           104:                        const struct ppp_auth_cred *creds,
        !           105:                        const struct ppp_auth_resp *resp);
        !           106: 
        !           107: __BEGIN_DECLS
        !           108: 
        !           109: extern void    ppp_link_get_mppe(struct ppp_link *link, int dir,
        !           110:                        union ppp_auth_mppe *mppe);
        !           111: extern void    ppp_link_write(struct ppp_link *link,
        !           112:                        u_int16_t proto, const void *data, size_t len);
        !           113: extern const   struct ppp_auth_config *ppp_link_auth_get_config(
        !           114:                        struct ppp_link *link);
        !           115: extern const   struct ppp_auth_type *ppp_link_get_auth(
        !           116:                        struct ppp_link *link, int dir);
        !           117: extern int     ppp_link_authorize(struct ppp_link *link, int dir,
        !           118:                        const struct ppp_auth_cred *cred,
        !           119:                        ppp_link_auth_finish_t *finish);
        !           120: extern int     ppp_link_auth_in_progress(struct ppp_link *link, int dir);
        !           121: extern void    ppp_link_auth_complete(struct ppp_link *link, int dir,
        !           122:                        const struct ppp_auth_cred *cred,
        !           123:                        const union ppp_auth_mppe *mppe);
        !           124: extern void    ppp_link_recv_bypass(struct ppp_link *link,
        !           125:                        u_int16_t proto, u_char *data, size_t len);
        !           126: extern struct  ppp_log *ppp_link_get_log(struct ppp_link *link);
        !           127: 
        !           128: __END_DECLS
        !           129: 
        !           130: #endif /* _PDEL_PPP_PRIVATE_H_ */
        !           131: 
        !           132: #endif /* _PDEL_PPP_PPP_LINK_H_ */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>