bundle.h (92f4ff1ccdbdf822fdacb5df1857e120610162de) bundle.h (b6217683dc0269a53b799399522dbdfb5a4919cc)
1/*-
2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $Id: bundle.h,v 1.1.2.22 1998/04/03 19:21:07 brian Exp $
26 * $Id: bundle.h,v 1.1.2.23 1998/04/03 19:24:41 brian Exp $
27 */
28
29#define PHASE_DEAD 0 /* Link is dead */
30#define PHASE_ESTABLISH 1 /* Establishing link */
31#define PHASE_AUTHENTICATE 2 /* Being authenticated */
32#define PHASE_NETWORK 3 /* We're alive ! */
33#define PHASE_TERMINATE 4 /* Terminating link */
34
35
36struct datalink;
37struct physical;
38struct link;
27 */
28
29#define PHASE_DEAD 0 /* Link is dead */
30#define PHASE_ESTABLISH 1 /* Establishing link */
31#define PHASE_AUTHENTICATE 2 /* Being authenticated */
32#define PHASE_NETWORK 3 /* We're alive ! */
33#define PHASE_TERMINATE 4 /* Terminating link */
34
35
36struct datalink;
37struct physical;
38struct link;
39struct server;
40struct prompt;
39
40struct bundle {
41 struct descriptor desc; /* really all our datalinks */
42 int unit; /* The tun number */
43 int ifIndex; /* The interface number */
44 int tun_fd; /* The /dev/tunX descriptor */
45 char dev[20]; /* The /dev/tunX name */
46 char *ifname; /* The interface name */

--- 33 unchanged lines hidden (view full) ---

80 struct {
81 int fd; /* write status here */
82 } notify;
83};
84
85#define descriptor2bundle(d) \
86 ((d)->type == BUNDLE_DESCRIPTOR ? (struct bundle *)(d) : NULL)
87
41
42struct bundle {
43 struct descriptor desc; /* really all our datalinks */
44 int unit; /* The tun number */
45 int ifIndex; /* The interface number */
46 int tun_fd; /* The /dev/tunX descriptor */
47 char dev[20]; /* The /dev/tunX name */
48 char *ifname; /* The interface name */

--- 33 unchanged lines hidden (view full) ---

82 struct {
83 int fd; /* write status here */
84 } notify;
85};
86
87#define descriptor2bundle(d) \
88 ((d)->type == BUNDLE_DESCRIPTOR ? (struct bundle *)(d) : NULL)
89
88extern struct bundle *bundle_Create(const char *);
90extern struct bundle *bundle_Create(const char *, struct prompt *);
89extern void bundle_Destroy(struct bundle *);
90extern const char *bundle_PhaseName(struct bundle *);
91#define bundle_Phase(b) ((b)->phase)
92extern void bundle_NewPhase(struct bundle *, u_int);
93extern int bundle_LinkIsUp(const struct bundle *);
94extern void bundle_SetRoute(struct bundle *, int, struct in_addr,
95 struct in_addr, struct in_addr, int);
96extern void bundle_LinkLost(struct bundle *, struct link *, int);

--- 9 unchanged lines hidden (view full) ---

106extern int bundle_RemainingIdleTime(struct bundle *);
107extern void bundle_LayerUp(struct bundle *, struct fsm *);
108extern int bundle_IsDead(struct bundle *);
109
110extern struct physical *bundle2physical(struct bundle *, const char *);
111extern struct datalink *bundle2datalink(struct bundle *, const char *);
112extern struct authinfo *bundle2pap(struct bundle *, const char *);
113extern struct chap *bundle2chap(struct bundle *, const char *);
91extern void bundle_Destroy(struct bundle *);
92extern const char *bundle_PhaseName(struct bundle *);
93#define bundle_Phase(b) ((b)->phase)
94extern void bundle_NewPhase(struct bundle *, u_int);
95extern int bundle_LinkIsUp(const struct bundle *);
96extern void bundle_SetRoute(struct bundle *, int, struct in_addr,
97 struct in_addr, struct in_addr, int);
98extern void bundle_LinkLost(struct bundle *, struct link *, int);

--- 9 unchanged lines hidden (view full) ---

108extern int bundle_RemainingIdleTime(struct bundle *);
109extern void bundle_LayerUp(struct bundle *, struct fsm *);
110extern int bundle_IsDead(struct bundle *);
111
112extern struct physical *bundle2physical(struct bundle *, const char *);
113extern struct datalink *bundle2datalink(struct bundle *, const char *);
114extern struct authinfo *bundle2pap(struct bundle *, const char *);
115extern struct chap *bundle2chap(struct bundle *, const char *);
116
117extern void bundle_RegisterDescriptor(struct bundle *, struct descriptor *);
118extern void bundle_UnRegisterDescriptor(struct bundle *, struct descriptor *);
119
120extern void bundle_DelPromptDescriptors(struct bundle *, struct server *);
121extern void bundle_DisplayPrompt(struct bundle *);
122extern void bundle_WriteTermPrompt(struct bundle *, struct datalink *,
123 const char *, int);
124extern void bundle_SetTtyCommandMode(struct bundle *, struct datalink *);