#include "olsr_types.h"#include "interfaces.h"#include "process_routes.h"#include <arpa/inet.h>#include <net/if.h>

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 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 int(* packet_transform_function)(uint8_t *, int *) |
Definition at line 54 of file net_olsr.h.
| 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.
| f | the function pointer |
Definition at line 329 of file net_olsr.c.
References ptf::function, ptf::next, and olsr_malloc().
Referenced by secure_plugin_init().

| 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().

| void init_net | ( | void | ) |
Definition at line 100 of file net_olsr.c.
References avl_comp_default, avl_init(), deny_ipv4_defaults, deny_ipv6_defaults, filter_tree, inet_pton(), olsr_config::ip_version, LOG_NETWORKING, olsr_add_invalid_address(), olsr_cnf, olsr_expire_buffer_timer(), OLSR_INFO, olsr_timer_add(), and OLSR_WARN.
Referenced by main().

| 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.
| ifp | the interface to create a buffer for |
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().

| 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)
| ifp | the interface corresponding to the buffer |
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.
| ifp | the interface corresponding to the buffer | |
| data | a pointer to the data to add | |
| size | the number of byte to copy from data |
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 | ) |
Sends a packet on a given interface.
| ifp | the interface to send on. |
Definition at line 376 of file net_olsr.c.
References olsr_netbuf::buff, ptf::function, interface::if_index, interface::int_multicast, interface::int_name, olsr_config::ip_version, LOG_NETWORKING, interface::netbuf, ptf::next, olsr_cnf, OLSR_HEADERSIZE, interface::olsr_seqnum, olsr_sockaddr_to_string(), OLSR_WARN, os_sendto(), olsr_netbuf::pending, interface::send_socket_fd, olsr_packet::seqno, olsr_packet::size, and olsr_sockaddr::v4.
Referenced by generate_hello(), generate_hna(), generate_mid(), net_remove_buffer(), olsr_expire_buffer_timer(), 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().

| 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.
| ifp | the interface corresponding to the buffer |
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.
| ifp | the interface corresponding to the buffer to remove |
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().

| 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().

| void set_buffer_timer | ( | struct interface * | ifn | ) |
Definition at line 159 of file net_olsr.c.
References interface::buffer_hold_timer, OLSR_BUFFER_HOLD_JITTER, OLSR_BUFFER_HOLD_TIME, and olsr_timer_start().
Referenced by add_interface(), generate_hna(), generate_mid(), olsr_forward_message(), olsr_output_lq_tc_internal(), single_hna(), and spread_host().

1.6.3