117680Spst/*
239297Sfenner * Copyright (c) 1990, 1992, 1993, 1994, 1995, 1996, 1997
317680Spst *	The Regents of the University of California.  All rights reserved.
417680Spst *
517680Spst * Redistribution and use in source and binary forms, with or without
617680Spst * modification, are permitted provided that: (1) source code distributions
717680Spst * retain the above copyright notice and this paragraph in its entirety, (2)
817680Spst * distributions including binary code include the above copyright notice and
917680Spst * this paragraph in its entirety in the documentation or other materials
1017680Spst * provided with the distribution, and (3) all advertising materials mentioning
1117680Spst * features or use of this software display the following acknowledgement:
1217680Spst * ``This product includes software developed by the University of California,
1317680Spst * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
1417680Spst * the University nor the names of its contributors may be used to endorse
1517680Spst * or promote products derived from this software without specific prior
1617680Spst * written permission.
1717680Spst * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
1817680Spst * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
1917680Spst * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2017680Spst *
21190207Srpaulo * @(#) $Header: /tcpdump/master/tcpdump/addrtoname.h,v 1.20 2007-08-08 14:06:34 hannes Exp $ (LBL)
2217680Spst */
2317680Spst
2417680Spst/* Name to address translation routines. */
2517680Spst
26190207Srpauloenum {
27190207Srpaulo    LINKADDR_ETHER,
28190207Srpaulo    LINKADDR_FRELAY,
29190207Srpaulo    LINKADDR_IEEE1394,
30190207Srpaulo    LINKADDR_ATM
31190207Srpaulo};
32190207Srpaulo
33190207Srpaulo#define BUFSIZE 128
34190207Srpaulo
35190207Srpauloextern const char *linkaddr_string(const u_char *, const unsigned int, const unsigned int);
3698524Sfennerextern const char *etheraddr_string(const u_char *);
37235530Sdelphijextern const char *le64addr_string(const u_char *);
3898524Sfennerextern const char *etherproto_string(u_short);
3998524Sfennerextern const char *tcpport_string(u_short);
4098524Sfennerextern const char *udpport_string(u_short);
4198524Sfennerextern const char *getname(const u_char *);
4256893Sfenner#ifdef INET6
4398524Sfennerextern const char *getname6(const u_char *);
4456893Sfenner#endif
4598524Sfennerextern const char *intoa(u_int32_t);
4617680Spst
4739297Sfennerextern void init_addrtoname(u_int32_t, u_int32_t);
4817680Spstextern struct hnamemem *newhnamemem(void);
4956893Sfenner#ifdef INET6
5056893Sfennerextern struct h6namemem *newh6namemem(void);
5156893Sfenner#endif
5217680Spst
5317680Spst#define ipaddr_string(p) getname((const u_char *)(p))
5456893Sfenner#ifdef INET6
5556893Sfenner#define ip6addr_string(p) getname6((const u_char *)(p))
5656893Sfenner#endif
57