ifgroup.c (274710) | ifgroup.c (288305) |
---|---|
1/*- 2 * Copyright (c) 2006 Max Laier. 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, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#ifndef lint 27static const char rcsid[] = | 1/*- 2 * Copyright (c) 2006 Max Laier. 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, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26#ifndef lint 27static const char rcsid[] = |
28 "$FreeBSD: head/sbin/ifconfig/ifgroup.c 274710 2014-11-19 13:57:39Z feld $"; | 28 "$FreeBSD: head/sbin/ifconfig/ifgroup.c 288305 2015-09-27 07:51:18Z ngie $"; |
29#endif /* not lint */ 30 | 29#endif /* not lint */ 30 |
31#include <sys/types.h> | 31#include <sys/param.h> |
32#include <sys/ioctl.h> 33#include <sys/socket.h> 34#include <net/if.h> 35 36#include <ctype.h> 37#include <err.h> 38#include <errno.h> 39#include <stdio.h> --- 129 unchanged lines hidden (view full) --- 169 .af_af = AF_UNSPEC, 170 .af_other_status = getifgroups, 171}; 172static struct option group_gopt = { "g:", "[-g groupname]", printgroup }; 173 174static __constructor void 175group_ctor(void) 176{ | 32#include <sys/ioctl.h> 33#include <sys/socket.h> 34#include <net/if.h> 35 36#include <ctype.h> 37#include <err.h> 38#include <errno.h> 39#include <stdio.h> --- 129 unchanged lines hidden (view full) --- 169 .af_af = AF_UNSPEC, 170 .af_other_status = getifgroups, 171}; 172static struct option group_gopt = { "g:", "[-g groupname]", printgroup }; 173 174static __constructor void 175group_ctor(void) 176{ |
177#define N(a) (sizeof(a) / sizeof(a[0])) | |
178 int i; 179 | 177 int i; 178 |
180 for (i = 0; i < N(group_cmds); i++) | 179 for (i = 0; i < nitems(group_cmds); i++) |
181 cmd_register(&group_cmds[i]); 182 af_register(&af_group); 183 opt_register(&group_gopt); | 180 cmd_register(&group_cmds[i]); 181 af_register(&af_group); 182 opt_register(&group_gopt); |
184#undef N | |
185} | 183} |