ifconfig.c (147979) | ifconfig.c (148001) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. 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 --- 24 unchanged lines hidden (view full) --- 33 The Regents of the University of California. All rights reserved.\n"; 34#endif /* not lint */ 35 36#ifndef lint 37#if 0 38static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94"; 39#endif 40static const char rcsid[] = | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. 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 --- 24 unchanged lines hidden (view full) --- 33 The Regents of the University of California. All rights reserved.\n"; 34#endif /* not lint */ 35 36#ifndef lint 37#if 0 38static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94"; 39#endif 40static const char rcsid[] = |
41 "$FreeBSD: head/sbin/ifconfig/ifconfig.c 147979 2005-07-13 21:23:40Z yar $"; | 41 "$FreeBSD: head/sbin/ifconfig/ifconfig.c 148001 2005-07-14 18:33:21Z rwatson $"; |
42#endif /* not lint */ 43 44#include <sys/param.h> 45#include <sys/ioctl.h> 46#include <sys/socket.h> 47#include <sys/sysctl.h> 48#include <sys/time.h> 49#include <sys/module.h> --- 36 unchanged lines hidden (view full) --- 86int setipdst; 87int setmask; 88int doalias; 89int clearaddr; 90int newaddr = 1; 91int verbose; 92 93int supmedia = 0; | 42#endif /* not lint */ 43 44#include <sys/param.h> 45#include <sys/ioctl.h> 46#include <sys/socket.h> 47#include <sys/sysctl.h> 48#include <sys/time.h> 49#include <sys/module.h> --- 36 unchanged lines hidden (view full) --- 86int setipdst; 87int setmask; 88int doalias; 89int clearaddr; 90int newaddr = 1; 91int verbose; 92 93int supmedia = 0; |
94int printkeys = 0; /* Print keying material for interfaces. */ |
|
94int printname = 0; /* Print the name of the created interface. */ 95 96static int ifconfig(int argc, char *const *argv, const struct afswtch *afp); 97static void status(const struct afswtch *afp, int addrcount, 98 struct sockaddr_dl *sdl, struct if_msghdr *ifm, 99 struct ifa_msghdr *ifam); 100static void tunnel_status(int s); 101static void usage(void); --- 49 unchanged lines hidden (view full) --- 151 size_t needed; 152 int mib[6]; 153 char options[1024]; 154 struct option *p; 155 156 all = downonly = uponly = namesonly = verbose = 0; 157 158 /* Parse leading line options */ | 95int printname = 0; /* Print the name of the created interface. */ 96 97static int ifconfig(int argc, char *const *argv, const struct afswtch *afp); 98static void status(const struct afswtch *afp, int addrcount, 99 struct sockaddr_dl *sdl, struct if_msghdr *ifm, 100 struct ifa_msghdr *ifam); 101static void tunnel_status(int s); 102static void usage(void); --- 49 unchanged lines hidden (view full) --- 152 size_t needed; 153 int mib[6]; 154 char options[1024]; 155 struct option *p; 156 157 all = downonly = uponly = namesonly = verbose = 0; 158 159 /* Parse leading line options */ |
159 strlcpy(options, "adlmuv", sizeof(options)); | 160 strlcpy(options, "adklmuv", sizeof(options)); |
160 for (p = opts; p != NULL; p = p->next) 161 strlcat(options, p->opt, sizeof(options)); 162 while ((c = getopt(argc, argv, options)) != -1) { 163 switch (c) { 164 case 'a': /* scan all interfaces */ 165 all++; 166 break; 167 case 'd': /* restrict scan to "down" interfaces */ 168 downonly++; 169 break; | 161 for (p = opts; p != NULL; p = p->next) 162 strlcat(options, p->opt, sizeof(options)); 163 while ((c = getopt(argc, argv, options)) != -1) { 164 switch (c) { 165 case 'a': /* scan all interfaces */ 166 all++; 167 break; 168 case 'd': /* restrict scan to "down" interfaces */ 169 downonly++; 170 break; |
171 case 'k': 172 printkeys++; 173 break; |
|
170 case 'l': /* scan interface names only */ 171 namesonly++; 172 break; 173 case 'm': /* show media choices in status */ 174 supmedia = 1; 175 break; 176 case 'u': /* restrict scan to "up" interfaces */ 177 uponly++; --- 883 unchanged lines hidden --- | 174 case 'l': /* scan interface names only */ 175 namesonly++; 176 break; 177 case 'm': /* show media choices in status */ 178 supmedia = 1; 179 break; 180 case 'u': /* restrict scan to "up" interfaces */ 181 uponly++; --- 883 unchanged lines hidden --- |