~ubuntu-branches/ubuntu/wily/dhcpcd5/wily-proposed

« back to all changes in this revision

Viewing changes to if-options.h

  • Committer: Package Import Robot
  • Author(s): Daniel Echeverry
  • Date: 2015-06-03 10:43:23 UTC
  • mfrom: (7.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20150603104323-74htea00somdput9
Tags: 6.9.0-1
* QA Upload
* New upstream release. Closes: #786772, #758713, #782085, #788693
* debian/control
  + Use Replaces instead Conflicts field
  + Bump Standards-Version 3.9.6
    + Update to DEP5 copyright format 1.0
* debian/rules
  + Add DEB_HOST_GNU_TYPE and DEB_BUILD_GNU_TYPE
* debian/patches
  + Add fix_ftbfs_kfreebsd.diff patch
    + Fix ftbfs on kfreebsd Closes: #770464
  + Add fix_manpage.diff patch
    * Fix lintian warning
  + Remove CVE-2014-6060.patch patch
    + Merge with upstream
  + Remove kfreebsd.diff patch
    * Upstream removed platform-bsd.c file in new version
* debian/prerm
  + Replace bashim with set -e
* debian/postint
  + Replace bashim with set -e
* debian/postrm
  + Replace bashim with set -e

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * dhcpcd - DHCP client daemon
3
 
 * Copyright (c) 2006-2013 Roy Marples <roy@marples.name>
 
3
 * Copyright (c) 2006-2015 Roy Marples <roy@marples.name>
4
4
 * All rights reserved
5
5
 
6
6
 * Redistribution and use in source and binary forms, with or without
28
28
#ifndef IF_OPTIONS_H
29
29
#define IF_OPTIONS_H
30
30
 
 
31
#include <sys/param.h>
31
32
#include <sys/socket.h>
32
33
#include <net/if.h>
33
34
#include <netinet/in.h>
36
37
#include <limits.h>
37
38
#include <stdint.h>
38
39
 
39
 
#include "ipv4.h"
 
40
#include "auth.h"
40
41
 
41
42
/* Don't set any optional arguments here so we retain POSIX
42
43
 * compatibility with getopt */
43
 
#define IF_OPTS "46bc:de:f:gh:i:kl:m:no:pqr:s:t:u:v:wxy:z:ABC:DEF:GHI:JKLO:Q:S:TUVW:X:Z:"
 
44
#define IF_OPTS "46bc:de:f:gh:i:j:kl:m:no:pqr:s:t:u:v:wxy:z:" \
 
45
                "ABC:DEF:GHI:JKLMO:Q:S:TUVW:X:Z:"
44
46
 
45
47
#define DEFAULT_TIMEOUT         30
46
48
#define DEFAULT_REBOOT          5
75
77
#define DHCPCD_QUIET                    (1ULL << 21)
76
78
#define DHCPCD_BACKGROUND               (1ULL << 22)
77
79
#define DHCPCD_VENDORRAW                (1ULL << 23)
78
 
#define DHCPCD_TIMEOUT_IPV4LL           (1ULL << 24)
 
80
#define DHCPCD_NOWAITIP                 (1ULL << 24) /* To force daemonise */
79
81
#define DHCPCD_WAITIP                   (1ULL << 25)
80
 
#define DHCPCD_WAITUP                   (1ULL << 26)
 
82
#define DHCPCD_SLAACPRIVATE             (1ULL << 26)
81
83
#define DHCPCD_CSR_WARNED               (1ULL << 27)
82
84
#define DHCPCD_XID_HWADDR               (1ULL << 28)
83
85
#define DHCPCD_BROADCAST                (1ULL << 29)
95
97
#define DHCPCD_STOPPING                 (1ULL << 41)
96
98
#define DHCPCD_DEPARTED                 (1ULL << 42)
97
99
#define DHCPCD_HOSTNAME_SHORT           (1ULL << 43)
 
100
#define DHCPCD_EXITING                  (1ULL << 44)
 
101
#define DHCPCD_WAITIP4                  (1ULL << 45)
 
102
#define DHCPCD_WAITIP6                  (1ULL << 46)
 
103
#define DHCPCD_DEV                      (1ULL << 47)
 
104
#define DHCPCD_IAID                     (1ULL << 48)
 
105
#define DHCPCD_DHCP                     (1ULL << 49)
 
106
#define DHCPCD_DHCP6                    (1ULL << 50)
 
107
#define DHCPCD_NOPFXDLG                 (1ULL << 51)
 
108
#define DHCPCD_PFXDLGONLY               (1ULL << 52)
 
109
#define DHCPCD_PFXDLGMIX                (1ULL << 53)
 
110
#define DHCPCD_IPV6RA_AUTOCONF          (1ULL << 54)
 
111
#define DHCPCD_ROUTER_HOST_ROUTE_WARNED (1ULL << 55)
 
112
#define DHCPCD_IPV6RA_ACCEPT_NOPUBLIC   (1ULL << 56)
 
113
#define DHCPCD_BOOTP                    (1ULL << 57)
 
114
 
 
115
#define DHCPCD_WAITOPTS (DHCPCD_WAITIP | DHCPCD_WAITIP4 | DHCPCD_WAITIP6)
 
116
 
 
117
#define DHCPCD_WARNINGS (DHCPCD_CSR_WARNED | \
 
118
                DHCPCD_ROUTER_HOST_ROUTE_WARNED)
 
119
#define DHCPCD_CONF (DHCPCD_NOPFXDLG | DHCPCD_PFXDLGONLY)
98
120
 
99
121
extern const struct option cf_options[];
100
122
 
101
123
struct if_sla {
102
124
        char ifname[IF_NAMESIZE];
103
125
        uint32_t sla;
104
 
        short prefix_len;
 
126
        uint8_t prefix_len;
105
127
        int8_t sla_set;
106
128
};
107
129
 
108
 
struct if_iaid {
 
130
struct if_ia {
109
131
        uint8_t iaid[4];
 
132
#ifdef INET6
 
133
        uint16_t ia_type;
 
134
        uint8_t iaid_set;
 
135
        struct in6_addr addr;
 
136
        uint8_t prefix_len;
 
137
        uint32_t sla_max;
110
138
        size_t sla_len;
111
139
        struct if_sla *sla;
 
140
#endif
 
141
};
 
142
 
 
143
struct vivco {
 
144
        size_t len;
 
145
        uint8_t *data;
112
146
};
113
147
 
114
148
struct if_options {
 
149
        time_t mtime;
 
150
        uint8_t iaid[4];
115
151
        int metric;
116
 
        uint8_t requestmask[256 / 8];
117
 
        uint8_t requiremask[256 / 8];
118
 
        uint8_t nomask[256 / 8];
119
 
        uint8_t requestmask6[(UINT16_MAX + 1) / 8];
120
 
        uint8_t requiremask6[(UINT16_MAX + 1) / 8];
121
 
        uint8_t nomask6[(UINT16_MAX + 1) / 8];
122
 
        uint8_t dstmask[256 / 8];
 
152
        uint8_t requestmask[256 / NBBY];
 
153
        uint8_t requiremask[256 / NBBY];
 
154
        uint8_t nomask[256 / NBBY];
 
155
        uint8_t rejectmask[256 / NBBY];
 
156
        uint8_t dstmask[256 / NBBY];
 
157
        uint8_t requestmasknd[(UINT16_MAX + 1) / NBBY];
 
158
        uint8_t requiremasknd[(UINT16_MAX + 1) / NBBY];
 
159
        uint8_t nomasknd[(UINT16_MAX + 1) / NBBY];
 
160
        uint8_t rejectmasknd[(UINT16_MAX + 1) / NBBY];
 
161
        uint8_t requestmask6[(UINT16_MAX + 1) / NBBY];
 
162
        uint8_t requiremask6[(UINT16_MAX + 1) / NBBY];
 
163
        uint8_t nomask6[(UINT16_MAX + 1) / NBBY];
 
164
        uint8_t rejectmask6[(UINT16_MAX + 1) / NBBY];
123
165
        uint32_t leasetime;
124
166
        time_t timeout;
125
167
        time_t reboot;
131
173
        char **config;
132
174
 
133
175
        char **environ;
134
 
        char script[PATH_MAX];
 
176
        char *script;
135
177
 
136
178
        char hostname[HOSTNAME_MAX_LEN + 1]; /* We don't store the length */
137
 
        int fqdn;
 
179
        uint8_t fqdn;
138
180
        uint8_t vendorclassid[VENDORCLASSID_MAX_LEN + 2];
139
 
        char clientid[CLIENTID_MAX_LEN + 2];
 
181
        uint8_t clientid[CLIENTID_MAX_LEN + 2];
140
182
        uint8_t userclass[USERCLASS_MAX_LEN + 2];
141
183
        uint8_t vendor[VENDOR_MAX_LEN + 2];
142
184
 
148
190
        in_addr_t *arping;
149
191
        char *fallback;
150
192
 
151
 
#ifdef INET6
152
 
        uint16_t ia_type;
153
 
        size_t iaid_len;
154
 
        struct if_iaid *iaid;
155
 
        int dadtransmits;
156
 
#endif
 
193
        struct if_ia *ia;
 
194
        size_t ia_len;
 
195
 
 
196
        struct dhcp_opt *dhcp_override;
 
197
        size_t dhcp_override_len;
 
198
        struct dhcp_opt *nd_override;
 
199
        size_t nd_override_len;
 
200
        struct dhcp_opt *dhcp6_override;
 
201
        size_t dhcp6_override_len;
 
202
        uint32_t vivco_en;
 
203
        struct vivco *vivco;
 
204
        size_t vivco_len;
 
205
        struct dhcp_opt *vivso_override;
 
206
        size_t vivso_override_len;
 
207
 
 
208
        struct auth auth;
157
209
};
158
210
 
159
 
extern unsigned long long options;
160
 
 
161
 
struct if_options *read_config(const char *,
 
211
struct if_options *read_config(struct dhcpcd_ctx *,
162
212
    const char *, const char *, const char *);
163
 
int add_options(struct if_options *, int, char **);
 
213
int add_options(struct dhcpcd_ctx *, const char *,
 
214
    struct if_options *, int, char **);
 
215
void free_dhcp_opt_embenc(struct dhcp_opt *);
164
216
void free_options(struct if_options *);
165
217
 
166
218
#endif