diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/addr_resolv.c | 50 | ||||
-rw-r--r-- | epan/dfilter/dfilter-macro.c | 32 | ||||
-rw-r--r-- | epan/diam_dict.l | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-giop.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-isakmp.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-kerberos.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-ssl-utils.c | 80 | ||||
-rw-r--r-- | epan/dissectors/packet-ssl.c | 26 | ||||
-rw-r--r-- | epan/dissectors/packet-tpncp.c | 10 | ||||
-rw-r--r-- | epan/dtd_preparse.l | 48 | ||||
-rw-r--r-- | epan/emem.c | 11 | ||||
-rw-r--r-- | epan/filesystem.c | 48 | ||||
-rw-r--r-- | epan/libwireshark.def | 9 | ||||
-rw-r--r-- | epan/plugins.c | 28 | ||||
-rw-r--r-- | epan/prefs.c | 12 | ||||
-rw-r--r-- | epan/radius_dict.l | 8 | ||||
-rw-r--r-- | epan/uat.c | 4 | ||||
-rw-r--r-- | epan/uat_load.l | 6 | ||||
-rw-r--r-- | epan/wslua/init_wslua.c | 4 |
19 files changed, 202 insertions, 204 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index 5723e85126..d40ed5bf0e 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -122,7 +122,7 @@ #include "filesystem.h" #include <epan/strutil.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include <epan/prefs.h> #include <epan/emem.h> @@ -356,7 +356,7 @@ static void add_service_name(hashport_t **proto_table, guint port, const char *s { int hash_idx; hashport_t *tp; - + hash_idx = HASH_PORT(port); tp = proto_table[hash_idx]; @@ -465,7 +465,7 @@ static void parse_services_file(const char * path) static char *buf = NULL; /* services hash table initialization */ - serv_p = eth_fopen(path, "r"); + serv_p = ws_fopen(path, "r"); if (serv_p == NULL) return; @@ -610,7 +610,7 @@ static void fill_dummy_ip4(guint addr, hashipv4_t* volatile tp) * If length of mask is 32, we chomp the whole address. * If the address string starts '.' (should not happen?), * we skip that '.'. - */ + */ i = subnet_entry.mask_length / 8; while(*(paddr) != '\0' && i > 0) { if(*(++paddr) == '.') { @@ -618,11 +618,11 @@ static void fill_dummy_ip4(guint addr, hashipv4_t* volatile tp) } } - /* There are more efficient ways to do this, but this is safe if we + /* There are more efficient ways to do this, but this is safe if we * trust g_snprintf and MAXNAMELEN */ - g_snprintf(tp->name, MAXNAMELEN, "%s%s", subnet_entry.name, paddr); - } else { + g_snprintf(tp->name, MAXNAMELEN, "%s%s", subnet_entry.name, paddr); + } else { ip_to_str_buf((guint8 *)&addr, tp->name, MAXNAMELEN); } } @@ -991,7 +991,7 @@ static void set_ethent(char *path) if (eth_p) rewind(eth_p); else - eth_p = eth_fopen(path, "r"); + eth_p = ws_fopen(path, "r"); } static void end_ethent(void) @@ -1573,7 +1573,7 @@ static void set_ipxnetent(char *path) if (ipxnet_p) rewind(ipxnet_p); else - ipxnet_p = eth_fopen(path, "r"); + ipxnet_p = ws_fopen(path, "r"); } static void end_ipxnetent(void) @@ -1798,7 +1798,7 @@ read_hosts_file (const char *hostspath) * See the hosts(4) or hosts(5) man page for hosts file format * (not available on all systems). */ - if ((hf = eth_fopen(hostspath, "r")) == NULL) + if ((hf = ws_fopen(hostspath, "r")) == NULL) return FALSE; while (fgetline(&line, &size, hf) >= 0) { @@ -1852,7 +1852,7 @@ read_hosts_file (const char *hostspath) /* Read in a list of subnet definition - name pairs. * <line> = <comment> | <entry> | <whitespace> * <comment> = <whitespace>#<any> - * <entry> = <subnet_definition> <whitespace> <subnet_name> [<comment>|<whitespace><any>] + * <entry> = <subnet_definition> <whitespace> <subnet_name> [<comment>|<whitespace><any>] * <subnet_definition> = <ipv4_address> / <subnet_mask_length> * <ipv4_address> is a full address; it will be masked to get the subnet-ID. * <subnet_mask_length> is a decimal 1-31 @@ -1873,7 +1873,7 @@ read_subnets_file (const char *subnetspath) guint32 host_addr; /* IPv4 ONLY */ int mask_length; - if ((hf = eth_fopen(subnetspath, "r")) == NULL) + if ((hf = ws_fopen(subnetspath, "r")) == NULL) return FALSE; while (fgetline(&line, &size, hf) >= 0) { @@ -1892,7 +1892,7 @@ read_subnets_file (const char *subnetspath) } *cp2 = '\0'; /* Cut token */ ++cp2 ; - + /* Check if this is a valid IPv4 address */ if (inet_pton(AF_INET, cp, &host_addr) != 1) { continue; /* no */ @@ -1901,7 +1901,7 @@ read_subnets_file (const char *subnetspath) mask_length = atoi(cp2); if(0 >= mask_length || mask_length > 31) { continue; /* invalid mask length */ - } + } if ((cp = strtok(NULL, " \t")) == NULL) continue; /* no subnet name */ @@ -1926,7 +1926,7 @@ static subnet_entry_t subnet_lookup(const guint32 addr) while(have_subnet_entry && i > 0) { guint32 masked_addr; subnet_length_entry_t* length_entry; - + /* Note that we run from 31 (length 32) to 0 (length 1) */ --i; g_assert(i < SUBNETLENGTHSIZE); @@ -1937,7 +1937,7 @@ static subnet_entry_t subnet_lookup(const guint32 addr) if(NULL != length_entry->subnet_addresses) { hashipv4_t * tp; guint32 hash_idx; - + masked_addr = addr & length_entry->mask; hash_idx = HASH_IPV4_ADDRESS(masked_addr); @@ -1954,7 +1954,7 @@ static subnet_entry_t subnet_lookup(const guint32 addr) } } } - + subnet_entry.mask = 0; subnet_entry.mask_length = 0; subnet_entry.name = NULL; @@ -2013,7 +2013,7 @@ static guint32 get_subnet_mask(guint32 mask_length) { initialised = TRUE; - /* XXX There must be a better way to do this than + /* XXX There must be a better way to do this than * hand-coding the values, but I can't seem to * come up with one! */ @@ -2026,7 +2026,7 @@ static guint32 get_subnet_mask(guint32 mask_length) { inet_pton(AF_INET, "252.0.0.0", &masks[5]); inet_pton(AF_INET, "254.0.0.0", &masks[6]); inet_pton(AF_INET, "255.0.0.0", &masks[7]); - + inet_pton(AF_INET, "255.128.0.0", &masks[8]); inet_pton(AF_INET, "255.192.0.0", &masks[9]); inet_pton(AF_INET, "255.224.0.0", &masks[10]); @@ -2035,7 +2035,7 @@ static guint32 get_subnet_mask(guint32 mask_length) { inet_pton(AF_INET, "255.252.0.0", &masks[13]); inet_pton(AF_INET, "255.254.0.0", &masks[14]); inet_pton(AF_INET, "255.255.0.0", &masks[15]); - + inet_pton(AF_INET, "255.255.128.0", &masks[16]); inet_pton(AF_INET, "255.255.192.0", &masks[17]); inet_pton(AF_INET, "255.255.224.0", &masks[18]); @@ -2044,7 +2044,7 @@ static guint32 get_subnet_mask(guint32 mask_length) { inet_pton(AF_INET, "255.255.252.0", &masks[21]); inet_pton(AF_INET, "255.255.254.0", &masks[22]); inet_pton(AF_INET, "255.255.255.0", &masks[23]); - + inet_pton(AF_INET, "255.255.255.128", &masks[24]); inet_pton(AF_INET, "255.255.255.192", &masks[25]); inet_pton(AF_INET, "255.255.255.224", &masks[26]); @@ -2054,7 +2054,7 @@ static guint32 get_subnet_mask(guint32 mask_length) { inet_pton(AF_INET, "255.255.255.254", &masks[30]); inet_pton(AF_INET, "255.255.255.255", &masks[31]); } - + if(mask_length == 0 || mask_length > SUBNETLENGTHSIZE) { g_assert_not_reached(); return 0; @@ -2070,7 +2070,7 @@ static void subnet_name_lookup_init() guint32 i; for(i = 0; i < SUBNETLENGTHSIZE; ++i) { guint32 length = i + 1; - + subnet_length_entries[i].subnet_addresses = NULL; subnet_length_entries[i].mask_length = length; subnet_length_entries[i].mask = get_subnet_mask(length); @@ -2373,9 +2373,9 @@ extern void add_ipv6_name(struct e_in6_addr *addrp, const gchar *name) static gchar *ep_utoa(guint port) { gchar *bp = ep_alloc(MAXNAMELEN); - + bp = &bp[MAXNAMELEN -1]; - + *bp = 0; do { *--bp = (port % 10) +'0'; diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c index 4242c833cd..832190131e 100644 --- a/epan/dfilter/dfilter-macro.c +++ b/epan/dfilter/dfilter-macro.c @@ -38,7 +38,7 @@ #include <epan/uat.h> #include <epan/report_err.h> #include <epan/proto.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> typedef struct { const char* name; @@ -112,7 +112,7 @@ static void macro_fprint(dfilter_macro_t* m, void* ud) { } void dfilter_macro_save(const gchar* filename, gchar** error) { - FILE* f = eth_fopen(filename,"w"); + FILE* f = ws_fopen(filename,"w"); if (!f) { *error = ep_strdup_printf("Could not open file: '%s', error: %s\n", filename, strerror(errno) ); @@ -515,12 +515,12 @@ static void* macro_copy(void* dest, const void* orig, unsigned len _U_) { /* * Copy the contents of m->priv (a "cooked" version * of m->text) into d->priv. - * + * * First we clone m->text into d->priv, this gets * us a NUL terminated string of the proper length. * - * Then we loop copying bytes from m->priv into - * d-priv. Since m->priv contains internal ACSII NULs + * Then we loop copying bytes from m->priv into + * d-priv. Since m->priv contains internal ACSII NULs * we use the length of m->text to stop the copy. */ @@ -531,7 +531,7 @@ static void* macro_copy(void* dest, const void* orig, unsigned len _U_) { gchar* newPriv = d->priv; while(oldText && *oldText) { *(newPriv++) = *(oldPriv++); - oldText++; + oldText++; } } @@ -543,8 +543,8 @@ static void* macro_copy(void* dest, const void* orig, unsigned len _U_) { * to hold the final NULL terminator. * * The following copy clones the original m->parts - * array into d->parts but then fixes-up the pointers - * so that they point into the appropriate sections + * array into d->parts but then fixes-up the pointers + * so that they point into the appropriate sections * of the d->priv. */ @@ -623,26 +623,26 @@ void dfilter_macro_get_uat(void** p) { #ifdef DUMP_DFILTER_MACRO /* * The dfilter_macro_t has several characteristics that are - * not immediattly obvious. The dump_dfilter_filter_macro_t() - * function can be used to help "visualize" the contents of + * not immediattly obvious. The dump_dfilter_filter_macro_t() + * function can be used to help "visualize" the contents of * a dfilter_macro_t. * * Some non-obvious components of this struct include: * * m->parts is an argv style array of pointers into the - * m->priv string. + * m->priv string. * * The last pointer of an m->parts array should contain * NULL to indicate the end of the parts pointer array. * * m->priv is a "cooked" copy of the m->text string. - * Any variable substitution indicators within m->text - * ("$1", "$2", ...) will have been replaced with ASCII + * Any variable substitution indicators within m->text + * ("$1", "$2", ...) will have been replaced with ASCII * NUL characters within m->priv. * - * The first element of m->parts array (m-parts[0]) will - * usually have the same pointer value as m->priv (unless - * the dfilter-macro starts off with a variable + * The first element of m->parts array (m-parts[0]) will + * usually have the same pointer value as m->priv (unless + * the dfilter-macro starts off with a variable * substitution indicator (e.g. "$1"). */ diff --git a/epan/diam_dict.l b/epan/diam_dict.l index e6478d5e9a..ce0742b5ad 100644 --- a/epan/diam_dict.l +++ b/epan/diam_dict.l @@ -59,7 +59,7 @@ #include "emem.h" #include "diam_dict.h" #include "diam_dict_lex.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> typedef struct entity_t { char* name; @@ -615,7 +615,7 @@ static FILE* ddict_open(const char* system_directory, const char* filename) { fname = strdup(filename); } - fh = eth_fopen(fname,"r"); + fh = ws_fopen(fname,"r"); D(("fname: %s fh: %p\n",fname,fh)); @@ -798,7 +798,7 @@ void ddict_print(FILE* fh, ddict_t* d) { /* * We want to stop processing when we get to the end of the input. - * (%option noyywrap is not used because if used then + * (%option noyywrap is not used because if used then * some flex versions (eg: 2.5.35) generate code which causes * warnings by the Windows VC compiler). */ diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c index cc67d5035a..551d8e9379 100644 --- a/epan/dissectors/packet-giop.c +++ b/epan/dissectors/packet-giop.c @@ -301,7 +301,7 @@ #include "packet-giop.h" #include "packet-tcp.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> /* @@ -1291,7 +1291,7 @@ static void read_IOR_strings_from_file(const gchar *name, int max_iorlen) { gboolean stream_is_big_endian; - fp = eth_fopen(name,"r"); /* open read only */ + fp = ws_fopen(name,"r"); /* open read only */ if (fp == NULL) { if (errno == EACCES) @@ -3785,17 +3785,17 @@ dissect_giop_fragment( tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, if (fragment_tree == NULL) { fragment_tree = proto_item_add_subtree (tf, ett_giop_fragment); - + } } - + request_id = get_CDR_ulong(tvb, &offset, stream_is_big_endian,GIOP_HEADER_SIZE); if (check_col(pinfo->cinfo, COL_INFO)) { col_append_fstr(pinfo->cinfo, COL_INFO, " id=%u", request_id); - } + } if (fragment_tree ) - { + { proto_tree_add_uint (fragment_tree, hf_giop_req_id, tvb, offset-4, 4,request_id); } diff --git a/epan/dissectors/packet-isakmp.c b/epan/dissectors/packet-isakmp.c index cac01ab92d..c72edbd598 100644 --- a/epan/dissectors/packet-isakmp.c +++ b/epan/dissectors/packet-isakmp.c @@ -56,7 +56,7 @@ #include <nettle/cbc.h> #endif #include <epan/strutil.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #endif #include <epan/packet.h> @@ -3218,7 +3218,7 @@ isakmp_init_protocol(void) { G_ALLOC_AND_FREE); if (logf) fclose(logf); - logf = eth_fopen(pluto_log_path, "r"); + logf = ws_fopen(pluto_log_path, "r"); scan_pluto_log(); #endif /* HAVE_LIBNETTLE */ diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c index 3b7b2da063..9393675526 100644 --- a/epan/dissectors/packet-kerberos.c +++ b/epan/dissectors/packet-kerberos.c @@ -102,7 +102,7 @@ #include <epan/dissectors/packet-gssapi.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #define UDP_PORT_KERBEROS 88 #define TCP_PORT_KERBEROS 88 @@ -731,7 +731,7 @@ read_keytab_file(const char *service_key_file) unsigned char buf[SERVICE_KEY_SIZE]; int newline_skip = 0, count = 0; - if (service_key_file != NULL && eth_stat (service_key_file, &st) == 0) { + if (service_key_file != NULL && ws_stat (service_key_file, &st) == 0) { /* The service key file contains raw 192-bit (24 byte) 3DES keys. * There can be zero, one (\n), or two (\r\n) characters between @@ -749,7 +749,7 @@ read_keytab_file(const char *service_key_file) } } - skf = eth_fopen(service_key_file, "rb"); + skf = ws_fopen(service_key_file, "rb"); if (! skf) return; while (fread(buf, SERVICE_KEY_SIZE, 1, skf) == 1) { @@ -838,7 +838,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo, ENDTRY; if (do_continue) continue; - + data_len = item_len + offset - CONFOUNDER_PLUS_CHECKSUM; if ((int) item_len + offset > length) { tvb_free(encr_tvb); diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c index 833006cec7..51277b40c6 100644 --- a/epan/dissectors/packet-ssl-utils.c +++ b/epan/dissectors/packet-ssl-utils.c @@ -37,7 +37,7 @@ #include <epan/emem.h> #include <epan/strutil.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> /* * Lookup tables @@ -105,7 +105,7 @@ const value_string ssl_20_cipher_suites[] = { { 0x000035, "TLS_RSA_WITH_AES_256_CBC_SHA" }, { 0x000036, "TLS_DH_DSS_WITH_AES_256_CBC_SHA" }, { 0x000037, "TLS_DH_RSA_WITH_AES_256_CBC_SHA" }, - { 0x000038, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" }, + { 0x000038, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" }, { 0x000039, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" }, { 0x00003A, "TLS_DH_anon_WITH_AES_256_CBC_SHA" }, { 0x000041, "TLS_RSA_WITH_CAMELLIA_128_CBC_SHA" }, @@ -1835,7 +1835,7 @@ ssl_privkey_to_sexp(struct gnutls_x509_privkey_int* priv_key) gcry_sexp_t rsa_priv_key; gint major, minor, patch; gint i; - + #ifdef SSL_FAST gcry_mpi_t* rsa_params = g_malloc(sizeof(gcry_mpi_t)*RSA_PARS); #else @@ -1845,7 +1845,7 @@ ssl_privkey_to_sexp(struct gnutls_x509_privkey_int* priv_key) /* * note: openssl and gnutls use 'p' and 'q' with opposite meaning: * our 'p' must be equal to 'q' as provided from openssl and viceversa - */ + */ /* RSA get parameter */ if (gnutls_x509_privkey_export_rsa_raw(priv_key, @@ -1856,7 +1856,7 @@ ssl_privkey_to_sexp(struct gnutls_x509_privkey_int* priv_key) #endif return NULL; } - + /* convert each rsa parameter to mpi format*/ for(i=0; i<RSA_PARS; i++) { if (gcry_mpi_scan(&rsa_params[i], GCRYMPI_FMT_USG, rsa_datum[i].data, rsa_datum[i].size,&tmp_size) != 0) { @@ -1865,7 +1865,7 @@ ssl_privkey_to_sexp(struct gnutls_x509_privkey_int* priv_key) g_free(rsa_params); #endif return NULL; - } + } } ssl_get_version(&major, &minor, &patch); @@ -1887,7 +1887,7 @@ ssl_privkey_to_sexp(struct gnutls_x509_privkey_int* priv_key) ssl_debug_printf("ssl_load_key: can't built rsa private key s-exp\n"); #ifdef SSL_FAST g_free(rsa_params); -#endif +#endif return NULL; } @@ -1901,7 +1901,7 @@ ssl_privkey_to_sexp(struct gnutls_x509_privkey_int* priv_key) } return rsa_priv_key; #endif - + } Ssl_private_key_t * @@ -1920,7 +1920,7 @@ ssl_load_key(FILE* fp) private_key->x509_cert = 0; private_key->x509_pkey = 0; private_key->sexp_pkey = 0; - + /* init private key data*/ gnutls_x509_privkey_init(&priv_key); @@ -1947,7 +1947,7 @@ ssl_load_key(FILE* fp) ssl_debug_printf("ssl_load_key: can't read from file %d bytes, got %d\n", key.size, bytes); g_free(private_key); - g_free(key.data); + g_free(key.data); return NULL; } @@ -1965,7 +1965,7 @@ ssl_load_key(FILE* fp) if ( !private_key->sexp_pkey ) { g_free(private_key); return NULL; - } + } return private_key; } @@ -2004,7 +2004,7 @@ ssl_load_pkcs12(FILE* fp, const gchar *cert_passwd) { private_key->x509_cert = 0; private_key->x509_pkey = 0; private_key->sexp_pkey = 0; - + rest = 4096; data.data = g_malloc(rest); data.size = rest; @@ -2097,7 +2097,7 @@ ssl_load_pkcs12(FILE* fp, const gchar *cert_passwd) { if (ret < 0) { g_strlcpy(buf_email, "<ERROR>", 128); } buf_len = sizeof(buf_keyid); - ret = gnutls_x509_crt_get_key_id(ssl_cert, 0, buf_keyid, &buf_len); + ret = gnutls_x509_crt_get_key_id(ssl_cert, 0, buf_keyid, &buf_len); if (ret < 0) { g_strlcpy(buf_keyid, "<ERROR>", 32); } private_key->x509_cert = ssl_cert; @@ -2106,14 +2106,14 @@ ssl_load_pkcs12(FILE* fp, const gchar *cert_passwd) { case GNUTLS_BAG_PKCS8_KEY: case GNUTLS_BAG_PKCS8_ENCRYPTED_KEY: - + ret = gnutls_x509_privkey_init(&ssl_pkey); if (ret < 0) { ssl_debug_printf( "gnutls_x509_privkey_init(&ssl_pkey) - %s\n", gnutls_strerror(ret)); g_free(private_key); return 0; } - ret = gnutls_x509_privkey_import_pkcs8(ssl_pkey, &data, GNUTLS_X509_FMT_DER, cert_passwd, + ret = gnutls_x509_privkey_import_pkcs8(ssl_pkey, &data, GNUTLS_X509_FMT_DER, cert_passwd, (bag_type==GNUTLS_BAG_PKCS8_KEY) ? GNUTLS_PKCS_PLAIN : 0); if (ret < 0) { ssl_debug_printf( "Can not decrypt private key - %s\n", gnutls_strerror(ret)); @@ -2122,19 +2122,19 @@ ssl_load_pkcs12(FILE* fp, const gchar *cert_passwd) { } buf_len = sizeof(buf_keyid); - ret = gnutls_x509_privkey_get_key_id(ssl_pkey, 0, buf_keyid, &buf_len); + ret = gnutls_x509_privkey_get_key_id(ssl_pkey, 0, buf_keyid, &buf_len); if (ret < 0) { ssl_debug_printf( "gnutls_x509_privkey_get_key_id(ssl_pkey, 0, buf_keyid, &buf_len) - %s\n", gnutls_strerror(ret)); return 0; } ssl_debug_printf( "Private key imported: KeyID %s\n", bytes_to_str(buf_keyid, buf_len)); - - private_key->x509_pkey = ssl_pkey; + + private_key->x509_pkey = ssl_pkey; private_key->sexp_pkey = ssl_privkey_to_sexp(ssl_pkey); if ( !private_key->sexp_pkey ) { g_free(private_key); return NULL; - } + } break; default: ; @@ -2142,7 +2142,7 @@ ssl_load_pkcs12(FILE* fp, const gchar *cert_passwd) { } /* j */ } /* i */ - return private_key; + return private_key; } @@ -2158,10 +2158,10 @@ void ssl_free_key(Ssl_private_key_t* key) if (!key->x509_cert) gnutls_x509_crt_deinit (key->x509_cert); - + if (!key->x509_pkey) gnutls_x509_privkey_deinit(key->x509_pkey); - + g_free((Ssl_private_key_t*)key); } @@ -2371,7 +2371,7 @@ ssl_association_add(GTree* associations, dissector_handle_t handle, guint port, if(!assoc->handle){ fprintf(stderr, "association_add() could not find handle for protocol:%s\n",protocol); } else { - if(port) { + if(port) { if(tcp) dissector_add("tcp.port", port, handle); else @@ -2605,33 +2605,33 @@ ssl_parse_key_list(const gchar * keys_list, GHashTable *key_hash, GTree* associa } *filename=0; filename++; - + cert_passwd = strchr(filename,','); if (cert_passwd) { *cert_passwd=0; - cert_passwd++; + cert_passwd++; } - + /* convert ip and port string to network rappresentation*/ service = g_malloc(sizeof(SslService) + 4); service->addr.type = AT_IPv4; service->addr.len = 4; service->addr.data = ip = ((guchar*)service) + sizeof(SslService); - + /* remove all spaces in addr */ read_index = 0; write_index = 0; - + while(addr[read_index]) { if (addr[read_index] != ' ') { addr[write_index] = addr[read_index]; write_index++; - } - read_index++; + } + read_index++; } addr[write_index] = 0; - + if ( !strcmp("any", addr) || !strcmp("ANY", addr) ) { ip[0] = 0; ip[1] = 0; @@ -2650,17 +2650,17 @@ ssl_parse_key_list(const gchar * keys_list, GHashTable *key_hash, GTree* associa ip[0], ip[1], ip[2], ip[3], service->port, filename, cert_passwd); /* try to load pen or p12 file*/ - fp = eth_fopen(filename, "rb"); + fp = ws_fopen(filename, "rb"); if (!fp) { fprintf(stderr, "can't open file %s \n",filename); continue; } - + if (!cert_passwd) { private_key = ssl_load_key(fp); - } - else - { + } + else + { private_key = ssl_load_pkcs12(fp,cert_passwd); } /* !!! */ @@ -2669,17 +2669,17 @@ ssl_parse_key_list(const gchar * keys_list, GHashTable *key_hash, GTree* associa filename); continue; } - + fclose(fp); ssl_debug_printf("ssl_init private key file %s successfully loaded\n",filename); - + /* if item exists, remove first */ tmp_private_key = g_hash_table_lookup(key_hash, service); if (tmp_private_key) { g_hash_table_remove(key_hash, service); ssl_free_key(tmp_private_key); - } + } g_hash_table_insert(key_hash, service, private_key); ssl_association_add(associations, handle, service->port, protocol, tcp, TRUE); @@ -2753,7 +2753,7 @@ ssl_set_debug(char* name) else if (!name || (strcmp(name, "") ==0)) ssl_debug_file = NULL; else - ssl_debug_file = eth_fopen(name, "w"); + ssl_debug_file = ws_fopen(name, "w"); if (!use_stderr && ssl_debug_file) debug_file_must_be_closed = 1; } diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c index 97b2a5a01b..d991b25dc7 100644 --- a/epan/dissectors/packet-ssl.c +++ b/epan/dissectors/packet-ssl.c @@ -120,7 +120,7 @@ #include "packet-x509if.h" #include "packet-ssl.h" #include "packet-ssl-utils.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> static gboolean ssl_desegment = TRUE; @@ -334,7 +334,7 @@ ssl_parse(void) if (ssl_keys_list && (ssl_keys_list[0] != 0)) { if (file_exists(ssl_keys_list)) { - if ((ssl_keys_file = eth_fopen(ssl_keys_list, "r"))) { + if ((ssl_keys_file = ws_fopen(ssl_keys_list, "r"))) { read_failed = FALSE; fstat(fileno(ssl_keys_file), &statb); size = statb.st_size; @@ -548,7 +548,7 @@ dissect_ssl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) else { SslService dummy; char ip_addr_any[] = {0,0,0,0}; - + ssl_session = se_alloc0(sizeof(SslDecryptSession)); ssl_session_init(ssl_session); ssl_session->version = SSL_VER_UNKNOWN; @@ -570,37 +570,37 @@ dissect_ssl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * is not always available * Note that with HAVE_LIBGNUTLS undefined private_key is allways 0 * and thus decryption never engaged*/ - - + + ssl_session->private_key = 0; private_key = g_hash_table_lookup(ssl_key_hash, &dummy); if (!private_key) { ssl_debug_printf("dissect_ssl can't find private key for this server! Try it again with universal port 0\n"); - + dummy.port = 0; private_key = g_hash_table_lookup(ssl_key_hash, &dummy); } if (!private_key) { ssl_debug_printf("dissect_ssl can't find private key for this server (universal port)! Try it again with universal address 0.0.0.0\n"); - + dummy.addr.type = AT_IPv4; dummy.addr.len = 4; dummy.addr.data = ip_addr_any; - + dummy.port = port; private_key = g_hash_table_lookup(ssl_key_hash, &dummy); } - + if (!private_key) { ssl_debug_printf("dissect_ssl can't find any private key!\n"); - } + } else { - ssl_session->private_key = private_key->sexp_pkey; + ssl_session->private_key = private_key->sexp_pkey; } - + } conv_version= & ssl_session->version; @@ -1274,7 +1274,7 @@ dissect_ssl_payload(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *t process_ssl_payload(next_tvb, 0, pinfo, tree, association); pinfo->fragmented = save_fragmented; } - + /* restore desegmentation ability */ pinfo->can_desegment = save_can_desegment; } diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c index e8a3e8a5cf..8b00925738 100644 --- a/epan/dissectors/packet-tpncp.c +++ b/epan/dissectors/packet-tpncp.c @@ -36,7 +36,7 @@ #include <glib.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include <epan/packet.h> #include <epan/prefs.h> @@ -123,7 +123,7 @@ static value_string tpncp_enums_id_vals[MAX_ENUMS_NUM][MAX_ENUM_ENTRIES]; static gchar *tpncp_enums_name_vals[MAX_ENUMS_NUM]; static gint hf_size = 1; -static gint hf_allocated = 0; +static gint hf_allocated = 0; static hf_register_info *hf = NULL; static hf_register_info hf_tpncp[] = { { @@ -618,8 +618,8 @@ static gint init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info, current_data_id = data_id; } else { - if ((current_tpncp_data_field_info->p_next = - (tpncp_data_field_info *)g_malloc0(sizeof(tpncp_data_field_info))) + if ((current_tpncp_data_field_info->p_next = + (tpncp_data_field_info *)g_malloc0(sizeof(tpncp_data_field_info))) == NULL) return (-1); current_tpncp_data_field_info = current_tpncp_data_field_info->p_next; @@ -684,7 +684,7 @@ static gint init_tpncp_db(void) { g_snprintf(tpncp_dat_file_path, MAX_TPNCP_DAT_FILE_PATH_LEN, "%s" G_DIR_SEPARATOR_S"tpncp" G_DIR_SEPARATOR_S "tpncp.dat", get_datafile_dir()); /* Open file with TPNCP data. */ - if ((file = eth_fopen(tpncp_dat_file_path, "r")) == NULL) + if ((file = ws_fopen(tpncp_dat_file_path, "r")) == NULL) return (-1); fill_tpncp_id_vals(tpncp_events_id_vals, file); diff --git a/epan/dtd_preparse.l b/epan/dtd_preparse.l index 9325718389..e42e9bfd8c 100644 --- a/epan/dtd_preparse.l +++ b/epan/dtd_preparse.l @@ -25,12 +25,12 @@ /* * dtd_preparser.l * - * an XML dissector for wireshark + * an XML dissector for wireshark * * DTD Preparser - import a dtd file into a GString * including files, removing comments * and resolving %entities; - * + * * Copyright 2004, Luis E. Garcia Ontanon <luis.ontanon@gmail.com> * * $Id$ @@ -43,24 +43,24 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - + #include <glib.h> #include <string.h> #include <errno.h> #include <stdio.h> #include "dtd.h" #include "dtd_preparse_lex.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #define ECHO g_string_append(current,yytext); @@ -135,7 +135,7 @@ newline \n <IN_COMMENT>[^-]? | <IN_COMMENT>[-] ; <IN_COMMENT>{comment_stop} { current = output; BEGIN OUTSIDE; } - + {newline} { linenum++; if (current) g_string_append_printf(current,"%s\n",location()); @@ -159,27 +159,27 @@ newline \n static gchar* replace_entity(gchar* entity) { GString* replacement; - + *entity = '%'; - + replacement = g_hash_table_lookup(entities,entity); - + if (replacement) { return replacement->str; } else { g_string_append_printf(error,"dtd_preparse: in file '%s': entity %s does not exists\n", filename, entity); return ""; } - + } static const gchar* location(void) { static gchar* loc = NULL; - + if (loc) g_free(loc); - + loc = g_strdup_printf("<? wireshark:location %s:%u ?>", filename, linenum); - + return loc; } @@ -191,31 +191,31 @@ static gboolean free_gstring_hash_items(gpointer k,gpointer v,gpointer p _U_) { extern GString* dtd_preparse(const gchar* dname,const gchar* fname, GString* err) { gchar* fullname = g_strdup_printf("%s%c%s",dname,G_DIR_SEPARATOR,fname); - + dtd_dirname = dname; filename = fname; linenum = 1; - yyin = eth_fopen(fullname,"r"); - + yyin = ws_fopen(fullname,"r"); + if (!yyin) { if (err) g_string_append_printf(err, "Could not open file: '%s', error: %s",fullname,strerror(errno)); - + return NULL; } - + error = err; - + entities = g_hash_table_new(g_str_hash,g_str_equal); current = output = g_string_new(location()); - + BEGIN OUTSIDE; yylex(); - + fclose(yyin); - + yyrestart(NULL); g_hash_table_foreach_remove(entities,free_gstring_hash_items,NULL); @@ -228,7 +228,7 @@ extern GString* dtd_preparse(const gchar* dname,const gchar* fname, GString* er /* * We want to stop processing when we get to the end of the input. - * (%option noyywrap is not used because if used then + * (%option noyywrap is not used because if used then * some flex versions (eg: 2.5.35) generate code which causes * warnings by the Windows VC compiler). */ diff --git a/epan/emem.c b/epan/emem.c index 9d2dec4a4b..84cab06da2 100644 --- a/epan/emem.c +++ b/epan/emem.c @@ -44,7 +44,6 @@ #include <glib.h> #include <proto.h> #include "emem.h" -#include <wiretap/file_util.h> #ifdef _WIN32 #include <windows.h> /* VirtualAlloc, VirtualProtect */ @@ -1410,7 +1409,7 @@ emem_tree_lookup32_array(emem_tree_t *se_tree, emem_tree_key_t *key) /* Strings are stored as an array of uint32 containing the string characters - with 4 characters in each uint32. + with 4 characters in each uint32. The first byte of the string is stored as the most significant byte. If the string is not a multiple of 4 characters in length the last uint32 containing the string bytes are padded with 0 bytes. @@ -1445,7 +1444,7 @@ emem_tree_insert_string(emem_tree_t* se_tree, const gchar* k, void* v, guint32 f if (i%4 == 3) { aligned[i/4] = tmp; tmp = 0; - } + } } /* add required padding to the last uint32 */ if (i%4 != 0) { @@ -1455,7 +1454,7 @@ emem_tree_insert_string(emem_tree_t* se_tree, const gchar* k, void* v, guint32 f } aligned[i/4-1] = tmp; } - + /* add the terminator */ aligned[div-1] = 0x00000001; @@ -1498,7 +1497,7 @@ emem_tree_lookup_string(emem_tree_t* se_tree, const gchar* k, guint32 flags) if (i%4 == 3) { aligned[i/4] = tmp; tmp = 0; - } + } } /* add required padding to the last uint32 */ if (i%4 != 0) { @@ -1508,7 +1507,7 @@ emem_tree_lookup_string(emem_tree_t* se_tree, const gchar* k, guint32 flags) } aligned[i/4-1] = tmp; } - + /* add the terminator */ aligned[div-1] = 0x00000001; diff --git a/epan/filesystem.c b/epan/filesystem.c index be779561b3..8e60567574 100644 --- a/epan/filesystem.c +++ b/epan/filesystem.c @@ -57,7 +57,7 @@ #include "filesystem.h" #include "privileges.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #define PROFILES_DIR "profiles" #define U3_MY_CAPTURES "\\My Captures" @@ -195,7 +195,7 @@ test_for_directory(const char *path) { struct stat statb; - if (eth_stat(path, &statb) < 0) + if (ws_stat(path, &statb) < 0) return errno; if (S_ISDIR(statb.st_mode)) @@ -209,7 +209,7 @@ test_for_fifo(const char *path) { struct stat statb; - if (eth_stat(path, &statb) < 0) + if (ws_stat(path, &statb) < 0) return errno; if (S_ISFIFO(statb.st_mode)) @@ -975,12 +975,12 @@ delete_directory (const char *directory, char **pf_dir_path_return) gchar *filename; int ret = 0; - if ((dir = eth_dir_open(directory, 0, NULL)) != NULL) { - while ((file = eth_dir_read_name(dir)) != NULL) { + if ((dir = ws_dir_open(directory, 0, NULL)) != NULL) { + while ((file = ws_dir_read_name(dir)) != NULL) { filename = g_strdup_printf ("%s%s%s", directory, G_DIR_SEPARATOR_S, - eth_dir_get_name(file)); + ws_dir_get_name(file)); if (test_for_directory(filename) != EISDIR) { - ret = eth_remove(filename); + ret = ws_remove(filename); #if 0 } else { /* The user has manually created a directory in the profile directory */ @@ -994,10 +994,10 @@ delete_directory (const char *directory, char **pf_dir_path_return) } g_free (filename); } - eth_dir_close(dir); + ws_dir_close(dir); } - if (ret == 0 && (ret = eth_remove(directory)) != 0) { + if (ret == 0 && (ret = ws_remove(directory)) != 0) { *pf_dir_path_return = g_strdup (directory); } @@ -1025,7 +1025,7 @@ rename_persconffile_profile(const char *fromname, const char *toname, char *to_dir = g_strdup (get_persconffile_dir(toname)); int ret = 0; - ret = eth_rename (from_dir, to_dir); + ret = ws_rename (from_dir, to_dir); if (ret != 0) { *pf_from_dir_path_return = g_strdup (from_dir); *pf_to_dir_path_return = g_strdup (to_dir); @@ -1061,8 +1061,8 @@ create_persconffile_profile(const char *profilename, char **pf_dir_path_return) * If not then create it. */ pf_dir_path = get_profiles_dir (); - if (eth_stat(pf_dir_path, &s_buf) != 0 && errno == ENOENT) { - ret = eth_mkdir(pf_dir_path, 0755); + if (ws_stat(pf_dir_path, &s_buf) != 0 && errno == ENOENT) { + ret = ws_mkdir(pf_dir_path, 0755); if (ret == -1) { *pf_dir_path_return = g_strdup(pf_dir_path); return ret; @@ -1071,7 +1071,7 @@ create_persconffile_profile(const char *profilename, char **pf_dir_path_return) } pf_dir_path = get_persconffile_dir(profilename); - if (eth_stat(pf_dir_path, &s_buf) != 0 && errno == ENOENT) { + if (ws_stat(pf_dir_path, &s_buf) != 0 && errno == ENOENT) { #ifdef _WIN32 /* * Does the parent directory of that directory @@ -1089,20 +1089,20 @@ create_persconffile_profile(const char *profilename, char **pf_dir_path_return) pf_dir_parent_path_len = strlen(pf_dir_parent_path); if (pf_dir_parent_path_len > 0 && pf_dir_parent_path[pf_dir_parent_path_len - 1] != ':' - && eth_stat(pf_dir_parent_path, &s_buf) != 0) { + && ws_stat(pf_dir_parent_path, &s_buf) != 0) { /* * No, it doesn't exist - make it first. */ - ret = eth_mkdir(pf_dir_parent_path, 0755); + ret = ws_mkdir(pf_dir_parent_path, 0755); if (ret == -1) { *pf_dir_path_return = pf_dir_parent_path; return -1; } } g_free(pf_dir_path_copy); - ret = eth_mkdir(pf_dir_path, 0755); + ret = ws_mkdir(pf_dir_path, 0755); #else - ret = eth_mkdir(pf_dir_path, 0755); + ret = ws_mkdir(pf_dir_path, 0755); #endif } else { /* @@ -1268,7 +1268,7 @@ get_persconffile_path(const char *filename, gboolean from_profile, gboolean for_ } #ifdef _WIN32 if (!for_writing) { - if (eth_stat(path, &s_buf) != 0 && errno == ENOENT) { + if (ws_stat(path, &s_buf) != 0 && errno == ENOENT) { /* * OK, it's not in the personal configuration file * directory; is it in the ".wireshark" subdirectory @@ -1277,7 +1277,7 @@ get_persconffile_path(const char *filename, gboolean from_profile, gboolean for_ old_path = g_strdup_printf( "%s" G_DIR_SEPARATOR_S ".wireshark" G_DIR_SEPARATOR_S "%s", get_home_dir(), filename); - if (eth_stat(old_path, &s_buf) == 0) { + if (ws_stat(old_path, &s_buf) == 0) { /* * OK, it exists; return it instead. */ @@ -1368,7 +1368,7 @@ get_datafile_path(const char *filename) gboolean deletefile(const char *path) { - return eth_unlink(path) == 0; + return ws_unlink(path) == 0; } /* @@ -1481,14 +1481,14 @@ file_exists(const char *fname) * so this is working, but maybe not quite the way expected. ULFL */ file_stat.st_ino = 1; /* this will make things work if an error occured */ - eth_stat(fname, &file_stat); + ws_stat(fname, &file_stat); if (file_stat.st_ino == 0) { return TRUE; } else { return FALSE; } #else - if (eth_stat(fname, &file_stat) != 0 && errno == ENOENT) { + if (ws_stat(fname, &file_stat) != 0 && errno == ENOENT) { return FALSE; } else { return TRUE; @@ -1543,9 +1543,9 @@ files_identical(const char *fname1, const char *fname2) /* * Compare st_dev and st_ino. */ - if (eth_stat(fname1, &filestat1) == -1) + if (ws_stat(fname1, &filestat1) == -1) return FALSE; /* can't get info about the first file */ - if (eth_stat(fname2, &filestat2) == -1) + if (ws_stat(fname2, &filestat2) == -1) return FALSE; /* can't get info about the second file */ return (filestat1.st_dev == filestat2.st_dev && filestat1.st_ino == filestat2.st_ino); diff --git a/epan/libwireshark.def b/epan/libwireshark.def index 4c09e0203d..dd8d7c0b3a 100644 --- a/epan/libwireshark.def +++ b/epan/libwireshark.def @@ -254,10 +254,10 @@ dissect_per_sequence_of dissect_per_sequence dissect_per_set_of dissect_per_VisibleString -dissect_q932_PartyNumber -dissect_q932_PartySubaddress +dissect_q932_PartyNumber +dissect_q932_PartySubaddress dissect_q932_PresentedNumberUnscreened -dissect_q932_PresentedNumberScreened +dissect_q932_PresentedNumberScreened dissect_qsig_na_Name dissect_rpc_array dissect_rpc_bool @@ -335,7 +335,6 @@ epan_dissect_run epan_get_version epan_init epan_strcasestr -eth_stdio_fopen ether_to_str ex_opt_add ex_opt_count @@ -634,7 +633,7 @@ proto_find_finfo proto_frame DATA proto_get_finfo_ptr_array proto_get_first_protocol_field -proto_get_first_protocol +proto_get_first_protocol proto_get_id proto_get_id_by_filter_name proto_get_next_protocol diff --git a/epan/plugins.c b/epan/plugins.c index 3c20fb6c68..cc84b475ec 100644 --- a/epan/plugins.c +++ b/epan/plugins.c @@ -50,7 +50,7 @@ #include "filesystem.h" #include "privileges.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include "report_err.h" /* linked list of all plugins */ @@ -148,12 +148,12 @@ plugins_scan_dir(const char *dirname) gchar *dot; int cr; - if ((dir = eth_dir_open(dirname, 0, NULL)) != NULL) + if ((dir = ws_dir_open(dirname, 0, NULL)) != NULL) { - while ((file = eth_dir_read_name(dir)) != NULL) + while ((file = ws_dir_read_name(dir)) != NULL) { - name = eth_dir_get_name(file); + name = ws_dir_get_name(file); /* * GLib 2.x defines G_MODULE_SUFFIX as the extension used on @@ -180,7 +180,7 @@ plugins_scan_dir(const char *dirname) continue; } version = gp; - + /* * Do we have a register routine? */ @@ -263,7 +263,7 @@ plugins_scan_dir(const char *dirname) g_module_close(handle); continue; } - + /* * Do we have a register_wtap_module routine? */ @@ -273,7 +273,7 @@ plugins_scan_dir(const char *dirname) } else { register_wtap_module = NULL; } - + /* * Do we have a register_codec_module routine? */ @@ -288,7 +288,7 @@ plugins_scan_dir(const char *dirname) * Does this dissector do anything useful? */ if (register_protoinfo == NULL && - register_tap_listener == NULL && + register_tap_listener == NULL && register_wtap_module == NULL && register_codec_module == NULL ) { @@ -319,9 +319,9 @@ plugins_scan_dir(const char *dirname) g_module_close(handle); continue; } - + } - eth_dir_close(dir); + ws_dir_close(dir); } } @@ -357,9 +357,9 @@ init_plugins(void) */ plugin_dir = get_plugin_dir(); if (running_in_build_directory()) { - if ((dir = eth_dir_open(plugin_dir, 0, NULL)) != NULL) { - while ((file = eth_dir_read_name(dir)) != NULL) { - name = eth_dir_get_name(file); + if ((dir = ws_dir_open(plugin_dir, 0, NULL)) != NULL) { + while ((file = ws_dir_read_name(dir)) != NULL) { + name = ws_dir_get_name(file); if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue; /* skip "." and ".." */ /* @@ -411,7 +411,7 @@ void register_all_plugin_registrations(void) { plugin *pt_plug; - + /* * For all plugins with register-handoff routines, call the routines. * This is called from "proto_init()"; it must be called after diff --git a/epan/prefs.c b/epan/prefs.c index b6a641af5d..918a0797d4 100644 --- a/epan/prefs.c +++ b/epan/prefs.c @@ -46,7 +46,7 @@ #include "cfile.h" #include <epan/column.h> #include "print.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include <epan/prefs-int.h> #include <epan/uat-int.h> @@ -1263,19 +1263,19 @@ read_prefs(int *gpf_errno_return, int *gpf_read_errno_return, * file doesn't exist, try the old path. */ gpf_path = get_datafile_path(PF_NAME); - if ((pf = eth_fopen(gpf_path, "r")) == NULL && errno == ENOENT) { + if ((pf = ws_fopen(gpf_path, "r")) == NULL && errno == ENOENT) { /* * It doesn't exist by the new name; try the old name. */ g_free(gpf_path); gpf_path = get_datafile_path(OLD_GPF_NAME); - pf = eth_fopen(gpf_path, "r"); + pf = ws_fopen(gpf_path, "r"); } } else { /* * We have the path; try it. */ - pf = eth_fopen(gpf_path, "r"); + pf = ws_fopen(gpf_path, "r"); } /* @@ -1318,7 +1318,7 @@ read_prefs(int *gpf_errno_return, int *gpf_read_errno_return, /* Read the user's preferences file, if it exists. */ *pf_path_return = NULL; - if ((pf = eth_fopen(pf_path, "r")) != NULL) { + if ((pf = ws_fopen(pf_path, "r")) != NULL) { /* * Start out the counters of "mgcp.{tcp,udp}.port" entries we've * seen. @@ -2562,7 +2562,7 @@ write_prefs(char **pf_path_return) if (pf_path_return != NULL) { pf_path = get_persconffile_path(PF_NAME, TRUE, TRUE); - if ((pf = eth_fopen(pf_path, "w")) == NULL) { + if ((pf = ws_fopen(pf_path, "w")) == NULL) { *pf_path_return = pf_path; return errno; } diff --git a/epan/radius_dict.l b/epan/radius_dict.l index 6ae9623139..0ef6761160 100644 --- a/epan/radius_dict.l +++ b/epan/radius_dict.l @@ -59,7 +59,7 @@ #include <epan/packet.h> #include <epan/dissectors/packet-radius.h> #include "radius_dict_lex.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #ifdef _WIN32 /* disable Windows VC compiler warning "signed/unsigned mismatch" associated */ @@ -198,7 +198,7 @@ fullpaths[include_stack_ptr] = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", directory,yytext); - yyin = eth_fopen( fullpaths[include_stack_ptr], "r" ); + yyin = ws_fopen( fullpaths[include_stack_ptr], "r" ); if (!yyin) { if (errno) { @@ -382,7 +382,7 @@ gboolean radius_load_dictionary (radius_dictionary_t* d, gchar* dir, const gchar error = g_string_new(""); - yyin = eth_fopen(fullpaths[include_stack_ptr],"r"); + yyin = ws_fopen(fullpaths[include_stack_ptr],"r"); if (!yyin) { g_string_append_printf(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], strerror(errno) ); @@ -423,7 +423,7 @@ gboolean radius_load_dictionary (radius_dictionary_t* d, gchar* dir, const gchar /* * We want to stop processing when we get to the end of the input. - * (%option noyywrap is not used because if used then + * (%option noyywrap is not used because if used then * some flex versions (eg: 2.5.35) generate code which causes * warnings by the Windows VC compiler). */ diff --git a/epan/uat.c b/epan/uat.c index 1d97aa1fd1..632267f070 100644 --- a/epan/uat.c +++ b/epan/uat.c @@ -43,7 +43,7 @@ #include <epan/filesystem.h> #include <epan/packet.h> #include <epan/range.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #include "uat-int.h" @@ -240,7 +240,7 @@ gboolean uat_save(uat_t* uat, char** error) { if (! fname ) return FALSE; - fp = eth_fopen(fname,"w"); + fp = ws_fopen(fname,"w"); if (!fp) { *error = ep_strdup_printf("uat_save: error opening '%s': %s",fname,strerror(errno)); diff --git a/epan/uat_load.l b/epan/uat_load.l index 2df7df8aaa..b34ecc51f2 100644 --- a/epan/uat_load.l +++ b/epan/uat_load.l @@ -59,7 +59,7 @@ #include <epan/emem.h> #include "uat-int.h" #include "uat_load_lex.h" -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> #ifdef _WIN32 /* disable Windows VC compiler warning "signed/unsigned mismatch" associated */ @@ -288,7 +288,7 @@ gboolean uat_load(uat_t* uat_in, char** err) { } - if (!(yyin = eth_fopen(fname,"r"))) { + if (!(yyin = ws_fopen(fname,"r"))) { *err = strerror(errno); g_free(fname); return FALSE; @@ -353,7 +353,7 @@ gboolean uat_load_str(uat_t* uat_in, char* entry, char** err) { /* * We want to stop processing when we get to the end of the input. - * (%option noyywrap is not used because if used then + * (%option noyywrap is not used because if used then * some flex versions (eg: 2.5.35) generate code which causes * warnings by the Windows VC compiler). */ diff --git a/epan/wslua/init_wslua.c b/epan/wslua/init_wslua.c index 79c7d07769..0745cea101 100644 --- a/epan/wslua/init_wslua.c +++ b/epan/wslua/init_wslua.c @@ -32,7 +32,7 @@ #include <epan/expert.h> #include <epan/ex-opt.h> #include <epan/privileges.h> -#include <wiretap/file_util.h> +#include <wsutil/file_util.h> static lua_State* L = NULL; @@ -192,7 +192,7 @@ static int lua_main_error_handler(lua_State* LS) { void lua_load_script(const gchar* filename) { FILE* file; - if (! ( file = eth_fopen(filename,"r")) ) { + if (! ( file = ws_fopen(filename,"r")) ) { report_open_failure(filename,errno,FALSE); return; } |