Remove support for RFC868 Time Server options. Totally obsolete, and

ifchd just had empty hooks that never received work messages anyway.

Shorten the names of ifchd commands.  This breaks wire protocol, but
thankfully I haven't released yet!
This commit is contained in:
Nicholas J. Kain 2011-07-25 03:39:17 -04:00
parent 544a837944
commit 8caf9e7d7a
5 changed files with 20 additions and 36 deletions

19
ifchd/ifch_proto.h Normal file
View File

@ -0,0 +1,19 @@
#ifndef NJK_IFCH_PROTO_H__
#define NJK_IFCH_PROTO_H__ 1
#define CMD_INTERFACE "iface"
#define CMD_IP "ip"
#define CMD_SUBNET "snet"
#define CMD_TIMEZONE "tzone"
#define CMD_ROUTER "routr"
#define CMD_DNS "dns"
#define CMD_LPRSVR "lpr"
#define CMD_HOSTNAME "host"
#define CMD_DOMAIN "dom"
#define CMD_IPTTL "ipttl"
#define CMD_MTU "mtu"
#define CMD_BROADCAST "bcast"
#define CMD_NTPSVR "ntp"
#define CMD_WINS "wins"
#endif

View File

@ -68,7 +68,6 @@ enum states {
STATE_SUBNET,
STATE_TIMEZONE,
STATE_ROUTER,
STATE_TIMESVR,
STATE_DNS,
STATE_LPRSVR,
STATE_HOSTNAME,
@ -246,10 +245,6 @@ static void parse_list(int idx, char *str, strlist_t **toplist,
static void perform_timezone(int idx, char *str)
{}
/* Does anyone use this command? */
static void perform_timesvr(int idx, char *str)
{}
/* Add a dns server to the /etc/resolv.conf -- we already have a fd. */
static void perform_dns(int idx, char *str)
{
@ -403,8 +398,6 @@ static void execute_list(int i)
state[i] = STATE_TIMEZONE;
if (strncmp(p, CMD_ROUTER, sizeof(CMD_ROUTER)) == 0)
state[i] = STATE_ROUTER;
if (strncmp(p, CMD_TIMESVR, sizeof(CMD_TIMESVR)) == 0)
state[i] = STATE_TIMESVR;
if (strncmp(p, CMD_DNS, sizeof(CMD_DNS)) == 0)
state[i] = STATE_DNS;
if (strncmp(p, CMD_LPRSVR, sizeof(CMD_LPRSVR)) == 0)
@ -456,12 +449,6 @@ static void execute_list(int i)
state[i] = STATE_NOTHING;
break;
case STATE_TIMESVR:
perform_timesvr(i, p);
free_stritem(&(curl[i]));
state[i] = STATE_NOTHING;
break;
case STATE_DNS:
perform_dns(i, p);
free_stritem(&(curl[i]));

View File

@ -1,20 +0,0 @@
#ifndef NJK_IFPROTO_H__
#define NJK_IFPROTO_H__ 1
#define CMD_INTERFACE "interface"
#define CMD_IP "ip"
#define CMD_SUBNET "subnet"
#define CMD_TIMEZONE "timezone"
#define CMD_ROUTER "router"
#define CMD_TIMESVR "timesvr"
#define CMD_DNS "dns"
#define CMD_LPRSVR "lprsvr"
#define CMD_HOSTNAME "hostname"
#define CMD_DOMAIN "domain"
#define CMD_IPTTL "ipttl"
#define CMD_MTU "mtu"
#define CMD_BROADCAST "broadcast"
#define CMD_NTPSRV "ntpsrv"
#define CMD_WINS "wins"
#endif

View File

@ -37,7 +37,7 @@
struct dhcp_option {
uint8_t code;
uint8_t type;
char name[10];
char name[6];
};
#define DCODE_PADDING 0x00
@ -57,7 +57,6 @@ static const struct dhcp_option options[] = {
{DCODE_SUBNET , OPTION_IP | OPTION_LIST | OPTION_REQ, CMD_SUBNET },
{DCODE_TIMEZONE , OPTION_S32, CMD_TIMEZONE },
{DCODE_ROUTER , OPTION_IP | OPTION_REQ, CMD_ROUTER },
{DCODE_TIMESVR , OPTION_IP | OPTION_LIST, CMD_TIMESVR },
{DCODE_DNS , OPTION_IP | OPTION_LIST | OPTION_REQ, CMD_DNS },
{DCODE_LPRSVR , OPTION_IP | OPTION_LIST, CMD_LPRSVR },
{DCODE_HOSTNAME , OPTION_STRING | OPTION_REQ, CMD_HOSTNAME },

View File

@ -33,7 +33,6 @@
#define DCODE_SUBNET 0x01
#define DCODE_TIMEZONE 0x02
#define DCODE_ROUTER 0x03
#define DCODE_TIMESVR 0x04
#define DCODE_DNS 0x06
#define DCODE_LPRSVR 0x09
#define DCODE_HOSTNAME 0x0c