138465Smsmith/*
238465Smsmith * Copyright (c) 1990, 1992, 1993, 1994, 1995, 1996, 1997
338465Smsmith *	The Regents of the University of California.  All rights reserved.
438465Smsmith *
538465Smsmith * Redistribution and use in source and binary forms, with or without
638465Smsmith * modification, are permitted provided that: (1) source code distributions
738465Smsmith * retain the above copyright notice and this paragraph in its entirety, (2)
838465Smsmith * distributions including binary code include the above copyright notice and
938465Smsmith * this paragraph in its entirety in the documentation or other materials
1038465Smsmith * provided with the distribution, and (3) all advertising materials mentioning
1138465Smsmith * features or use of this software display the following acknowledgement:
1238465Smsmith * ``This product includes software developed by the University of California,
1338465Smsmith * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
1438465Smsmith * the University nor the names of its contributors may be used to endorse
1538465Smsmith * or promote products derived from this software without specific prior
1638465Smsmith * written permission.
1738465Smsmith * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
1838465Smsmith * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
1938465Smsmith * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2038465Smsmith *
2138465Smsmith * @(#) $Header: /tcpdump/master/tcpdump/addrtoname.h,v 1.20 2007-08-08 14:06:34 hannes Exp $ (LBL)
2238465Smsmith */
2338465Smsmith
2438465Smsmith/* Name to address translation routines. */
2538465Smsmith
2650477Speterenum {
2738465Smsmith    LINKADDR_ETHER,
2838465Smsmith    LINKADDR_FRELAY,
29234789Smarius    LINKADDR_IEEE1394,
30234789Smarius    LINKADDR_ATM
31234789Smarius};
3238465Smsmith
3340553Smsmith#define BUFSIZE 128
3478195Speter
3538465Smsmithextern const char *linkaddr_string(const u_char *, const unsigned int, const unsigned int);
3638465Smsmithextern const char *etheraddr_string(const u_char *);
3738465Smsmithextern const char *le64addr_string(const u_char *);
3838465Smsmithextern const char *etherproto_string(u_short);
3938465Smsmithextern const char *tcpport_string(u_short);
4038465Smsmithextern const char *udpport_string(u_short);
4138465Smsmithextern const char *getname(const u_char *);
4238465Smsmith#ifdef INET6
4338465Smsmithextern const char *getname6(const u_char *);
4438465Smsmith#endif
4538465Smsmithextern const char *intoa(u_int32_t);
4638465Smsmith
4738465Smsmithextern void init_addrtoname(u_int32_t, u_int32_t);
4886090Sjhbextern struct hnamemem *newhnamemem(void);
49185029Spjd#ifdef INET6
50163897Smarcelextern struct h6namemem *newh6namemem(void);
51201941Smarcel#endif
5238465Smsmith
5338465Smsmith#define ipaddr_string(p) getname((const u_char *)(p))
5438465Smsmith#ifdef INET6
5538465Smsmith#define ip6addr_string(p) getname6((const u_char *)(p))
5638465Smsmith#endif
5738465Smsmith