コード例 #1
0
static void
voip_calls_remove_tap_listener(void)
{
	/* Remove the calls tap listener */
	remove_tap_listener_sip_calls();
	remove_tap_listener_isup_calls();
	remove_tap_listener_mtp3_calls();
	remove_tap_listener_h225_calls();
	remove_tap_listener_h245dg_calls();
	remove_tap_listener_q931_calls();
	remove_tap_listener_h248_calls();
	remove_tap_listener_sccp_calls();
	remove_tap_listener_sdp_calls();
	remove_tap_listener_rtp();
	if (find_tap_id("unistim")) { /* The plugin may be missing */
		remove_tap_listener_unistim_calls();
	}
	if (find_tap_id("voip")) {
		remove_tap_listener_voip_calls();
	}
	remove_tap_listener_rtp_event();
	remove_tap_listener_mgcp_calls();
	remove_tap_listener_actrace_calls();
	remove_tap_listener_skinny_calls();
	remove_tap_listener_iax2_calls();
	remove_tap_listener_t38();
}
コード例 #2
0
ファイル: tap.c プロジェクト: linshimiao/wireshark
/* This function registers that a dissector has the packet tap ability
   available.  The name parameter is the name of this tap and extensions can
   use open_tap(char *name,... to specify that it wants to receive packets/
   events from this tap.

   This function is only to be called once, when the dissector initializes.

   The return value from this call is later used as a parameter to the
   tap_packet(unsigned int *tap_id,...
   call so that the tap subsystem knows to which tap point this tapped
   packet is associated.
*/
int
register_tap(const char *name)
{
	tap_dissector_t *td, *tdl;
	int i, tap_id;

	if(tap_dissector_list){
		tap_id=find_tap_id(name);
		if (tap_id)
			return tap_id;
	}

	td=(tap_dissector_t *)g_malloc(sizeof(tap_dissector_t));
	td->next=NULL;
	td->name = g_strdup(name);

	if(!tap_dissector_list){
		tap_dissector_list=td;
		i=1;
	} else {
		for(i=2,tdl=tap_dissector_list;tdl->next;i++,tdl=tdl->next)
			;
		tdl->next=td;
	}
	return i;
}
コード例 #3
0
ファイル: tap.c プロジェクト: linshimiao/wireshark
/* this function attaches the tap_listener to the named tap.
 * function returns :
 *     NULL: ok.
 * non-NULL: error, return value points to GString containing error
 *           message.
 */
GString *
register_tap_listener(const char *tapname, void *tapdata, const char *fstring,
		      guint flags, tap_reset_cb reset, tap_packet_cb packet, tap_draw_cb draw)
{
	volatile tap_listener_t *tl;
	int tap_id;
	dfilter_t *code=NULL;
	GString *error_string;
	gchar *err_msg;

	tap_id=find_tap_id(tapname);
	if(!tap_id){
		error_string = g_string_new("");
		g_string_printf(error_string, "Tap %s not found", tapname);
		return error_string;
	}

	tl=(volatile tap_listener_t *)g_malloc0(sizeof(tap_listener_t));
	tl->needs_redraw=TRUE;
	tl->flags=flags;
	if(fstring){
		if(!dfilter_compile(fstring, &code, &err_msg)){
			error_string = g_string_new("");
			g_string_printf(error_string,
			    "Filter \"%s\" is invalid - %s",
			    fstring, err_msg);
			g_free(err_msg);
			free_tap_listener(tl);
			return error_string;
		}
	}
	tl->fstring=g_strdup(fstring);
	tl->code=code;

	tl->tap_id=tap_id;
	tl->tapdata=tapdata;
	tl->reset=reset;
	tl->packet=packet;
	tl->draw=draw;
	tl->next=tap_listener_queue;

	tap_listener_queue=tl;

	return NULL;
}