|
Helium
|
Internal header file for fragmentation support. More...
#include <stddef.h>#include <time.h>
Go to the source code of this file.
Data Structures | |
| struct | he_fragment_entry_node |
| struct | he_fragment_entry |
| struct | he_fragment_table |
Macros | |
| #define | MAX_FRAGMENT_ENTRIES 65536 |
Typedefs | |
| typedef struct he_conn | he_conn_t |
| typedef struct he_fragment_entry_node | he_fragment_entry_node_t |
| typedef struct he_fragment_entry | he_fragment_entry_t |
| typedef struct he_fragment_table | he_fragment_table_t |
Functions | |
| he_return_code_t | he_internal_frag_and_send_message (he_conn_t *conn, uint8_t *packet, uint16_t length, uint16_t frag_size) |
| Fragment a packet and send it over the secured tunnel as multiple messages. More... | |
| void | he_fragment_entry_reset (he_fragment_entry_t *entry) |
| Reset the given fragment entry. More... | |
| int | he_fragment_entry_update (he_fragment_entry_t *entry, uint8_t *data, uint16_t offset, size_t length, uint8_t mf, bool *assembled) |
| Update the given fragment entry with a new fragment. More... | |
| he_fragment_table_t * | he_internal_fragment_table_create (size_t num_entries) |
| Create and initialize a new fragment table. More... | |
| he_fragment_entry_t * | he_internal_fragment_table_find (he_fragment_table_t *tbl, uint16_t frag_id) |
| Find entry for the given fragment id. More... | |
| void | he_internal_fragment_table_delete (he_fragment_table_t *tbl, uint16_t frag_id) |
| Delete entry from the fragment table. More... | |
| void | he_internal_fragment_table_destroy (he_fragment_table_t *tbl) |
Destroy the given he_fragment_table and free up all memory. More... | |
Internal header file for fragmentation support.
Lightway Core Copyright (C) 2023 Express VPN International Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
| void he_fragment_entry_reset | ( | he_fragment_entry_t * | entry | ) |
Reset the given fragment entry.
| entry | A pointer to a valid fragment entry |
| int he_fragment_entry_update | ( | he_fragment_entry_t * | entry, |
| uint8_t * | data, | ||
| uint16_t | offset, | ||
| size_t | length, | ||
| uint8_t | mf, | ||
| bool * | assembled | ||
| ) |
Update the given fragment entry with a new fragment.
| entry | A pointer to a valid fragment entry |
| data | A pointer to the fragment data |
| offset | Offset of the fragment in the original packet in bytes |
| length | Length of the fragment |
| mf | More Fragment flag |
| assembled | (out) Indicate if the packet has been fully reassembled. |
| he_return_code_t he_internal_frag_and_send_message | ( | he_conn_t * | conn, |
| uint8_t * | packet, | ||
| uint16_t | length, | ||
| uint16_t | frag_size | ||
| ) |
Fragment a packet and send it over the secured tunnel as multiple messages.
| conn | A pointer to a valid connection |
| packet | A pointer to the raw packet to be sent |
| length | The length of the packet |
| frag_size | Size of each fragment in bytes |
Lightway Core Copyright (C) 2023 Express VPN International Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
| he_fragment_table_t* he_internal_fragment_table_create | ( | size_t | num_entries | ) |
Create and initialize a new fragment table.
| num_entries | Number of fragment entries can be used in the fragment table. If it's 0, the default value MAX_FRAGMENT_ENTRIES will be used. |
he_internal_fragment_table_destroy after use. | void he_internal_fragment_table_delete | ( | he_fragment_table_t * | tbl, |
| uint16_t | frag_id | ||
| ) |
Delete entry from the fragment table.
| tbl | Pointer to a valid he_fragment_table_t struct. |
| frag_id | Fragment Identifier |
| void he_internal_fragment_table_destroy | ( | he_fragment_table_t * | tbl | ) |
Destroy the given he_fragment_table and free up all memory.
| tbl | A pointer to a valid he_fragment_table struct. |
| he_fragment_entry_t* he_internal_fragment_table_find | ( | he_fragment_table_t * | tbl, |
| uint16_t | frag_id | ||
| ) |
Find entry for the given fragment id.
| tbl | Pointer to a valid he_fragment_table_t struct. |
| frag_id | Fragment Identifier |
1.8.17