Details
ND_MenuEntryCB ()
void (*ND_MenuEntryCB) (ND_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).
enum ND_GuiColor
typedef enum {
ND_COLOR_BG,
ND_COLOR_RED,
ND_COLOR_YELLOW
} ND_GuiColor; |
nd_gui_init ()
The function initializes Netdude GUI components, beyond what
can be done through Glade, e.g. the progress bar, tooltips etc.
nd_gui_sync ()
This function sets various GUI elements sensitive or insensitive
according to the current packet/trace selection.
nd_gui_show_packet_menu ()
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.
nd_gui_num_packets_set ()
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.
nd_gui_modified_set ()
void nd_gui_modified_set (ND_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).
nd_gui_statusbar_set ()
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.
nd_gui_statusbar_clear ()
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.
nd_gui_pbar_reset ()
void nd_gui_pbar_reset (int num_steps); |
The function initializes the progress bar in the lower right
part of the main window to num_steps number of steps.
Each call to nd_gui_pbar_inc() will advance the progress
bar by one of these steps.
nd_gui_pbar_inc ()
void nd_gui_pbar_inc (void); |
The function increments the progress bar. The amount by which
is increased depends on the value passed to nd_gui_pbar_reset().
nd_gui_pbar_clear ()
void nd_gui_pbar_clear (void); |
The function clears the progress bar in the main window.
nd_gui_pbar_start_activity ()
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.
nd_gui_pbar_stop_activity ()
void nd_gui_pbar_stop_activity (void); |
The function stops activity display in the progress bar.
nd_gui_list_incomplete_column_visible ()
void nd_gui_list_incomplete_column_visible
(GtkWidget *clist,
gboolean visible); |
The packet lists for each trace can provide an additional column indicating
whether a packet was captured completely or not. This function specifies
whether this column is visible or not. clist is usually obtained from
the current trace as trace->list.
nd_gui_list_incomplete_row_set ()
void nd_gui_list_incomplete_row_set (GtkWidget *clist,
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(). The function
does not adjust any internal structures -- only the GUI.
nd_gui_list_remove_selected_rows ()
void nd_gui_list_remove_selected_rows
(GtkWidget *clist); |
The function removes the selected rows from clist. This updates
only the widget, no signals are emitted. Use the clist functions
for full service.
nd_gui_list_remove_row ()
void nd_gui_list_remove_row (GtkWidget *clist,
guint index); |
The function removes the specified row from clist (counting starts
at zero). This updates only the widget, no signals are emitted.
Use the clist functions for full service.
nd_gui_list_update ()
void nd_gui_list_update (ND_Trace *trace,
gboolean find_context); |
The function refreshes the tcpdump output for trace. If find_context
is TRUE, each packet's tcpdump output is updated to reflect
the context of the packet in the trace. This update depends on
what the protocols do with the line string in their update_tcpdump_line()
implementation. Also, the completeness column is updated.
nd_gui_list_update_packet ()
void nd_gui_list_update_packet (const ND_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.
nd_gui_list_update_packet_at_index ()
void nd_gui_list_update_packet_at_index
(const ND_Packet *packet,
int index); |
If you know the index of packet in its trace, use this function
instead of nd_gui_list_update_packet().
nd_gui_list_update_packet_state ()
void nd_gui_list_update_packet_state (const ND_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() implementations.
nd_gui_list_update_packet_state_at_index ()
void nd_gui_list_update_packet_state_at_index
(const ND_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().
nd_gui_windowtitle_set ()
void nd_gui_windowtitle_set (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.
nd_gui_timestamp_schedule ()
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.
nd_gui_timestamp_hide ()
void nd_gui_timestamp_hide (void); |
nd_gui_proto_menu_register ()
void nd_gui_proto_menu_register (ND_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.
nd_gui_trace_add ()
void nd_gui_trace_add (ND_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.
nd_gui_trace_remove ()
void nd_gui_trace_remove (ND_Trace *trace); |
The function removes trace from the GUI. No other internal
data structures are touched.
nd_gui_trace_new_tab ()
void nd_gui_trace_new_tab (ND_Trace *trace); |
The function creates a new GTK notebook tab for trace
and hooks them into the given trace.
nd_gui_trace_name_set ()
void nd_gui_trace_name_set (ND_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.
nd_gui_widget_set_color ()
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().
nd_gui_create_menu ()
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.
nd_gui_proto_table_create ()
GtkWidget* nd_gui_proto_table_create (ND_Trace *trace,
ND_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 trace->fields pointer points to. Its last array entry must
contain NULL values.
nd_gui_proto_table_clear ()
void nd_gui_proto_table_clear (ND_Trace *trace,
ND_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.
nd_gui_proto_table_add ()
void nd_gui_proto_table_add (ND_Trace *trace,
ND_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.
nd_gui_proto_table_block_events ()
void nd_gui_proto_table_block_events (ND_Trace *trace,
ND_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()!
nd_gui_proto_table_unblock_events ()
void nd_gui_proto_table_unblock_events
(ND_Trace *trace,
ND_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().
nd_gui_add_monowidth_widget ()
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.
nd_gui_del_monowidth_widget ()
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.
nd_gui_update_monowidth_widgets ()
void nd_gui_update_monowidth_widgets (void); |