-
Notifications
You must be signed in to change notification settings - Fork 3
/
ifchd.h
54 lines (45 loc) · 1.23 KB
/
ifchd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2018 Nicholas J. Kain <njkain at gmail dot com>
// SPDX-License-Identifier: MIT
#ifndef NJK_IFCHD_H_
#define NJK_IFCHD_H_
#include <limits.h>
#include "ndhc-defines.h"
enum ifchd_states {
STATE_NOTHING,
STATE_IP4SET,
STATE_TIMEZONE,
STATE_ROUTER,
STATE_DNS,
STATE_LPRSVR,
STATE_HOSTNAME,
STATE_DOMAIN,
STATE_IPTTL,
STATE_MTU,
STATE_NTPSVR,
STATE_WINS,
STATE_CARRIER,
};
#include <net/if.h>
struct ifchd_client {
/* Socket fd, current state, and idle time for connection. */
int state;
/* Per-connection buffer. */
char ibuf[MAX_BUF];
/* ' '-delimited buffers of nameservers and domains */
char namesvrs[MAX_BUF];
char domains[MAX_BUF];
};
extern struct ifchd_client cl;
extern int allow_hostname;
extern uid_t ifch_uid;
extern gid_t ifch_gid;
int perform_timezone(const char *str, size_t len);
int perform_dns(const char *str, size_t len);
int perform_lprsvr(const char *str, size_t len);
int perform_hostname(const char *str, size_t len);
int perform_domain(const char *str, size_t len);
int perform_ipttl(const char *str, size_t len);
int perform_ntpsrv(const char *str, size_t len);
int perform_wins(const char *str, size_t len);
void ifch_main(void);
#endif