Move vlan(4) syntax from ifconfig.c into vlan.c.

This commit is contained in:
dyoung 2008-05-07 20:11:15 +00:00
parent 8bc06077c3
commit 48fa574a64
3 changed files with 21 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ifconfig.c,v 1.196 2008/05/07 20:03:27 dyoung Exp $ */
/* $NetBSD: ifconfig.c,v 1.197 2008/05/07 20:11:15 dyoung Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -69,7 +69,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
__RCSID("$NetBSD: ifconfig.c,v 1.196 2008/05/07 20:03:27 dyoung Exp $");
__RCSID("$NetBSD: ifconfig.c,v 1.197 2008/05/07 20:11:15 dyoung Exp $");
#endif
#endif /* not lint */
@ -317,11 +317,6 @@ struct kwinst misckw[] = {
, {.k_word = "prefixlen", .k_nextparser = &parse_prefixlen.pi_parser}
, {.k_word = "trailers", .k_neg = true,
.k_exec = notrailers, .k_nextparser = &command_root.pb_parser}
, {.k_word = "vlan", .k_nextparser = &vlan.pi_parser}
, {.k_word = "vlanif", .k_act = "vlan",
.k_nextparser = &vlanif.pif_parser}
, {.k_word = "-vlanif", .k_key = "vlanif", .k_type = KW_T_STR,
.k_str = "", .k_exec = setvlanif}
#ifndef INET_ONLY
, {.k_word = "phase", .k_nextparser = &phase.pi_parser}
, {.k_word = "range", .k_nextparser = &parse_range.ps_parser}
@ -409,6 +404,7 @@ struct branch opt_clone_brs[] = {
#endif /*INET6*/
, {.b_nextparser = &misc.pk_parser}
, {.b_nextparser = &tunnel.pk_parser}
, {.b_nextparser = &vlan.pk_parser}
, {.b_nextparser = &agr.pk_parser}
, {.b_nextparser = &kw80211.pk_parser}
, {.b_nextparser = &address.pa_parser}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vlan.c,v 1.6 2008/05/06 18:58:47 dyoung Exp $ */
/* $NetBSD: vlan.c,v 1.7 2008/05/07 20:11:15 dyoung Exp $ */
/*
* Copyright (c) 1983, 1993
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: vlan.c,v 1.6 2008/05/06 18:58:47 dyoung Exp $");
__RCSID("$NetBSD: vlan.c,v 1.7 2008/05/07 20:11:15 dyoung Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -53,12 +53,23 @@ __RCSID("$NetBSD: vlan.c,v 1.6 2008/05/06 18:58:47 dyoung Exp $");
#include "extern.h"
#include "vlan.h"
struct pinteger vlan = PINTEGER_INITIALIZER1(&vlan, "vlan", 0, USHRT_MAX, 10,
setvlan, "vlan", &command_root.pb_parser);
struct pinteger vlantag = PINTEGER_INITIALIZER1(&vlantag, "VLAN tag",
0, USHRT_MAX, 10, setvlan, "vlantag", &command_root.pb_parser);
struct piface vlanif = PIFACE_INITIALIZER(&vlanif, "vlanif", setvlanif,
"vlanif", &command_root.pb_parser);
static const struct kwinst vlankw[] = {
{.k_word = "vlan", .k_nextparser = &vlantag.pi_parser}
, {.k_word = "vlanif", .k_act = "vlan",
.k_nextparser = &vlanif.pif_parser}
, {.k_word = "-vlanif", .k_key = "vlanif", .k_type = KW_T_STR,
.k_str = "", .k_exec = setvlanif}
};
struct pkw vlan = PKW_INITIALIZER(&vlan, "vlan", NULL, NULL,
vlankw, __arraycount(vlankw), NULL);
static int
checkifname(const char *ifname)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: vlan.h,v 1.3 2008/05/06 17:29:04 dyoung Exp $ */
/* $NetBSD: vlan.h,v 1.4 2008/05/07 20:11:15 dyoung Exp $ */
/*
* Copyright (c) 1983, 1993
@ -29,8 +29,9 @@
* SUCH DAMAGE.
*/
extern struct pinteger vlan;
extern struct pinteger vlantag;
extern struct piface vlanif;
extern struct pkw vlan;
int setvlan(prop_dictionary_t, prop_dictionary_t);
int setvlanif(prop_dictionary_t, prop_dictionary_t);