/home/aaron/olsrd-current/olsrd/src/core/net_olsr.h File Reference

#include "olsr_types.h"
#include "interfaces.h"
#include "process_routes.h"
#include <arpa/inet.h>
#include <net/if.h>
Include dependency graph for net_olsr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  filter_entry

Defines

#define OLSR_FOR_ALL_FILTERS(filter, iterator)   avl_for_each_element_safe(&filter_tree, filter, filter_node, iterator)

Typedefs

typedef int(* packet_transform_function )(uint8_t *, int *)

Functions

void init_net (void)
void set_buffer_timer (struct interface *ifn)
void deinit_netfilters (void)
int net_add_buffer (struct interface *)
void net_remove_buffer (struct interface *)
static INLINE int net_outbuffer_bytes_left (const struct interface *ifp)
static INLINE uint16_t net_output_pending (const struct interface *ifp)
int EXPORT() net_outbuffer_push (struct interface *, const void *, const uint16_t)
int EXPORT() net_output (struct interface *)
void EXPORT() add_ptf (packet_transform_function)
bool olsr_validate_address (const union olsr_ip_addr *)

Define Documentation

#define OLSR_FOR_ALL_FILTERS ( filter,
iterator   )     avl_for_each_element_safe(&filter_tree, filter, filter_node, iterator)

Definition at line 64 of file net_olsr.h.

Referenced by deinit_netfilters().


Typedef Documentation

typedef int(* packet_transform_function)(uint8_t *, int *)

Definition at line 54 of file net_olsr.h.


Function Documentation

void EXPORT() add_ptf ( packet_transform_function  f  ) 

Add a packet transform function. Theese are functions called just prior to sending data in a buffer.

Parameters:
f the function pointer
Returns:
1

Definition at line 329 of file net_olsr.c.

References ptf::function, ptf::next, and olsr_malloc().

Referenced by secure_plugin_init().

Here is the call graph for this function:

void deinit_netfilters ( void   ) 

Definition at line 179 of file net_olsr.c.

References avl_delete(), filter_entry::filter_node, filter_tree, and OLSR_FOR_ALL_FILTERS.

Referenced by olsr_shutdown().

Here is the call graph for this function:

void init_net ( void   ) 
int net_add_buffer ( struct interface ifp  ) 

Create an outputbuffer for the given interface. This function will allocate the needed storage according to the MTU of the interface.

Parameters:
ifp the interface to create a buffer for
Returns:
0 on success, negative if a buffer already existed for the given interface

Definition at line 199 of file net_olsr.c.

References olsr_netbuf::buff, olsr_netbuf::bufsize, interface::int_mtu, olsr_netbuf::maxsize, interface::netbuf, OLSR_HEADERSIZE, olsr_malloc(), olsr_netbuf::pending, and olsr_netbuf::reserved.

Referenced by add_interface(), and chk_if_changed().

Here is the call graph for this function:

static INLINE int net_outbuffer_bytes_left ( const struct interface ifp  )  [static]

Report the number of bytes currently available in the buffer (not including possible reserved bytes)

Parameters:
ifp the interface corresponding to the buffer
Returns:
the number of bytes available in the buffer or

Definition at line 85 of file net_olsr.h.

References olsr_netbuf::maxsize, interface::netbuf, and olsr_netbuf::pending.

Referenced by generate_hello(), generate_hna(), generate_mid(), olsr_output_lq_tc_internal(), and spread_host().

int EXPORT() net_outbuffer_push ( struct interface ifp,
const void *  data,
const uint16_t  size 
)

Add data to a buffer.

Parameters:
ifp the interface corresponding to the buffer
data a pointer to the data to add
size the number of byte to copy from data
Returns:
-1 if no buffer was found, 0 if there was not enough room in buffer or the number of bytes added on success

Definition at line 283 of file net_olsr.c.

References olsr_netbuf::buff, olsr_netbuf::maxsize, interface::netbuf, OLSR_HEADERSIZE, and olsr_netbuf::pending.

Referenced by generate_hello(), generate_hna(), generate_mid(), olsr_forward_message(), olsr_mdns_gen(), olsr_namesvc_gen(), olsr_obamp_gen(), olsr_output_lq_tc_internal(), send_challenge(), send_cres(), send_rres(), single_hna(), and spread_host().

int EXPORT() net_output ( struct interface ifp  ) 
static INLINE uint16_t net_output_pending ( const struct interface ifp  )  [static]

Returns the number of bytes pending in the buffer. That is the number of bytes added but not sent.

Parameters:
ifp the interface corresponding to the buffer
Returns:
the number of bytes currently pending

Definition at line 99 of file net_olsr.h.

References interface::netbuf, and olsr_netbuf::pending.

Referenced by olsr_expire_buffer_timer(), and olsr_forward_message().

void net_remove_buffer ( struct interface ifp  ) 

Remove a outputbuffer. Frees the allocated memory.

Parameters:
ifp the interface corresponding to the buffer to remove
Returns:
0 on success, negative if no buffer is found

Definition at line 232 of file net_olsr.c.

References olsr_netbuf::buff, net_output(), interface::netbuf, and olsr_netbuf::pending.

Referenced by chk_if_changed(), and remove_interface().

Here is the call graph for this function:

bool olsr_validate_address ( const union olsr_ip_addr  ) 

Definition at line 450 of file net_olsr.c.

References avl_find(), filter_tree, LOG_NETWORKING, OLSR_DEBUG, and olsr_ip_to_string().

Referenced by olsr_add_invalid_address(), olsr_tc_update_edge(), olsr_update_mid_entry(), and parse_packet().

Here is the call graph for this function:

void set_buffer_timer ( struct interface ifn  ) 
Generated on Wed May 22 06:00:52 2013 for olsrd by  doxygen 1.6.3