bundle.h (cd7bd93a816437fd4c82a178133c420f69bb3b20) bundle.h (565e35e50e2cdac423588a3d18742544bde128b0)
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.25 1998/04/03 19:26:17 brian Exp $
26 * $Id: bundle.h,v 1.1.2.26 1998/04/05 22:48:02 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

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

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 */
49 int routing_seq; /* The current routing sequence number */
50 u_int phase; /* Curent phase */
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

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

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 */
49 int routing_seq; /* The current routing sequence number */
50 u_int phase; /* Curent phase */
51 int phys_type; /* Union of all physical::type's */
51
52 unsigned CleaningUp : 1; /* Going to exit.... */
53
54 struct fsm_parent fsm; /* Our callback functions */
55 struct datalink *links; /* Our data links */
56
57 struct {
58 int idle_timeout; /* NCP Idle timeout value */

--- 23 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
52
53 unsigned CleaningUp : 1; /* Going to exit.... */
54
55 struct fsm_parent fsm; /* Our callback functions */
56 struct datalink *links; /* Our data links */
57
58 struct {
59 int idle_timeout; /* NCP Idle timeout value */

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

83 struct {
84 int fd; /* write status here */
85 } notify;
86};
87
88#define descriptor2bundle(d) \
89 ((d)->type == BUNDLE_DESCRIPTOR ? (struct bundle *)(d) : NULL)
90
90extern struct bundle *bundle_Create(const char *, struct prompt *);
91extern struct bundle *bundle_Create(const char *, struct prompt *, int);
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);
92extern void bundle_Destroy(struct bundle *);
93extern const char *bundle_PhaseName(struct bundle *);
94#define bundle_Phase(b) ((b)->phase)
95extern void bundle_NewPhase(struct bundle *, u_int);
96extern int bundle_LinkIsUp(const struct bundle *);
97extern void bundle_SetRoute(struct bundle *, int, struct in_addr,
98 struct in_addr, struct in_addr, int);
98extern void bundle_LinkLost(struct bundle *, struct link *, int);
99extern void bundle_LinkLost(struct bundle *, struct physical *, int);
99extern void bundle_Close(struct bundle *, const char *, int);
100extern void bundle_Close(struct bundle *, const char *, int);
100extern void bundle_Open(struct bundle *, const char *name);
101extern void bundle_Open(struct bundle *, const char *, int);
101extern void bundle_LinkClosed(struct bundle *, struct datalink *);
102
103extern int bundle_FillQueues(struct bundle *);
104extern int bundle_ShowLinks(struct cmdargs const *);
105extern void bundle_StartIdleTimer(struct bundle *);
106extern void bundle_SetIdleTimer(struct bundle *, int);
107extern void bundle_StopIdleTimer(struct bundle *);
108extern int bundle_RemainingIdleTime(struct bundle *);

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

117extern void bundle_DisplayPrompt(struct bundle *);
118extern void bundle_WriteTermPrompt(struct bundle *, struct datalink *,
119 const char *, int);
120extern void bundle_SetTtyCommandMode(struct bundle *, struct datalink *);
121
122extern void bundle_DatalinkClone(struct bundle *, struct datalink *,
123 const char *);
124extern void bundle_DatalinkRemove(struct bundle *, struct datalink *);
102extern void bundle_LinkClosed(struct bundle *, struct datalink *);
103
104extern int bundle_FillQueues(struct bundle *);
105extern int bundle_ShowLinks(struct cmdargs const *);
106extern void bundle_StartIdleTimer(struct bundle *);
107extern void bundle_SetIdleTimer(struct bundle *, int);
108extern void bundle_StopIdleTimer(struct bundle *);
109extern int bundle_RemainingIdleTime(struct bundle *);

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

118extern void bundle_DisplayPrompt(struct bundle *);
119extern void bundle_WriteTermPrompt(struct bundle *, struct datalink *,
120 const char *, int);
121extern void bundle_SetTtyCommandMode(struct bundle *, struct datalink *);
122
123extern void bundle_DatalinkClone(struct bundle *, struct datalink *,
124 const char *);
125extern void bundle_DatalinkRemove(struct bundle *, struct datalink *);
126extern void bundle_CleanDatalinks(struct bundle *);