iPXE
|
Fragment reassembly. More...
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <ipxe/retry.h>
#include <ipxe/timer.h>
#include <ipxe/ipstat.h>
#include <ipxe/fragment.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | fragment_expired (struct retry_timer *timer, int fail __unused) |
Expire fragment reassembly buffer. More... | |
static struct fragment * | fragment_find (struct fragment_reassembler *fragments, struct io_buffer *iobuf, size_t hdrlen) |
Find fragment reassembly buffer. More... | |
struct io_buffer * | fragment_reassemble (struct fragment_reassembler *fragments, struct io_buffer *iobuf, size_t *hdrlen) |
Reassemble packet. More... | |
Fragment reassembly.
Definition in file fragment.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Expire fragment reassembly buffer.
timer | Retry timer |
fail | Failure indicator |
Definition at line 46 of file fragment.c.
References container_of, DBGC, fragment::fragments, free, free_iob(), fragment::iobuf, fragment::list, list_del, ip_statistics::reasm_fails, and fragment_reassembler::stats.
Referenced by fragment_reassemble().
|
static |
Find fragment reassembly buffer.
fragments | Fragment reassembler |
iobuf | I/O buffer |
hdrlen | Length of non-fragmentable potion of I/O buffer |
fragment | Fragment reassembly buffer, or NULL if not found |
Definition at line 65 of file fragment.c.
References fragment::fragments, fragment::hdrlen, fragment::iobuf, fragment_reassembler::is_fragment, fragment_reassembler::list, fragment::list, list_for_each_entry, and NULL.
Referenced by fragment_reassemble().
struct io_buffer* fragment_reassemble | ( | struct fragment_reassembler * | fragments, |
struct io_buffer * | iobuf, | ||
size_t * | hdrlen | ||
) |
Reassemble packet.
fragments | Fragment reassembler |
iobuf | I/O buffer |
hdrlen | Length of non-fragmentable potion of I/O buffer |
iobuf | Reassembled packet, or NULL |
This function takes ownership of the I/O buffer. Note that the length of the non-fragmentable portion may be modified.
Definition at line 88 of file fragment.c.
References alloc_iob(), io_buffer::data, DBGC, fragment_expired(), fragment_find(), fragment_reassembler::fragment_offset, FRAGMENT_TIMEOUT, fragment::fragments, free, free_iob(), fragment::hdrlen, iob_headroom(), iob_len(), iob_pull, iob_put, iob_reserve, fragment::iobuf, fragment_reassembler::list, fragment::list, list_add, list_del, memcpy(), fragment_reassembler::more_fragments, NULL, offset, ip_statistics::reasm_fails, ip_statistics::reasm_oks, ip_statistics::reasm_reqds, start_timer_fixed(), fragment_reassembler::stats, stop_timer(), fragment::timer, and zalloc().