Annotation of embedaddon/libpdel/ppp/ppp_pptp_ctrl.h, revision 1.1.1.1
1.1 misho 1:
2: /*
3: * Copyright (c) 1995-1999 Whistle Communications, Inc.
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: * Whistle Communications; provided, however, that: (i) any and
10: * all reproductions of the source or object code must include the
11: * copyright notice above and the following disclaimer of warranties;
12: * and (ii) no rights are granted, in any manner or form, to use
13: * Whistle Communications, Inc. trademarks, including the mark "WHISTLE
14: * COMMUNICATIONS" on advertising, endorsements, or otherwise except
15: * as such appears in the above copyright notice or in the software.
16: *
17: * THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS",
18: * AND TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS
19: * MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,
20: * REGARDING THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND
21: * ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22: * PURPOSE, OR NON-INFRINGEMENT. WHISTLE COMMUNICATIONS DOES NOT
23: * WARRANT, GUARANTEE, OR MAKE ANY REPRESENTATIONS REGARDING THE USE
24: * OF, OR THE RESULTS OF THE USE OF THIS SOFTWARE IN TERMS OF ITS
25: * CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. IN NO EVENT
26: * SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES RESULTING
27: * FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING WITHOUT
28: * LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
29: * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE
30: * GOODS OR SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED
31: * AND UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33: * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS
34: * IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35: *
36: * Author: <archie@freebsd.org>
37: */
38:
39: #ifndef _PDEL_PPP_PPP_PPTP_CTRL_H_
40: #define _PDEL_PPP_PPP_PPTP_CTRL_H_
41:
42: struct ppp_log;
43: struct pptp_engine;
44:
45: /*
46: * Callback function types
47: */
48:
49: /*
50: * Link callback info (passed to PPTP control code)
51: *
52: * cookie Link private cookie for this connection, NULL = failed
53: * result Called to report success/failure of a locally initiated
54: * incoming or outgoing call to peer; also used to report
55: * when/if a call is terminated by error or the remote side.
56: * setLinkInfo Called when peer notifies us of the remote call link info
57: * cancel Called to cancel a local outgoing call initiated by peer
58: */
59: struct pptplinkinfo { /* PPTP's info for accessing link code */
60: void *cookie; /* NULL indicates response is invalid */
61: void (*result)(void *cookie, const char *errmsg);
62: void (*setLinkInfo)(void *cookie, u_int32_t sa, u_int32_t ra);
63: void (*cancel)(void *cookie); /* cancel outgoing call */
64: };
65: typedef struct pptplinkinfo *PptpLinkInfo;
66:
67: /*
68: * PPTP control callback info (passed to link code)
69: *
70: * cookie PPTP control private cookie for this connection, NULL = failed
71: * peer_addr Peer's IP address
72: * peer_port Peer's TCP port
73: * close Close/shutdown the call
74: * answer Notify of outgoing call (initiated by peer) success/failure
75: * Must be called sometime after return from the link-supplied
76: * 'PptpGetOutLink_t' function.
77: */
78: struct pptpctrlinfo { /* Link's info for accessing PPTP code */
79: void *cookie; /* NULL indicates response is invalid */
80: struct in_addr peer_addr; /* Peer IP address and port */
81: u_int16_t peer_port;
82: void (*close)(void *cookie, int result, int err, int cause);
83: void (*answer)(void *cookie, int rs, int er, int cs, int sp);
84: };
85: typedef struct pptpctrlinfo *PptpCtrlInfo;
86:
87: typedef int PptpCheckNewConn_t(void *arg, struct in_addr ip,
88: u_int16_t port, char *logname, size_t lnmax);
89:
90: typedef struct pptplinkinfo PptpGetInLink_t(void *arg,
91: struct pptpctrlinfo cinfo, struct in_addr peer,
92: u_int16_t port, int bearType, const char *callingNum,
93: const char *calledNum, const char *subAddress);
94:
95: typedef struct pptplinkinfo PptpGetOutLink_t(void *arg,
96: struct pptpctrlinfo cinfo, struct in_addr peer,
97: u_int16_t port, int bearType, int frameType,
98: int minBps, int maxBps, const char *calledNum,
99: const char *subAddress);
100:
101: /*
102: * Public functions
103: */
104:
105: __BEGIN_DECLS
106:
107: extern struct pptp_engine *PptpCtrlInit(void *arg, struct pevent_ctx *ctx,
108: pthread_mutex_t *mutex,
109: PptpCheckNewConn_t *checkNewConn,
110: PptpGetInLink_t *getInLink,
111: PptpGetOutLink_t *getOutLink,
112: struct in_addr ip, u_int16_t port, const char *vendor,
113: struct ppp_log *log, int nocd);
114:
115: extern void PptpCtrlShutdown(struct pptp_engine **enginep);
116:
117: extern int PptpCtrlListen(struct pptp_engine *engine, int enable);
118:
119: extern struct pptpctrlinfo PptpCtrlInCall(struct pptp_engine *engine,
120: struct pptplinkinfo linfo, struct in_addr ip,
121: u_int16_t port, const char *logname, int bearType,
122: int frameType, int minBps, int maxBps,
123: const char *callingNum, const char *calledNum,
124: const char *subAddress);
125:
126: extern struct pptpctrlinfo PptpCtrlOutCall(struct pptp_engine *engine,
127: struct pptplinkinfo linfo, struct in_addr ip,
128: u_int16_t port, const char *logname, int bearType,
129: int frameType, int minBps, int maxBps,
130: const char *calledNum, const char *subAddress);
131:
132: extern int PptpCtrlGetSessionInfo(const struct pptpctrlinfo *cp,
133: struct in_addr *selfAddr, struct in_addr *peerAddr,
134: u_int16_t *selfCid, u_int16_t *peerCid,
135: u_int16_t *peerWin, u_int16_t *peerPpd);
136:
137: __END_DECLS
138:
139: #endif /* _PDEL_PPP_PPP_PPTP_CTRL_H_ */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>