Whitespace cleanup:
Use consistent indentation; Convert "4 space tabs" to spaces; Remove trailing whitespace. svn path=/trunk/; revision=39082
This commit is contained in:
parent
781129806f
commit
e6bd9d1a8c
|
@ -469,10 +469,10 @@
|
|||
|
||||
/***************************************************************************/
|
||||
/* File Objects */
|
||||
#define AL_OBJ_FILE_CMD 0x4603 /* 70 03 File Control - Command */
|
||||
#define AL_OBJ_FILE_STAT 0x4604 /* 70 04 File Control - Status */
|
||||
#define AL_OBJ_FILE_TRANS 0x4605 /* 70 05 File Control - Transport */
|
||||
#define AL_OBJ_FILE_TRAN_ST 0x4606 /* 70 05 File Control - Transport Status */
|
||||
#define AL_OBJ_FILE_CMD 0x4603 /* 70 03 File Control - Command */
|
||||
#define AL_OBJ_FILE_STAT 0x4604 /* 70 04 File Control - Status */
|
||||
#define AL_OBJ_FILE_TRANS 0x4605 /* 70 05 File Control - Transport */
|
||||
#define AL_OBJ_FILE_TRAN_ST 0x4606 /* 70 05 File Control - Transport Status */
|
||||
|
||||
/* File Control Mode flags */
|
||||
#define AL_OBJ_FILE_MODE_NULL 0x00 /* NULL */
|
||||
|
@ -1032,9 +1032,9 @@ static GHashTable *dl_conversation_table = NULL;
|
|||
/* Data-Link-Layer Conversation Key Structure */
|
||||
typedef struct _dl_conversation_key
|
||||
{
|
||||
guint32 conversation; /* TCP / UDP conversation index */
|
||||
guint16 src; /* DNP3.0 Source Address */
|
||||
guint16 dst; /* DNP3.0 Destination Address */
|
||||
guint32 conversation; /* TCP / UDP conversation index */
|
||||
guint16 src; /* DNP3.0 Source Address */
|
||||
guint16 dst; /* DNP3.0 Destination Address */
|
||||
} dl_conversation_key_t;
|
||||
|
||||
/* Data-Link-Layer conversation key equality function */
|
||||
|
@ -1058,12 +1058,12 @@ dl_conversation_equal(gconstpointer v, gconstpointer w)
|
|||
static guint
|
||||
dl_conversation_hash(gconstpointer v)
|
||||
{
|
||||
const dl_conversation_key_t *key = (const dl_conversation_key_t*)v;
|
||||
guint val;
|
||||
const dl_conversation_key_t *key = (const dl_conversation_key_t*)v;
|
||||
guint val;
|
||||
|
||||
val = key->conversation + (key->src << 16) + key->dst;
|
||||
val = key->conversation + (key->src << 16) + key->dst;
|
||||
|
||||
return val;
|
||||
return val;
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
@ -2165,7 +2165,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
|
|||
switch (al_obj)
|
||||
{
|
||||
case AL_OBJ_AO_32: /* 32-Bit Analog Output Status (Obj:40, Var:01) */
|
||||
case AL_OBJ_AOC_32NT: /* 32-Bit Analog Output Event w/o Time (Obj:42, Var:01) */
|
||||
case AL_OBJ_AOC_32NT: /* 32-Bit Analog Output Event w/o Time (Obj:42, Var:01) */
|
||||
case AL_OBJ_AOC_32T: /* 32-Bit Analog Output Event with Time (Obj:42, Var:03) */
|
||||
|
||||
al_val32 = tvb_get_letohl(tvb, data_pos);
|
||||
|
@ -2175,8 +2175,8 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
|
|||
break;
|
||||
|
||||
case AL_OBJ_AO_16: /* 16-Bit Analog Output Status (Obj:40, Var:02) */
|
||||
case AL_OBJ_AOC_16NT: /* 16-Bit Analog Output Event w/o Time (Obj:42, Var:02) */
|
||||
case AL_OBJ_AOC_16T: /* 16-Bit Analog Output Event with Time (Obj:42, Var:04) */
|
||||
case AL_OBJ_AOC_16NT: /* 16-Bit Analog Output Event w/o Time (Obj:42, Var:02) */
|
||||
case AL_OBJ_AOC_16T: /* 16-Bit Analog Output Event with Time (Obj:42, Var:04) */
|
||||
|
||||
al_val16 = tvb_get_letohs(tvb, data_pos);
|
||||
proto_item_append_text(point_item, ", Value: %u", al_val16);
|
||||
|
@ -2185,8 +2185,8 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
|
|||
break;
|
||||
|
||||
case AL_OBJ_AO_FLT: /* 32-Bit Floating Point Output Status (Obj:40, Var:03) */
|
||||
case AL_OBJ_AOC_FLTNT: /* 32-Bit Floating Point Output Event w/o Time (Obj:42, Var:05) */
|
||||
case AL_OBJ_AOC_FLTT: /* 32-Bit Floating Point Output Event w/ Time (Obj:42, Var:07) */
|
||||
case AL_OBJ_AOC_FLTNT: /* 32-Bit Floating Point Output Event w/o Time (Obj:42, Var:05) */
|
||||
case AL_OBJ_AOC_FLTT: /* 32-Bit Floating Point Output Event w/ Time (Obj:42, Var:07) */
|
||||
|
||||
al_valflt = tvb_get_letohieee_float(tvb, data_pos);
|
||||
proto_item_append_text(point_item, ", Value: %g", al_valflt);
|
||||
|
@ -2195,8 +2195,8 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
|
|||
break;
|
||||
|
||||
case AL_OBJ_AO_DBL: /* 64-Bit Floating Point Output Status (Obj:40, Var:04) */
|
||||
case AL_OBJ_AOC_DBLNT: /* 64-Bit Floating Point Output Event w/o Time (Obj:42, Var:06) */
|
||||
case AL_OBJ_AOC_DBLT: /* 64-Bit Floating Point Output Event w/ Time (Obj:42, Var:08) */
|
||||
case AL_OBJ_AOC_DBLNT: /* 64-Bit Floating Point Output Event w/o Time (Obj:42, Var:06) */
|
||||
case AL_OBJ_AOC_DBLT: /* 64-Bit Floating Point Output Event w/ Time (Obj:42, Var:08) */
|
||||
|
||||
al_valdbl = tvb_get_letohieee_double(tvb, data_pos);
|
||||
proto_item_append_text(point_item, ", Value: %g", al_valdbl);
|
||||
|
@ -2391,7 +2391,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
|
|||
offset = data_pos;
|
||||
break;
|
||||
|
||||
case AL_OBJ_FILE_TRAN_ST: /* File Control Tansport Status (Obj:70, Var:06) */
|
||||
case AL_OBJ_FILE_TRAN_ST: /* File Control Tansport Status (Obj:70, Var:06) */
|
||||
|
||||
/* File Handle */
|
||||
proto_tree_add_item(point_tree, hf_dnp3_al_file_handle, tvb, data_pos, 4, ENC_LITTLE_ENDIAN);
|
||||
|
@ -2416,7 +2416,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree
|
|||
proto_item_set_len(point_item, data_pos - offset);
|
||||
|
||||
offset = data_pos;
|
||||
break;
|
||||
break;
|
||||
|
||||
case AL_OBJ_IIN: /* IIN Data Object */
|
||||
|
||||
|
@ -2656,9 +2656,9 @@ dissect_dnp3_al(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
break;
|
||||
|
||||
case AL_FUNC_OPENFILE: /* Open File Function Code 0x19 */
|
||||
case AL_FUNC_CLOSEFILE: /* Close File Function Code 0x1A */
|
||||
case AL_FUNC_DELETEFILE: /* Delete File Function Code 0x1B */
|
||||
case AL_FUNC_OPENFILE: /* Open File Function Code 0x19 */
|
||||
case AL_FUNC_CLOSEFILE: /* Close File Function Code 0x1A */
|
||||
case AL_FUNC_DELETEFILE: /* Delete File Function Code 0x1B */
|
||||
|
||||
/* Create File Data Objects Tree */
|
||||
t_robj = proto_tree_add_text(al_tree, tvb, offset, -1, "File Data Objects");
|
||||
|
@ -2941,11 +2941,11 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
/* Look up the conversation to get the fragment reassembly id */
|
||||
conversation = find_or_create_conversation(pinfo);
|
||||
|
||||
/*
|
||||
* The TCP/UDP conversation is not sufficient to identify a conversation
|
||||
* on a multi-drop DNP network. Lookup conversation data based on TCP/UDP
|
||||
* conversation and the DNP src and dst addresses
|
||||
*/
|
||||
/*
|
||||
* The TCP/UDP conversation is not sufficient to identify a conversation
|
||||
* on a multi-drop DNP network. Lookup conversation data based on TCP/UDP
|
||||
* conversation and the DNP src and dst addresses
|
||||
*/
|
||||
|
||||
dl_conversation_key.conversation = conversation->index;
|
||||
dl_conversation_key.src = dl_src;
|
||||
|
@ -2958,14 +2958,14 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
dl_conversation_key_t* new_dl_conversation_key = NULL;
|
||||
new_dl_conversation_key = se_alloc(sizeof(dl_conversation_key_t));
|
||||
*new_dl_conversation_key = dl_conversation_key;
|
||||
|
||||
|
||||
conv_data_ptr = se_alloc(sizeof(dnp3_conv_t));
|
||||
|
||||
|
||||
/*** Increment static global fragment reassembly id ***/
|
||||
conv_data_ptr->conv_seq_number = seq_number++;
|
||||
|
||||
g_hash_table_insert(dl_conversation_table, new_dl_conversation_key, conv_data_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
conv_seq_number = conv_data_ptr->conv_seq_number;
|
||||
|
||||
|
|
|
@ -1853,22 +1853,22 @@ dissect_diameter_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
length = tvb_length(tvb);
|
||||
flags_3gpp = tvb_get_guint8(tvb,offset);
|
||||
|
||||
proto_tree_add_item(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
proto_tree_add_item(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
|
||||
switch(flags_3gpp)
|
||||
{
|
||||
case 0:
|
||||
case 0:
|
||||
/* CGI */
|
||||
flags = GTPv2_ULI_CGI_MASK;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
case 1:
|
||||
/* SAI */
|
||||
flags = GTPv2_ULI_SAI_MASK;
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 2:
|
||||
/* RAI */
|
||||
flags = GTPv2_ULI_RAI_MASK;
|
||||
break;
|
||||
break;
|
||||
case 128:
|
||||
/* TAI */
|
||||
flags = GTPv2_ULI_TAI_MASK;
|
||||
|
@ -1882,7 +1882,7 @@ dissect_diameter_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_ECGI_MASK;
|
||||
break;
|
||||
default:
|
||||
proto_tree_add_text(tree, tvb, 1, -1, "Geographic Location");
|
||||
proto_tree_add_text(tree, tvb, 1, -1, "Geographic Location");
|
||||
return length;
|
||||
}
|
||||
|
||||
|
@ -4626,7 +4626,7 @@ void proto_register_gtpv2(void)
|
|||
FT_BOOLEAN, 8, NULL, GTPv2_ULI_CGI_MASK,
|
||||
NULL, HFILL}
|
||||
},
|
||||
{ &hf_gtpv2_glt,
|
||||
{ &hf_gtpv2_glt,
|
||||
{"Geographic Location Type", "gtpv2.glt",
|
||||
FT_UINT8, BASE_DEC, VALS(geographic_location_type_vals), 0x0,
|
||||
NULL, HFILL}
|
||||
|
|
|
@ -635,7 +635,7 @@ static guint8 h223_al2_crc8bit( tvbuff_t *tvb ) {
|
|||
static void
|
||||
dissect_mux_al_pdu( tvbuff_t *tvb, packet_info *pinfo, proto_tree *vc_tree,
|
||||
/* circuit_t* vc_circuit, */
|
||||
h223_lc_params* lc_params )
|
||||
h223_lc_params* lc_params )
|
||||
{
|
||||
proto_tree *al_tree = NULL;
|
||||
proto_item *al_item, *hidden_item;
|
||||
|
@ -739,9 +739,9 @@ dissect_mux_al_pdu( tvbuff_t *tvb, packet_info *pinfo, proto_tree *vc_tree,
|
|||
*/
|
||||
static void
|
||||
dissect_mux_sdu_fragment(tvbuff_t *volatile next_tvb, packet_info *pinfo,
|
||||
guint32 pkt_offset, proto_tree *pdu_tree,
|
||||
h223_call_info* call_info, guint16 vc,
|
||||
gboolean end_of_mux_sdu)
|
||||
guint32 pkt_offset, proto_tree *pdu_tree,
|
||||
h223_call_info* call_info, guint16 vc,
|
||||
gboolean end_of_mux_sdu)
|
||||
{
|
||||
/* update the circuit details before passing to a subdissector */
|
||||
guint32 orig_circuit = pinfo->circuit_id;
|
||||
|
@ -856,10 +856,10 @@ mux_element_sublist_size( h223_mux_element* me )
|
|||
*/
|
||||
static guint32
|
||||
dissect_mux_payload_by_me_list( tvbuff_t *tvb, packet_info *pinfo,
|
||||
guint32 pkt_offset, proto_tree *pdu_tree,
|
||||
h223_call_info* call_info,
|
||||
h223_mux_element *me, guint32 offset,
|
||||
gboolean endOfMuxSdu )
|
||||
guint32 pkt_offset, proto_tree *pdu_tree,
|
||||
h223_call_info* call_info,
|
||||
h223_mux_element *me, guint32 offset,
|
||||
gboolean endOfMuxSdu )
|
||||
{
|
||||
guint32 len = tvb_reported_length(tvb);
|
||||
guint32 frag_len;
|
||||
|
@ -909,8 +909,8 @@ dissect_mux_payload_by_me_list( tvbuff_t *tvb, packet_info *pinfo,
|
|||
*/
|
||||
static void
|
||||
dissect_mux_payload( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset,
|
||||
proto_tree *pdu_tree, h223_call_info *call_info,
|
||||
guint8 mc, gboolean endOfMuxSdu )
|
||||
proto_tree *pdu_tree, h223_call_info *call_info,
|
||||
guint8 mc, gboolean endOfMuxSdu )
|
||||
{
|
||||
guint32 len = tvb_reported_length(tvb);
|
||||
|
||||
|
@ -944,7 +944,7 @@ dissect_mux_payload( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset,
|
|||
*/
|
||||
static void
|
||||
dissect_mux_pdu( tvbuff_t *tvb, packet_info *pinfo, guint32 pkt_offset,
|
||||
proto_tree *h223_tree, h223_call_info *call_info)
|
||||
proto_tree *h223_tree, h223_call_info *call_info)
|
||||
{
|
||||
guint32 offset = 0;
|
||||
/* actual (as opposed to reported) payload len */
|
||||
|
@ -1188,8 +1188,8 @@ h223_mux_check_hdlc(int h223_level, guint32 nbytes, guint32 tail_buf)
|
|||
|
||||
static gint
|
||||
dissect_mux_pdu_fragment( tvbuff_t *tvb, guint32 start_offset,
|
||||
packet_info *pinfo, proto_tree *h223_tree,
|
||||
h223_call_info *call_info)
|
||||
packet_info *pinfo, proto_tree *h223_tree,
|
||||
h223_call_info *call_info)
|
||||
{
|
||||
tvbuff_t *volatile next_tvb;
|
||||
volatile guint32 offset = start_offset;
|
||||
|
@ -1265,16 +1265,16 @@ dissect_mux_pdu_fragment( tvbuff_t *tvb, guint32 start_offset,
|
|||
}
|
||||
|
||||
CATCH2(BoundsError,ReportedBoundsError) {
|
||||
/* Restore the private_data structure in case one of the
|
||||
* called dissectors modified it (and, due to the exception,
|
||||
* was unable to restore it).
|
||||
*/
|
||||
pinfo->private_data = pd_save;
|
||||
/* Restore the private_data structure in case one of the
|
||||
* called dissectors modified it (and, due to the exception,
|
||||
* was unable to restore it).
|
||||
*/
|
||||
pinfo->private_data = pd_save;
|
||||
|
||||
col_append_str(pinfo->cinfo, COL_INFO, "[Malformed Packet]");
|
||||
proto_tree_add_protocol_format(h223_tree, proto_malformed,
|
||||
tvb, 0, 0, "[Malformed Packet: %s]",
|
||||
pinfo->current_proto);
|
||||
pinfo->current_proto);
|
||||
}
|
||||
|
||||
ENDTRY;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1922,7 +1922,7 @@ static guint32 dissect_trunkpacket (tvbuff_t * tvb, guint32 offset,
|
|||
/* Timestamp */
|
||||
proto_tree_add_item(iax2_tree, hf_iax2_trunk_ts, tvb, offset + 2, 4, FALSE);
|
||||
}
|
||||
|
||||
|
||||
offset += 6;
|
||||
|
||||
if( trunkts ) {
|
||||
|
@ -2807,7 +2807,7 @@ proto_reg_handoff_iax2 (void)
|
|||
dissector_add_uint("udp.port", IAX2_PORT, find_dissector("iax2"));
|
||||
v110_handle = find_dissector("v110");
|
||||
if(v110_handle)
|
||||
dissector_add_uint("iax2.dataformat", AST_DATAFORMAT_V110, v110_handle);
|
||||
dissector_add_uint("iax2.dataformat", AST_DATAFORMAT_V110, v110_handle);
|
||||
data_handle = find_dissector("data");
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* See
|
||||
*
|
||||
* http://new.11mercenary.net/~johnycsh/ppi_geolocation_spec/
|
||||
* http://new.11mercenary.net/~johnycsh/ppi_geolocation_spec/
|
||||
*
|
||||
* for specifications.
|
||||
*
|
||||
|
|
|
@ -270,8 +270,8 @@ static gint ett_tcp_opt_rvbd_trpy_flags = -1;
|
|||
#define TCPOPT_MOOD 25 /* RFC5841 TCP Packet Mood */
|
||||
#define TCPOPT_QS 27 /* RFC4782 */
|
||||
#define TCPOPT_USER_TO 28 /* RFC5482 */
|
||||
#define TCPOPT_EXP_FD 0xfd /* Experimental, reserved */
|
||||
#define TCPOPT_EXP_FE 0xfe /* Experimental, reserved */
|
||||
#define TCPOPT_EXP_FD 0xfd /* Experimental, reserved */
|
||||
#define TCPOPT_EXP_FE 0xfe /* Experimental, reserved */
|
||||
/* Non IANA registered option numbers */
|
||||
#define TCPOPT_RVBD_PROBE 76 /* Riverbed probe option */
|
||||
#define TCPOPT_RVBD_TRPY 78 /* Riverbed transparency option */
|
||||
|
@ -300,7 +300,7 @@ static gint ett_tcp_opt_rvbd_trpy_flags = -1;
|
|||
#define TCPOLEN_USER_TO 4
|
||||
#define TCPOLEN_RVBD_PROBE_MIN 3
|
||||
#define TCPOLEN_RVBD_TRPY_MIN 16
|
||||
#define TCPOLEN_EXP_MIN 2
|
||||
#define TCPOLEN_EXP_MIN 2
|
||||
|
||||
static const true_false_string tcp_option_user_to_granularity = {
|
||||
"Minutes", "Seconds"
|
||||
|
@ -2270,12 +2270,12 @@ dissect_tcpopt_exp(const ip_tcp_opt *optp _U_, tvbuff_t *tvb,
|
|||
proto_tree *exp_tree;
|
||||
|
||||
item = proto_tree_add_item(opt_tree, hf_tcp_option_exp, tvb,
|
||||
offset, optlen, FALSE);
|
||||
offset, optlen, FALSE);
|
||||
exp_tree = proto_item_add_subtree(item, ett_tcp_option_exp);
|
||||
proto_tree_add_item(exp_tree, hf_tcp_option_kind, tvb, offset, 1, FALSE);
|
||||
proto_tree_add_item(exp_tree, hf_tcp_option_len, tvb, offset + 1, 1, FALSE);
|
||||
proto_tree_add_item(exp_tree, hf_tcp_option_exp_data, tvb,
|
||||
offset + 2, optlen - 2, FALSE);
|
||||
offset + 2, optlen - 2, FALSE);
|
||||
tcp_info_append_uint(pinfo, "Expxx", TRUE);
|
||||
}
|
||||
|
||||
|
@ -2305,7 +2305,7 @@ dissect_tcpopt_mss(const ip_tcp_opt *optp, tvbuff_t *tvb,
|
|||
|
||||
mss = tvb_get_ntohs(tvb, offset + 2);
|
||||
item = proto_tree_add_none_format(opt_tree, hf_tcp_option_mss, tvb, offset,
|
||||
optlen, "%s: %u bytes", optp->name, mss);
|
||||
optlen, "%s: %u bytes", optp->name, mss);
|
||||
exp_tree = proto_item_add_subtree(item, ett_tcp_option_mss);
|
||||
proto_tree_add_item(exp_tree, hf_tcp_option_kind, tvb, offset, 1, FALSE);
|
||||
proto_tree_add_item(exp_tree, hf_tcp_option_len, tvb, offset + 1, 1, FALSE);
|
||||
|
@ -2476,8 +2476,8 @@ dissect_tcpopt_timestamp(const ip_tcp_opt *optp _U_, tvbuff_t *tvb,
|
|||
|
||||
proto_item_append_text(ti, "TSval %u, TSecr %u", ts_val, ts_ecr);
|
||||
if (tcp_ignore_timestamps == FALSE) {
|
||||
tcp_info_append_uint(pinfo, "TSval", ts_val);
|
||||
tcp_info_append_uint(pinfo, "TSecr", ts_ecr);
|
||||
tcp_info_append_uint(pinfo, "TSval", ts_val);
|
||||
tcp_info_append_uint(pinfo, "TSecr", ts_ecr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -660,9 +660,9 @@ static void dissect_wifi_p2p_group_id(proto_item *tlv_root,
|
|||
}
|
||||
|
||||
static void dissect_wifi_p2p_group_bssid(packet_info *pinfo,
|
||||
proto_item *tlv_root,
|
||||
proto_item *tlv_item, tvbuff_t *tvb,
|
||||
int offset, guint16 slen)
|
||||
proto_item *tlv_root,
|
||||
proto_item *tlv_item, tvbuff_t *tvb,
|
||||
int offset, guint16 slen)
|
||||
{
|
||||
int s_offset;
|
||||
guint8 addr[6];
|
||||
|
|
|
@ -36,18 +36,18 @@
|
|||
/* set the given nstime_t to zero */
|
||||
void nstime_set_zero(nstime_t *nstime)
|
||||
{
|
||||
nstime->secs = 0;
|
||||
nstime->nsecs = 0;
|
||||
nstime->secs = 0;
|
||||
nstime->nsecs = 0;
|
||||
}
|
||||
|
||||
/* is the given nstime_t currently zero? */
|
||||
gboolean nstime_is_zero(nstime_t *nstime)
|
||||
{
|
||||
if(nstime->secs == 0 && nstime->nsecs == 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
if(nstime->secs == 0 && nstime->nsecs == 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* set the given nstime_t to (0,maxint) to mark it as "unset"
|
||||
|
@ -56,18 +56,18 @@ gboolean nstime_is_zero(nstime_t *nstime)
|
|||
*/
|
||||
void nstime_set_unset(nstime_t *nstime)
|
||||
{
|
||||
nstime->secs = 0;
|
||||
nstime->nsecs = G_MAXINT;
|
||||
nstime->secs = 0;
|
||||
nstime->nsecs = G_MAXINT;
|
||||
}
|
||||
|
||||
/* is the given nstime_t currently (0,maxint)? */
|
||||
gboolean nstime_is_unset(nstime_t *nstime)
|
||||
{
|
||||
if(nstime->secs == 0 && nstime->nsecs == G_MAXINT) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
if(nstime->secs == 0 && nstime->nsecs == G_MAXINT) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -77,8 +77,8 @@ gboolean nstime_is_unset(nstime_t *nstime)
|
|||
*/
|
||||
void nstime_copy(nstime_t *a, const nstime_t *b)
|
||||
{
|
||||
a->secs = b->secs;
|
||||
a->nsecs = b->nsecs;
|
||||
a->secs = b->secs;
|
||||
a->nsecs = b->nsecs;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
772
epan/uat.c
772
epan/uat.c
|
@ -53,204 +53,204 @@
|
|||
static GPtrArray* all_uats = NULL;
|
||||
|
||||
void uat_init(void) {
|
||||
all_uats = g_ptr_array_new();
|
||||
all_uats = g_ptr_array_new();
|
||||
}
|
||||
|
||||
uat_t* uat_new(const char* name,
|
||||
size_t size,
|
||||
const char* filename,
|
||||
gboolean from_profile,
|
||||
void** data_ptr,
|
||||
guint* numitems_ptr,
|
||||
const char* category,
|
||||
const char* help,
|
||||
uat_copy_cb_t copy_cb,
|
||||
uat_update_cb_t update_cb,
|
||||
uat_free_cb_t free_cb,
|
||||
uat_post_update_cb_t post_update_cb,
|
||||
uat_field_t* flds_array) {
|
||||
/* Create new uat */
|
||||
uat_t* uat = g_malloc(sizeof(uat_t));
|
||||
guint i;
|
||||
size_t size,
|
||||
const char* filename,
|
||||
gboolean from_profile,
|
||||
void** data_ptr,
|
||||
guint* numitems_ptr,
|
||||
const char* category,
|
||||
const char* help,
|
||||
uat_copy_cb_t copy_cb,
|
||||
uat_update_cb_t update_cb,
|
||||
uat_free_cb_t free_cb,
|
||||
uat_post_update_cb_t post_update_cb,
|
||||
uat_field_t* flds_array) {
|
||||
/* Create new uat */
|
||||
uat_t* uat = g_malloc(sizeof(uat_t));
|
||||
guint i;
|
||||
|
||||
/* Add to global array of uats */
|
||||
if (!all_uats)
|
||||
all_uats = g_ptr_array_new();
|
||||
/* Add to global array of uats */
|
||||
if (!all_uats)
|
||||
all_uats = g_ptr_array_new();
|
||||
|
||||
g_ptr_array_add(all_uats,uat);
|
||||
g_ptr_array_add(all_uats,uat);
|
||||
|
||||
/* Check params */
|
||||
g_assert(name && size && filename && data_ptr && numitems_ptr);
|
||||
/* Check params */
|
||||
g_assert(name && size && filename && data_ptr && numitems_ptr);
|
||||
|
||||
/* Set uat values from inputs */
|
||||
uat->name = g_strdup(name);
|
||||
uat->record_size = size;
|
||||
uat->filename = g_strdup(filename);
|
||||
uat->from_profile = from_profile;
|
||||
uat->user_ptr = data_ptr;
|
||||
uat->nrows_p = numitems_ptr;
|
||||
uat->copy_cb = copy_cb;
|
||||
uat->update_cb = update_cb;
|
||||
uat->free_cb = free_cb;
|
||||
uat->post_update_cb = post_update_cb;
|
||||
uat->fields = flds_array;
|
||||
uat->user_data = g_array_new(FALSE,FALSE,(guint)uat->record_size);
|
||||
uat->changed = FALSE;
|
||||
uat->loaded = FALSE;
|
||||
uat->rep = NULL;
|
||||
uat->free_rep = NULL;
|
||||
uat->help = help;
|
||||
uat->category = category;
|
||||
/* Set uat values from inputs */
|
||||
uat->name = g_strdup(name);
|
||||
uat->record_size = size;
|
||||
uat->filename = g_strdup(filename);
|
||||
uat->from_profile = from_profile;
|
||||
uat->user_ptr = data_ptr;
|
||||
uat->nrows_p = numitems_ptr;
|
||||
uat->copy_cb = copy_cb;
|
||||
uat->update_cb = update_cb;
|
||||
uat->free_cb = free_cb;
|
||||
uat->post_update_cb = post_update_cb;
|
||||
uat->fields = flds_array;
|
||||
uat->user_data = g_array_new(FALSE,FALSE,(guint)uat->record_size);
|
||||
uat->changed = FALSE;
|
||||
uat->loaded = FALSE;
|
||||
uat->rep = NULL;
|
||||
uat->free_rep = NULL;
|
||||
uat->help = help;
|
||||
uat->category = category;
|
||||
|
||||
for (i=0;flds_array[i].title;i++) {
|
||||
fld_data_t* f = g_malloc(sizeof(fld_data_t));
|
||||
for (i=0;flds_array[i].title;i++) {
|
||||
fld_data_t* f = g_malloc(sizeof(fld_data_t));
|
||||
|
||||
f->colnum = i+1;
|
||||
f->rep = NULL;
|
||||
f->free_rep = NULL;
|
||||
f->colnum = i+1;
|
||||
f->rep = NULL;
|
||||
f->free_rep = NULL;
|
||||
|
||||
flds_array[i].priv = f;
|
||||
}
|
||||
flds_array[i].priv = f;
|
||||
}
|
||||
|
||||
uat->ncols = i;
|
||||
uat->ncols = i;
|
||||
|
||||
*data_ptr = NULL;
|
||||
*numitems_ptr = 0;
|
||||
*data_ptr = NULL;
|
||||
*numitems_ptr = 0;
|
||||
|
||||
return uat;
|
||||
return uat;
|
||||
}
|
||||
|
||||
void* uat_add_record(uat_t* uat, const void* data) {
|
||||
void* rec;
|
||||
void* rec;
|
||||
|
||||
g_array_append_vals (uat->user_data, data, 1);
|
||||
g_array_append_vals (uat->user_data, data, 1);
|
||||
|
||||
rec = uat->user_data->data + (uat->record_size * (uat->user_data->len-1));
|
||||
rec = uat->user_data->data + (uat->record_size * (uat->user_data->len-1));
|
||||
|
||||
if (uat->copy_cb) {
|
||||
uat->copy_cb(rec, data, (unsigned int) uat->record_size);
|
||||
}
|
||||
if (uat->copy_cb) {
|
||||
uat->copy_cb(rec, data, (unsigned int) uat->record_size);
|
||||
}
|
||||
|
||||
UAT_UPDATE(uat);
|
||||
UAT_UPDATE(uat);
|
||||
|
||||
return rec;
|
||||
return rec;
|
||||
}
|
||||
|
||||
void uat_swap(uat_t* uat, guint a, guint b) {
|
||||
size_t s = uat->record_size;
|
||||
void* tmp = ep_alloc(s);
|
||||
size_t s = uat->record_size;
|
||||
void* tmp = ep_alloc(s);
|
||||
|
||||
g_assert( a < uat->user_data->len && b < uat->user_data->len );
|
||||
g_assert( a < uat->user_data->len && b < uat->user_data->len );
|
||||
|
||||
if (a == b) return;
|
||||
if (a == b) return;
|
||||
|
||||
memcpy(tmp, UAT_INDEX_PTR(uat,a), s);
|
||||
memcpy(UAT_INDEX_PTR(uat,a), UAT_INDEX_PTR(uat,b), s);
|
||||
memcpy(UAT_INDEX_PTR(uat,b), tmp, s);
|
||||
memcpy(tmp, UAT_INDEX_PTR(uat,a), s);
|
||||
memcpy(UAT_INDEX_PTR(uat,a), UAT_INDEX_PTR(uat,b), s);
|
||||
memcpy(UAT_INDEX_PTR(uat,b), tmp, s);
|
||||
|
||||
}
|
||||
|
||||
void uat_remove_record_idx(uat_t* uat, guint idx) {
|
||||
|
||||
g_assert( idx < uat->user_data->len );
|
||||
g_assert( idx < uat->user_data->len );
|
||||
|
||||
if (uat->free_cb) {
|
||||
uat->free_cb(UAT_INDEX_PTR(uat,idx));
|
||||
}
|
||||
if (uat->free_cb) {
|
||||
uat->free_cb(UAT_INDEX_PTR(uat,idx));
|
||||
}
|
||||
|
||||
g_array_remove_index(uat->user_data, idx);
|
||||
g_array_remove_index(uat->user_data, idx);
|
||||
|
||||
UAT_UPDATE(uat);
|
||||
UAT_UPDATE(uat);
|
||||
|
||||
}
|
||||
|
||||
/* The returned filename was g_malloc()'d so the caller must free it */
|
||||
gchar* uat_get_actual_filename(uat_t* uat, gboolean for_writing) {
|
||||
|
||||
gchar* pers_fname = get_persconffile_path(uat->filename, uat->from_profile, for_writing);
|
||||
gchar* pers_fname = get_persconffile_path(uat->filename, uat->from_profile, for_writing);
|
||||
|
||||
if (! for_writing ) {
|
||||
gchar* data_fname = get_datafile_path(uat->filename);
|
||||
if (! for_writing ) {
|
||||
gchar* data_fname = get_datafile_path(uat->filename);
|
||||
|
||||
if ((! file_exists(pers_fname) ) && file_exists(data_fname)) {
|
||||
g_free(pers_fname);
|
||||
return data_fname;
|
||||
}
|
||||
if ((! file_exists(pers_fname) ) && file_exists(data_fname)) {
|
||||
g_free(pers_fname);
|
||||
return data_fname;
|
||||
}
|
||||
|
||||
g_free(data_fname);
|
||||
}
|
||||
g_free(data_fname);
|
||||
}
|
||||
|
||||
if ((! file_exists(pers_fname) ) && (! for_writing ) ) {
|
||||
g_free(pers_fname);
|
||||
return NULL;
|
||||
}
|
||||
if ((! file_exists(pers_fname) ) && (! for_writing ) ) {
|
||||
g_free(pers_fname);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pers_fname;
|
||||
return pers_fname;
|
||||
}
|
||||
|
||||
uat_t* uat_get_table_by_name(const char* name) {
|
||||
guint i;
|
||||
guint i;
|
||||
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
if ( g_str_equal(u->name,name) ) {
|
||||
return (u);
|
||||
}
|
||||
}
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
if ( g_str_equal(u->name,name) ) {
|
||||
return (u);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void putfld(FILE* fp, void* rec, uat_field_t* f) {
|
||||
guint fld_len;
|
||||
const char* fld_ptr;
|
||||
guint fld_len;
|
||||
const char* fld_ptr;
|
||||
|
||||
f->cb.tostr(rec,&fld_ptr,&fld_len,f->cbdata.tostr,f->fld_data);
|
||||
f->cb.tostr(rec,&fld_ptr,&fld_len,f->cbdata.tostr,f->fld_data);
|
||||
|
||||
switch(f->mode){
|
||||
case PT_TXTMOD_ENUM:
|
||||
case PT_TXTMOD_FILENAME:
|
||||
case PT_TXTMOD_DIRECTORYNAME:
|
||||
case PT_TXTMOD_STRING: {
|
||||
guint i;
|
||||
switch(f->mode){
|
||||
case PT_TXTMOD_ENUM:
|
||||
case PT_TXTMOD_FILENAME:
|
||||
case PT_TXTMOD_DIRECTORYNAME:
|
||||
case PT_TXTMOD_STRING: {
|
||||
guint i;
|
||||
|
||||
putc('"',fp);
|
||||
putc('"',fp);
|
||||
|
||||
for(i=0;i<fld_len;i++) {
|
||||
char c = fld_ptr[i];
|
||||
for(i=0;i<fld_len;i++) {
|
||||
char c = fld_ptr[i];
|
||||
|
||||
if (c == '"' || c == '\\' || ! isprint((guchar)c) ) {
|
||||
fprintf(fp,"\\x%.2x",c);
|
||||
} else {
|
||||
putc(c,fp);
|
||||
}
|
||||
}
|
||||
if (c == '"' || c == '\\' || ! isprint((guchar)c) ) {
|
||||
fprintf(fp,"\\x%.2x",c);
|
||||
} else {
|
||||
putc(c,fp);
|
||||
}
|
||||
}
|
||||
|
||||
putc('"',fp);
|
||||
return;
|
||||
}
|
||||
case PT_TXTMOD_HEXBYTES: {
|
||||
guint i;
|
||||
putc('"',fp);
|
||||
return;
|
||||
}
|
||||
case PT_TXTMOD_HEXBYTES: {
|
||||
guint i;
|
||||
|
||||
for(i=0;i<fld_len;i++) {
|
||||
fprintf(fp,"%.2x",((guint8*)fld_ptr)[i]);
|
||||
}
|
||||
for(i=0;i<fld_len;i++) {
|
||||
fprintf(fp,"%.2x",((guint8*)fld_ptr)[i]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
return;
|
||||
}
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
gboolean uat_save(uat_t* uat, char** error) {
|
||||
guint i;
|
||||
gchar* fname = uat_get_actual_filename(uat,TRUE);
|
||||
FILE* fp;
|
||||
guint i;
|
||||
gchar* fname = uat_get_actual_filename(uat,TRUE);
|
||||
FILE* fp;
|
||||
|
||||
if (! fname ) return FALSE;
|
||||
if (! fname ) return FALSE;
|
||||
|
||||
fp = ws_fopen(fname,"w");
|
||||
fp = ws_fopen(fname,"w");
|
||||
|
||||
if (!fp && errno == ENOENT) {
|
||||
/* Parent directory does not exist, try creating first */
|
||||
|
@ -263,186 +263,186 @@ gboolean uat_save(uat_t* uat, char** error) {
|
|||
fp = ws_fopen(fname,"w");
|
||||
}
|
||||
|
||||
if (!fp) {
|
||||
*error = ep_strdup_printf("uat_save: error opening '%s': %s",fname,g_strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
if (!fp) {
|
||||
*error = ep_strdup_printf("uat_save: error opening '%s': %s",fname,g_strerror(errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*error = NULL;
|
||||
g_free (fname);
|
||||
*error = NULL;
|
||||
g_free (fname);
|
||||
|
||||
fprintf(fp,"# This file is automatically generated, DO NOT MODIFY.\n");
|
||||
fprintf(fp,"# This file is automatically generated, DO NOT MODIFY.\n");
|
||||
|
||||
for ( i = 0 ; i < uat->user_data->len ; i++ ) {
|
||||
void* rec = uat->user_data->data + (uat->record_size * i);
|
||||
uat_field_t* f;
|
||||
guint j;
|
||||
for ( i = 0 ; i < uat->user_data->len ; i++ ) {
|
||||
void* rec = uat->user_data->data + (uat->record_size * i);
|
||||
uat_field_t* f;
|
||||
guint j;
|
||||
|
||||
f = uat->fields;
|
||||
f = uat->fields;
|
||||
|
||||
|
||||
for( j=0 ; j < uat->ncols ; j++ ) {
|
||||
putfld(fp, rec, &(f[j]));
|
||||
fputs((j == uat->ncols - 1) ? "\n" : "," ,fp);
|
||||
}
|
||||
for( j=0 ; j < uat->ncols ; j++ ) {
|
||||
putfld(fp, rec, &(f[j]));
|
||||
fputs((j == uat->ncols - 1) ? "\n" : "," ,fp);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
fclose(fp);
|
||||
|
||||
uat->changed = FALSE;
|
||||
uat->changed = FALSE;
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void uat_destroy(uat_t* uat) {
|
||||
/* XXX still missing a destructor */
|
||||
g_ptr_array_remove(all_uats,uat);
|
||||
/* XXX still missing a destructor */
|
||||
g_ptr_array_remove(all_uats,uat);
|
||||
|
||||
}
|
||||
|
||||
uat_t *uat_find(gchar *name) {
|
||||
guint i;
|
||||
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
|
||||
if (strcmp(u->name, name) == 0 || strcmp(u->filename, name) == 0) {
|
||||
return u;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void uat_clear(uat_t* uat) {
|
||||
guint i;
|
||||
guint i;
|
||||
|
||||
for ( i = 0 ; i < uat->user_data->len ; i++ ) {
|
||||
if (uat->free_cb) {
|
||||
uat->free_cb(UAT_INDEX_PTR(uat,i));
|
||||
}
|
||||
}
|
||||
for ( i = 0 ; i < uat->user_data->len ; i++ ) {
|
||||
if (uat->free_cb) {
|
||||
uat->free_cb(UAT_INDEX_PTR(uat,i));
|
||||
}
|
||||
}
|
||||
|
||||
g_array_set_size(uat->user_data,0);
|
||||
g_array_set_size(uat->user_data,0);
|
||||
|
||||
*((uat)->user_ptr) = NULL;
|
||||
*((uat)->nrows_p) = 0;
|
||||
*((uat)->user_ptr) = NULL;
|
||||
*((uat)->nrows_p) = 0;
|
||||
}
|
||||
|
||||
void* uat_dup(uat_t* uat, guint* len_p) {
|
||||
guint size = (guint) (uat->record_size * uat->user_data->len);
|
||||
*len_p = size;
|
||||
return size ? g_memdup(uat->user_data->data,size) : NULL ;
|
||||
guint size = (guint) (uat->record_size * uat->user_data->len);
|
||||
*len_p = size;
|
||||
return size ? g_memdup(uat->user_data->data,size) : NULL ;
|
||||
}
|
||||
|
||||
void* uat_se_dup(uat_t* uat, guint* len_p) {
|
||||
guint size = (guint) (uat->record_size * uat->user_data->len);
|
||||
*len_p = (guint) size;
|
||||
return size ? se_memdup(uat->user_data->data,size) : NULL ;
|
||||
guint size = (guint) (uat->record_size * uat->user_data->len);
|
||||
*len_p = (guint) size;
|
||||
return size ? se_memdup(uat->user_data->data,size) : NULL ;
|
||||
}
|
||||
|
||||
void uat_unload_all(void) {
|
||||
guint i;
|
||||
guint i;
|
||||
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
/* Do not unload if not in profile */
|
||||
if (u->from_profile) {
|
||||
uat_clear(u);
|
||||
u->loaded = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void uat_cleanup(void) {
|
||||
while( all_uats->len ) {
|
||||
uat_destroy((uat_t*)all_uats->pdata);
|
||||
}
|
||||
while( all_uats->len ) {
|
||||
uat_destroy((uat_t*)all_uats->pdata);
|
||||
}
|
||||
|
||||
g_ptr_array_free(all_uats,TRUE);
|
||||
g_ptr_array_free(all_uats,TRUE);
|
||||
}
|
||||
|
||||
|
||||
void uat_foreach_table(uat_cb_t cb,void* user_data) {
|
||||
guint i;
|
||||
guint i;
|
||||
|
||||
for (i=0; i < all_uats->len; i++)
|
||||
cb(g_ptr_array_index(all_uats,i), user_data);
|
||||
for (i=0; i < all_uats->len; i++)
|
||||
cb(g_ptr_array_index(all_uats,i), user_data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void uat_load_all(void) {
|
||||
guint i;
|
||||
gchar* err;
|
||||
guint i;
|
||||
gchar* err;
|
||||
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
err = NULL;
|
||||
for (i=0; i < all_uats->len; i++) {
|
||||
uat_t* u = g_ptr_array_index(all_uats,i);
|
||||
err = NULL;
|
||||
|
||||
if (!u->loaded)
|
||||
uat_load(u, &err);
|
||||
if (!u->loaded)
|
||||
uat_load(u, &err);
|
||||
|
||||
if (err) {
|
||||
report_failure("Error loading table '%s': %s",u->name,err);
|
||||
}
|
||||
}
|
||||
if (err) {
|
||||
report_failure("Error loading table '%s': %s",u->name,err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gboolean uat_fld_chk_str(void* u1 _U_, const char* strptr, unsigned len _U_, const void* u2 _U_, const void* u3 _U_, const char** err) {
|
||||
if (strptr == NULL) {
|
||||
*err = "NULL pointer";
|
||||
return FALSE;
|
||||
}
|
||||
if (strptr == NULL) {
|
||||
*err = "NULL pointer";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean uat_fld_chk_oid(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) {
|
||||
unsigned int i;
|
||||
*err = NULL;
|
||||
|
||||
if (strptr == NULL) {
|
||||
*err = "NULL pointer";
|
||||
return FALSE;
|
||||
}
|
||||
*err = NULL;
|
||||
|
||||
for(i = 0; i < len; i++)
|
||||
if(!(isdigit(strptr[i]) || strptr[i] == '.')) {
|
||||
*err = "Only digits [0-9] and \".\" allowed in an OID";
|
||||
break;
|
||||
}
|
||||
if (strptr == NULL) {
|
||||
*err = "NULL pointer";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(strptr[len-1] == '.')
|
||||
*err = "OIDs must not be terminated with a \".\"";
|
||||
for(i = 0; i < len; i++)
|
||||
if(!(isdigit(strptr[i]) || strptr[i] == '.')) {
|
||||
*err = "Only digits [0-9] and \".\" allowed in an OID";
|
||||
break;
|
||||
}
|
||||
|
||||
if(!((*strptr == '0' || *strptr == '1' || *strptr =='2') && (len > 1 && strptr[1] == '.')))
|
||||
*err = "OIDs must start with \"0.\" (ITU-T assigned), \"1.\" (ISO assigned) or \"2.\" (joint ISO/ITU-T assigned)";
|
||||
if(strptr[len-1] == '.')
|
||||
*err = "OIDs must not be terminated with a \".\"";
|
||||
|
||||
/* should also check that the second arc is in the range 0-39 */
|
||||
if(!((*strptr == '0' || *strptr == '1' || *strptr =='2') && (len > 1 && strptr[1] == '.')))
|
||||
*err = "OIDs must start with \"0.\" (ITU-T assigned), \"1.\" (ISO assigned) or \"2.\" (joint ISO/ITU-T assigned)";
|
||||
|
||||
return *err == NULL;
|
||||
/* should also check that the second arc is in the range 0-39 */
|
||||
|
||||
return *err == NULL;
|
||||
}
|
||||
|
||||
gboolean uat_fld_chk_proto(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) {
|
||||
if (len) {
|
||||
char* name = ep_strndup(strptr,len);
|
||||
ascii_strdown_inplace(name);
|
||||
g_strchug(name);
|
||||
if (len) {
|
||||
char* name = ep_strndup(strptr,len);
|
||||
ascii_strdown_inplace(name);
|
||||
g_strchug(name);
|
||||
|
||||
if (find_dissector(name)) {
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
} else {
|
||||
*err = "dissector not found";
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
if (find_dissector(name)) {
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
} else {
|
||||
*err = "dissector not found";
|
||||
return FALSE;
|
||||
}
|
||||
} else {
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean uat_fld_chk_num_dec(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) {
|
||||
|
@ -456,8 +456,8 @@ gboolean uat_fld_chk_num_dec(void* u1 _U_, const char* strptr, unsigned len, con
|
|||
}
|
||||
}
|
||||
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, unsigned len, const void* u2 _U_, const void* u3 _U_, const char** err) {
|
||||
|
@ -471,197 +471,197 @@ gboolean uat_fld_chk_num_hex(void* u1 _U_, const char* strptr, unsigned len, con
|
|||
}
|
||||
}
|
||||
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean uat_fld_chk_enum(void* u1 _U_, const char* strptr, unsigned len, const void* v, const void* u3 _U_, const char** err) {
|
||||
char* str = ep_strndup(strptr,len);
|
||||
guint i;
|
||||
const value_string* vs = v;
|
||||
char* str = ep_strndup(strptr,len);
|
||||
guint i;
|
||||
const value_string* vs = v;
|
||||
|
||||
for(i=0;vs[i].strptr;i++) {
|
||||
if (g_str_equal(vs[i].strptr,str)) {
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
for(i=0;vs[i].strptr;i++) {
|
||||
if (g_str_equal(vs[i].strptr,str)) {
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
*err = ep_strdup_printf("invalid value: %s",str);
|
||||
return FALSE;
|
||||
*err = ep_strdup_printf("invalid value: %s",str);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean uat_fld_chk_range(void* u1 _U_, const char* strptr, unsigned len, const void* v _U_, const void* u3, const char** err) {
|
||||
char* str = ep_strndup(strptr,len);
|
||||
range_t* r = NULL;
|
||||
convert_ret_t ret = range_convert_str(&r, str,GPOINTER_TO_UINT(u3));
|
||||
char* str = ep_strndup(strptr,len);
|
||||
range_t* r = NULL;
|
||||
convert_ret_t ret = range_convert_str(&r, str,GPOINTER_TO_UINT(u3));
|
||||
|
||||
switch ( ret ) {
|
||||
case CVT_NO_ERROR:
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
case CVT_SYNTAX_ERROR:
|
||||
*err = ep_strdup_printf("syntax error in range: %s",str);
|
||||
return FALSE;
|
||||
case CVT_NUMBER_TOO_BIG:
|
||||
*err = ep_strdup_printf("value too large in range: '%s' (max = %u)",str,GPOINTER_TO_UINT(u3));
|
||||
return FALSE;
|
||||
default:
|
||||
*err = "This should not happen, it is a bug in wireshark! please report to wireshark-dev@wireshark.org";
|
||||
return FALSE;
|
||||
}
|
||||
switch ( ret ) {
|
||||
case CVT_NO_ERROR:
|
||||
*err = NULL;
|
||||
return TRUE;
|
||||
case CVT_SYNTAX_ERROR:
|
||||
*err = ep_strdup_printf("syntax error in range: %s",str);
|
||||
return FALSE;
|
||||
case CVT_NUMBER_TOO_BIG:
|
||||
*err = ep_strdup_printf("value too large in range: '%s' (max = %u)",str,GPOINTER_TO_UINT(u3));
|
||||
return FALSE;
|
||||
default:
|
||||
*err = "This should not happen, it is a bug in wireshark! please report to wireshark-dev@wireshark.org";
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static int xton(char d) {
|
||||
switch(d) {
|
||||
case '0': return 0;
|
||||
case '1': return 1;
|
||||
case '2': return 2;
|
||||
case '3': return 3;
|
||||
case '4': return 4;
|
||||
case '5': return 5;
|
||||
case '6': return 6;
|
||||
case '7': return 7;
|
||||
case '8': return 8;
|
||||
case '9': return 9;
|
||||
case 'a': case 'A': return 10;
|
||||
case 'b': case 'B': return 11;
|
||||
case 'c': case 'C': return 12;
|
||||
case 'd': case 'D': return 13;
|
||||
case 'e': case 'E': return 14;
|
||||
case 'f': case 'F': return 15;
|
||||
default: return -1;
|
||||
}
|
||||
switch(d) {
|
||||
case '0': return 0;
|
||||
case '1': return 1;
|
||||
case '2': return 2;
|
||||
case '3': return 3;
|
||||
case '4': return 4;
|
||||
case '5': return 5;
|
||||
case '6': return 6;
|
||||
case '7': return 7;
|
||||
case '8': return 8;
|
||||
case '9': return 9;
|
||||
case 'a': case 'A': return 10;
|
||||
case 'b': case 'B': return 11;
|
||||
case 'c': case 'C': return 12;
|
||||
case 'd': case 'D': return 13;
|
||||
case 'e': case 'E': return 14;
|
||||
case 'f': case 'F': return 15;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
char* uat_unbinstring(const char* si, guint in_len, guint* len_p) {
|
||||
guint8* buf;
|
||||
guint len = in_len/2;
|
||||
int i = 0;
|
||||
int d0, d1;
|
||||
guint8* buf;
|
||||
guint len = in_len/2;
|
||||
int i = 0;
|
||||
int d0, d1;
|
||||
|
||||
if (in_len%2) {
|
||||
return NULL;
|
||||
}
|
||||
if (in_len%2) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buf= g_malloc0(len+1);
|
||||
if (len_p) *len_p = len;
|
||||
buf= g_malloc0(len+1);
|
||||
if (len_p) *len_p = len;
|
||||
|
||||
while(in_len) {
|
||||
d1 = xton(*(si++));
|
||||
d0 = xton(*(si++));
|
||||
while(in_len) {
|
||||
d1 = xton(*(si++));
|
||||
d0 = xton(*(si++));
|
||||
|
||||
buf[i++] = (d1 * 16) + d0;
|
||||
buf[i++] = (d1 * 16) + d0;
|
||||
|
||||
in_len -= 2;
|
||||
}
|
||||
in_len -= 2;
|
||||
}
|
||||
|
||||
return (char*)buf;
|
||||
return (char*)buf;
|
||||
}
|
||||
|
||||
char* uat_unesc(const char* si, guint in_len, guint* len_p) {
|
||||
char* buf = g_malloc0(in_len+1);
|
||||
char* p = buf;
|
||||
guint len = 0;
|
||||
const char* s;
|
||||
const char* in_end = si+in_len;
|
||||
char* buf = g_malloc0(in_len+1);
|
||||
char* p = buf;
|
||||
guint len = 0;
|
||||
const char* s;
|
||||
const char* in_end = si+in_len;
|
||||
|
||||
for (s = (void*)si; s < in_end; s++) {
|
||||
switch(*s) {
|
||||
case '\\':
|
||||
switch(*(++s)) {
|
||||
case 'a': *(p++) = '\a'; len++; break;
|
||||
case 'b': *(p++) = '\b'; len++; break;
|
||||
case 'e': *(p++) = '\033' /* '\e' is non ANSI-C */; len++; break;
|
||||
case 'f': *(p++) = '\f'; len++; break;
|
||||
case 'n': *(p++) = '\n'; len++; break;
|
||||
case 'r': *(p++) = '\r'; len++; break;
|
||||
case 't': *(p++) = '\t'; len++; break;
|
||||
case 'v': *(p++) = '\v'; len++; break;
|
||||
for (s = (void*)si; s < in_end; s++) {
|
||||
switch(*s) {
|
||||
case '\\':
|
||||
switch(*(++s)) {
|
||||
case 'a': *(p++) = '\a'; len++; break;
|
||||
case 'b': *(p++) = '\b'; len++; break;
|
||||
case 'e': *(p++) = '\033' /* '\e' is non ANSI-C */; len++; break;
|
||||
case 'f': *(p++) = '\f'; len++; break;
|
||||
case 'n': *(p++) = '\n'; len++; break;
|
||||
case 'r': *(p++) = '\r'; len++; break;
|
||||
case 't': *(p++) = '\t'; len++; break;
|
||||
case 'v': *(p++) = '\v'; len++; break;
|
||||
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
{
|
||||
int c0 = 0;
|
||||
int c1 = 0;
|
||||
int c2 = 0;
|
||||
int c = 0;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
{
|
||||
int c0 = 0;
|
||||
int c1 = 0;
|
||||
int c2 = 0;
|
||||
int c = 0;
|
||||
|
||||
c0 = (*s) - '0';
|
||||
c0 = (*s) - '0';
|
||||
|
||||
if ( s[1] >= '0' && s[1] <= '7' ) {
|
||||
c1 = c0;
|
||||
c0 = (*++s) - '0';
|
||||
if ( s[1] >= '0' && s[1] <= '7' ) {
|
||||
c1 = c0;
|
||||
c0 = (*++s) - '0';
|
||||
|
||||
if ( s[1] >= '0' && s[1] <= '7' ) {
|
||||
c2 = c1;
|
||||
c1 = c0;
|
||||
c0 = (*++s) - '0';
|
||||
}
|
||||
}
|
||||
c = (64 * c2) + (8 * c1) + c0;
|
||||
*(p++) = (char) (c > 255 ? 255 : c);
|
||||
len++;
|
||||
break;
|
||||
}
|
||||
if ( s[1] >= '0' && s[1] <= '7' ) {
|
||||
c2 = c1;
|
||||
c1 = c0;
|
||||
c0 = (*++s) - '0';
|
||||
}
|
||||
}
|
||||
c = (64 * c2) + (8 * c1) + c0;
|
||||
*(p++) = (char) (c > 255 ? 255 : c);
|
||||
len++;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'x':
|
||||
{
|
||||
char c1 = *(s+1);
|
||||
char c0 = *(s+2);
|
||||
case 'x':
|
||||
{
|
||||
char c1 = *(s+1);
|
||||
char c0 = *(s+2);
|
||||
|
||||
if (isxdigit((guchar)c1) && isxdigit((guchar)c0)) {
|
||||
*(p++) = (xton(c1) * 0x10) + xton(c0);
|
||||
s += 2;
|
||||
} else {
|
||||
*(p++) = *s;
|
||||
}
|
||||
len++;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
*p++ = *s;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
*(p++) = *s;
|
||||
len++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isxdigit((guchar)c1) && isxdigit((guchar)c0)) {
|
||||
*(p++) = (xton(c1) * 0x10) + xton(c0);
|
||||
s += 2;
|
||||
} else {
|
||||
*(p++) = *s;
|
||||
}
|
||||
len++;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
*p++ = *s;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
*(p++) = *s;
|
||||
len++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (len_p) *len_p = len;
|
||||
return buf;
|
||||
if (len_p) *len_p = len;
|
||||
return buf;
|
||||
}
|
||||
|
||||
char* uat_undquote(const char* si, guint in_len, guint* len_p) {
|
||||
return uat_unesc(si+1,in_len-2,len_p);
|
||||
return uat_unesc(si+1,in_len-2,len_p);
|
||||
}
|
||||
|
||||
|
||||
char* uat_esc(const char* buf, guint len) {
|
||||
const guint8* end = ((guint8*)buf)+len;
|
||||
char* out = ep_alloc0((4*len)+1);
|
||||
const guint8* b;
|
||||
char* s = out;
|
||||
const guint8* end = ((guint8*)buf)+len;
|
||||
char* out = ep_alloc0((4*len)+1);
|
||||
const guint8* b;
|
||||
char* s = out;
|
||||
|
||||
for (b = (void*)buf; b < end; b++) {
|
||||
if (isprint(*b) ) {
|
||||
*(s++) = (*b);
|
||||
} else {
|
||||
g_snprintf(s,5,"\\x%.2x",((guint)*b));
|
||||
s+=4;
|
||||
}
|
||||
}
|
||||
for (b = (void*)buf; b < end; b++) {
|
||||
if (isprint(*b) ) {
|
||||
*(s++) = (*b);
|
||||
} else {
|
||||
g_snprintf(s,5,"\\x%.2x",((guint)*b));
|
||||
s+=4;
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
return out;
|
||||
|
||||
}
|
||||
|
||||
|
@ -676,10 +676,10 @@ CHK_STR_IS_DEF(isxdigit)
|
|||
*
|
||||
* Local Variables:
|
||||
* c-basic-offset: 4
|
||||
* tab-width: 4
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*
|
||||
* ex: set shiftwidth=4 tabstop=4 expandtab:
|
||||
* :indentSize=4:tabSize=4:noTabs=true:
|
||||
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
||||
* :indentSize=4:tabSize=8:noTabs=true:
|
||||
*/
|
||||
|
|
6
file.c
6
file.c
|
@ -478,8 +478,8 @@ calc_progbar_val(capture_file *cf, gint64 size, gint64 file_pos, gchar *status_s
|
|||
}
|
||||
|
||||
g_snprintf(status_str, status_size,
|
||||
"%" G_GINT64_MODIFIER "dKB of %" G_GINT64_MODIFIER "dKB",
|
||||
file_pos / 1024, size / 1024);
|
||||
"%" G_GINT64_MODIFIER "dKB of %" G_GINT64_MODIFIER "dKB",
|
||||
file_pos / 1024, size / 1024);
|
||||
|
||||
return progbar_val;
|
||||
}
|
||||
|
@ -2758,7 +2758,7 @@ cf_find_string_protocol_tree(capture_file *cf, proto_tree *tree, match_data *md
|
|||
mdata->cf = cf;
|
||||
/* Iterate through all the nodes looking for matching text */
|
||||
proto_tree_children_foreach(tree, match_subtree_text, mdata);
|
||||
return mdata->frame_matched ? MR_MATCHED : MR_NOTMATCHED;
|
||||
return mdata->frame_matched ? MR_MATCHED : MR_NOTMATCHED;
|
||||
}
|
||||
|
||||
static match_result
|
||||
|
|
|
@ -446,7 +446,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
|
|||
g_signal_connect(new_bt, "clicked", G_CALLBACK(filter_new_bt_clicked_cb), filter_list_type_p);
|
||||
gtk_widget_show(new_bt);
|
||||
gtk_box_pack_start (GTK_BOX (list_bb), new_bt, FALSE, FALSE, 0);
|
||||
gtk_widget_set_tooltip_text(new_bt, "Create a new filter at the end of the list (with the current properties)");
|
||||
gtk_widget_set_tooltip_text(new_bt, "Create a new filter at the end of the list (with the current properties)");
|
||||
|
||||
del_bt = gtk_button_new_from_stock(GTK_STOCK_DELETE);
|
||||
gtk_widget_set_sensitive(del_bt, FALSE);
|
||||
|
@ -454,7 +454,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
|
|||
g_object_set_data(G_OBJECT(main_w), E_FILT_DEL_BT_KEY, del_bt);
|
||||
gtk_widget_show(del_bt);
|
||||
gtk_box_pack_start (GTK_BOX (list_bb), del_bt, FALSE, FALSE, 0);
|
||||
gtk_widget_set_tooltip_text(del_bt, "Delete the selected filter");
|
||||
gtk_widget_set_tooltip_text(del_bt, "Delete the selected filter");
|
||||
|
||||
filter_fr = gtk_frame_new(list_name);
|
||||
gtk_box_pack_start(GTK_BOX(top_hb), filter_fr, TRUE, TRUE, 0);
|
||||
|
@ -547,7 +547,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
|
|||
g_object_set_data(G_OBJECT(main_w), E_FILT_PARENT_FILTER_TE_KEY, parent_filter_te);
|
||||
|
||||
if (list_type == DFILTER_EDITED_LIST) {
|
||||
gtk_widget_set_tooltip_text(filter_te,
|
||||
gtk_widget_set_tooltip_text(filter_te,
|
||||
"Enter a display filter. "
|
||||
"The background color of this field is changed by a continuous syntax check"
|
||||
" (green is valid, red is invalid, yellow may have unexpected results).");
|
||||
|
@ -558,7 +558,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
|
|||
g_signal_connect(add_expression_bt, "clicked", G_CALLBACK(filter_add_expr_bt_cb), main_w);
|
||||
gtk_box_pack_start(GTK_BOX(bottom_hb), add_expression_bt, FALSE, FALSE, 0);
|
||||
gtk_widget_show(add_expression_bt);
|
||||
gtk_widget_set_tooltip_text(add_expression_bt, "Add an expression to the filter string");
|
||||
gtk_widget_set_tooltip_text(add_expression_bt, "Add an expression to the filter string");
|
||||
}
|
||||
|
||||
|
||||
|
@ -569,7 +569,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
|
|||
|
||||
ok_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
|
||||
g_signal_connect(ok_bt, "clicked", G_CALLBACK(filter_dlg_ok_cb), filter_list_type_p);
|
||||
gtk_widget_set_tooltip_text(ok_bt, "Apply the filters and close this dialog");
|
||||
gtk_widget_set_tooltip_text(ok_bt, "Apply the filters and close this dialog");
|
||||
|
||||
/* Catch the "activate" signal on the filter name and filter
|
||||
expression text entries, so that if the user types Return
|
||||
|
@ -583,14 +583,14 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
|
|||
|
||||
apply_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_APPLY);
|
||||
g_signal_connect(apply_bt, "clicked", G_CALLBACK(filter_dlg_apply_cb), filter_list_type_p);
|
||||
gtk_widget_set_tooltip_text(apply_bt, "Apply the filters and keep this dialog open");
|
||||
gtk_widget_set_tooltip_text(apply_bt, "Apply the filters and keep this dialog open");
|
||||
|
||||
save_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_SAVE);
|
||||
g_signal_connect(save_bt, "clicked", G_CALLBACK(filter_dlg_save_cb), filter_list_type_p);
|
||||
gtk_widget_set_tooltip_text(save_bt, "Save the filters permanently and keep this dialog open");
|
||||
gtk_widget_set_tooltip_text(save_bt, "Save the filters permanently and keep this dialog open");
|
||||
|
||||
cancel_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
|
||||
gtk_widget_set_tooltip_text(cancel_bt, "Cancel the changes");
|
||||
gtk_widget_set_tooltip_text(cancel_bt, "Cancel the changes");
|
||||
g_signal_connect(cancel_bt, "clicked", G_CALLBACK(filter_dlg_cancel_cb), filter_list_type_p);
|
||||
window_set_cancel_button(main_w, cancel_bt, NULL);
|
||||
|
||||
|
@ -600,7 +600,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
|
|||
} else {
|
||||
g_signal_connect(help_bt, "clicked", G_CALLBACK(topic_cb), (gpointer)HELP_DISPLAY_FILTERS_DIALOG);
|
||||
}
|
||||
gtk_widget_set_tooltip_text(help_bt, "Show topic specific help");
|
||||
gtk_widget_set_tooltip_text(help_bt, "Show topic specific help");
|
||||
|
||||
if(ok_bt) {
|
||||
gtk_widget_grab_default(ok_bt);
|
||||
|
|
|
@ -400,99 +400,99 @@ hostlist_show_popup_menu_cb(void *widg _U_, GdkEvent *event, hostlist_table *et)
|
|||
static void
|
||||
apply_as_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_and_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_AND_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_AND_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_or_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_OR_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_OR_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_and_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_AND_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_AND_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_or_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_OR_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_OR_NOT_SELECTED, 0));
|
||||
}
|
||||
|
||||
static void
|
||||
prep_as_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_and_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_AND_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_AND_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_or_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_OR_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_OR_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_and_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_AND_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_AND_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_or_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_OR_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_OR_NOT_SELECTED, 0));
|
||||
}
|
||||
|
||||
static void
|
||||
find_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_FRAME(ACTYPE_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_FRAME(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_FRAME(ACTYPE_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_FRAME(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_prev_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_PREVIOUS(ACTYPE_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_PREVIOUS(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_prev_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_PREVIOUS(ACTYPE_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_PREVIOUS(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_next_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_NEXT(ACTYPE_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_NEXT(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_next_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_NEXT(ACTYPE_NOT_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_FIND_NEXT(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
color_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_COLORIZE(ACTYPE_SELECTED, 0));
|
||||
hostlist_select_filter_cb( widget , user_data, CALLBACK_COLORIZE(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
|
||||
static const char *ui_desc_hostlist_table_popup =
|
||||
|
@ -544,73 +544,73 @@ static const char *ui_desc_hostlist_table_popup =
|
|||
* const gchar *tooltip;
|
||||
* GCallback callback;
|
||||
* } GtkActionEntry;
|
||||
* const gchar *name; The name of the action.
|
||||
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
|
||||
* const gchar *label; The label for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* If label is NULL, the label of the stock item with id stock_id is used.
|
||||
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
|
||||
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
|
||||
* const gchar *name; The name of the action.
|
||||
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
|
||||
* const gchar *label; The label for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* GCallback callback; The function to call when the action is activated.
|
||||
* If label is NULL, the label of the stock item with id stock_id is used.
|
||||
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
|
||||
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* GCallback callback; The function to call when the action is activated.
|
||||
*
|
||||
*/
|
||||
static const GtkActionEntry service_resp_t__popup_entries[] = {
|
||||
{ "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
|
||||
{ "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
|
||||
{ "/Find Frame", NULL, "Find Frame", NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Frame", NULL, "Find Frame", NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Next", NULL, "Find Next" , NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Previous", NULL, "Find Previous", NULL, NULL, NULL },
|
||||
{ "/Colorize Procedure", NULL, "Colorize Procedure", NULL, NULL, NULL },
|
||||
{ "/Apply as Filter/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(apply_as_selected_cb) },
|
||||
{ "/Apply as Filter/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(apply_as_not_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", G_CALLBACK(apply_as_and_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", G_CALLBACK(apply_as_or_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", G_CALLBACK(apply_as_and_not_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", G_CALLBACK(apply_as_or_not_selected_cb) },
|
||||
{ "/Prepare a Filter/Selected", NULL, "Selected", NULL, "selcted", G_CALLBACK(prep_as_selected_cb) },
|
||||
{ "/Prepare a Filter/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(prep_as_not_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", G_CALLBACK(prep_as_and_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", G_CALLBACK(prep_as_or_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", G_CALLBACK(prep_as_and_not_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", G_CALLBACK(prep_as_or_not_selected_cb) },
|
||||
{ "/Find Frame/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_selected_cb) },
|
||||
{ "/Find Frame/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_not_selected_cb) },
|
||||
{ "/Find Previous/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_prev_selected_cb) },
|
||||
{ "/Find Previous/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_prev_not_selected_cb) },
|
||||
{ "/Find Next/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_next_selected_cb) },
|
||||
{ "/Find Next/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_next_not_selected_cb) },
|
||||
{ "/Colorize Procedure/Colorize Host Traffic",NULL, "Colorize Host Traffic", NULL, "Colorize Host Traffic", G_CALLBACK(color_selected_cb) },
|
||||
{ "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
|
||||
{ "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
|
||||
{ "/Find Frame", NULL, "Find Frame", NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Frame", NULL, "Find Frame", NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Next", NULL, "Find Next" , NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Previous", NULL, "Find Previous", NULL, NULL, NULL },
|
||||
{ "/Colorize Procedure", NULL, "Colorize Procedure", NULL, NULL, NULL },
|
||||
{ "/Apply as Filter/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(apply_as_selected_cb) },
|
||||
{ "/Apply as Filter/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(apply_as_not_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", G_CALLBACK(apply_as_and_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", G_CALLBACK(apply_as_or_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", G_CALLBACK(apply_as_and_not_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", G_CALLBACK(apply_as_or_not_selected_cb) },
|
||||
{ "/Prepare a Filter/Selected", NULL, "Selected", NULL, "selcted", G_CALLBACK(prep_as_selected_cb) },
|
||||
{ "/Prepare a Filter/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(prep_as_not_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", G_CALLBACK(prep_as_and_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", G_CALLBACK(prep_as_or_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", G_CALLBACK(prep_as_and_not_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", G_CALLBACK(prep_as_or_not_selected_cb) },
|
||||
{ "/Find Frame/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_selected_cb) },
|
||||
{ "/Find Frame/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_not_selected_cb) },
|
||||
{ "/Find Previous/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_prev_selected_cb) },
|
||||
{ "/Find Previous/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_prev_not_selected_cb) },
|
||||
{ "/Find Next/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_next_selected_cb) },
|
||||
{ "/Find Next/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_next_not_selected_cb) },
|
||||
{ "/Colorize Procedure/Colorize Host Traffic",NULL, "Colorize Host Traffic", NULL, "Colorize Host Traffic", G_CALLBACK(color_selected_cb) },
|
||||
};
|
||||
|
||||
static void
|
||||
hostlist_create_popup_menu(hostlist_table *hl)
|
||||
{
|
||||
GtkUIManager *ui_manager;
|
||||
GtkActionGroup *action_group;
|
||||
GError *error = NULL;
|
||||
GtkUIManager *ui_manager;
|
||||
GtkActionGroup *action_group;
|
||||
GError *error = NULL;
|
||||
|
||||
action_group = gtk_action_group_new ("HostlistTablePopupActionGroup");
|
||||
gtk_action_group_add_actions (action_group, /* the action group */
|
||||
(gpointer)service_resp_t__popup_entries, /* an array of action descriptions */
|
||||
G_N_ELEMENTS(service_resp_t__popup_entries),/* the number of entries */
|
||||
hl); /* data to pass to the action callbacks */
|
||||
action_group = gtk_action_group_new ("HostlistTablePopupActionGroup");
|
||||
gtk_action_group_add_actions (action_group, /* the action group */
|
||||
(gpointer)service_resp_t__popup_entries, /* an array of action descriptions */
|
||||
G_N_ELEMENTS(service_resp_t__popup_entries),/* the number of entries */
|
||||
hl); /* data to pass to the action callbacks */
|
||||
|
||||
ui_manager = gtk_ui_manager_new ();
|
||||
gtk_ui_manager_insert_action_group (ui_manager,
|
||||
action_group,
|
||||
0); /* the position at which the group will be inserted */
|
||||
gtk_ui_manager_add_ui_from_string (ui_manager,ui_desc_hostlist_table_popup, -1, &error);
|
||||
if (error != NULL)
|
||||
ui_manager = gtk_ui_manager_new ();
|
||||
gtk_ui_manager_insert_action_group (ui_manager,
|
||||
action_group,
|
||||
0); /* the position at which the group will be inserted */
|
||||
gtk_ui_manager_add_ui_from_string (ui_manager,ui_desc_hostlist_table_popup, -1, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
fprintf (stderr, "Warning: building hostlist table filter popup failed: %s\n",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
hl->menu = gtk_ui_manager_get_widget(ui_manager, "/HostlistTableFilterPopup");
|
||||
g_signal_connect(hl->table, "button_press_event", G_CALLBACK(hostlist_show_popup_menu_cb), hl);
|
||||
hl->menu = gtk_ui_manager_get_widget(ui_manager, "/HostlistTableFilterPopup");
|
||||
g_signal_connect(hl->table, "button_press_event", G_CALLBACK(hostlist_show_popup_menu_cb), hl);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1376,7 +1376,7 @@ init_hostlist_table(gboolean hide_ports, const char *table_name, const char *tap
|
|||
window_set_cancel_button(hosttable->win, close_bt, window_cancel_button_cb);
|
||||
|
||||
copy_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_COPY);
|
||||
gtk_widget_set_tooltip_text(copy_bt, "Copy all statistical values of this page to the clipboard in CSV (Comma Separated Values) format.");
|
||||
gtk_widget_set_tooltip_text(copy_bt, "Copy all statistical values of this page to the clipboard in CSV (Comma Separated Values) format.");
|
||||
g_object_set_data(G_OBJECT(copy_bt), HOST_PTR_KEY, hosttable);
|
||||
g_signal_connect(copy_bt, "clicked", G_CALLBACK(copy_as_csv_cb), NULL);
|
||||
|
||||
|
@ -1616,15 +1616,15 @@ init_hostlist_notebook_cb(GtkWidget *w _U_, gpointer d _U_)
|
|||
resolv_cb = gtk_check_button_new_with_mnemonic("Name resolution");
|
||||
gtk_container_add(GTK_CONTAINER(hbox), resolv_cb);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolv_cb), TRUE);
|
||||
gtk_widget_set_tooltip_text(resolv_cb,
|
||||
"Show results of name resolutions rather than the \"raw\" values. Please note: The corresponding name resolution must be enabled.");
|
||||
gtk_widget_set_tooltip_text(resolv_cb,
|
||||
"Show results of name resolutions rather than the \"raw\" values. Please note: The corresponding name resolution must be enabled.");
|
||||
|
||||
g_signal_connect(resolv_cb, "toggled", G_CALLBACK(hostlist_resolve_toggle_dest), pages);
|
||||
|
||||
filter_cb = gtk_check_button_new_with_mnemonic("Limit to display filter");
|
||||
gtk_container_add(GTK_CONTAINER(hbox), filter_cb);
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(filter_cb), FALSE);
|
||||
gtk_widget_set_tooltip_text(filter_cb, "Limit the list to endpoints matching the current display filter.");
|
||||
gtk_widget_set_tooltip_text(filter_cb, "Limit the list to endpoints matching the current display filter.");
|
||||
|
||||
g_signal_connect(filter_cb, "toggled", G_CALLBACK(hostlist_filter_toggle_dest), pages);
|
||||
|
||||
|
|
1916
gtk/main_menubar.c
1916
gtk/main_menubar.c
File diff suppressed because it is too large
Load Diff
724
gtk/menus.c
724
gtk/menus.c
File diff suppressed because it is too large
Load Diff
|
@ -80,25 +80,25 @@ static void prefs_main_destroy_cb(GtkWidget *, gpointer);
|
|||
static void prefs_tree_select_cb(GtkTreeSelection *, gpointer);
|
||||
|
||||
|
||||
#define E_PREFSW_SCROLLW_KEY "prefsw_scrollw"
|
||||
#define E_PREFSW_TREE_KEY "prefsw_tree"
|
||||
#define E_PREFSW_NOTEBOOK_KEY "prefsw_notebook"
|
||||
#define E_PREFSW_SAVE_BT_KEY "prefsw_save_bt"
|
||||
#define E_PAGE_ITER_KEY "page_iter"
|
||||
#define E_PAGE_MODULE_KEY "page_module"
|
||||
#define E_PAGESW_FRAME_KEY "pagesw_frame"
|
||||
#define E_PREFSW_SCROLLW_KEY "prefsw_scrollw"
|
||||
#define E_PREFSW_TREE_KEY "prefsw_tree"
|
||||
#define E_PREFSW_NOTEBOOK_KEY "prefsw_notebook"
|
||||
#define E_PREFSW_SAVE_BT_KEY "prefsw_save_bt"
|
||||
#define E_PAGE_ITER_KEY "page_iter"
|
||||
#define E_PAGE_MODULE_KEY "page_module"
|
||||
#define E_PAGESW_FRAME_KEY "pagesw_frame"
|
||||
|
||||
#define E_GUI_PAGE_KEY "gui_options_page"
|
||||
#define E_GUI_LAYOUT_PAGE_KEY "gui_layout_page"
|
||||
#define E_GUI_COLUMN_PAGE_KEY "gui_column_options_page"
|
||||
#define E_GUI_FONT_PAGE_KEY "gui_font_options_page"
|
||||
#define E_GUI_COLORS_PAGE_KEY "gui_colors_options_page"
|
||||
#define E_CAPTURE_PAGE_KEY "capture_options_page"
|
||||
#define E_PRINT_PAGE_KEY "printer_options_page"
|
||||
#define E_NAMERES_PAGE_KEY "nameres_options_page"
|
||||
#define E_TAPS_PAGE_KEY "taps_options_page"
|
||||
#define E_PROTOCOLS_PAGE_KEY "protocols_options_page"
|
||||
#define E_FILTER_EXPRESSIONS_PAGE_KEY "filter_expressions_page"
|
||||
#define E_GUI_PAGE_KEY "gui_options_page"
|
||||
#define E_GUI_LAYOUT_PAGE_KEY "gui_layout_page"
|
||||
#define E_GUI_COLUMN_PAGE_KEY "gui_column_options_page"
|
||||
#define E_GUI_FONT_PAGE_KEY "gui_font_options_page"
|
||||
#define E_GUI_COLORS_PAGE_KEY "gui_colors_options_page"
|
||||
#define E_CAPTURE_PAGE_KEY "capture_options_page"
|
||||
#define E_PRINT_PAGE_KEY "printer_options_page"
|
||||
#define E_NAMERES_PAGE_KEY "nameres_options_page"
|
||||
#define E_TAPS_PAGE_KEY "taps_options_page"
|
||||
#define E_PROTOCOLS_PAGE_KEY "protocols_options_page"
|
||||
#define E_FILTER_EXPRESSIONS_PAGE_KEY "filter_expressions_page"
|
||||
|
||||
/*
|
||||
* Keep a static pointer to the current "Preferences" window, if any, so that
|
||||
|
|
|
@ -99,99 +99,99 @@ proto_hier_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data _U_, g
|
|||
static void
|
||||
apply_as_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_and_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_AND_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_AND_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_or_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_OR_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_OR_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_and_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_AND_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_AND_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
apply_as_or_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_OR_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_MATCH(ACTYPE_OR_NOT_SELECTED, 0));
|
||||
}
|
||||
|
||||
static void
|
||||
prep_as_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_and_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_AND_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_AND_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_or_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_OR_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_OR_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_and_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_AND_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_AND_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
prep_as_or_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_OR_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_PREPARE(ACTYPE_OR_NOT_SELECTED, 0));
|
||||
}
|
||||
|
||||
static void
|
||||
find_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_FRAME(ACTYPE_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_FRAME(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_FRAME(ACTYPE_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_FRAME(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_prev_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_PREVIOUS(ACTYPE_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_PREVIOUS(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_prev_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_PREVIOUS(ACTYPE_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_PREVIOUS(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_next_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_NEXT(ACTYPE_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_NEXT(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
find_next_not_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_NEXT(ACTYPE_NOT_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_FIND_NEXT(ACTYPE_NOT_SELECTED, 0));
|
||||
}
|
||||
static void
|
||||
color_selected_cb(GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_COLORIZE(ACTYPE_SELECTED, 0));
|
||||
proto_hier_select_filter_cb( widget , user_data, CALLBACK_COLORIZE(ACTYPE_SELECTED, 0));
|
||||
}
|
||||
|
||||
|
||||
|
@ -244,44 +244,44 @@ static const char *ui_desc_proto_hier_stats_filter_popup =
|
|||
* const gchar *tooltip;
|
||||
* GCallback callback;
|
||||
* } GtkActionEntry;
|
||||
* const gchar *name; The name of the action.
|
||||
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
|
||||
* const gchar *label; The label for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* If label is NULL, the label of the stock item with id stock_id is used.
|
||||
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
|
||||
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
|
||||
* const gchar *name; The name of the action.
|
||||
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
|
||||
* const gchar *label; The label for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* GCallback callback; The function to call when the action is activated.
|
||||
* If label is NULL, the label of the stock item with id stock_id is used.
|
||||
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
|
||||
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
|
||||
* see gtk_action_group_set_translation_domain().
|
||||
* GCallback callback; The function to call when the action is activated.
|
||||
*
|
||||
*/
|
||||
static const GtkActionEntry proto_hier_stats_popup_entries[] = {
|
||||
{ "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
|
||||
{ "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
|
||||
{ "/Find Frame", NULL, "Find Frame", NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Frame", NULL, "Find Frame", NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Next", NULL, "Find Next" , NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Previous", NULL, "Find Previous", NULL, NULL, NULL },
|
||||
{ "/Colorize Procedure", NULL, "Colorize Procedure", NULL, NULL, NULL },
|
||||
{ "/Apply as Filter/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(apply_as_selected_cb) },
|
||||
{ "/Apply as Filter/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(apply_as_not_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", G_CALLBACK(apply_as_and_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", G_CALLBACK(apply_as_or_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", G_CALLBACK(apply_as_and_not_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", G_CALLBACK(apply_as_or_not_selected_cb) },
|
||||
{ "/Prepare a Filter/Selected", NULL, "Selected", NULL, "selcted", G_CALLBACK(prep_as_selected_cb) },
|
||||
{ "/Prepare a Filter/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(prep_as_not_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", G_CALLBACK(prep_as_and_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", G_CALLBACK(prep_as_or_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", G_CALLBACK(prep_as_and_not_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", G_CALLBACK(prep_as_or_not_selected_cb) },
|
||||
{ "/Find Frame/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_selected_cb) },
|
||||
{ "/Find Frame/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_not_selected_cb) },
|
||||
{ "/Find Previous/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_prev_selected_cb) },
|
||||
{ "/Find Previous/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_prev_not_selected_cb) },
|
||||
{ "/Find Next/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_next_selected_cb) },
|
||||
{ "/Find Next/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_next_not_selected_cb) },
|
||||
{ "/Colorize Procedure/Colorize Protocol", NULL, "Colorize Protocol", NULL, "Colorize Protocol", G_CALLBACK(color_selected_cb) },
|
||||
{ "/Apply as Filter", NULL, "Apply as Filter", NULL, NULL, NULL },
|
||||
{ "/Prepare a Filter", NULL, "Prepare a Filter", NULL, NULL, NULL },
|
||||
{ "/Find Frame", NULL, "Find Frame", NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Frame", NULL, "Find Frame", NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Next", NULL, "Find Next" , NULL, NULL, NULL },
|
||||
{ "/Find Frame/Find Previous", NULL, "Find Previous", NULL, NULL, NULL },
|
||||
{ "/Colorize Procedure", NULL, "Colorize Procedure", NULL, NULL, NULL },
|
||||
{ "/Apply as Filter/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(apply_as_selected_cb) },
|
||||
{ "/Apply as Filter/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(apply_as_not_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", G_CALLBACK(apply_as_and_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", G_CALLBACK(apply_as_or_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", G_CALLBACK(apply_as_and_not_selected_cb) },
|
||||
{ "/Apply as Filter/" UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", G_CALLBACK(apply_as_or_not_selected_cb) },
|
||||
{ "/Prepare a Filter/Selected", NULL, "Selected", NULL, "selcted", G_CALLBACK(prep_as_selected_cb) },
|
||||
{ "/Prepare a Filter/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(prep_as_not_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and Selected", G_CALLBACK(prep_as_and_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or Selected", G_CALLBACK(prep_as_or_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " and not Selected", G_CALLBACK(prep_as_and_not_selected_cb) },
|
||||
{ "/Prepare a Filter/" UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", NULL, UTF8_HORIZONTAL_ELLIPSIS " or not Selected", G_CALLBACK(prep_as_or_not_selected_cb) },
|
||||
{ "/Find Frame/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_selected_cb) },
|
||||
{ "/Find Frame/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_not_selected_cb) },
|
||||
{ "/Find Previous/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_prev_selected_cb) },
|
||||
{ "/Find Previous/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_prev_not_selected_cb) },
|
||||
{ "/Find Next/Selected", NULL, "Selected", NULL, "Selected", G_CALLBACK(find_next_selected_cb) },
|
||||
{ "/Find Next/Not Selected", NULL, "Not Selected", NULL, "Not Selected", G_CALLBACK(find_next_not_selected_cb) },
|
||||
{ "/Colorize Procedure/Colorize Protocol", NULL, "Colorize Protocol", NULL, "Colorize Protocol", G_CALLBACK(color_selected_cb) },
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -388,31 +388,31 @@ static void
|
|||
proto_hier_create_popup_menu(void)
|
||||
{
|
||||
|
||||
GtkUIManager *ui_manager;
|
||||
GtkActionGroup *action_group;
|
||||
GError *error = NULL;
|
||||
GtkWidget *popup_menu_object;
|
||||
GtkUIManager *ui_manager;
|
||||
GtkActionGroup *action_group;
|
||||
GError *error = NULL;
|
||||
GtkWidget *popup_menu_object;
|
||||
|
||||
action_group = gtk_action_group_new ("ProtoHierStatsTFilterPopupActionGroup");
|
||||
gtk_action_group_add_actions (action_group, /* the action group */
|
||||
(gpointer)proto_hier_stats_popup_entries, /* an array of action descriptions */
|
||||
G_N_ELEMENTS(proto_hier_stats_popup_entries), /* the number of entries */
|
||||
NULL); /* data to pass to the action callbacks */
|
||||
action_group = gtk_action_group_new ("ProtoHierStatsTFilterPopupActionGroup");
|
||||
gtk_action_group_add_actions (action_group, /* the action group */
|
||||
(gpointer)proto_hier_stats_popup_entries, /* an array of action descriptions */
|
||||
G_N_ELEMENTS(proto_hier_stats_popup_entries), /* the number of entries */
|
||||
NULL); /* data to pass to the action callbacks */
|
||||
|
||||
ui_manager = gtk_ui_manager_new ();
|
||||
gtk_ui_manager_insert_action_group (ui_manager,
|
||||
action_group,
|
||||
0); /* the position at which the group will be inserted */
|
||||
gtk_ui_manager_add_ui_from_string (ui_manager,ui_desc_proto_hier_stats_filter_popup, -1, &error);
|
||||
if (error != NULL)
|
||||
ui_manager = gtk_ui_manager_new ();
|
||||
gtk_ui_manager_insert_action_group (ui_manager,
|
||||
action_group,
|
||||
0); /* the position at which the group will be inserted */
|
||||
gtk_ui_manager_add_ui_from_string (ui_manager,ui_desc_proto_hier_stats_filter_popup, -1, &error);
|
||||
if (error != NULL)
|
||||
{
|
||||
fprintf (stderr, "Warning: building proto hier ststs filter popup failed: %s\n",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
popup_menu_object = gtk_ui_manager_get_widget(ui_manager, "/ProtoHierStatsFilterPopup");
|
||||
g_signal_connect(tree, "button_press_event", G_CALLBACK(proto_hier_show_popup_menu_cb), popup_menu_object);
|
||||
popup_menu_object = gtk_ui_manager_get_widget(ui_manager, "/ProtoHierStatsFilterPopup");
|
||||
g_signal_connect(tree, "button_press_event", G_CALLBACK(proto_hier_show_popup_menu_cb), popup_menu_object);
|
||||
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ proto_hier_create_popup_menu(void)
|
|||
static void
|
||||
create_tree(GtkWidget *container, ph_stats_t *ps)
|
||||
{
|
||||
GtkWidget *sw;
|
||||
GtkWidget *sw;
|
||||
GtkTreeView *tree_view;
|
||||
GtkTreeStore *store;
|
||||
GtkCellRenderer *renderer;
|
||||
|
|
Loading…
Reference in New Issue