Data Structures | |
struct | packet_dimension |
Packet dimension. More... | |
struct | packet |
Packet header. More... | |
Files | |
file | packet.c |
Packet map and queue implementation. | |
file | packet.h |
Packet map and queue. | |
file | packet_client.c |
Packet client implementation. | |
file | packet_client.h |
Packet client. | |
file | packet_header.h |
Packet header. | |
file | packet_messages.h |
Packet server module messages. | |
file | packet_remote.c |
Packet client interface implementation for standalone remote modules. | |
file | packet_server.c |
Packet server implementation. | |
file | packet_server.h |
Packet server. | |
Defines | |
#define | PACKET_MAP_SIZE 100 |
Packet map page size. | |
#define | PACKET_MAP_PAGE(packet_id) (((packet_id) - 1) / PACKET_MAP_SIZE) |
Returns the packet map page index. | |
#define | PACKET_MAP_INDEX(packet_id) (((packet_id) - 1) % PACKET_MAP_SIZE) |
Returns the packet index in the corresponding packet map page. | |
#define | PACKET_DATA_LENGTH(header) ((header)->data_end - (header)->data_start) |
Returns the actual packet data length. | |
#define | PACKET_MAX_ADDRESS_LENGTH(header) ((header)->dest_addr - (header)->src_addr) |
Returns the maximum packet address length. | |
#define | PACKET_MIN_SUFFIX(header) ((header)->length - (header)->data_start - (header)->max_content) |
Returns the minimum packet suffix. | |
#define | PACKET_MAGIC_VALUE 0x11227788 |
Packet integrity check magic value. | |
#define | ARP_GET_PROTO(call) (services_t) IPC_GET_ARG2(*call) |
Returns the protocol service message parameter. | |
#define | IPC_GET_ID(call) (packet_id_t) IPC_GET_ARG1(*call) |
Returns the packet identifier message parameter. | |
#define | IPC_GET_CONTENT(call) (size_t) IPC_GET_ARG1(*call) |
Returns the maximal content length message parameter. | |
#define | IPC_GET_ADDR_LEN(call) (size_t) IPC_GET_ARG2(*call) |
Returns the maximal address length message parameter. | |
#define | IPC_GET_PREFIX(call) (size_t) IPC_GET_ARG3(*call) |
Returns the maximal prefix length message parameter. | |
#define | IPC_GET_SUFFIX(call) (size_t) IPC_GET_ARG4(*call) |
Returns the maximal suffix length message parameter. | |
#define | FREE_QUEUES_COUNT 7 |
#define | DEFAULT_ADDR_LEN 32 |
The default address length reserved for new packets. | |
#define | DEFAULT_PREFIX 64 |
The default prefix reserved for new packets. | |
#define | DEFAULT_SUFFIX 64 |
The default suffix reserved for new packets. | |
Typedefs | |
typedef packet_t | packet_map_t [PACKET_MAP_SIZE] |
Type definition of the packet map page. | |
typedef packet_map_t * | packet_map_ref |
Type definition of the packet map page pointer. | |
typedef int | packet_id_t |
Packet identifier type. | |
typedef struct packet * | packet_t |
Type definition of the packet. | |
typedef packet_t * | packet_ref |
Type definition of the packet pointer. | |
typedef struct packet_dimension | packet_dimension_t |
Type definition of the packet dimension. | |
typedef packet_dimension_t * | packet_dimension_ref |
Type definition of the packet dimension pointer. | |
Enumerations | |
enum | packet_messages { NET_PACKET_CREATE_1 = NET_PACKET_FIRST, NET_PACKET_CREATE_4, NET_PACKET_GET, NET_PACKET_GET_SIZE, NET_PACKET_RELEASE } |
Packet server module messages. More... | |
Functions | |
GENERIC_FIELD_DECLARE (gpm, packet_map_t) | |
Packet map. | |
int | packet_destroy (packet_t packet) |
Releases the packet. | |
GENERIC_FIELD_IMPLEMENT (gpm, packet_map_t) | |
static int | packet_is_valid (const packet_t packet) |
Returns whether the packet is valid. | |
int | packet_return (int phone, packet_ref packet, packet_id_t packet_id, size_t size) |
Obtains the packet from the packet server as the shared memory block. | |
int | packet_server_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, int *answer_count) |
Processes the packet server message. | |
Variables | |
struct { | |
fibril_rwlock_t lock | |
Safety lock. | |
gpm_t packet_map | |
Packet map. | |
} | pm_globals |
Packet map global data. | |
struct { | |
fibril_mutex_t lock | |
Safety lock. | |
packet_t free [FREE_QUEUES_COUNT] | |
Free packet queues. | |
size_t sizes [FREE_QUEUES_COUNT] | |
Packet length upper bounds of the free packet queues. | |
unsigned int count | |
Total packets allocated. | |
} | ps_globals |
Packet server global data. | |
Packet management system interface | |
| |
int | pm_init (void) |
Initializes the packet map. | |
packet_t | pm_find (packet_id_t packet_id) |
Finds the packet mapping. | |
int | pm_add (packet_t packet) |
Adds the packet mapping. | |
void | pm_destroy (void) |
Releases the packet map. | |
int | pq_add (packet_t *first, packet_t packet, size_t order, size_t metric) |
Add packet to the sorted queue. | |
packet_t | pq_find (packet_t first, size_t order) |
Finds the packet with the given order. | |
int | pq_insert_after (packet_t packet, packet_t new_packet) |
Inserts packet after the given one. | |
packet_t | pq_detach (packet_t packet) |
Detach the packet from the queue. | |
int | pq_set_order (packet_t packet, size_t order, size_t metric) |
Sets the packet order and metric attributes. | |
int | pq_get_order (packet_t packet, size_t *order, size_t *metric) |
Sets the packet order and metric attributes. | |
void | pq_destroy (packet_t first, void(*packet_release)(packet_t packet)) |
Releases the whole queue. | |
packet_t | pq_next (packet_t packet) |
Returns the next packet in the queue. | |
packet_t | pq_previous (packet_t packet) |
Returns the previous packet in the queue. | |
Packet client interface | |
| |
int | packet_copy_data (packet_t packet, const void *data, size_t length) |
Copies the specified data to the beginning of the actual packet content. | |
void * | packet_prefix (packet_t packet, size_t length) |
Allocates the specified space right before the actual packet content and returns its pointer. | |
void * | packet_suffix (packet_t packet, size_t length) |
Allocates the specified space right after the actual packet content and returns its pointer. | |
int | packet_trim (packet_t packet, size_t prefix, size_t suffix) |
Trims the actual packet content by the specified prefix and suffix lengths. | |
packet_id_t | packet_get_id (const packet_t packet) |
Returns the packet identifier. | |
int | packet_get_addr (const packet_t packet, uint8_t **src, uint8_t **dest) |
Returns the stored packet addresses and their length. | |
size_t | packet_get_data_length (const packet_t packet) |
Returns the packet content length. | |
void * | packet_get_data (const packet_t packet) |
Returns the pointer to the beginning of the packet content. | |
int | packet_set_addr (packet_t packet, const uint8_t *src, const uint8_t *dest, size_t addr_len) |
Sets the packet addresses. | |
packet_t | packet_get_copy (int phone, packet_t packet) |
Returns the packet copy. | |
int | packet_translate (int phone, packet_ref packet, packet_id_t packet_id) |
Translates the packet identifier to the packet reference. | |
packet_t | packet_get_4 (int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix) |
Obtains the packet of the given dimensions. | |
packet_t | packet_get_1 (int phone, size_t content) |
Obtains the packet of the given content size. | |
void | pq_release (int phone, packet_id_t packet_id) |
Releases the packet queue. | |
#define | PACKET_PREFIX(packet, type) (type *) packet_prefix((packet), sizeof(type)) |
Allocates the specified type right before the actual packet content and returns its pointer. | |
#define | PACKET_SUFFIX(packet, type) (type *) packet_suffix((packet), sizeof(type)) |
Allocates the specified type right after the actual packet content and returns its pointer. | |
#define | PACKET_TRIM(packet, prefix, suffix) packet_trim((packet), sizeof(prefix), sizeof(suffix)) |
Trims the actual packet content by the specified prefix and suffix types. | |
Packet server support functions | |
| |
packet_t | packet_get (size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix) |
Returns the packet of dimensions at least as given. | |
int | packet_release_wrapper (packet_id_t packet_id) |
Releases the packet queue. | |
void | packet_release (packet_t packet) |
Releases the packet and returns it to the appropriate free packet queue. | |
packet_t | packet_create (size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix) |
Creates a new packet of dimensions at least as given. | |
void | packet_init (packet_t packet, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix) |
Clears and initializes the packet according to the given dimensions. | |
int | packet_reply (const packet_t packet) |
Shares the packet memory block. |
#define ARP_GET_PROTO | ( | call | ) | (services_t) IPC_GET_ARG2(*call) |
Returns the protocol service message parameter.
#define DEFAULT_ADDR_LEN 32 |
The default address length reserved for new packets.
#define DEFAULT_PREFIX 64 |
The default prefix reserved for new packets.
Referenced by packet_get_1().
#define DEFAULT_SUFFIX 64 |
The default suffix reserved for new packets.
Referenced by packet_get_1().
#define FREE_QUEUES_COUNT 7 |
Referenced by packet_get(), and packet_release().
#define IPC_GET_ADDR_LEN | ( | call | ) | (size_t) IPC_GET_ARG2(*call) |
Returns the maximal address length message parameter.
#define IPC_GET_CONTENT | ( | call | ) | (size_t) IPC_GET_ARG1(*call) |
Returns the maximal content length message parameter.
#define IPC_GET_ID | ( | call | ) | (packet_id_t) IPC_GET_ARG1(*call) |
Returns the packet identifier message parameter.
#define IPC_GET_PREFIX | ( | call | ) | (size_t) IPC_GET_ARG3(*call) |
Returns the maximal prefix length message parameter.
#define IPC_GET_SUFFIX | ( | call | ) | (size_t) IPC_GET_ARG4(*call) |
Returns the maximal suffix length message parameter.
#define PACKET_DATA_LENGTH | ( | header | ) | ((header)->data_end - (header)->data_start) |
#define PACKET_MAGIC_VALUE 0x11227788 |
Packet integrity check magic value.
Referenced by packet_create(), and packet_is_valid().
#define PACKET_MAP_INDEX | ( | packet_id | ) | (((packet_id) - 1) % PACKET_MAP_SIZE) |
#define PACKET_MAP_PAGE | ( | packet_id | ) | (((packet_id) - 1) / PACKET_MAP_SIZE) |
#define PACKET_MAP_SIZE 100 |
Packet map page size.
#define PACKET_MAX_ADDRESS_LENGTH | ( | header | ) | ((header)->dest_addr - (header)->src_addr) |
#define PACKET_MIN_SUFFIX | ( | header | ) | ((header)->length - (header)->data_start - (header)->max_content) |
Allocates the specified type right before the actual packet content and returns its pointer.
The wrapper of the packet_prepend() function.
[in] | packet | The packet to be used. |
[in] | type | The type to be allocated at the beginning of the packet content. |
Referenced by eth_prepare_packet(), icmp_echo(), icmp_prepare_packet(), tcp_send_message(), and udp_sendto_message().
Allocates the specified type right after the actual packet content and returns its pointer.
The wrapper of the packet_append() function.
[in] | packet | The packet to be used. |
[in] | type | The type to be allocated at the end of the packet content. |
Referenced by eth_prepare_packet(), and tcp_create_notification_packet().
#define PACKET_TRIM | ( | packet, | |||
prefix, | |||||
suffix | ) | packet_trim((packet), sizeof(prefix), sizeof(suffix)) |
Trims the actual packet content by the specified prefix and suffix types.
The wrapper of the packet_trim() function.
[in] | packet | The packet to be trimmed. |
[in] | prefix | The type of the prefix to be removed from the beginning of the packet content. |
[in] | suffix | The type of the suffix to be removed from the end of the packet content. |
typedef packet_dimension_t* packet_dimension_ref |
Type definition of the packet dimension pointer.
typedef struct packet_dimension packet_dimension_t |
Type definition of the packet dimension.
typedef int packet_id_t |
Packet identifier type.
Value zero (0) is used as an invalid identifier.
typedef packet_map_t* packet_map_ref |
Type definition of the packet map page pointer.
typedef packet_t packet_map_t[PACKET_MAP_SIZE] |
Type definition of the packet map page.
typedef packet_t* packet_ref |
enum packet_messages |
Packet server module messages.
NET_PACKET_CREATE_1 |
Create packet message with specified content length.
|
NET_PACKET_CREATE_4 |
Create packet message with specified address length, prefix, content and suffix.
|
NET_PACKET_GET |
Get packet message.
|
NET_PACKET_GET_SIZE |
Get packet size message.
|
NET_PACKET_RELEASE |
Release packet message.
|
GENERIC_FIELD_DECLARE | ( | gpm | , | |
packet_map_t | ||||
) |
GENERIC_FIELD_IMPLEMENT | ( | gpm | , | |
packet_map_t | ||||
) |
int packet_copy_data | ( | packet_t | packet, | |
const void * | data, | |||
size_t | length | |||
) |
Copies the specified data to the beginning of the actual packet content.
Pushes the content end if needed.
[in] | packet | The packet to be filled. |
[in] | data | The data to be copied. |
[in] | length | The length of the copied data. |
packet_t packet_create | ( | size_t | length, | |
size_t | addr_len, | |||
size_t | max_prefix, | |||
size_t | max_content, | |||
size_t | max_suffix | |||
) |
Creates a new packet of dimensions at least as given.
Should be used only when the global data are locked.
[in] | length | The total length of the packet, including the header, the addresses and the data of the packet. |
[in] | addr_len | The source and destination addresses maximal length in bytes. |
[in] | max_prefix | The maximal prefix length in bytes. |
[in] | max_content | The maximal content length in bytes. |
[in] | max_suffix | The maximal suffix length in bytes. |
References ERROR_DECLARE, ERROR_OCCURRED, length, magic_value, packet_id, packet_init(), PACKET_MAGIC_VALUE, pm_add(), and ps_globals.
Referenced by packet_get().
int packet_destroy | ( | packet_t | packet | ) |
packet_t packet_get | ( | size_t | addr_len, | |
size_t | max_prefix, | |||
size_t | max_content, | |||
size_t | max_suffix | |||
) |
Returns the packet of dimensions at least as given.
Tries to reuse free packets first. Creates a new packet aligned to the memory page size if none available. Locks the global data during its processing.
[in] | addr_len | The source and destination addresses maximal length in bytes. |
[in] | max_prefix | The maximal prefix length in bytes. |
[in] | max_content | The maximal content length in bytes. |
[in] | max_suffix | The maximal suffix length in bytes. |
References FREE_QUEUES_COUNT, length, next, packet_create(), packet_init(), packet_is_valid(), pm_find(), pq_detach(), and ps_globals.
Referenced by packet_get_1(), and packet_get_4().
packet_t packet_get_1 | ( | int | phone, | |
size_t | content | |||
) |
Obtains the packet of the given content size.
Contacts the packet server to return the appropriate packet.
[in] | phone | The packet server module phone. |
[in] | content | The maximal content length in bytes. |
References DEFAULT_ADDR_LEN, DEFAULT_PREFIX, DEFAULT_SUFFIX, and packet_get().
packet_t packet_get_4 | ( | int | phone, | |
size_t | max_content, | |||
size_t | addr_len, | |||
size_t | max_prefix, | |||
size_t | max_suffix | |||
) |
Obtains the packet of the given dimensions.
Contacts the packet server to return the appropriate packet.
[in] | phone | The packet server module phone. |
[in] | addr_len | The source and destination addresses maximal length in bytes. |
[in] | max_prefix | The maximal prefix length in bytes. |
[in] | max_content | The maximal content length in bytes. |
[in] | max_suffix | The maximal suffix length in bytes. |
References packet_get().
Referenced by arp_translate_message(), icmp_echo(), ip_fragment_packet(), and tcp_create_notification_packet().
int packet_get_addr | ( | const packet_t | packet, | |
uint8_t ** | src, | |||
uint8_t ** | dest | |||
) |
Returns the stored packet addresses and their length.
[in] | packet | The packet. |
[out] | src | The source address. May be NULL if not desired. |
[out] | dest | The destination address. May be NULL if not desired. |
Referenced by eth_prepare_packet(), icmp_process_packet(), ip_fragment_packet(), tcp_process_packet(), udp_process_packet(), and udp_recvfrom_message().
Returns the packet copy.
Copies the addresses, data, order and metric values. Does not copy the queue placement.
Referenced by tcp_prepare_copy().
void * packet_get_data | ( | const packet_t | packet | ) |
Returns the pointer to the beginning of the packet content.
Referenced by arp_receive_message(), eth_process_packet(), icmp_client_process_packet(), icmp_process_packet(), ip_fragment_packet(), ip_prepare_icmp(), ip_prepare_packet(), ip_process_packet(), irq_handler(), netif_send_message(), tcp_process_packet(), tcp_queue_prepare_packet(), tcp_send_prepare_packet(), udp_process_packet(), udp_recvfrom_message(), and udp_sendto_message().
size_t packet_get_data_length | ( | const packet_t | packet | ) |
Returns the packet content length.
Referenced by arp_receive_message(), eth_prepare_packet(), eth_process_packet(), icmp_client_header_length(), icmp_client_process_packet(), icmp_prepare_packet(), icmp_process_packet(), icmp_send_packet(), ip_deliver_local(), ip_fragment_packet(), ip_prepare_icmp(), ip_prepare_packet(), ip_split_packet(), irq_handler(), netif_send_message(), tcp_process_established(), tcp_process_listen(), tcp_process_packet(), tcp_process_syn_sent(), tcp_send_prepare_packet(), udp_process_packet(), and udp_sendto_message().
packet_id_t packet_get_id | ( | const packet_t | packet | ) |
Returns the packet identifier.
Referenced by arp_translate_message(), dp_pkt2user(), dp_send(), eth_send_message(), icmp_client_process_packet(), icmp_destination_unreachable_msg(), icmp_parameter_problem_msg(), icmp_process_echo_reply(), icmp_release_and_return(), icmp_source_quench_msg(), icmp_time_exceeded_msg(), il_received_msg(), ip_prepare_icmp(), ip_received_error_msg(), ip_release_and_return(), ip_send_msg(), ip_send_route(), ip_split_packet(), irq_handler(), netif_send_message(), netif_send_msg(), nil_received_msg(), queue_packet(), tcp_connect_core(), tcp_get_packets_to_send(), tcp_process_acknowledgement(), tcp_process_established(), tcp_process_listen(), tcp_process_packet(), tcp_process_syn_received(), tcp_process_syn_sent(), tcp_queue_received_packet(), tcp_recvfrom_message(), tcp_release_and_return(), tcp_retransmit_packet(), tcp_send_prepare_packet(), tl_received_msg(), udp_process_packet(), udp_recvfrom_message(), and udp_release_and_return().
void packet_init | ( | packet_t | packet, | |
size_t | addr_len, | |||
size_t | max_prefix, | |||
size_t | max_content, | |||
size_t | max_suffix | |||
) |
Clears and initializes the packet according to the given dimensions.
[in] | packet | The packet to be initialized. |
[in] | addr_len | The source and destination addresses maximal length in bytes. |
[in] | max_prefix | The maximal prefix length in bytes. |
[in] | max_content | The maximal content length in bytes. |
[in] | max_suffix | The maximal suffix length in bytes. |
Referenced by packet_create(), and packet_get().
static int packet_is_valid | ( | const packet_t | packet | ) | [inline, static] |
Returns whether the packet is valid.
References magic_value, and PACKET_MAGIC_VALUE.
Referenced by packet_destroy(), packet_get(), packet_release_wrapper(), and packet_reply().
void * packet_prefix | ( | packet_t | packet, | |
size_t | length | |||
) |
Allocates the specified space right before the actual packet content and returns its pointer.
[in] | packet | The packet to be used. |
[in] | length | The space length to be allocated at the beginning of the packet content. |
Referenced by ip_prepare_packet().
void packet_release | ( | packet_t | packet | ) |
Releases the packet and returns it to the appropriate free packet queue.
Should be used only when the global data are locked.
References FREE_QUEUES_COUNT, length, pq_add(), and ps_globals.
Referenced by packet_release_wrapper().
int packet_release_wrapper | ( | packet_id_t | packet_id | ) |
Releases the packet queue.
[in] | packet_id | The first packet identifier. |
References packet_is_valid(), packet_release(), pm_find(), pq_destroy(), and ps_globals.
Referenced by pq_release().
int packet_reply | ( | const packet_t | packet | ) |
Shares the packet memory block.
References length, and packet_is_valid().
int packet_return | ( | int | phone, | |
packet_ref | packet, | |||
packet_id_t | packet_id, | |||
size_t | size | |||
) |
Obtains the packet from the packet server as the shared memory block.
Creates the local packet mapping as well.
[in] | phone | The packet server module phone. |
[out] | packet | The packet reference pointer to store the received packet reference. |
[in] | packet_id | The packet identifier. |
[in] | size | The packet total size in bytes. |
References ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, NET_PACKET_GET, and pm_add().
int packet_server_message | ( | ipc_callid_t | callid, | |
ipc_call_t * | call, | |||
ipc_call_t * | answer, | |||
int * | answer_count | |||
) |
Processes the packet server message.
[in] | callid | The message identifier. |
[in] | call | The message parameters. |
[out] | answer | The message answer parameters. |
[out] | answer_count | The last parameter for the actual answer in the answer parameter. |
Referenced by module_message().
int packet_set_addr | ( | packet_t | packet, | |
const uint8_t * | src, | |||
const uint8_t * | dest, | |||
size_t | addr_len | |||
) |
Sets the packet addresses.
[in] | packet | The packet. |
[in] | src | The new source address. May be NULL. |
[in] | dest | The new destination address. May be NULL. |
[in] | addr_len | The addresses length. |
Referenced by arp_receive_message(), arp_translate_message(), eth_process_packet(), icmp_echo(), icmp_process_packet(), ip_deliver_local(), ip_fragment_packet_data(), ip_prepare_icmp(), ip_prepare_packet(), ip_process_packet(), and tcp_queue_prepare_packet().
void * packet_suffix | ( | packet_t | packet, | |
size_t | length | |||
) |
Allocates the specified space right after the actual packet content and returns its pointer.
[in] | packet | The packet to be used. |
[in] | length | The space length to be allocated at the end of the packet content. |
Referenced by arp_translate_message(), dp_pkt2user(), eth_prepare_packet(), icmp_echo(), ip_create_middle_header(), ip_fragment_packet(), and ip_fragment_packet_data().
int packet_translate | ( | int | phone, | |
packet_ref | packet, | |||
packet_id_t | packet_id | |||
) |
Translates the packet identifier to the packet reference.
Tries to find mapping first. Contacts the packet server to share the packet if the mapping is not present.
[in] | phone | The packet server module phone. |
[out] | packet | The packet reference. |
[in] | packet_id | The packet identifier. |
References pm_find().
Referenced by eth_receiver(), icmp_process_message(), nil_message(), nildummy_receiver(), tcp_recvfrom_message(), and udp_recvfrom_message().
int packet_trim | ( | packet_t | packet, | |
size_t | prefix, | |||
size_t | suffix | |||
) |
Trims the actual packet content by the specified prefix and suffix lengths.
[in] | packet | The packet to be trimmed. |
[in] | prefix | The prefix length to be removed from the beginning of the packet content. |
[in] | suffix | The suffix length to be removed from the end of the packet content. |
Referenced by eth_process_packet(), icmp_prepare_packet(), icmp_process_packet(), ip_deliver_local(), ip_fragment_packet(), ip_fragment_packet_data(), tcp_process_established(), tcp_process_listen(), tcp_process_packet(), tcp_process_syn_sent(), udp_process_packet(), and udp_recvfrom_message().
int pm_add | ( | packet_t | packet | ) |
Adds the packet mapping.
Referenced by packet_create(), and packet_return().
void pm_destroy | ( | void | ) |
packet_t pm_find | ( | packet_id_t | packet_id | ) |
Finds the packet mapping.
[in] | packet_id | The packet identifier to be found. |
Referenced by packet_get(), packet_release_wrapper(), and packet_translate().
int pm_init | ( | void | ) |
Initializes the packet map.
Referenced by module_start().
Add packet to the sorted queue.
The queue is sorted in the ascending order. The packet is inserted right before the packets of the same order value.
[in,out] | first | The first packet of the queue. Sets the first packet of the queue. The original first packet may be shifted by the new packet. |
[in] | packet | The packet to be added. |
[in] | order | The packet order value. |
[in] | metric | The metric value of the packet. |
Referenced by dp_pkt2user(), packet_release(), queue_packet(), tcp_process_acknowledgement(), tcp_process_established(), tcp_queue_packet(), and udp_sendto_message().
Releases the whole queue.
Detaches all packets of the queue and calls the packet_release() for each of them.
[in] | first | The first packet of the queue. |
[in] | packet_release | The releasing function called for each of the packets after its detachment. |
Referenced by packet_release_wrapper().
Detach the packet from the queue.
Referenced by dp_send(), eth_send_message(), ip_prepare_icmp(), ip_receive_message(), ip_split_packet(), netif_send_message(), nil_received_msg(), packet_get(), tcp_process_acknowledgement(), tcp_process_established(), tcp_process_listen(), tcp_process_syn_sent(), tcp_send_packets(), and udp_process_packet().
Finds the packet with the given order.
Referenced by tcp_get_packets_to_send(), and tcp_retransmit_packet().
int pq_get_order | ( | packet_t | packet, | |
size_t * | order, | |||
size_t * | metric | |||
) |
Sets the packet order and metric attributes.
[in] | packet | The packet to be set. |
[out] | order | The packet order value. |
[out] | metric | The metric value of the packet. |
Referenced by tcp_get_packets_to_send(), tcp_process_acknowledgement(), tcp_process_established(), and tcp_retransmit_packet().
Inserts packet after the given one.
Referenced by ip_fragment_packet_data(), tcp_get_packets_to_send(), and tcp_process_established().
Returns the next packet in the queue.
Referenced by eth_send_message(), ip_prepare_packet(), ip_split_packet(), netif_send_message(), queue_packet(), tcp_get_packets_to_send(), tcp_process_established(), tcp_process_packet(), and udp_process_packet().
void pq_release | ( | int | phone, | |
packet_id_t | packet_id | |||
) |
Releases the packet queue.
All packets in the queue are marked as free for use. The packet queue may be one packet only. The module should not use the packets after this point until they are received or obtained again.
References packet_release_wrapper().
Referenced by arp_translate_message(), eth_send_message(), icmp_process_echo_reply(), icmp_release_and_return(), ip_prepare_icmp(), ip_release_and_return(), ip_send_route(), ip_split_packet(), nil_received_msg(), socket_destroy_core(), tcp_get_packets_to_send(), tcp_process_acknowledgement(), tcp_process_established(), tcp_process_listen(), tcp_process_packet(), tcp_process_syn_received(), tcp_process_syn_sent(), tcp_recvfrom_message(), tcp_release_and_return(), tcp_send_prepare_packet(), udp_process_packet(), udp_recvfrom_message(), and udp_release_and_return().
int pq_set_order | ( | packet_t | packet, | |
size_t | order, | |||
size_t | metric | |||
) |
Sets the packet order and metric attributes.
[in] | packet | The packet to be set. |
[in] | order | The packet order value. |
[in] | metric | The metric value of the packet. |
Referenced by tcp_process_established().
unsigned { ... } count [inherited] |
Total packets allocated.
fibril_mutex_t { ... } lock [inherited] |
Safety lock.
fibril_rwlock_t { ... } lock [inherited] |
Safety lock.
gpm_t { ... } packet_map [inherited] |
Packet map.
struct { ... } pm_globals [static] |
Packet map global data.
struct { ... } ps_globals [static] |
Packet server global data.
Referenced by packet_create(), packet_get(), packet_release(), and packet_release_wrapper().