Don't include libwireshark headers from libwiretap.

Move the definitions of hashipv4_t and hashipv6_t to wiretap/wtap.h, as
that's the main place they're used.  Change them a bit not to depend on
other stuff from libwireshark, and change the code as required by those
changes.

This should fix the Solaris build; apparently, the Sun^WOracle compiler
is generating code for static inline functions even if they're never
called, so that libwiretap ends up including code that calls tvbuff and
wmem functions.

There's probably further cleanup that could be done here, but this
should at least fix the build, as well as getting rid of a dependency
between two libraries that are at least somewhat independent (libwiretap
should *not* depend on libwireshark, as some programs use libwiretap but
not libwireshark, and, ultimately, we probably want it to be possible to
use libwireshark without libwiretap but that'd be more work).

Change-Id: I91c745282f17d7c8bff7809aa277eab2b3cf47c1
Reviewed-on: https://code.wireshark.org/review/11537
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2015-11-03 14:12:14 -08:00
parent 40b45dfb6e
commit 58431e2f6a
5 changed files with 19 additions and 16 deletions

View File

@ -896,7 +896,7 @@ static hashipv6_t *
new_ipv6(const struct e_in6_addr *addr)
{
hashipv6_t *tp = g_new(hashipv6_t,1);
tp->addr = *addr;
memcpy(tp->addr, addr->bytes, sizeof tp->addr);
tp->flags = 0;
tp->name[0] = '\0';
ip6_to_str_buf(addr, tp->ip6);

View File

@ -89,20 +89,7 @@ typedef struct serv_port {
#define DUMMY_AND_RESOLVE_FLGS (DUMMY_ADDRESS_ENTRY | TRIED_RESOLVE_ADDRESS)
#define USED_AND_RESOLVED_MASK (DUMMY_ADDRESS_ENTRY | RESOLVED_ADDRESS_USED)
typedef struct hashipv4 {
guint addr;
guint8 flags; /* B0 dummy_entry, B1 resolve, B2 If the address is used in the trace */
gchar ip[16];
gchar name[MAXNAMELEN];
} hashipv4_t;
typedef struct hashipv6 {
struct e_in6_addr addr;
guint8 flags; /* B0 dummy_entry, B1 resolve, B2 If the address is used in the trace */
gchar ip6[MAX_IP6_STR_LEN]; /* XX */
gchar name[MAXNAMELEN];
} hashipv6_t;
/*
* Flag controlling what names to resolve.
*/

View File

@ -424,7 +424,7 @@ static int CaptureInfoConst_get_hosts(lua_State* L) {
/* create the entry table */
lua_newtable(L);
/* addr is in network order already */
lua_pushlstring(L, (char*)(&ipv6_hash_list_entry->addr.bytes[0]), 16);
lua_pushlstring(L, (char*)(&ipv6_hash_list_entry->addr[0]), 16);
lua_setfield(L, -2, "addr");
lua_pushstring(L, ipv6_hash_list_entry->name);
lua_setfield(L, -2, "name");

View File

@ -35,7 +35,6 @@
#include "wtap-int.h"
#include <epan/addr_resolv.h>
#include "file_wrappers.h"
#include "pcap-common.h"
#include "pcap-encap.h"

View File

@ -1433,6 +1433,23 @@ typedef struct wtapng_name_res_s {
/* XXX */
} wtapng_name_res_t;
#ifndef MAXNAMELEN
#define MAXNAMELEN 64 /* max name length (hostname and port name) */
#endif
typedef struct hashipv4 {
guint addr;
guint8 flags; /* B0 dummy_entry, B1 resolve, B2 If the address is used in the trace */
gchar ip[16];
gchar name[MAXNAMELEN];
} hashipv4_t;
typedef struct hashipv6 {
guint8 addr[16];
guint8 flags; /* B0 dummy_entry, B1 resolve, B2 If the address is used in the trace */
gchar ip6[40];
gchar name[MAXNAMELEN];
} hashipv6_t;
/** A struct with lists of resolved addresses.
* Used when writing name resoultion blocks (NRB)