xref: /openbsd/usr.sbin/tcpdump/addrtoname.h (revision e654d8cd)
1 /*	$OpenBSD: addrtoname.h,v 1.12 2018/10/22 16:12:45 kn Exp $	*/
2 
3 /*
4  * Copyright (c) 1990, 1992, 1993, 1994, 1995, 1996, 1997
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that: (1) source code distributions
9  * retain the above copyright notice and this paragraph in its entirety, (2)
10  * distributions including binary code include the above copyright notice and
11  * this paragraph in its entirety in the documentation or other materials
12  * provided with the distribution, and (3) all advertising materials mentioning
13  * features or use of this software display the following acknowledgement:
14  * ``This product includes software developed by the University of California,
15  * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
16  * the University nor the names of its contributors may be used to endorse
17  * or promote products derived from this software without specific prior
18  * written permission.
19  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22  *
23  * @(#) $Id: addrtoname.h,v 1.12 2018/10/22 16:12:45 kn Exp $ (LBL)
24  */
25 
26 #ifndef BYTE_ORDER
27 #error "No byte order defined"
28 #endif
29 
30 #if BYTE_ORDER == BIG_ENDIAN
31 #define WORDS_BIGENDIAN
32 #endif /* BYTE_ORDER */
33 
34 /* Name to address translation routines. */
35 extern char *linkaddr_string(const u_char *, const int);
36 extern char *etheraddr_string(const u_char *);
37 extern char *etherproto_string(u_short);
38 extern char *tcpport_string(u_short);
39 extern char *udpport_string(u_short);
40 extern char *ipproto_string(u_int);
41 extern char *getname(const u_char *);
42 extern char *getname6(const u_char *);
43 extern char *intoa(u_int32_t);
44 
45 extern void init_addrtoname(u_int32_t, u_int32_t);
46 extern struct hnamemem *newhnamemem(void);
47 extern struct h6namemem *newh6namemem(void);
48 
49 #define ipaddr_string(p) getname((const u_char *)(p))
50 #define ip6addr_string(p) getname6((const u_char *)(p))
51