]> The Tcpdump Group git mirrors - libpcap/commitdiff
Get rid of Win32/Src/{getnetent.c,getnetbynm.c} - we don't build or use them.
authorGuy Harris <[email protected]>
Wed, 23 Sep 2015 21:33:29 +0000 (14:33 -0700)
committerGuy Harris <[email protected]>
Wed, 23 Sep 2015 21:33:29 +0000 (14:33 -0700)
Makefile.in
Win32/Prj/libpcap.dsp
Win32/Src/getnetbynm.c [deleted file]
Win32/Src/getnetent.c [deleted file]
nametoaddr.c

index 3b4f89949caa8d4a200089979ede2e17bd10507b..f05a9796996e77ed1abec5b60328779e36d0e5f7 100644 (file)
@@ -352,8 +352,6 @@ EXTRA_DIST = \
        Win32/Prj/libpcap.dsp \
        Win32/Prj/libpcap.dsw \
        Win32/Src/gai_strerror.c \
-       Win32/Src/getnetbynm.c \
-       Win32/Src/getnetent.c \
        Win32/Src/getopt.c \
        Win32/Src/getservent.c \
        Win32/Src/inet_net.c
index 38041d7dbf0c4ff8682ae7fb256fa1e8fab2b971..b8fc445f78ecdb31c190436f4065365236196068 100644 (file)
@@ -106,14 +106,6 @@ SOURCE=..\..\gencode.c
 # End Source File
 # Begin Source File
 
-SOURCE=..\Src\getnetbynm.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\Src\getnetent.c
-# End Source File
-# Begin Source File
-
 SOURCE=..\Src\getservent.c
 # End Source File
 # Begin Source File
diff --git a/Win32/Src/getnetbynm.c b/Win32/Src/getnetbynm.c
deleted file mode 100644 (file)
index fa4d398..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getnetbyname.c     5.5 (Berkeley) 6/27/88";
-#endif /* LIBC_SCCS and not lint */
-
-#include "inetprivate.h"
-
-extern int _net_stayopen;
-
-struct netent *
-getnetbyname(const char *name)
-{
-       register struct netent *p;
-       register char **cp;
-
-       setnetent(_net_stayopen);
-       while (p = getnetent()) {
-               if (strcmp(p->n_name, name) == 0)
-                       break;
-               for (cp = p->n_aliases; *cp != 0; cp++)
-                       if (strcmp(*cp, name) == 0)
-                               goto found;
-       }
-found:
-       if (!_net_stayopen)
-               endnetent();
-       return (p);
-}
diff --git a/Win32/Src/getnetent.c b/Win32/Src/getnetent.c
deleted file mode 100644 (file)
index 95281a5..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getnetent.c        5.5 (Berkeley) 6/27/88";
-#endif /* LIBC_SCCS and not lint */
-
-#include "inetprivate.h"
-
-#define        MAXALIASES      35
-
-static char NETDB[] = _PATH_NETWORKS;
-static FILE *netf = NULL;
-static char line[BUFSIZ+1];
-static struct netent net;
-static char *net_aliases[MAXALIASES];
-static char *any(char *, char *);
-
-int _net_stayopen;
-extern u_int32_t inet_network(const char *cp);
-
-void
-setnetent(f)
-       int f;
-{
-       if (netf == NULL)
-               netf = fopen(NETDB, "r" );
-       else
-               rewind(netf);
-       _net_stayopen |= f;
-}
-
-void
-endnetent()
-{
-       if (netf) {
-               fclose(netf);
-               netf = NULL;
-       }
-       _net_stayopen = 0;
-}
-
-struct netent *
-getnetent()
-{
-       char *p;
-       register char *cp, **q;
-
-       if (netf == NULL && (netf = fopen(NETDB, "r" )) == NULL)
-               return (NULL);
-again:
-       p = fgets(line, BUFSIZ, netf);
-       if (p == NULL)
-               return (NULL);
-       if (*p == '#')
-               goto again;
-       cp = any(p, "#\n");
-       if (cp == NULL)
-               goto again;
-       *cp = '\0';
-       net.n_name = p;
-       cp = any(p, " \t");
-       if (cp == NULL)
-               goto again;
-       *cp++ = '\0';
-       while (*cp == ' ' || *cp == '\t')
-               cp++;
-       p = any(cp, " \t");
-       if (p != NULL)
-               *p++ = '\0';
-       net.n_net = inet_network(cp);
-       net.n_addrtype = AF_INET;
-       q = net.n_aliases = net_aliases;
-       if (p != NULL)
-               cp = p;
-       while (cp && *cp) {
-               if (*cp == ' ' || *cp == '\t') {
-                       cp++;
-                       continue;
-               }
-               if (q < &net_aliases[MAXALIASES - 1])
-                       *q++ = cp;
-               cp = any(cp, " \t");
-               if (cp != NULL)
-                       *cp++ = '\0';
-       }
-       *q = NULL;
-       return (&net);
-}
-
-static char *
-any(cp, match)
-       register char *cp;
-       char *match;
-{
-       register char *mp, c;
-
-       while (c = *cp) {
-               for (mp = match; *mp; mp++)
-                       if (*mp == c)
-                               return (cp);
-               cp++;
-       }
-       return ((char *)0);
-}
index b4bb4b4502c18281417a14e42ca236d16fa07d28..850e122a70263e3356564e8f1e2a10ef44860224 100644 (file)
@@ -176,6 +176,15 @@ pcap_nametonetaddr(const char *name)
 #else
        /*
         * There's no "getnetbyname()" on Windows.
+        *
+        * XXX - I guess we could use the BSD code to read
+        * C:\Windows\System32\drivers\etc/networks, assuming
+        * that's its home on all the versions of Windows
+        * we use, but that file probably just has the loopback
+        * network on 127/24 on 99 44/100% of Windows machines.
+        *
+        * (Heck, these days it probably just has that on 99 44/100%
+        * of *UN*X* machines.)
         */
        return 0;
 #endif