nd_trace_registry

Name

nd_trace_registry -- 

Synopsis



void        (*ND_TraceFunc)                 (LND_Trace *trace,
                                             void *user_data);
void        nd_trace_registry_init          (void);
void        nd_trace_registry_set_current   (LND_Trace *trace);
LND_Trace*  nd_trace_registry_get_current   (void);
void        nd_trace_registry_add           (LND_Trace *trace);
void        nd_trace_registry_remove        (LND_Trace *trace);
void        nd_trace_registry_foreach       (ND_TraceFunc callback,
                                             void *user_data);

Description

Details

ND_TraceFunc ()

void        (*ND_TraceFunc)                 (LND_Trace *trace,
                                             void *user_data);

The trace registry uses functions of this signature as callbacks for iterating over the registered traces. See also nd_trace_registry_foreach().

trace :

the trace iterated.

user_data :

arbitrary data.


nd_trace_registry_init ()

void        nd_trace_registry_init          (void);

The trace registry is Netdude's central repository for currently edited traces. This function sets up the necessary data structures and is called when Netdude is launched.


nd_trace_registry_set_current ()

void        nd_trace_registry_set_current   (LND_Trace *trace);

There is always one trace in the registry that is the current one, i.e. the one the user has selected right now. This function sets it and updates the GUI accordingly (i.e. adjusts window title etc).

trace :

new current trace.


nd_trace_registry_get_current ()

LND_Trace*  nd_trace_registry_get_current   (void);

This function returns the current trace. Use this to obtain the trace when you have no other means, like a ND_Packet, for example.

Returns :

current trace.


nd_trace_registry_add ()

void        nd_trace_registry_add           (LND_Trace *trace);

In order to register a trace in the registry, use this function. It checks if the trace is already registered and in that case, simply returns. Takes care of adding the trace in the GUI etc.

trace :

the added trace.


nd_trace_registry_remove ()

void        nd_trace_registry_remove        (LND_Trace *trace);

Removes a trace from the registry and takes care of updating the gui etc.

trace :

trace to remove.


nd_trace_registry_foreach ()

void        nd_trace_registry_foreach       (ND_TraceFunc callback,
                                             void *user_data);

The function calls callback for every trace currently registered and passes it as first argument. The second argument is the user data, which is simply passed through.

callback :

a function of type ND_TraceFunc

user_data :

arbitrary data passed through to the callback