#define PHASE_DEAD 0
#define PHASE_ESTABLISH 1
#define PHASE_AUTHENTICATE 2
#define PHASE_NETWORK 3
#define PHASE_TERMINATE 4
#define OPT_FILTERDECAP 1
#define OPT_FORCE_SCRIPTS 2
#define OPT_IDCHECK 3
#define OPT_IFACEALIAS 4
#ifndef NOINET6
#define OPT_IPCP 5
#define OPT_IPV6CP 6
#endif
#define OPT_KEEPSESSION 7
#define OPT_LOOPBACK 8
#define OPT_NAS_IP_ADDRESS 9
#define OPT_NAS_IDENTIFIER 10
#define OPT_PASSWDAUTH 11
#define OPT_PROXY 12
#define OPT_PROXYALL 13
#define OPT_SROUTES 14
#define OPT_TCPMSSFIXUP 15
#define OPT_THROUGHPUT 16
#define OPT_UTMP 17
#define OPT_MAX 17
#define MAX_ENDDISC_CLASS 5
#define Enabled(b, o) ((b)->cfg.optmask & (1ull << (o)))
#define opt_enable(b, o) ((b)->cfg.optmask |= (1ull << (o)))
#define opt_disable(b, o) ((b)->cfg.optmask &= ~(1ull << (o)))
#define AUTO_UP 1
#define AUTO_DOWN 2
struct sockaddr_un;
struct datalink;
struct physical;
struct link;
struct server;
struct prompt;
struct iface;
struct bundle {
struct fdescriptor desc;
int unit;
struct {
char Name[20];
int fd;
unsigned header : 1;
} dev;
u_long bandwidth;
struct iface *iface;
int routing_seq;
u_int phase;
struct {
int all;
int open;
} phys_type;
unsigned CleaningUp : 1;
unsigned NatEnabled : 1;
struct fsm_parent fsm;
struct datalink *links;
time_t upat;
struct {
struct {
unsigned timeout;
unsigned min_timeout;
} idle;
struct {
char name[AUTHLEN];
char key[AUTHLEN];
} auth;
unsigned long long optmask;
char label[50];
u_short ifqueue;
struct {
unsigned timeout;
} choked;
} cfg;
struct ncp ncp;
struct {
struct filter in;
struct filter out;
struct filter dial;
struct filter alive;
} filter;
struct {
struct pppTimer timer;
time_t done;
} idle;
#ifndef NORADIUS
struct {
struct pppTimer timer;
time_t done;
} session;
#endif
struct {
int fd;
} notify;
struct {
struct pppTimer timer;
} choked;
#ifndef NORADIUS
struct radius radius;
struct radacct radacct;
#ifndef NOINET6
struct radacct radacct6;
#endif
#endif
};
#define descriptor2bundle(d) \
((d)->type == BUNDLE_DESCRIPTOR ? (struct bundle *)(d) : NULL)
extern struct bundle *bundle_Create(const char *, int, int);
extern void bundle_Destroy(struct bundle *);
extern const char *bundle_PhaseName(struct bundle *);
#define bundle_Phase(b) ((b)->phase)
extern void bundle_NewPhase(struct bundle *, u_int);
extern void bundle_LinksRemoved(struct bundle *);
extern void bundle_Close(struct bundle *, const char *, int);
extern void bundle_Down(struct bundle *, int);
extern void bundle_Open(struct bundle *, const char *, int, int);
extern void bundle_LinkClosed(struct bundle *, struct datalink *);
extern int bundle_ShowLinks(struct cmdargs const *);
extern int bundle_ShowStatus(struct cmdargs const *);
extern void bundle_StartIdleTimer(struct bundle *, unsigned secs);
extern void bundle_SetIdleTimer(struct bundle *, unsigned, unsigned);
extern void bundle_StopIdleTimer(struct bundle *);
extern int bundle_IsDead(struct bundle *);
extern struct datalink *bundle2datalink(struct bundle *, const char *);
#ifndef NORADIUS
extern void bundle_StartSessionTimer(struct bundle *, unsigned secs);
extern void bundle_StopSessionTimer(struct bundle *);
#endif
extern void bundle_RegisterDescriptor(struct bundle *, struct fdescriptor *);
extern void bundle_UnRegisterDescriptor(struct bundle *, struct fdescriptor *);
extern void bundle_SetTtyCommandMode(struct bundle *, struct datalink *);
extern int bundle_DatalinkClone(struct bundle *, struct datalink *,
const char *);
extern void bundle_DatalinkRemove(struct bundle *, struct datalink *);
extern void bundle_CleanDatalinks(struct bundle *);
extern void bundle_SetLabel(struct bundle *, const char *);
extern const char *bundle_GetLabel(struct bundle *);
extern void bundle_SendDatalink(struct datalink *, int, struct sockaddr_un *);
extern int bundle_LinkSize(void);
extern void bundle_ReceiveDatalink(struct bundle *, int);
extern int bundle_SetMode(struct bundle *, struct datalink *, int);
extern int bundle_RenameDatalink(struct bundle *, struct datalink *,
const char *);
extern void bundle_setsid(struct bundle *, int);
extern void bundle_LockTun(struct bundle *);
extern unsigned bundle_HighestState(struct bundle *);
extern int bundle_Exception(struct bundle *, int);
extern void bundle_AdjustFilters(struct bundle *, struct ncpaddr *,
struct ncpaddr *);
extern void bundle_AdjustDNS(struct bundle *);
extern void bundle_CalculateBandwidth(struct bundle *);
extern void bundle_AutoAdjust(struct bundle *, int, int);
extern int bundle_WantAutoloadTimer(struct bundle *);
extern void bundle_ChangedPID(struct bundle *);
extern void bundle_Notify(struct bundle *, char);
extern int bundle_Uptime(struct bundle *);