Deleted Added
full compact
ifgif.c (193664) ifgif.c (194799)
1/*-
2 * Copyright (c) 2009 Hiroki Sato. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef lint
27static const char rcsid[] =
1/*-
2 * Copyright (c) 2009 Hiroki Sato. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
22 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#ifndef lint
27static const char rcsid[] =
28 "$FreeBSD: head/sbin/ifconfig/ifgif.c 193664 2009-06-07 23:00:40Z hrs $";
28 "$FreeBSD: head/sbin/ifconfig/ifgif.c 194799 2009-06-23 23:49:52Z delphij $";
29#endif
30
31#include <sys/param.h>
32#include <sys/ioctl.h>
33#include <sys/socket.h>
34#include <sys/sockio.h>
35
36#include <stdlib.h>

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

61 { "SEND_REV_ETHIP_VER", GIF_SEND_REVETHIP },
62};
63
64static void
65gif_status(int s)
66{
67 int opts;
68 int nopts = 0;
29#endif
30
31#include <sys/param.h>
32#include <sys/ioctl.h>
33#include <sys/socket.h>
34#include <sys/sockio.h>
35
36#include <stdlib.h>

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

61 { "SEND_REV_ETHIP_VER", GIF_SEND_REVETHIP },
62};
63
64static void
65gif_status(int s)
66{
67 int opts;
68 int nopts = 0;
69 int i;
69 size_t i;
70
71 ifr.ifr_data = (caddr_t)&opts;
72 if (ioctl(s, GIFGOPTS, &ifr) == -1)
73 return;
74
75 printf("\toptions=%d<", opts);
76 for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) {
77 if (opts & gif_opts[i].mask) {

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

118 .af_af = AF_UNSPEC,
119 .af_other_status = gif_status,
120};
121
122static __constructor void
123gif_ctor(void)
124{
125#define N(a) (sizeof(a) / sizeof(a[0]))
70
71 ifr.ifr_data = (caddr_t)&opts;
72 if (ioctl(s, GIFGOPTS, &ifr) == -1)
73 return;
74
75 printf("\toptions=%d<", opts);
76 for (i=0; i < sizeof(gif_opts)/sizeof(gif_opts[0]); i++) {
77 if (opts & gif_opts[i].mask) {

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

118 .af_af = AF_UNSPEC,
119 .af_other_status = gif_status,
120};
121
122static __constructor void
123gif_ctor(void)
124{
125#define N(a) (sizeof(a) / sizeof(a[0]))
126 int i;
126 size_t i;
127
128 for (i = 0; i < N(gif_cmds); i++)
129 cmd_register(&gif_cmds[i]);
130 af_register(&af_gif);
131#undef N
132}
127
128 for (i = 0; i < N(gif_cmds); i++)
129 cmd_register(&gif_cmds[i]);
130 af_register(&af_gif);
131#undef N
132}