forked from osmocom/wireshark
Move a routine into dumpcap - it's not used outside dumpcap.
svn path=/trunk/; revision=32042
This commit is contained in:
parent
13152548f6
commit
3b845dcce0
|
@ -560,26 +560,6 @@ free_pcap_linktype_list(GList *linktype_list)
|
|||
g_list_free(linktype_list);
|
||||
}
|
||||
|
||||
/* Set the data link type on a pcap. */
|
||||
const char *
|
||||
set_pcap_linktype(pcap_t *pch, char *devname
|
||||
#ifdef HAVE_PCAP_SET_DATALINK
|
||||
_U_
|
||||
#endif
|
||||
, int dlt)
|
||||
{
|
||||
#ifdef HAVE_PCAP_SET_DATALINK
|
||||
if (pcap_set_datalink(pch, dlt) == 0)
|
||||
return NULL; /* no error */
|
||||
return pcap_geterr(pch);
|
||||
#else
|
||||
/* Let them set it to the type it is; reject any other request. */
|
||||
if (get_pcap_linktype(pch, devname) == dlt)
|
||||
return NULL; /* no error */
|
||||
return "That DLT isn't one of the DLTs supported by this device";
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *
|
||||
linktype_val_to_name(int dlt)
|
||||
{
|
||||
|
|
|
@ -96,7 +96,6 @@ void free_pcap_linktype_list(GList *linktype_list);
|
|||
/* get/set the link type of an interface */
|
||||
/* (only used in capture_loop.c / capture-pcap-util.c) */
|
||||
int get_pcap_linktype(pcap_t *pch, const char *devname);
|
||||
const char *set_pcap_linktype(pcap_t *pch, char *devname, int dlt);
|
||||
|
||||
|
||||
const char *linktype_val_to_name(int dlt);
|
||||
|
|
20
dumpcap.c
20
dumpcap.c
|
@ -671,6 +671,26 @@ relinquish_all_capabilities()
|
|||
|
||||
#endif /* HAVE_LIBCAP */
|
||||
|
||||
/* Set the data link type on a pcap. */
|
||||
static const char *
|
||||
set_pcap_linktype(pcap_t *pch, char *devname
|
||||
#ifdef HAVE_PCAP_SET_DATALINK
|
||||
_U_
|
||||
#endif
|
||||
, int dlt)
|
||||
{
|
||||
#ifdef HAVE_PCAP_SET_DATALINK
|
||||
if (pcap_set_datalink(pch, dlt) == 0)
|
||||
return NULL; /* no error */
|
||||
return pcap_geterr(pch);
|
||||
#else
|
||||
/* Let them set it to the type it is; reject any other request. */
|
||||
if (get_pcap_linktype(pch, devname) == dlt)
|
||||
return NULL; /* no error */
|
||||
return "That DLT isn't one of the DLTs supported by this device";
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Take care of byte order in the libpcap headers read from pipes.
|
||||
* (function taken from wiretap/libpcap.c) */
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue