|
Packit |
209cc3 |
/*
|
|
Packit |
209cc3 |
* Copyright (c) 1994, 1996
|
|
Packit |
209cc3 |
* The Regents of the University of California. All rights reserved.
|
|
Packit |
209cc3 |
*
|
|
Packit |
209cc3 |
* Redistribution and use in source and binary forms, with or without
|
|
Packit |
209cc3 |
* modification, are permitted provided that the following conditions
|
|
Packit |
209cc3 |
* are met:
|
|
Packit |
209cc3 |
* 1. Redistributions of source code must retain the above copyright
|
|
Packit |
209cc3 |
* notice, this list of conditions and the following disclaimer.
|
|
Packit |
209cc3 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
Packit |
209cc3 |
* notice, this list of conditions and the following disclaimer in the
|
|
Packit |
209cc3 |
* documentation and/or other materials provided with the distribution.
|
|
Packit |
209cc3 |
* 3. All advertising materials mentioning features or use of this software
|
|
Packit |
209cc3 |
* must display the following acknowledgement:
|
|
Packit |
209cc3 |
* This product includes software developed by the Computer Systems
|
|
Packit |
209cc3 |
* Engineering Group at Lawrence Berkeley Laboratory.
|
|
Packit |
209cc3 |
* 4. Neither the name of the University nor of the Laboratory may be used
|
|
Packit |
209cc3 |
* to endorse or promote products derived from this software without
|
|
Packit |
209cc3 |
* specific prior written permission.
|
|
Packit |
209cc3 |
*
|
|
Packit |
209cc3 |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
Packit |
209cc3 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
Packit |
209cc3 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
Packit |
209cc3 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
Packit |
209cc3 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
Packit |
209cc3 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
Packit |
209cc3 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
Packit |
209cc3 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
Packit |
209cc3 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
Packit |
209cc3 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
Packit |
209cc3 |
* SUCH DAMAGE.
|
|
Packit |
209cc3 |
*/
|
|
Packit |
209cc3 |
|
|
Packit |
209cc3 |
#ifndef lib_pcap_namedb_h
|
|
Packit |
209cc3 |
#define lib_pcap_namedb_h
|
|
Packit |
209cc3 |
|
|
Packit |
209cc3 |
#ifdef __cplusplus
|
|
Packit |
209cc3 |
extern "C" {
|
|
Packit |
209cc3 |
#endif
|
|
Packit |
209cc3 |
|
|
Packit |
209cc3 |
/*
|
|
Packit |
209cc3 |
* As returned by the pcap_next_etherent()
|
|
Packit |
209cc3 |
* XXX this stuff doesn't belong in this interface, but this
|
|
Packit |
209cc3 |
* library already must do name to address translation, so
|
|
Packit |
209cc3 |
* on systems that don't have support for /etc/ethers, we
|
|
Packit |
209cc3 |
* export these hooks since they're already being used by
|
|
Packit |
209cc3 |
* some applications (such as tcpdump) and already being
|
|
Packit |
209cc3 |
* marked as exported in some OSes offering libpcap (such
|
|
Packit |
209cc3 |
* as Debian).
|
|
Packit |
209cc3 |
*/
|
|
Packit |
209cc3 |
struct pcap_etherent {
|
|
Packit |
209cc3 |
u_char addr[6];
|
|
Packit |
209cc3 |
char name[122];
|
|
Packit |
209cc3 |
};
|
|
Packit |
209cc3 |
#ifndef PCAP_ETHERS_FILE
|
|
Packit |
209cc3 |
#define PCAP_ETHERS_FILE "/etc/ethers"
|
|
Packit |
209cc3 |
#endif
|
|
Packit |
209cc3 |
PCAP_API struct pcap_etherent *pcap_next_etherent(FILE *);
|
|
Packit |
209cc3 |
PCAP_API u_char *pcap_ether_hostton(const char*);
|
|
Packit |
209cc3 |
PCAP_API u_char *pcap_ether_aton(const char *);
|
|
Packit |
209cc3 |
|
|
Packit |
209cc3 |
PCAP_API bpf_u_int32 **pcap_nametoaddr(const char *);
|
|
Packit |
209cc3 |
PCAP_API struct addrinfo *pcap_nametoaddrinfo(const char *);
|
|
Packit |
209cc3 |
PCAP_API bpf_u_int32 pcap_nametonetaddr(const char *);
|
|
Packit |
209cc3 |
|
|
Packit |
209cc3 |
PCAP_API int pcap_nametoport(const char *, int *, int *);
|
|
Packit |
209cc3 |
PCAP_API int pcap_nametoportrange(const char *, int *, int *, int *);
|
|
Packit |
209cc3 |
PCAP_API int pcap_nametoproto(const char *);
|
|
Packit |
209cc3 |
PCAP_API int pcap_nametoeproto(const char *);
|
|
Packit |
209cc3 |
PCAP_API int pcap_nametollc(const char *);
|
|
Packit |
209cc3 |
/*
|
|
Packit |
209cc3 |
* If a protocol is unknown, PROTO_UNDEF is returned.
|
|
Packit |
209cc3 |
* Also, pcap_nametoport() returns the protocol along with the port number.
|
|
Packit |
209cc3 |
* If there are ambiguous entried in /etc/services (i.e. domain
|
|
Packit |
209cc3 |
* can be either tcp or udp) PROTO_UNDEF is returned.
|
|
Packit |
209cc3 |
*/
|
|
Packit |
209cc3 |
#define PROTO_UNDEF -1
|
|
Packit |
209cc3 |
|
|
Packit |
209cc3 |
#ifdef __cplusplus
|
|
Packit |
209cc3 |
}
|
|
Packit |
209cc3 |
#endif
|
|
Packit |
209cc3 |
|
|
Packit |
209cc3 |
#endif
|