1/*
2 * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
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: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
--- 7 unchanged lines hidden (view full) ---
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * Name to id translation routines used by the scanner.
22 * These functions are not time critical.
23 *
24 * $FreeBSD: head/contrib/libpcap/nametoaddr.c 75110 2001-04-03 04:32:48Z fenner $
25 */
26
27#ifndef lint
28static const char rcsid[] =
29 "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.57.2.1 2001/01/17 18:21:56 guy Exp $ (LBL)";
30#endif
31
32#ifdef HAVE_CONFIG_H
33#include "config.h"
34#endif
35
36#include <sys/param.h>
37#include <sys/types.h> /* concession to AIX */
--- 281 unchanged lines hidden (view full) ---
319 register u_int d;
320
321 e = ep = (u_char *)malloc(6);
322
323 while (*s) {
324 if (*s == ':')
325 s += 1;
326 d = xdtoi(*s++);
327 if (isxdigit(*s)) {
328 d <<= 4;
329 d |= xdtoi(*s++);
330 }
331 *ep++ = d;
332 }
333
334 return (e);
335}
--- 74 unchanged lines hidden (view full) ---
410 if (nep == ((struct nodeent *)0))
411 bpf_error("unknown decnet host name '%s'\n", name);
412
413 memcpy((char *)&res, (char *)nep->n_addr, sizeof(unsigned short));
414 return(res);
415#else
416 bpf_error("decnet name support not included, '%s' cannot be translated\n",
417 name);
418#endif
419}
2 * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
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: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
--- 7 unchanged lines hidden (view full) ---
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * Name to id translation routines used by the scanner.
22 * These functions are not time critical.
23 *
24 * $FreeBSD: head/contrib/libpcap/nametoaddr.c 75110 2001-04-03 04:32:48Z fenner $
25 */
26
27#ifndef lint
28static const char rcsid[] =
29 "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.57.2.1 2001/01/17 18:21:56 guy Exp $ (LBL)";
30#endif
31
32#ifdef HAVE_CONFIG_H
33#include "config.h"
34#endif
35
36#include <sys/param.h>
37#include <sys/types.h> /* concession to AIX */
--- 281 unchanged lines hidden (view full) ---
319 register u_int d;
320
321 e = ep = (u_char *)malloc(6);
322
323 while (*s) {
324 if (*s == ':')
325 s += 1;
326 d = xdtoi(*s++);
327 if (isxdigit(*s)) {
328 d <<= 4;
329 d |= xdtoi(*s++);
330 }
331 *ep++ = d;
332 }
333
334 return (e);
335}
--- 74 unchanged lines hidden (view full) ---
410 if (nep == ((struct nodeent *)0))
411 bpf_error("unknown decnet host name '%s'\n", name);
412
413 memcpy((char *)&res, (char *)nep->n_addr, sizeof(unsigned short));
414 return(res);
415#else
416 bpf_error("decnet name support not included, '%s' cannot be translated\n",
417 name);
418#endif
419}