Merged revisions 11610-11649 via svnmerge from
[wvapps.git] / wvdial / wvdialmon.h
blob63e6dc84c340382ef892f4c8317853df84e357ca
3 // copyright: (C) 2000 by SuSE GmbH
4 // author: arvin@suse.de
5 // WvStreamsified by Patrick Patterson <ppatters@nit.ca>
7 #ifndef __WVDIALMON_H
8 #define __WVDIALMON_H
11 #include <stdio.h>
12 #include <unistd.h>
13 #include <stdlib.h>
14 #include <errno.h>
15 #include <string.h>
16 #include <regex.h>
18 #include "wvbuf.h"
19 #include "wvstring.h"
20 #include "wvlog.h"
21 #include "strutils.h"
23 class WvDialMon
26 public:
28 WvDialMon ();
29 ~WvDialMon ();
31 // void setexec( const WvString name ) { executename = name; };
32 void setconnectmsg( WvStringParm name ) { connectmsg = name; };
34 void setdnstests (WvString, WvString);
35 void setcheckdns (int flag) { do_check_dns = flag; }
36 void setcheckdfr (int flag) { do_check_dfr = flag; }
38 void reset();
40 // the returned buffer is only valid until the next call
41 char* analyse_line( const char *line );
43 const int auth_failed();
45 private:
47 // name of program to execute after successful connection
48 // WvString executename;
49 //
50 // message to display after connection has been setup
51 WvString connectmsg;
53 // time to wait before launch of executename
54 // int usleep_time;
55 //
56 // regex to match `status = '
57 regex_t rx_status;
59 // regex to match quoted (not empty) text
60 regex_t rx_quote;
63 WvLog log;
64 WvLog err;
66 WvString buffer;
68 int get_quotedtext(char *dest, const char *line);
70 // flag
71 int _auth_failed;
73 // check defaultroute stuff
74 //
75 int do_check_dfr;
76 int check_dfr();
78 int kernel_version;
79 FILE *route_fd;
80 char route_buffer[512];
81 int route_dev_col, route_dest_col, route_gw_col;
82 int route_flags_col, route_mask_col;
83 int route_num_cols;
85 int open_route_table ();
86 void close_route_table ();
87 int read_route_table (struct rtentry *rt);
88 int defaultroute_exists (struct rtentry *rt);
90 // check DNS stuff
91 //
92 int do_check_dns;
93 int check_dns();
95 WvString dnstest1, dnstest2;
97 int check_dns_name( const char *name );
98 regex_t rx_namesrv;
103 #endif // __WVDIALMON_H