Annotation of embedaddon/libpdel/ppp/ppp_channel.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_CHANNEL_H_
! 42: #define _PDEL_PPP_PPP_CHANNEL_H_
! 43:
! 44: #ifndef _PDEL_PPP_PRIVATE_H_
! 45: #error "This header is only for use by the ppp library."
! 46: #endif
! 47:
! 48: struct ppp_channel;
! 49:
! 50: /* Channel events */
! 51: enum ppp_channeloutput {
! 52: PPP_CHANNEL_OUTPUT_DOWN_FATAL = 1, /* unrecoverable down event */
! 53: PPP_CHANNEL_OUTPUT_DOWN_NONFATAL, /* recoverable down event */
! 54: PPP_CHANNEL_OUTPUT_UP, /* up event */
! 55: };
! 56:
! 57: /* Channel output structure */
! 58: struct ppp_channel_output {
! 59: enum ppp_channeloutput type; /* type of output */
! 60: char *info; /* info about down events */
! 61: };
! 62:
! 63: /* Channel methods */
! 64: typedef void ppp_channel_open_t(struct ppp_channel *chan);
! 65: typedef void ppp_channel_close_t(struct ppp_channel *chan);
! 66: typedef void ppp_channel_destroy_t(struct ppp_channel **chanp);
! 67: typedef void ppp_channel_free_output_t(struct ppp_channel *chan,
! 68: struct ppp_channel_output *output);
! 69:
! 70: /* Methods supported by devices only */
! 71: typedef void ppp_channel_set_link_info_t(struct ppp_channel *chan,
! 72: u_int32_t accm);
! 73: typedef int ppp_channel_get_origination_t(struct ppp_channel *chan);
! 74: typedef const char *ppp_channel_get_node_t(struct ppp_channel *chan);
! 75: typedef const char *ppp_channel_get_hook_t(struct ppp_channel *chan);
! 76: typedef int ppp_channel_is_async_t(struct ppp_channel *chan);
! 77: typedef u_int ppp_channel_get_mtu_t(struct ppp_channel *chan);
! 78: typedef int ppp_channel_get_acfcomp_t(struct ppp_channel *chan);
! 79: typedef int ppp_channel_get_pfcomp_t(struct ppp_channel *chan);
! 80:
! 81: /* Channel methods */
! 82: struct ppp_channel_meth {
! 83: ppp_channel_open_t *open;
! 84: ppp_channel_close_t *close;
! 85: ppp_channel_destroy_t *destroy;
! 86: ppp_channel_free_output_t *free_output;
! 87: ppp_channel_set_link_info_t *set_link_info;
! 88: ppp_channel_get_origination_t *get_origination;
! 89: ppp_channel_get_node_t *get_node;
! 90: ppp_channel_get_hook_t *get_hook;
! 91: ppp_channel_is_async_t *is_async;
! 92: ppp_channel_get_mtu_t *get_mtu;
! 93: ppp_channel_get_acfcomp_t *get_acfcomp;
! 94: ppp_channel_get_pfcomp_t *get_pfcomp;
! 95: };
! 96:
! 97: /* Channel structure */
! 98: struct ppp_channel {
! 99: struct ppp_channel_meth *meth; /* methods */
! 100: void *priv; /* channel private */
! 101: struct mesg_port *outport; /* output msg port */
! 102: };
! 103:
! 104: __BEGIN_DECLS
! 105:
! 106: /* Convenience functions */
! 107: extern ppp_channel_open_t ppp_channel_open;
! 108: extern ppp_channel_close_t ppp_channel_close;
! 109: extern ppp_channel_destroy_t ppp_channel_destroy;
! 110: extern ppp_channel_free_output_t ppp_channel_free_output;
! 111: extern ppp_channel_set_link_info_t ppp_channel_set_link_info;
! 112: extern ppp_channel_get_origination_t ppp_channel_get_origination;
! 113: extern ppp_channel_get_node_t ppp_channel_get_node;
! 114: extern ppp_channel_get_hook_t ppp_channel_get_hook;
! 115: extern ppp_channel_is_async_t ppp_channel_is_async;
! 116: extern ppp_channel_get_mtu_t ppp_channel_get_mtu;
! 117: extern ppp_channel_get_acfcomp_t ppp_channel_get_acfcomp;
! 118: extern ppp_channel_get_pfcomp_t ppp_channel_get_pfcomp;
! 119:
! 120: extern struct mesg_port *ppp_channel_get_outport(struct ppp_channel *chan);
! 121:
! 122: __END_DECLS
! 123:
! 124: #endif /* _PDEL_PPP_PPP_CHANNEL_H_ */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>