2004-09-28 03:02:53 +04:00
|
|
|
/* $NetBSD: nametoaddr.c,v 1.14 2004/09/27 23:02:53 dyoung Exp $ */
|
1995-03-06 14:37:58 +03:00
|
|
|
|
1995-03-06 14:32:59 +03:00
|
|
|
/*
|
2004-09-28 03:02:53 +04:00
|
|
|
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
|
1995-03-06 14:32:59 +03:00
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that: (1) source code distributions
|
|
|
|
* retain the above copyright notice and this paragraph in its entirety, (2)
|
|
|
|
* distributions including binary code include the above copyright notice and
|
|
|
|
* this paragraph in its entirety in the documentation or other materials
|
|
|
|
* provided with the distribution, and (3) all advertising materials mentioning
|
|
|
|
* features or use of this software display the following acknowledgement:
|
|
|
|
* ``This product includes software developed by the University of California,
|
|
|
|
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
|
|
|
* the University nor the names of its contributors may 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
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
*
|
|
|
|
* Name to id translation routines used by the scanner.
|
|
|
|
* These functions are not time critical.
|
|
|
|
*/
|
|
|
|
|
1997-10-03 19:53:00 +04:00
|
|
|
#include <sys/cdefs.h>
|
1995-03-06 14:32:59 +03:00
|
|
|
#ifndef lint
|
1997-10-03 19:53:00 +04:00
|
|
|
#if 0
|
|
|
|
static const char rcsid[] =
|
2004-09-28 03:02:53 +04:00
|
|
|
"@(#) Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.68.2.3 2003/11/19 18:13:48 guy Exp (LBL)";
|
1997-10-03 19:53:00 +04:00
|
|
|
#else
|
2004-09-28 03:02:53 +04:00
|
|
|
__RCSID("$NetBSD: nametoaddr.c,v 1.14 2004/09/27 23:02:53 dyoung Exp $");
|
1997-10-03 19:53:00 +04:00
|
|
|
#endif
|
1995-03-06 14:32:59 +03:00
|
|
|
#endif
|
|
|
|
|
2004-09-28 03:02:53 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
#include <pcap-stdinc.h>
|
|
|
|
|
|
|
|
#else /* WIN32 */
|
|
|
|
|
1995-03-06 14:32:59 +03:00
|
|
|
#include <sys/param.h>
|
1996-12-13 11:25:54 +03:00
|
|
|
#include <sys/types.h> /* concession to AIX */
|
1995-03-06 14:32:59 +03:00
|
|
|
#include <sys/socket.h>
|
1997-10-03 19:53:00 +04:00
|
|
|
#include <sys/time.h>
|
1996-12-13 11:25:54 +03:00
|
|
|
|
2004-09-28 03:02:53 +04:00
|
|
|
#include <netinet/in.h>
|
|
|
|
#endif /* WIN32 */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XXX - why was this included even on UNIX?
|
|
|
|
*/
|
|
|
|
#ifdef __MINGW32__
|
|
|
|
#include "IP6_misc.h"
|
1996-12-13 11:25:54 +03:00
|
|
|
#endif
|
|
|
|
|
2004-09-28 03:02:53 +04:00
|
|
|
#ifndef WIN32
|
|
|
|
#ifdef HAVE_ETHER_HOSTTON
|
|
|
|
#ifdef HAVE_NETINET_IF_ETHER_H
|
|
|
|
struct mbuf; /* Squelch compiler warnings on some platforms for */
|
|
|
|
struct rtentry; /* declarations in <net/if.h> */
|
|
|
|
#include <net/if.h> /* for "struct ifnet" in "struct arpcom" on Solaris */
|
1995-03-06 14:32:59 +03:00
|
|
|
#include <netinet/if_ether.h>
|
2004-09-28 03:02:53 +04:00
|
|
|
#endif /* HAVE_NETINET_IF_ETHER_H */
|
|
|
|
#endif /* HAVE_ETHER_HOSTTON */
|
1995-03-06 14:32:59 +03:00
|
|
|
#include <arpa/inet.h>
|
2004-09-28 03:02:53 +04:00
|
|
|
#include <netdb.h>
|
|
|
|
#endif /* WIN32 */
|
1999-07-02 14:05:22 +04:00
|
|
|
#ifdef INET6
|
|
|
|
#include <netdb.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#endif /*INET6*/
|
1995-03-06 14:32:59 +03:00
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <errno.h>
|
1996-12-13 11:25:54 +03:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <memory.h>
|
1995-03-06 14:32:59 +03:00
|
|
|
#include <stdio.h>
|
1996-12-13 11:25:54 +03:00
|
|
|
|
|
|
|
#include "pcap-int.h"
|
1995-03-06 14:32:59 +03:00
|
|
|
|
|
|
|
#include "gencode.h"
|
1996-12-13 11:25:54 +03:00
|
|
|
#include <pcap-namedb.h>
|
1995-03-06 14:32:59 +03:00
|
|
|
|
1996-12-13 11:25:54 +03:00
|
|
|
#ifdef HAVE_OS_PROTO_H
|
|
|
|
#include "os-proto.h"
|
1995-03-06 14:32:59 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NTOHL
|
|
|
|
#define NTOHL(x) (x) = ntohl(x)
|
|
|
|
#define NTOHS(x) (x) = ntohs(x)
|
|
|
|
#endif
|
|
|
|
|
2004-09-28 03:02:53 +04:00
|
|
|
static __inline int xdtoi(int);
|
1995-03-06 14:32:59 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Convert host name to internet address.
|
|
|
|
* Return 0 upon failure.
|
|
|
|
*/
|
1996-12-13 11:25:54 +03:00
|
|
|
bpf_u_int32 **
|
1995-03-06 14:32:59 +03:00
|
|
|
pcap_nametoaddr(const char *name)
|
|
|
|
{
|
|
|
|
#ifndef h_addr
|
1996-12-13 11:25:54 +03:00
|
|
|
static bpf_u_int32 *hlist[2];
|
1995-03-06 14:32:59 +03:00
|
|
|
#endif
|
1996-12-13 11:25:54 +03:00
|
|
|
bpf_u_int32 **p;
|
1995-03-06 14:32:59 +03:00
|
|
|
struct hostent *hp;
|
|
|
|
|
|
|
|
if ((hp = gethostbyname(name)) != NULL) {
|
|
|
|
#ifndef h_addr
|
1996-12-13 11:25:54 +03:00
|
|
|
hlist[0] = (bpf_u_int32 *)hp->h_addr;
|
1995-03-06 14:32:59 +03:00
|
|
|
NTOHL(hp->h_addr);
|
|
|
|
return hlist;
|
|
|
|
#else
|
1996-12-13 11:25:54 +03:00
|
|
|
for (p = (bpf_u_int32 **)hp->h_addr_list; *p; ++p)
|
1995-03-06 14:32:59 +03:00
|
|
|
NTOHL(**p);
|
1996-12-13 11:25:54 +03:00
|
|
|
return (bpf_u_int32 **)hp->h_addr_list;
|
1995-03-06 14:32:59 +03:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-07-02 14:05:22 +04:00
|
|
|
#ifdef INET6
|
|
|
|
struct addrinfo *
|
|
|
|
pcap_nametoaddrinfo(const char *name)
|
|
|
|
{
|
|
|
|
struct addrinfo hints, *res;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
memset(&hints, 0, sizeof(hints));
|
|
|
|
hints.ai_family = PF_UNSPEC;
|
2000-04-14 18:18:40 +04:00
|
|
|
hints.ai_socktype = SOCK_STREAM; /*not really*/
|
1999-07-02 14:05:22 +04:00
|
|
|
error = getaddrinfo(name, NULL, &hints, &res);
|
|
|
|
if (error)
|
|
|
|
return NULL;
|
|
|
|
else
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
#endif /*INET6*/
|
|
|
|
|
1995-03-06 14:32:59 +03:00
|
|
|
/*
|
|
|
|
* Convert net name to internet address.
|
|
|
|
* Return 0 upon failure.
|
|
|
|
*/
|
1996-12-13 11:25:54 +03:00
|
|
|
bpf_u_int32
|
1995-03-06 14:32:59 +03:00
|
|
|
pcap_nametonetaddr(const char *name)
|
|
|
|
{
|
2004-09-28 03:02:53 +04:00
|
|
|
#ifndef WIN32
|
1995-03-06 14:32:59 +03:00
|
|
|
struct netent *np;
|
|
|
|
|
|
|
|
if ((np = getnetbyname(name)) != NULL)
|
|
|
|
return np->n_net;
|
|
|
|
else
|
|
|
|
return 0;
|
2004-09-28 03:02:53 +04:00
|
|
|
#else
|
|
|
|
/*
|
|
|
|
* There's no "getnetbyname()" on Windows.
|
|
|
|
*/
|
|
|
|
return 0;
|
|
|
|
#endif
|
1995-03-06 14:32:59 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Convert a port name to its port and protocol numbers.
|
|
|
|
* We assume only TCP or UDP.
|
|
|
|
* Return 0 upon failure.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
pcap_nametoport(const char *name, int *port, int *proto)
|
|
|
|
{
|
|
|
|
struct servent *sp;
|
2004-09-28 03:02:53 +04:00
|
|
|
int tcp_port = -1;
|
|
|
|
int udp_port = -1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We need to check /etc/services for ambiguous entries.
|
|
|
|
* If we find the ambiguous entry, and it has the
|
|
|
|
* same port number, change the proto to PROTO_UNDEF
|
|
|
|
* so both TCP and UDP will be checked.
|
|
|
|
*/
|
|
|
|
sp = getservbyname(name, "tcp");
|
|
|
|
if (sp != NULL) tcp_port = ntohs(sp->s_port);
|
|
|
|
sp = getservbyname(name, "udp");
|
|
|
|
if (sp != NULL) udp_port = ntohs(sp->s_port);
|
|
|
|
if (tcp_port >= 0) {
|
|
|
|
*port = tcp_port;
|
|
|
|
*proto = IPPROTO_TCP;
|
|
|
|
if (udp_port >= 0) {
|
|
|
|
if (udp_port == tcp_port)
|
|
|
|
*proto = PROTO_UNDEF;
|
1996-12-13 11:25:54 +03:00
|
|
|
#ifdef notdef
|
2004-09-28 03:02:53 +04:00
|
|
|
else
|
1995-03-06 14:32:59 +03:00
|
|
|
/* Can't handle ambiguous names that refer
|
|
|
|
to different port numbers. */
|
|
|
|
warning("ambiguous port %s in /etc/services",
|
|
|
|
name);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
2004-09-28 03:02:53 +04:00
|
|
|
if (udp_port >= 0) {
|
|
|
|
*port = udp_port;
|
|
|
|
*proto = IPPROTO_UDP;
|
|
|
|
return 1;
|
|
|
|
}
|
1995-03-06 14:32:59 +03:00
|
|
|
#if defined(ultrix) || defined(__osf__)
|
|
|
|
/* Special hack in case NFS isn't in /etc/services */
|
|
|
|
if (strcmp(name, "nfs") == 0) {
|
|
|
|
*port = 2049;
|
|
|
|
*proto = PROTO_UNDEF;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
pcap_nametoproto(const char *str)
|
|
|
|
{
|
|
|
|
struct protoent *p;
|
|
|
|
|
|
|
|
p = getprotobyname(str);
|
|
|
|
if (p != 0)
|
|
|
|
return p->p_proto;
|
|
|
|
else
|
|
|
|
return PROTO_UNDEF;
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "ethertype.h"
|
|
|
|
|
|
|
|
struct eproto {
|
|
|
|
char *s;
|
|
|
|
u_short p;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Static data base of ether protocol types. */
|
|
|
|
struct eproto eproto_db[] = {
|
|
|
|
{ "pup", ETHERTYPE_PUP },
|
|
|
|
{ "xns", ETHERTYPE_NS },
|
|
|
|
{ "ip", ETHERTYPE_IP },
|
1999-07-02 14:05:22 +04:00
|
|
|
#ifdef INET6
|
|
|
|
{ "ip6", ETHERTYPE_IPV6 },
|
|
|
|
#endif
|
1995-03-06 14:32:59 +03:00
|
|
|
{ "arp", ETHERTYPE_ARP },
|
|
|
|
{ "rarp", ETHERTYPE_REVARP },
|
|
|
|
{ "sprite", ETHERTYPE_SPRITE },
|
|
|
|
{ "mopdl", ETHERTYPE_MOPDL },
|
|
|
|
{ "moprc", ETHERTYPE_MOPRC },
|
|
|
|
{ "decnet", ETHERTYPE_DN },
|
|
|
|
{ "lat", ETHERTYPE_LAT },
|
1996-12-13 11:25:54 +03:00
|
|
|
{ "sca", ETHERTYPE_SCA },
|
1995-03-06 14:32:59 +03:00
|
|
|
{ "lanbridge", ETHERTYPE_LANBRIDGE },
|
|
|
|
{ "vexp", ETHERTYPE_VEXP },
|
|
|
|
{ "vprod", ETHERTYPE_VPROD },
|
|
|
|
{ "atalk", ETHERTYPE_ATALK },
|
|
|
|
{ "atalkarp", ETHERTYPE_AARP },
|
|
|
|
{ "loopback", ETHERTYPE_LOOPBACK },
|
|
|
|
{ "decdts", ETHERTYPE_DECDTS },
|
|
|
|
{ "decdns", ETHERTYPE_DECDNS },
|
|
|
|
{ (char *)0, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
pcap_nametoeproto(const char *s)
|
|
|
|
{
|
|
|
|
struct eproto *p = eproto_db;
|
|
|
|
|
|
|
|
while (p->s != 0) {
|
|
|
|
if (strcmp(p->s, s) == 0)
|
|
|
|
return p->p;
|
|
|
|
p += 1;
|
|
|
|
}
|
|
|
|
return PROTO_UNDEF;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Hex digit to integer. */
|
2004-09-28 03:02:53 +04:00
|
|
|
static __inline int
|
1995-03-06 14:32:59 +03:00
|
|
|
xdtoi(c)
|
|
|
|
register int c;
|
|
|
|
{
|
|
|
|
if (isdigit(c))
|
|
|
|
return c - '0';
|
|
|
|
else if (islower(c))
|
|
|
|
return c - 'a' + 10;
|
|
|
|
else
|
|
|
|
return c - 'A' + 10;
|
|
|
|
}
|
|
|
|
|
1996-12-13 11:25:54 +03:00
|
|
|
int
|
|
|
|
__pcap_atoin(const char *s, bpf_u_int32 *addr)
|
1995-03-06 14:32:59 +03:00
|
|
|
{
|
|
|
|
u_int n;
|
1996-12-13 11:25:54 +03:00
|
|
|
int len;
|
1995-03-06 14:32:59 +03:00
|
|
|
|
1996-12-13 11:25:54 +03:00
|
|
|
*addr = 0;
|
|
|
|
len = 0;
|
1995-03-06 14:32:59 +03:00
|
|
|
while (1) {
|
|
|
|
n = 0;
|
|
|
|
while (*s && *s != '.')
|
|
|
|
n = n * 10 + *s++ - '0';
|
1996-12-13 11:25:54 +03:00
|
|
|
*addr <<= 8;
|
|
|
|
*addr |= n & 0xff;
|
|
|
|
len += 8;
|
1995-03-06 14:32:59 +03:00
|
|
|
if (*s == '\0')
|
1996-12-13 11:25:54 +03:00
|
|
|
return len;
|
1995-03-06 14:32:59 +03:00
|
|
|
++s;
|
|
|
|
}
|
|
|
|
/* NOTREACHED */
|
|
|
|
}
|
|
|
|
|
1996-12-13 11:25:54 +03:00
|
|
|
int
|
|
|
|
__pcap_atodn(const char *s, bpf_u_int32 *addr)
|
1995-03-06 14:32:59 +03:00
|
|
|
{
|
|
|
|
#define AREASHIFT 10
|
|
|
|
#define AREAMASK 0176000
|
|
|
|
#define NODEMASK 01777
|
|
|
|
|
|
|
|
u_int node, area;
|
|
|
|
|
|
|
|
if (sscanf((char *)s, "%d.%d", &area, &node) != 2)
|
|
|
|
bpf_error("malformed decnet address '%s'", s);
|
|
|
|
|
1996-12-13 11:25:54 +03:00
|
|
|
*addr = (area << AREASHIFT) & AREAMASK;
|
|
|
|
*addr |= (node & NODEMASK);
|
1995-03-06 14:32:59 +03:00
|
|
|
|
1996-12-13 11:25:54 +03:00
|
|
|
return(32);
|
1995-03-06 14:32:59 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Convert 's' which has the form "xx:xx:xx:xx:xx:xx" into a new
|
|
|
|
* ethernet address. Assumes 's' is well formed.
|
|
|
|
*/
|
|
|
|
u_char *
|
|
|
|
pcap_ether_aton(const char *s)
|
|
|
|
{
|
|
|
|
register u_char *ep, *e;
|
|
|
|
register u_int d;
|
|
|
|
|
|
|
|
e = ep = (u_char *)malloc(6);
|
|
|
|
|
|
|
|
while (*s) {
|
|
|
|
if (*s == ':')
|
|
|
|
s += 1;
|
|
|
|
d = xdtoi(*s++);
|
2004-09-28 03:02:53 +04:00
|
|
|
if (isxdigit((unsigned char)*s)) {
|
1995-03-06 14:32:59 +03:00
|
|
|
d <<= 4;
|
|
|
|
d |= xdtoi(*s++);
|
|
|
|
}
|
|
|
|
*ep++ = d;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (e);
|
|
|
|
}
|
|
|
|
|
1996-12-13 11:25:54 +03:00
|
|
|
#ifndef HAVE_ETHER_HOSTTON
|
1995-03-06 14:32:59 +03:00
|
|
|
/* Roll our own */
|
|
|
|
u_char *
|
|
|
|
pcap_ether_hostton(const char *name)
|
|
|
|
{
|
|
|
|
register struct pcap_etherent *ep;
|
|
|
|
register u_char *ap;
|
|
|
|
static FILE *fp = NULL;
|
2004-09-28 03:02:53 +04:00
|
|
|
static int init = 0;
|
1995-03-06 14:32:59 +03:00
|
|
|
|
|
|
|
if (!init) {
|
|
|
|
fp = fopen(PCAP_ETHERS_FILE, "r");
|
|
|
|
++init;
|
|
|
|
if (fp == NULL)
|
|
|
|
return (NULL);
|
|
|
|
} else if (fp == NULL)
|
|
|
|
return (NULL);
|
|
|
|
else
|
|
|
|
rewind(fp);
|
1999-07-02 19:58:35 +04:00
|
|
|
|
1995-03-06 14:32:59 +03:00
|
|
|
while ((ep = pcap_next_etherent(fp)) != NULL) {
|
|
|
|
if (strcmp(ep->name, name) == 0) {
|
|
|
|
ap = (u_char *)malloc(6);
|
|
|
|
if (ap != NULL) {
|
|
|
|
memcpy(ap, ep->addr, 6);
|
|
|
|
return (ap);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
#else
|
1996-12-13 11:25:54 +03:00
|
|
|
|
2004-09-28 03:02:53 +04:00
|
|
|
/*
|
|
|
|
* XXX - perhaps this should, instead, be declared in "lbl/os-XXX.h" files,
|
|
|
|
* for those OS versions that don't declare it, rather than being declared
|
|
|
|
* here? That way, for example, we could declare it on FreeBSD 2.x (which
|
|
|
|
* doesn't declare it), but not on FreeBSD 3.x (which declares it like
|
|
|
|
* this) or FreeBSD 4.x (which declares it with its first argument as
|
|
|
|
* "const char *", so no matter how we declare it here, it'll fail to
|
|
|
|
* compile on one of 3.x or 4.x).
|
|
|
|
*/
|
|
|
|
#if !defined(sgi) && !defined(__NetBSD__) && !defined(__FreeBSD__) && \
|
|
|
|
!defined(_UNICOSMP)
|
1996-12-13 11:25:54 +03:00
|
|
|
extern int ether_hostton(char *, struct ether_addr *);
|
|
|
|
#endif
|
|
|
|
|
1995-03-06 14:32:59 +03:00
|
|
|
/* Use the os supplied routines */
|
|
|
|
u_char *
|
|
|
|
pcap_ether_hostton(const char *name)
|
|
|
|
{
|
|
|
|
register u_char *ap;
|
|
|
|
u_char a[6];
|
|
|
|
|
|
|
|
ap = NULL;
|
1996-12-13 11:25:54 +03:00
|
|
|
if (ether_hostton((char *)name, (struct ether_addr *)a) == 0) {
|
1995-03-06 14:32:59 +03:00
|
|
|
ap = (u_char *)malloc(6);
|
|
|
|
if (ap != NULL)
|
1997-10-03 19:53:00 +04:00
|
|
|
memcpy((char *)ap, (char *)a, 6);
|
1995-03-06 14:32:59 +03:00
|
|
|
}
|
|
|
|
return (ap);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
u_short
|
|
|
|
__pcap_nametodnaddr(const char *name)
|
|
|
|
{
|
|
|
|
#ifdef DECNETLIB
|
|
|
|
struct nodeent *getnodebyname();
|
|
|
|
struct nodeent *nep;
|
|
|
|
unsigned short res;
|
|
|
|
|
|
|
|
nep = getnodebyname(name);
|
|
|
|
if (nep == ((struct nodeent *)0))
|
|
|
|
bpf_error("unknown decnet host name '%s'\n", name);
|
|
|
|
|
|
|
|
memcpy((char *)&res, (char *)nep->n_addr, sizeof(unsigned short));
|
|
|
|
return(res);
|
|
|
|
#else
|
|
|
|
bpf_error("decnet name support not included, '%s' cannot be translated\n",
|
|
|
|
name);
|
1997-11-06 00:37:27 +03:00
|
|
|
/* NOTREACHED */
|
|
|
|
#ifdef lint
|
|
|
|
/*
|
|
|
|
* Arguably, lint should assume that functions which don't return
|
|
|
|
* (i.e. that contain no return statements and whose ends are
|
|
|
|
* unreachable) actually return a value, so callers won't get
|
|
|
|
* warnings for using that value (since they won't actually
|
|
|
|
* be doing so). However, most lints don't seem to do that...
|
|
|
|
*/
|
|
|
|
return (0);
|
|
|
|
#endif
|
1995-03-06 14:32:59 +03:00
|
|
|
#endif
|
|
|
|
}
|