xref: /freebsd/contrib/libpcap/pcap-null.c (revision 04fb2745)
18cf6c252SPaul Traina /*
23052b236SBill Fenner  * Copyright (c) 1994, 1995, 1996
38cf6c252SPaul Traina  *	The Regents of the University of California.  All rights reserved.
48cf6c252SPaul Traina  *
58cf6c252SPaul Traina  * Redistribution and use in source and binary forms, with or without
68cf6c252SPaul Traina  * modification, are permitted provided that: (1) source code distributions
78cf6c252SPaul Traina  * retain the above copyright notice and this paragraph in its entirety, (2)
88cf6c252SPaul Traina  * distributions including binary code include the above copyright notice and
98cf6c252SPaul Traina  * this paragraph in its entirety in the documentation or other materials
108cf6c252SPaul Traina  * provided with the distribution, and (3) all advertising materials mentioning
118cf6c252SPaul Traina  * features or use of this software display the following acknowledgement:
128cf6c252SPaul Traina  * ``This product includes software developed by the University of California,
138cf6c252SPaul Traina  * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
148cf6c252SPaul Traina  * the University nor the names of its contributors may be used to endorse
158cf6c252SPaul Traina  * or promote products derived from this software without specific prior
168cf6c252SPaul Traina  * written permission.
178cf6c252SPaul Traina  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
188cf6c252SPaul Traina  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
198cf6c252SPaul Traina  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
208cf6c252SPaul Traina  */
218cf6c252SPaul Traina 
22feb4ecdbSBruce M Simpson #ifdef HAVE_CONFIG_H
2304fb2745SSam Leffler #include <config.h>
24dc2c7305SBill Fenner #endif
25dc2c7305SBill Fenner 
26dc2c7305SBill Fenner #include <string.h>
27dc2c7305SBill Fenner 
288cf6c252SPaul Traina #include "pcap-int.h"
298cf6c252SPaul Traina 
308cf6c252SPaul Traina static char nosup[] = "live packet capture not supported on this system";
318cf6c252SPaul Traina 
328cf6c252SPaul Traina pcap_t *
pcap_create_interface(const char * device _U_,char * ebuf)338cf6c252SPaul Traina pcap_create_interface(const char *device _U_, char *ebuf)
348cf6c252SPaul Traina {
358cf6c252SPaul Traina 	(void)pcap_strlcpy(ebuf, nosup, PCAP_ERRBUF_SIZE);
368cf6c252SPaul Traina 	return (NULL);
378cf6c252SPaul Traina }
388cf6c252SPaul Traina 
398cf6c252SPaul Traina int
pcap_platform_finddevs(pcap_if_list_t * devlistp _U_,char * errbuf _U_)408cf6c252SPaul Traina pcap_platform_finddevs(pcap_if_list_t *devlistp _U_, char *errbuf _U_)
418cf6c252SPaul Traina {
428cf6c252SPaul Traina 	/*
43feb4ecdbSBruce M Simpson 	 * There are no interfaces on which we can capture.
44feb4ecdbSBruce M Simpson 	 */
458cf6c252SPaul Traina 	return (0);
46dc2c7305SBill Fenner }
478cf6c252SPaul Traina 
488cf6c252SPaul Traina #ifdef _WIN32
498cf6c252SPaul Traina int
pcap_lookupnet(const char * device _U_,bpf_u_int32 * netp _U_,bpf_u_int32 * maskp _U_,char * errbuf)508cf6c252SPaul Traina pcap_lookupnet(const char *device _U_, bpf_u_int32 *netp _U_,
51feb4ecdbSBruce M Simpson     bpf_u_int32 *maskp _U_, char *errbuf)
528cf6c252SPaul Traina {
538cf6c252SPaul Traina 	(void)pcap_strlcpy(errbuf, nosup, PCAP_ERRBUF_SIZE);
548cf6c252SPaul Traina 	return (-1);
55 }
56 #endif
57 
58 /*
59  * Libpcap version string.
60  */
61 const char *
pcap_lib_version(void)62 pcap_lib_version(void)
63 {
64 	return (PCAP_VERSION_STRING);
65 }
66