Deleted Added
full compact
ifvlan.c (138593) ifvlan.c (139494)
1/*
2 * Copyright (c) 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 42 unchanged lines hidden (view full) ---

51#include <unistd.h>
52#include <err.h>
53#include <errno.h>
54
55#include "ifconfig.h"
56
57#ifndef lint
58static const char rcsid[] =
1/*
2 * Copyright (c) 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 42 unchanged lines hidden (view full) ---

51#include <unistd.h>
52#include <err.h>
53#include <errno.h>
54
55#include "ifconfig.h"
56
57#ifndef lint
58static const char rcsid[] =
59 "$FreeBSD: head/sbin/ifconfig/ifvlan.c 138593 2004-12-08 19:18:07Z sam $";
59 "$FreeBSD: head/sbin/ifconfig/ifvlan.c 139494 2004-12-31 19:46:27Z sam $";
60#endif
61static int __tag = 0;
62static int __have_tag = 0;
63
64static void
60#endif
61static int __tag = 0;
62static int __have_tag = 0;
63
64static void
65vlan_status(int s, const struct rt_addrinfo *info __unused)
65vlan_status(int s)
66{
67 struct vlanreq vreq;
68
69 bzero((char *)&vreq, sizeof(struct vlanreq));
70 ifr.ifr_data = (caddr_t)&vreq;
71
72 if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) == -1)
73 return;

--- 78 unchanged lines hidden (view full) ---

152 DEF_CMD("vlanmtu", IFCAP_VLAN_MTU, setifcap),
153 DEF_CMD("-vlanmtu", -IFCAP_VLAN_MTU, setifcap),
154 DEF_CMD("vlanhwtag", IFCAP_VLAN_HWTAGGING, setifcap),
155 DEF_CMD("-vlanhwtag", -IFCAP_VLAN_HWTAGGING, setifcap),
156};
157static struct afswtch af_vlan = {
158 .af_name = "af_vlan",
159 .af_af = AF_UNSPEC,
66{
67 struct vlanreq vreq;
68
69 bzero((char *)&vreq, sizeof(struct vlanreq));
70 ifr.ifr_data = (caddr_t)&vreq;
71
72 if (ioctl(s, SIOCGETVLAN, (caddr_t)&ifr) == -1)
73 return;

--- 78 unchanged lines hidden (view full) ---

152 DEF_CMD("vlanmtu", IFCAP_VLAN_MTU, setifcap),
153 DEF_CMD("-vlanmtu", -IFCAP_VLAN_MTU, setifcap),
154 DEF_CMD("vlanhwtag", IFCAP_VLAN_HWTAGGING, setifcap),
155 DEF_CMD("-vlanhwtag", -IFCAP_VLAN_HWTAGGING, setifcap),
156};
157static struct afswtch af_vlan = {
158 .af_name = "af_vlan",
159 .af_af = AF_UNSPEC,
160 .af_status = vlan_status,
160 .af_other_status = vlan_status,
161};
162
163static __constructor void
164vlan_ctor(void)
165{
166#define N(a) (sizeof(a) / sizeof(a[0]))
167 int i;
168
169 for (i = 0; i < N(vlan_cmds); i++)
170 cmd_register(&vlan_cmds[i]);
171 af_register(&af_vlan);
172#undef N
173}
161};
162
163static __constructor void
164vlan_ctor(void)
165{
166#define N(a) (sizeof(a) / sizeof(a[0]))
167 int i;
168
169 for (i = 0; i < N(vlan_cmds); i++)
170 cmd_register(&vlan_cmds[i]);
171 af_register(&af_vlan);
172#undef N
173}