Skip to content
Newer
Older
100644 167 lines (121 sloc) 5.35 KB
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
1 #ifndef _NETCFG_H_
2 #define _NETCFG_H_
3
4 #define INTERFACES_FILE "/etc/network/interfaces"
5 #define HOSTS_FILE "/etc/hosts"
30cfe11 @joeyh * Ming Hua
joeyh authored Dec 31, 2003
6 #define HOSTNAME_FILE "/etc/hostname"
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
7 #define NETWORKS_FILE "/etc/networks"
8 #define RESOLV_FILE "/etc/resolv.conf"
c2ba6b5 Really fix dhclient.conf path
Samuel Thibault authored Mar 4, 2011
9 #define DHCLIENT_CONF "/etc/dhclient.conf"
b6d0d51 get rid of this ugly di_system_prebaseconfig_append junk and replace …
Joshua Kwan authored May 30, 2004
10 #define DOMAIN_FILE "/tmp/domain_name"
233f20e * Request ntp-servers option from dhcp server and store in
Dann Frazier authored Oct 19, 2007
11 #define NTP_SERVER_FILE "/tmp/dhcp-ntp-servers"
f4272c7 @mpalmer Apply WPA patch from Glenn Saberton
mpalmer authored Jan 24, 2011
12 #define WPASUPP_CTRL "/var/run/wpa_supplicant"
13 #define WPAPID "/var/run/wpa_supplicant.pid"
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
14
9bafa98 move some #defines around, upload 0.68
Joshua Kwan authored Jun 6, 2004
15 #define DEVNAMES "/etc/network/devnames"
16 #define DEVHOTPLUG "/etc/network/devhotplug"
e08ebaf /var/run/stab is Linux PCMCIA specific; provide a stub implementation…
Luca Favatella authored Jul 20, 2009
17 #ifdef __linux__
43a19e3 stick /var/run/stab in a #define in netcfg.h just like all the other …
Joshua Kwan authored Jun 29, 2004
18 #define STAB "/var/run/stab"
e08ebaf /var/run/stab is Linux PCMCIA specific; provide a stub implementation…
Luca Favatella authored Jul 20, 2009
19 #endif
9bafa98 move some #defines around, upload 0.68
Joshua Kwan authored Jun 6, 2004
20
f4272c7 @mpalmer Apply WPA patch from Glenn Saberton
mpalmer authored Jan 24, 2011
21 #define WPA_MIN 8 /* minimum passphrase length */
22 #define WPA_MAX 64 /* maximum passphrase length */
23
6219896 - add new combined dhcp and static netcfg
Gaudenz Steinlin authored Dec 11, 2003
24 #define _GNU_SOURCE
25
7132d73 break out all support modules into dhcp.c, static.c, wireless.c
Joshua Kwan authored May 10, 2004
26 #include <sys/types.h>
27 #include <arpa/inet.h>
28 #include <stdio.h>
29 #include <cdebconf/debconfclient.h>
30
31 #ifndef ARRAY_SIZE
32 # define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
33 #endif
34
cde6328 Fix compilation warnings
Matt Palmer authored Jan 6, 2011
35 #define empty_str(s) (s != NULL && *s == '\0')
7132d73 break out all support modules into dhcp.c, static.c, wireless.c
Joshua Kwan authored May 10, 2004
36
9bafa98 move some #defines around, upload 0.68
Joshua Kwan authored Jun 6, 2004
37 #define HELPFUL_COMMENT \
38 "# This file describes the network interfaces available on your system\n" \
fe238be Clean up comments written to /etc/network/interfaces
Thomas Hood authored Jun 27, 2004
39 "# and how to activate them. For more information, see interfaces(5).\n"
9bafa98 move some #defines around, upload 0.68
Joshua Kwan authored Jun 6, 2004
40
41 #define IPV6_HOSTS \
42 "# The following lines are desirable for IPv6 capable hosts\n" \
b10a007 @otavio Don't duplicate localhost definition for IPv4 and IPv6. Closes: #595107.
otavio authored Sep 5, 2010
43 "::1 ip6-localhost ip6-loopback\n" \
9bafa98 move some #defines around, upload 0.68
Joshua Kwan authored Jun 6, 2004
44 "fe00::0 ip6-localnet\n" \
45 "ff00::0 ip6-mcastprefix\n" \
46 "ff02::1 ip6-allnodes\n" \
d62a2f5 @bubulle No longer add ff02::3 to /etc/hosts
bubulle authored Jun 18, 2009
47 "ff02::2 ip6-allrouters\n"
9bafa98 move some #defines around, upload 0.68
Joshua Kwan authored Jun 6, 2004
48
01b5860 @sorinasandu First patch, bug 610752.
authored Apr 16, 2012
49 /* The default time, in seconds, that we will wait for a link to be
50 * established via link autonegotiation.
145c337 @mpalmer Extend link detection time, with a progress bar. Closes: #414117
mpalmer authored Jan 22, 2011
51 */
52 #define NETCFG_LINK_WAIT_TIME 3
53
5fac642 @edmonds Wait for the network to be usable before trying to use it (in the cas…
edmonds authored Feb 20, 2011
54 /* The number of times to attempt to verify gateway reachability.
55 * Each try invokes arping with a one second timeout.
56 */
57 #define NETCFG_GATEWAY_REACHABILITY_TRIES 50
58
75be707 @mpalmer Extract out the '63' magic number into a global constant
mpalmer authored Jan 22, 2011
59 #ifndef MAXHOSTNAMELEN
60 #define MAXHOSTNAMELEN 63
61 #endif
62
f4272c7 @mpalmer Apply WPA patch from Glenn Saberton
mpalmer authored Jan 24, 2011
63 typedef enum { NOT_ASKED = 30, GO_BACK, REPLY_WEP, REPLY_WPA } response_t;
8e11356 fix case where MII ioctl's aren't supported on the device
Joshua Kwan authored May 7, 2004
64 typedef enum { DHCP, STATIC, DUNNO } method_t;
7132d73 break out all support modules into dhcp.c, static.c, wireless.c
Joshua Kwan authored May 10, 2004
65 typedef enum { ADHOC = 1, MANAGED = 2 } wifimode_t;
f4272c7 @mpalmer Apply WPA patch from Glenn Saberton
mpalmer authored Jan 24, 2011
66 extern enum wpa_t { WPA_OK, WPA_QUEUED, WPA_UNAVAIL } wpa_supplicant_status;
517f56e lots of nice fixes for #234412
Joshua Kwan [obsolete] authored Mar 17, 2004
67
a018b7f @joeyh * Claus Hindsgaul
joeyh authored Oct 17, 2003
68 extern int netcfg_progress_displayed;
735275d templates cleanup, add amd64, standardize socket opening
Joshua Kwan authored May 16, 2004
69 extern int wfd, skfd;
7897182 lots of fixes and cleanups that make mii-lite work 100%
Joshua Kwan authored May 9, 2004
70 extern int input_result;
7132d73 break out all support modules into dhcp.c, static.c, wireless.c
Joshua Kwan authored May 10, 2004
71 extern int have_domain;
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
72
6219896 - add new combined dhcp and static netcfg
Gaudenz Steinlin authored Dec 11, 2003
73 /* network config */
74 extern char *interface;
75 extern char *hostname;
76 extern char *dhcp_hostname;
77 extern char *domain;
f122fb7 Reinsert code changes done by Bastian Blank.
Petter Reinholdtsen authored Mar 14, 2004
78 extern struct in_addr ipaddress;
79 extern struct in_addr nameserver_array[4];
80 extern struct in_addr network;
81 extern struct in_addr broadcast;
82 extern struct in_addr netmask;
83 extern struct in_addr gateway;
84 extern struct in_addr pointopoint;
6219896 - add new combined dhcp and static netcfg
Gaudenz Steinlin authored Dec 11, 2003
85
7132d73 break out all support modules into dhcp.c, static.c, wireless.c
Joshua Kwan authored May 10, 2004
86 /* wireless */
f4272c7 @mpalmer Apply WPA patch from Glenn Saberton
mpalmer authored Jan 24, 2011
87 extern char *essid, *wepkey, *passphrase;
7132d73 break out all support modules into dhcp.c, static.c, wireless.c
Joshua Kwan authored May 10, 2004
88 extern wifimode_t mode;
89
6219896 - add new combined dhcp and static netcfg
Gaudenz Steinlin authored Dec 11, 2003
90 /* common functions */
fd21ef7 Detect ipw2100 and ipw2200 hardware kill switches, and warn the user if
Colin Watson authored May 13, 2005
91 extern int check_kill_switch (const char *iface);
92
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
93 extern int is_interface_up (char *inter);
94
95 extern void get_name (char *name, char *p);
96
c4d9f7d free memory, redesign th eloop abit
Joshua Kwan authored May 23, 2004
97 extern int get_all_ifs (int all, char ***ptr);
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
98
73ed21c Remove empty netcfg-ppp package, and do some i18n fixes
Martin Sjögren authored Sep 28, 2003
99 extern char *get_ifdsc (struct debconfclient *client, const char *ifp);
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
100
10ed940 Copy configuration to /target and make it work
Matt Kraai authored Jan 23, 2003
101 extern FILE *file_open (char *path, const char *opentype);
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
102
103 extern void netcfg_die (struct debconfclient *client);
104
33aeb71 If BOOTIF= is set on the Linux command line, look for an interface wi…
Colin Watson authored Jun 16, 2011
105 extern int netcfg_get_interface(struct debconfclient *client, char **interface, int *num_interfaces, const char *defif);
ae5883f Add missing prototype for netcfg_get_interface.
Denis Barbier authored Dec 3, 2002
106
a253f59 @mpalmer Tighten up the requirements around hostname validation
mpalmer authored Jan 22, 2011
107 extern short valid_hostname (const char *hname);
108 extern short valid_domain (const char *dname);
97b2e2a bugfixen
Joshua Kwan authored Jul 8, 2004
109
c240714 move kill_dhcp_client to dhcp.c, add DHCP_HOSTNAME handler
Joshua Kwan authored May 12, 2004
110 extern int netcfg_get_hostname(struct debconfclient *client, char *template, char **hostname, short hdset);
10ed940 Copy configuration to /target and make it work
Matt Kraai authored Jan 23, 2003
111
359c225 * Reworked state engine of netcfg-static to change order of
Gaudenz Steinlin authored Nov 13, 2003
112 extern int netcfg_get_nameservers (struct debconfclient *client, char **nameservers);
113
114 extern int netcfg_get_domain(struct debconfclient *client, char **domain);
8d42c43 Rework state machine so that we can goback via "goback" buttons.
Alastair McKinstry authored Nov 8, 2003
115
6219896 - add new combined dhcp and static netcfg
Gaudenz Steinlin authored Dec 11, 2003
116 extern int netcfg_get_static(struct debconfclient *client);
117
118 extern int netcfg_activate_dhcp(struct debconfclient *client);
119
c2fa8d7 finish up the code I did kinda halfway
Joshua Kwan authored Jan 1, 2005
120 extern int resolv_conf_entries (void);
121
b019e1e Have dhcp.c write out manually-configured resolv.conf info. Closes: #…
Matthew Palmer authored Jan 1, 2011
122 extern int read_resolv_conf_nameservers (struct in_addr array[]);
123
08a99c5 warn on no default route (needs testing)
Joshua Kwan authored Jun 28, 2004
124 extern int ask_dhcp_options (struct debconfclient *client);
6219896 - add new combined dhcp and static netcfg
Gaudenz Steinlin authored Dec 11, 2003
125 extern int netcfg_activate_static(struct debconfclient *client);
126
b6d0d51 get rid of this ugly di_system_prebaseconfig_append junk and replace …
Joshua Kwan authored May 30, 2004
127 extern void netcfg_write_loopback (void);
128 extern void netcfg_write_common (struct in_addr ipaddress, char *hostname,
3cf10c0 Restore the domain argument to netcfg_write_common.
Matt Kraai authored Dec 30, 2003
129 char *domain);
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
130
f122fb7 Reinsert code changes done by Bastian Blank.
Petter Reinholdtsen authored Mar 14, 2004
131 void netcfg_nameservers_to_array(char *nameservers, struct in_addr array[]);
aba0cb9 I was handling the debconf substitution wrong, the result of splittin…
David Whedon authored Jan 18, 2001
132
a4a0987 Commit initial wireless configurator support. Probably doesn't work too
Joshua Kwan [obsolete] authored Feb 23, 2004
133 extern int is_wireless_iface (const char* iface);
45d0da7 add a priority override arg to set_essid so that 'reconfigure the wir…
Joshua Kwan authored May 16, 2004
134 extern int netcfg_wireless_set_essid (struct debconfclient *client, char* iface, char* priority);
a4a0987 Commit initial wireless configurator support. Probably doesn't work too
Joshua Kwan [obsolete] authored Feb 23, 2004
135 extern int netcfg_wireless_set_wep (struct debconfclient *client, char* iface);
f4272c7 @mpalmer Apply WPA patch from Glenn Saberton
mpalmer authored Jan 24, 2011
136 extern int wireless_security_type (struct debconfclient *client, char* iface);
137 extern int netcfg_set_passphrase (struct debconfclient *client, char* iface);
138 extern int init_wpa_supplicant_support (void);
139 extern int kill_wpa_supplicant (void);
a4a0987 Commit initial wireless configurator support. Probably doesn't work too
Joshua Kwan [obsolete] authored Feb 23, 2004
140
f4272c7 @mpalmer Apply WPA patch from Glenn Saberton
mpalmer authored Jan 24, 2011
141 extern int wpa_supplicant_start (struct debconfclient *client, char *iface, char *ssid, char *passphrase);
7132d73 break out all support modules into dhcp.c, static.c, wireless.c
Joshua Kwan authored May 10, 2004
142 extern int iface_is_hotpluggable(const char *iface);
c55a9fa don't add auto OR hotplug lines for PCMCIA devices
Joshua Kwan authored Jun 29, 2004
143 extern short find_in_stab (const char *iface);
785ccd4 no longer invoke ifconfig for simple up/down operations. make ifconfi…
Joshua Kwan authored May 15, 2004
144 extern void deconfigure_network(void);
7132d73 break out all support modules into dhcp.c, static.c, wireless.c
Joshua Kwan authored May 10, 2004
145
70f29e2 land tested iproute changes
Joshua Kwan authored May 15, 2004
146 extern void interface_up (char*);
147 extern void interface_down (char*);
7897182 lots of fixes and cleanups that make mii-lite work 100%
Joshua Kwan authored May 9, 2004
148
d8caf65 giant amounts of work in progress. DO NOT UPLOAD
Joshua Kwan authored May 12, 2004
149 extern void loop_setup(void);
24a1c32 fix seed_hostname_from_dns for DHCP. static is a hairier issue which …
Joshua Kwan authored May 15, 2004
150 extern void seed_hostname_from_dns(struct debconfclient *client, struct in_addr * ipaddress);
d8caf65 giant amounts of work in progress. DO NOT UPLOAD
Joshua Kwan authored May 12, 2004
151
70f29e2 land tested iproute changes
Joshua Kwan authored May 15, 2004
152 extern int inet_ptom (const char *src, int *dst, struct in_addr * addrp);
153 extern const char *inet_mtop (int src, char *dst, socklen_t cnt);
b6d0d51 get rid of this ugly di_system_prebaseconfig_append junk and replace …
Joshua Kwan authored May 30, 2004
154
70f29e2 land tested iproute changes
Joshua Kwan authored May 15, 2004
155 extern void parse_args (int argc, char** argv);
735275d templates cleanup, add amd64, standardize socket opening
Joshua Kwan authored May 16, 2004
156 extern void open_sockets (void);
b6d0d51 get rid of this ugly di_system_prebaseconfig_append junk and replace …
Joshua Kwan authored May 30, 2004
157 extern void reap_old_files (void);
70f29e2 land tested iproute changes
Joshua Kwan authored May 15, 2004
158
3419850 On Linux, feed the output of 'ip addr show' into /dev/random after the
Colin Watson authored Aug 10, 2009
159 extern void netcfg_update_entropy (void);
160
b7d7fb4 - remove mii-diag support
Joshua Kwan authored Sep 1, 2004
161 extern int netcfg_write_resolv (char*, struct in_addr *);
1e41354 apply Andrew's WEP patch, readd mii-diag as ethtool-lite
Joshua Kwan authored Sep 13, 2004
162
145c337 @mpalmer Extend link detection time, with a progress bar. Closes: #414117
mpalmer authored Jan 21, 2011
163 extern int ethtool_lite (const char *if_name);
164 extern int netcfg_detect_link(struct debconfclient *client, const char *if_name);
1e41354 apply Andrew's WEP patch, readd mii-diag as ethtool-lite
Joshua Kwan authored Sep 13, 2004
165
8063172 broke dhcp and static cfg's into different modules so we can share
David Whedon authored Jan 12, 2001
166 #endif /* _NETCFG_H_ */
Something went wrong with that request. Please try again.