95 size_t expected_offset;
108 if (
offset != expected_offset ) {
109 DBGC (
fragment,
"FRAG %p dropping out-of-sequence fragment " 129 (
iob_len ( iobuf ) - *hdrlen ) );
137 ( more_frags ?
"" :
" complete" ) );
149 "buffer to %zd bytes\n",
fragment, new_len );
165 if ( ! more_frags ) {
unsigned long reasm_reqds
ipSystemStatsReasmReqds
#define iob_pull(iobuf, len)
unsigned long reasm_oks
ipSystemStatsReasmOks
#define iob_put(iobuf, len)
struct ip_statistics * stats
Associated IP statistics.
static struct fragment * fragment_find(struct fragment_reassembler *fragments, struct io_buffer *iobuf, size_t hdrlen)
Find fragment reassembly buffer.
#define list_add(new, head)
Add a new entry to the head of a list.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
A fragment reassembly buffer.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define list_del(list)
Delete an entry from a list.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
struct io_buffer * fragment_reassemble(struct fragment_reassembler *fragments, struct io_buffer *iobuf, size_t *hdrlen)
Reassemble packet.
#define container_of(ptr, type, field)
Get containing structure.
unsigned long reasm_fails
ipSystemStatsReasmFails
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define __unused
Declare a variable or data structure as unused.
struct io_buffer * iobuf
Reassembled packet.
size_t(* fragment_offset)(struct io_buffer *iobuf, size_t hdrlen)
Get fragment offset.
static void(* free)(struct refcnt *refcnt))
void * zalloc(size_t size)
Allocate cleared memory.
static void fragment_expired(struct retry_timer *timer, int fail __unused)
Expire fragment reassembly buffer.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
struct fragment_reassembler * fragments
Fragment reassembler.
void start_timer_fixed(struct retry_timer *timer, unsigned long timeout)
Start timer with a specified timeout.
int(* is_fragment)(struct fragment *fragment, struct io_buffer *iobuf, size_t hdrlen)
Check if fragment matches fragment reassembly buffer.
#define iob_reserve(iobuf, len)
void stop_timer(struct retry_timer *timer)
Stop timer.
static size_t iob_headroom(struct io_buffer *iobuf)
Calculate available space at start of an I/O buffer.
int(* more_fragments)(struct io_buffer *iobuf, size_t hdrlen)
Check if more fragments exist.
void * data
Start of data.
struct retry_timer timer
Reassembly timer.
uint16_t offset
Offset to command line.
#define FRAGMENT_TIMEOUT
Fragment reassembly timeout.
#define NULL
NULL pointer (VOID *)
struct list_head list
List of fragment reassembly buffers.
size_t hdrlen
Length of non-fragmentable portion of reassembled packet.