void (*ND_MenuEntryCB) (LND_Packet *packet, guchar *header, int value); enum ND_GuiColor; void nd_gui_init (void); void nd_gui_sync_menus (void); void nd_gui_sync_edit_menu (void); void nd_gui_sync_file_menu (void); void nd_gui_sync_go_menu (void); void nd_gui_sync_protocol_menu (void); void nd_gui_show_packet_menu (GdkEventButton *event); void nd_gui_show_iterator_mode_menu (GdkEventButton *event); void nd_gui_num_packets_set (void); void nd_gui_set_trace_status (LND_Trace *trace); void nd_gui_iterator_mode_set (LND_Trace *trace); void nd_gui_statusbar_set (const char *text); void nd_gui_statusbar_set_noclear (const char *text); gint nd_gui_statusbar_clear (gpointer data); void nd_gui_pbar_reset (int num_total); void nd_gui_pbar_inc (int num_inc); void nd_gui_pbar_clear (int interval); void nd_gui_pbar_start_activity (void); void nd_gui_pbar_stop_activity (void); void nd_gui_list_freeze (LND_Trace *trace); void nd_gui_list_thaw (LND_Trace *trace); void nd_gui_list_set_incomplete_column_visible (LND_Trace *trace, gboolean visible); void nd_gui_list_set_row_incomplete (LND_Trace *trace, int row, gboolean incomplete); void nd_gui_list_set_row_filtered (LND_Trace *trace, int row, gboolean filtered); void nd_gui_list_remove_selected_rows (LND_Trace *trace); void nd_gui_list_remove_row (LND_Trace *trace, guint index); void nd_gui_list_insert_row (LND_Packet *packet, int index); void nd_gui_list_clear (LND_Trace *trace); void nd_gui_list_update (LND_Trace *trace); void nd_gui_list_update_packet (const LND_Packet *packet); void nd_gui_list_update_packet_at_index (const LND_Packet *packet, int index); void nd_gui_list_select_packet (LND_Trace *trace, guint index); void nd_gui_list_unselect_packet (LND_Trace *trace, guint index); void nd_gui_list_unselect_all (LND_Trace *trace, gboolean emit_signal); void nd_gui_list_select_all (LND_Trace *trace, gboolean emit_signal); void nd_gui_list_update_packet_state (const LND_Packet *packet); void nd_gui_list_update_packet_state_at_index (const LND_Packet *packet, int index); void nd_gui_set_windowtitle (const char *filename); void nd_gui_timestamp_schedule (GtkCList *clist, GdkEventMotion *event); void nd_gui_timestamp_hide (void); void nd_gui_proto_menu_register (LND_Protocol *proto); void nd_gui_trace_add (LND_Trace *trace); void nd_gui_trace_remove (LND_Trace *trace); void nd_gui_trace_new_tab (LND_Trace *trace); void nd_gui_trace_set_name (LND_Trace *trace); void nd_gui_widget_set_color (GtkWidget *widget, ND_GuiColor color); GtkWidget* nd_gui_create_menu (ND_MenuData *data); GtkWidget* nd_gui_proto_table_create (LND_Trace *trace, LND_ProtoInfo *pinf); void nd_gui_proto_table_clear (LND_Trace *trace, LND_ProtoInfo *pinf); void nd_gui_proto_table_add (LND_Trace *trace, LND_ProtoInfo *pinf, ND_ProtoField *field, void *data, gboolean is_error); void nd_gui_proto_table_block_events (LND_Trace *trace, LND_ProtoInfo *pi); void nd_gui_proto_table_unblock_events (LND_Trace *trace, LND_ProtoInfo *pi); void nd_gui_add_monowidth_widget (GtkWidget *widget); void nd_gui_del_monowidth_widget (GtkWidget *widget); void nd_gui_update_monowidth_widgets (void); void nd_gui_update_view_indicator (void); void nd_gui_update_area_indicator (void); |
void (*ND_MenuEntryCB) (LND_Packet *packet, guchar *header, int value); |
Functions of this signature are used for nd_gui_create_menu()
.
Each menu item supplies a specific header field value, which gets
passed to the callback as value. header is automatically set
correctly and points to the beginning of the protocol data currently
edited when the menu was popped up (including the correct nesting
level).
currently edited packet.
pointer to header structure of currently edited protocol.
the value for the affected header field that is set by the menu item.
void nd_gui_init (void); |
The function initializes Netdude GUI components, beyond what can be done through Glade, e.g. the progress bar, tooltips etc.
void nd_gui_sync_menus (void); |
This function sets various GUI elements sensitive or insensitive according to the current packet/trace selection.
void nd_gui_show_packet_menu (GdkEventButton *event); |
This function pops up the packet menu when the user right-clicks a line in the packet list.
mouse event that contains coordinates where to pop up menu.
void nd_gui_show_iterator_mode_menu (GdkEventButton *event); |
This function pops up the packet iteration mode menu when the user clicks on the button in the trace's tab.
mouse event that contains coordinates where to pop up menu.
void nd_gui_num_packets_set (void); |
The function updates the field in the lower left containing the number of packets of the current trace.
void nd_gui_set_trace_status (LND_Trace *trace); |
The function adjusts the GUI to reflect the modification status of trace (at the moment this means that the close button of trace is displayed either red or green).
trace to sync GUI to.
void nd_gui_statusbar_set (const char *text); |
The function sets the statusbar content to text, and schedules a timout that clears the statusbar after a little while.
new statusbar message.
void nd_gui_statusbar_set_noclear (const char *text); |
The function sets the statusbar content to text just like
nd_gui_statusbar_set()
, but doesn't schedule a timeout to
clear the bar.
new statusbar message.
gint nd_gui_statusbar_clear (gpointer data); |
The function immediately clears the status bar and is used
by nd_gui_statusbar_set()
. data is not used,
nor is the return value, these only exist to make
this function usable as a GTK timeout callback.
unused.
ignored.
void nd_gui_pbar_reset (int num_total); |
The function initializes the progress bar in the lower right part of the main window to num_steps number of steps.
number of steps between 0% and 100%.
void nd_gui_pbar_inc (int num_inc); |
The function increments the progress bar by num_inc units. The value
is bounded by the maximum value specified when nd_gui_pbar_reset()
was called, so you cannot pass something "too large" here.
value to add to progress bar.
void nd_gui_pbar_clear (int interval); |
The function clears the progress bar in the main window, after waiting the given amount of time if specified.
delay in milliseconds before the progress bar is cleared.
void nd_gui_pbar_start_activity (void); |
The function starts activity display in the main window, causing a small bar to slide back and forth in the progress bar.
void nd_gui_pbar_stop_activity (void); |
The function stops activity display in the progress bar.
void nd_gui_list_set_incomplete_column_visible (LND_Trace *trace, gboolean visible); |
void nd_gui_list_set_row_incomplete (LND_Trace *trace, int row, gboolean incomplete); |
The function adjusts the completeness status in the GUI for the given
packet. See also nd_gui_list_incomplete_column_visible()
trace whose list widget to adjust.
which row to update.
whether to mark the row as an incomplete packet or not.
void nd_gui_list_set_row_filtered (LND_Trace *trace, int row, gboolean filtered); |
trace whose list widget to update.
which row to update.
whether to mark the row as filtered or not.
void nd_gui_list_remove_selected_rows (LND_Trace *trace); |
The function removes the selected rows from clist. This updates only the widget, no signals are emitted. Use the clist functions for full service.
trace whose list widget to update.
void nd_gui_list_remove_row (LND_Trace *trace, guint index); |
The function removes the specified row from trace's list widget, (counting starts at zero). This updates only the widget, no signals are emitted. Use the clist functions for full service.
trace whose list widget to update.
row number to remove.
void nd_gui_list_insert_row (LND_Packet *packet, int index); |
The function inserts the packet's tcpdump data as a new row into the packet trace's list widget.
packet whose data to insert.
row number of the new line.
void nd_gui_list_clear (LND_Trace *trace); |
The function removes all entries from trace's list widget, without emitting any signals.
trace whose list widget to update.
void nd_gui_list_update (LND_Trace *trace); |
The function refreshes the tcpdump output for trace.
trace to update.
void nd_gui_list_update_packet (const LND_Packet *packet); |
The function updates the tcpdump output of packet. The packet is sent anew to the tcpdump process, then the text is updated. Context is always looked up. The completeness column is updated as well.
packet whose tcpdump output to update.
void nd_gui_list_update_packet_at_index (const LND_Packet *packet, int index); |
If you know the index of packet in its trace, use this function
instead of nd_gui_list_update_packet()
.
packet whose tcpdump output to update.
index of packet in trace.
void nd_gui_list_select_packet (LND_Trace *trace, guint index); |
The function selects row index in trace's list widget. A signal is emitted.
trace to update.
row number to select.
void nd_gui_list_unselect_packet (LND_Trace *trace, guint index); |
The function unselects row index in trace's list widget. A signal is emitted.
trace to update.
row number to unselect.
void nd_gui_list_unselect_all (LND_Trace *trace, gboolean emit_signal); |
The function unselects all rows in trace's list widget. A signal is emitted depending on emit_signal.
trace to update.
whether to emit unselect signals or not.
void nd_gui_list_select_all (LND_Trace *trace, gboolean emit_signal); |
The function elects all rows in trace's list widget. A signal is emitted depending on block_signal.
trace to update.
whether to emit select signals or not.
void nd_gui_list_update_packet_state (const LND_Packet *packet); |
The function takes the tcpdump output from the list widget and
iterates over all protocol in the packet, calling their
update_tcpdump_line()
packet whose tcpdump output to update.
void nd_gui_list_update_packet_state_at_index (const LND_Packet *packet, int index); |
If you know the index of packet in its trace, use this function
instead of nd_gui_list_update_packet_state()
.
packet whose tcpdump output to update.
index of packet in its trace.
void nd_gui_set_windowtitle (const char *filename); |
The function displays the given file name in the window title. Depending on the current preferences, the canonical filename or the filename only will be shown.
new (canonical) filename to display in window title.
void nd_gui_timestamp_schedule (GtkCList *clist, GdkEventMotion *event); |
The function schedules timestamp tooltip to be displayed. The delay depends on the user's preferences settings.
list widget with relevant row.
event containing the coordinates of the mouse.
void nd_gui_proto_menu_register (LND_Protocol *proto); |
Protocol plugins can provide a menu for any features they provide. This function takes care of hooking those menus into the main window.
Protocol providing a menu.
void nd_gui_trace_add (LND_Trace *trace); |
The function adds trace to the GUI. No other internal
data structures are touched. However, nd_trace_registry_set_current()
is called automatically through the callback that gets activated
when the trace is added.
trace to add to GUI.
void nd_gui_trace_remove (LND_Trace *trace); |
The function removes trace from the GUI. No other internal data structures are touched.
trace to remove from GUI:
void nd_gui_trace_new_tab (LND_Trace *trace); |
The function creates a new GTK notebook tab for trace and hooks them into the given trace.
trace for which tab is created.
void nd_gui_trace_set_name (LND_Trace *trace); |
The function updates the notebook tab label of trace to its current name and whether or not the canonical or the local filename is displayed.
trace for which tab is updated.
void nd_gui_widget_set_color (GtkWidget *widget, ND_GuiColor color); |
The function changes the color of the given widget
by scaling its color values in the desired directions.
The actual effect will depend on the GTK theme used.
This function is used to implement
nd_proto_info_field_set_state()
.
widget to modify.
color to use.
GtkWidget* nd_gui_create_menu (ND_MenuData *data); |
The function creates a menu out of the given ND_MenuData array and returns it. The last entry in the array must have a label value of NULL, which is easy since the data array is supposed to be declared statically.
array of ND_MenuDatas.
created menu.
GtkWidget* nd_gui_proto_table_create (LND_Trace *trace, LND_ProtoInfo *pinf); |
The function creates a GUI table based upon the specification of a protocol. The result depends on the statically initialized array which the ND_Protocol's 'fields' pointer points to. Its last array entry must contain a NULL value.
trace to which table belongs.
protocol type and nesting.
created table, a GtkTable.
void nd_gui_proto_table_clear (LND_Trace *trace, LND_ProtoInfo *pinf); |
Additional buttons can be added to protocol header tables at any time
using nd_gui_proto_table_add()
. This is the mechanism to display e.g. IP
options etc. To remove any previously added optional buttons,
call this function.
trace to which table belongs.
protocol type and nesting.
void nd_gui_proto_table_add (LND_Trace *trace, LND_ProtoInfo *pinf, ND_ProtoField *field, void *data, gboolean is_error); |
The function adds an optional button to the protocol header table of a given protocol. data is used to fill the field label string with the actual value. It depends on the format string in the field structure, what data needs to be passed here. When is_error is TRUE, the button is changed in color accordingly.
trace to which table belongs.
protocol type and nesting.
specification of the field.
arbitrary data passed in as void pointer.
whether the header field is in an erroneous state or not.
void nd_gui_proto_table_block_events (LND_Trace *trace, LND_ProtoInfo *pi); |
The function blocks all event propagation from the protocol header
table for the protocol instance specified in pi. Match this up
with nd_gui_proto_table_unblock_events()
!
trace affected.
protocol type and nesting.
void nd_gui_proto_table_unblock_events (LND_Trace *trace, LND_ProtoInfo *pi); |
The function unblocks all event propagation from the protocol header
table for the protocol instance specified in pi. Use this after
blocking the events with nd_gui_proto_table_block_events()
.
trace affected.
protocol type and nesting.
void nd_gui_add_monowidth_widget (GtkWidget *widget); |
Netdude keeps track of all widgets that need a monowidth font (like all the tcpdump packet lists). Use this function to add a widget to that set.
widget that uses a monowidth font.
void nd_gui_del_monowidth_widget (GtkWidget *widget); |
When monowidth widgets get destroyed, make sure you call this function so that Netdude doesn't unnecessarily keep track of them.
widget to forget.