]>
Commit | Line | Data |
---|---|---|
b4e381a8 MT |
1 | /* SmoothWall libsmooth. |
2 | * | |
3 | * This program is distributed under the terms of the GNU General Public | |
4 | * Licence. See the file COPYING for details. | |
5 | * | |
6 | * (c) Lawrence Manning, 2001 | |
7 | * Contains prototypes for library functions. | |
8 | * | |
b4e381a8 MT |
9 | */ |
10 | ||
11 | #ifndef ___LIBSMOOTH_H | |
12 | #define ___LIBSMOOTH_H | |
13 | ||
14 | #include <stdio.h> | |
15 | #include <stdlib.h> | |
16 | #include <string.h> | |
17 | #include <ctype.h> | |
18 | #include <wchar.h> | |
19 | #include <locale.h> | |
20 | #include <unistd.h> | |
21 | #include <sys/file.h> | |
22 | #include <sys/types.h> | |
23 | #include <sys/stat.h> | |
24 | #include <fcntl.h> | |
25 | #include <newt.h> | |
26 | #include <dirent.h> | |
27 | #include <sys/mount.h> | |
28 | ||
29 | #include <sys/socket.h> | |
30 | #include <netinet/in.h> | |
31 | #include <arpa/inet.h> | |
32 | ||
33 | #include <linux/cdrom.h> | |
34 | #include <sys/ioctl.h> | |
35 | ||
36 | #include "langs.h" | |
37 | ||
38 | #define STRING_SIZE 1023 | |
39 | ||
40 | #define ADDRESS 0 | |
41 | #define NETADDRESS 1 | |
42 | #define NETMASK 2 | |
43 | #define DHCP 3 | |
44 | #define NETCHANGE_TOTAL 4 | |
45 | ||
75ae2191 MT |
46 | #define SCANNED_NICS "/var/ipfire/ethernet/scanned_nics" |
47 | ||
5057b611 HS |
48 | #define _GREEN_CARD_ 0 |
49 | #define _RED_CARD_ 1 | |
50 | #define _ORANGE_CARD_ 2 | |
51 | #define _BLUE_CARD_ 3 | |
52 | ||
b4e381a8 MT |
53 | struct keyvalue |
54 | { | |
55 | char key[STRING_SIZE]; | |
56 | char value[STRING_SIZE]; | |
57 | struct keyvalue *next; | |
58 | }; | |
b4e381a8 MT |
59 | struct nic |
60 | { | |
f9cc0d70 | 61 | char driver[80]; |
75ae2191 MT |
62 | char description[256]; |
63 | char macaddr[20]; | |
b4e381a8 | 64 | }; |
5057b611 | 65 | |
75ae2191 | 66 | struct knic |
b4e381a8 | 67 | { |
f9cc0d70 | 68 | char driver[80]; |
75ae2191 MT |
69 | char description[256]; |
70 | char macaddr[20]; | |
5057b611 | 71 | char colour[20]; |
b4e381a8 MT |
72 | }; |
73 | ||
5057b611 | 74 | |
b4e381a8 MT |
75 | /* libsmooth.c */ |
76 | void reboot(void); | |
77 | void stripnl(char *s); | |
78 | int mysystem(char *command); | |
79 | void errorbox(char *message); | |
80 | void statuswindow(int width, int height, char *title, char *text, ...); | |
81 | int runcommandwithprogress(int width, int height, char *title, char *command, | |
82 | int lines, char *text, ...); | |
83 | int runcommandwithstatus(char *command, char *message); | |
84 | int runhiddencommandwithstatus(char *command, char *message); | |
85 | int checkformodule(char *module); | |
86 | int replace(char filename1[], char *from, char *to); | |
87 | char* get_version(void); | |
88 | ||
89 | /* netstuff.c */ | |
90 | int changeaddress(struct keyvalue *kv, char *colour, int typeflag, | |
91 | char *defaultdhcphostname); | |
92 | int gettype(char *type); | |
93 | int setnetaddress(struct keyvalue *kv, char *colour); | |
94 | void networkdialogcallbacktype(newtComponent cm, void *data); | |
95 | int interfacecheck(struct keyvalue *kv, char *colour); | |
9c1c1c57 | 96 | int init_knics(void); |
84e975ba | 97 | int create_udev(void); |
5057b611 | 98 | int scan_network_cards(void); |
9b040aa0 HS |
99 | int nicmenu(int colour); |
100 | int clear_card_entry(int cards); | |
101 | int ask_clear_card_entry(int cards); | |
b4e381a8 | 102 | int manualdriver(char *driver, char *driveroptions); |
b4e381a8 | 103 | |
d10e55d1 | 104 | /* varval.c */ |
b4e381a8 MT |
105 | struct keyvalue *initkeyvalues(void); |
106 | void freekeyvalues(struct keyvalue *head); | |
107 | int readkeyvalues(struct keyvalue *head, char *filename); | |
108 | int writekeyvalues(struct keyvalue *head, char *filename); | |
109 | int findkey(struct keyvalue *head, char *key, char *value); | |
110 | void appendkeyvalue(struct keyvalue *head, char *key, char *value); | |
111 | void replacekeyvalue(struct keyvalue *head, char *key, char *value); | |
112 | ||
113 | #endif | |
114 |