12949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project/* 22949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * Copyright (c) 1990, 1992, 1993, 1994, 1995, 1996, 1997 32949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * The Regents of the University of California. All rights reserved. 42949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * 52949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * Redistribution and use in source and binary forms, with or without 62949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * modification, are permitted provided that: (1) source code distributions 72949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * retain the above copyright notice and this paragraph in its entirety, (2) 82949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * distributions including binary code include the above copyright notice and 92949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * this paragraph in its entirety in the documentation or other materials 102949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * provided with the distribution, and (3) all advertising materials mentioning 112949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * features or use of this software display the following acknowledgement: 122949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * ``This product includes software developed by the University of California, 132949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of 142949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * the University nor the names of its contributors may be used to endorse 152949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * or promote products derived from this software without specific prior 162949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * written permission. 172949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 182949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 192949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 202949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project */ 212949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project 222949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project/* Name to address translation routines. */ 232949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project 2453f17a9db278d33517d9888dd77848f554522a38JP Abgrallenum { 2553f17a9db278d33517d9888dd77848f554522a38JP Abgrall LINKADDR_ETHER, 2653f17a9db278d33517d9888dd77848f554522a38JP Abgrall LINKADDR_FRELAY, 2753f17a9db278d33517d9888dd77848f554522a38JP Abgrall LINKADDR_IEEE1394, 2853f17a9db278d33517d9888dd77848f554522a38JP Abgrall LINKADDR_ATM 2953f17a9db278d33517d9888dd77848f554522a38JP Abgrall}; 3053f17a9db278d33517d9888dd77848f554522a38JP Abgrall 3153f17a9db278d33517d9888dd77848f554522a38JP Abgrall#define BUFSIZE 128 3253f17a9db278d33517d9888dd77848f554522a38JP Abgrall 33892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *linkaddr_string(netdissect_options *, const u_char *, const unsigned int, const unsigned int); 34892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *etheraddr_string(netdissect_options *, const u_char *); 3553f17a9db278d33517d9888dd77848f554522a38JP Abgrallextern const char *le64addr_string(const u_char *); 362949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Projectextern const char *etherproto_string(u_short); 372949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Projectextern const char *tcpport_string(u_short); 382949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Projectextern const char *udpport_string(u_short); 39892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *isonsap_string(const u_char *, register u_int); 40892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *dnaddr_string(netdissect_options *, u_short); 41892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *protoid_string(const u_char *); 42892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *ipxsap_string(u_short); 43892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *getname(netdissect_options *, const u_char *); 442949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project#ifdef INET6 45892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *getname6(netdissect_options *, const u_char *); 462949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project#endif 47892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char *intoa(uint32_t); 482949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project 49892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern void init_addrtoname(netdissect_options *, uint32_t, uint32_t); 502949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Projectextern struct hnamemem *newhnamemem(void); 512949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project#ifdef INET6 522949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Projectextern struct h6namemem *newh6namemem(void); 532949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project#endif 54892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughesextern const char * ieee8021q_tci_string(const uint16_t); 552949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project 56892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughes#define ipaddr_string(ndo, p) getname(ndo, (const u_char *)(p)) 572949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project#ifdef INET6 58892a68bdf2f50b40781212e4d7ee7369c8165953Elliott Hughes#define ip6addr_string(ndo, p) getname6(ndo, (const u_char *)(p)) 592949f58a438f6fd85f66a8b7ed4708042cde4b37The Android Open Source Project#endif 60