INITFILTER_OTHER_ERROR
} initfilter_status_t;
+typedef enum {
+ STATE_EXPECT_REC_HDR,
+ STATE_READ_REC_HDR,
+ STATE_EXPECT_DATA,
+ STATE_READ_DATA
+} cap_pipe_state_t;
+typedef enum {
+ PIPOK,
+ PIPEOF,
+ PIPERR,
+ PIPNEXIST
+} cap_pipe_err_t;
typedef struct _pcap_options {
guint32 received;
guint32 dropped;
size_t cap_pipe_bytes_to_read; /**< Used by cap_pipe_dispatch */
size_t cap_pipe_bytes_read; /**< Used by cap_pipe_dispatch */
#endif
- enum {
- STATE_EXPECT_REC_HDR,
- STATE_READ_REC_HDR,
- STATE_EXPECT_DATA,
- STATE_READ_DATA
- } cap_pipe_state;
- enum { PIPOK, PIPEOF, PIPERR, PIPNEXIST } cap_pipe_err;
+ cap_pipe_state_t cap_pipe_state;
+ cap_pipe_err_t cap_pipe_err;
+
#if defined(_WIN32)
GMutex *cap_pipe_read_mtx;
GAsyncQueue *cap_pipe_pending_q, *cap_pipe_done_q;
/*
* Allocate the interface capabilities structure.
*/
- caps = g_malloc(sizeof *caps);
+ caps = (if_capabilities_t *)g_malloc(sizeof *caps);
/*
* WinPcap 4.1.2, and possibly earlier versions, have a bug
#endif
pcap_opts->cap_pipe_bytes_to_read = 0;
pcap_opts->cap_pipe_bytes_read = 0;
- pcap_opts->cap_pipe_state = 0;
+ pcap_opts->cap_pipe_state = STATE_EXPECT_REC_HDR;
pcap_opts->cap_pipe_err = PIPOK;
#ifdef _WIN32
#if GLIB_CHECK_VERSION(2,31,0)
#if GLIB_CHECK_VERSION(2,31,18)
g_async_queue_lock(pcap_queue);
- queue_element = g_async_queue_timeout_pop_unlocked(pcap_queue, WRITER_THREAD_TIMEOUT);
+ queue_element = (pcap_queue_element *)g_async_queue_timeout_pop_unlocked(pcap_queue, WRITER_THREAD_TIMEOUT);
#else
GTimeVal write_thread_time;
g_get_current_time(&write_thread_time);
g_time_val_add(&write_thread_time, WRITER_THREAD_TIMEOUT);
g_async_queue_lock(pcap_queue);
- queue_element = g_async_queue_timed_pop_unlocked(pcap_queue, &write_thread_time);
+ queue_element = (pcap_queue_element *)g_async_queue_timed_pop_unlocked(pcap_queue, &write_thread_time);
#endif
if (queue_element) {
pcap_queue_bytes -= queue_element->phdr.caplen;
}
while (1) {
g_async_queue_lock(pcap_queue);
- queue_element = g_async_queue_try_pop_unlocked(pcap_queue);
+ queue_element = (pcap_queue_element *)g_async_queue_try_pop_unlocked(pcap_queue);
if (queue_element) {
pcap_queue_bytes -= queue_element->phdr.caplen;
pcap_queue_packets -= 1;
/* with the correct format. */
log_flags =
+ (GLogLevelFlags)(
G_LOG_LEVEL_ERROR|
G_LOG_LEVEL_CRITICAL|
G_LOG_LEVEL_WARNING|
G_LOG_LEVEL_MESSAGE|
G_LOG_LEVEL_INFO|
G_LOG_LEVEL_DEBUG|
- G_LOG_FLAG_FATAL|G_LOG_FLAG_RECURSION;
+ G_LOG_FLAG_FATAL|
+ G_LOG_FLAG_RECURSION);
g_log_set_handler(NULL,
log_flags,
line_prefix_info = g_new(line_prefix_info_t,1);
/* Create and use buffer for contents before time */
- line_prefix_info->before_time = g_malloc(before_time_offset+1);
+ line_prefix_info->before_time = (gchar *)g_malloc(before_time_offset+1);
memcpy(line_prefix_info->before_time, linebuff, before_time_offset);
line_prefix_info->before_time[before_time_offset] = '\0';
}
else {
/* Allocate & write buffer for line between timestamp and data */
- line_prefix_info->after_time = g_malloc(dollar_offset - after_time_offset);
+ line_prefix_info->after_time = (gchar *)g_malloc(dollar_offset - after_time_offset);
memcpy(line_prefix_info->after_time, linebuff+after_time_offset, dollar_offset - after_time_offset);
line_prefix_info->after_time[dollar_offset - after_time_offset-1] = '\0';
}
/* Add packet entry into table */
- pkey = g_malloc(sizeof(*pkey));
+ pkey = (gint64 *)g_malloc(sizeof(*pkey));
*pkey = this_offset;
g_hash_table_insert(file_externals->packet_prefix_table, pkey, line_prefix_info);
stub_offset += (int)(length + 1);
/* Protocol variant number (as string) */
- length = g_strlcpy((void*)&frame_buffer[stub_offset], variant_name, MAX_VARIANT_DIGITS+1);
+ length = g_strlcpy((gchar*)&frame_buffer[stub_offset], variant_name, MAX_VARIANT_DIGITS+1);
stub_offset += (int)(length + 1);
/* Outhdr */
unsigned int copyright :1;
unsigned int modeext :2;
unsigned int mode :2;
- unsigned int private :1;
+ unsigned int priv :1;
unsigned int padding :1;
unsigned int frequency :2;
unsigned int bitrate :4;
(mpa)->bitrate = MPA_UNMARSHAL_BITRATE(n); \
(mpa)->frequency = MPA_UNMARSHAL_FREQUENCY(n); \
(mpa)->padding = MPA_UNMARSHAL_PADDING(n); \
- (mpa)->private = MPA_UNMARSHAL_PRIVATE(n); \
+ (mpa)->priv = MPA_UNMARSHAL_PRIVATE(n); \
(mpa)->mode = MPA_UNMARSHAL_MODE(n); \
(mpa)->modeext = MPA_UNMARSHAL_MODEEXT(n); \
(mpa)->copyright = MPA_UNMARSHAL_COPYRIGHT(n); \