- Timestamping management added - Errors due to reading uninitialized data in ARP fixed - EthInterface reworked, incoming packet notification and payload readout separated (through which fixing concurrent access problems) - RX and TX offloads added - Capability to add a packet sieve layer without prior registration of specific packet class added (this makes it possible to register arbitrary EtherType connection blocks, for example)
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
#ifndef ETHERLIB_DYNMEM_H
|
|
#define ETHERLIB_DYNMEM_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifdef DYNMEM_DEBUG
|
|
#include <stdio.h>
|
|
#endif
|
|
|
|
#ifdef VALGRIND_DEBUG
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#endif
|
|
|
|
/**
|
|
* Initialize EtherLib dynamic memory management subsystem,
|
|
* based on heap pointer and size given in etherlib_options.h
|
|
*/
|
|
void dynmem_init();
|
|
|
|
/**
|
|
* Dynamically allocate memory from EtherLib's pool.
|
|
* @param size requested size
|
|
* @return pointer to allocated area or NULL on failure
|
|
*/
|
|
void * dynmem_alloc_(uint32_t size);
|
|
|
|
#ifdef DYNMEM_DEBUG
|
|
#define dynmem_alloc(size) dynmem_alloc_(size); MSG("ALLOC: %d %s() in %s:%d\n", size, __FUNCTION__, __FILE__, __LINE__)
|
|
#elif defined(VALGRIND_DEBUG)
|
|
#define dynmem_alloc(size) malloc(size)
|
|
#else
|
|
#define dynmem_alloc(size) dynmem_alloc_(size)
|
|
#endif
|
|
|
|
/**
|
|
* Release allocated block.
|
|
* @param ptr pointer to allocated area
|
|
*/
|
|
void dynmem_free_(void * ptr);
|
|
|
|
#ifdef DYNMEM_DEBUG
|
|
#define dynmem_free(ptr) MSG("FREE: %s() in %s:%d\n", __FUNCTION__, __FILE__, __LINE__), dynmem_free_(ptr)
|
|
#elif defined(VALGRIND_DEBUG)
|
|
#define dynmem_free(p) free(p)
|
|
#else
|
|
#define dynmem_free(ptr) dynmem_free_(ptr)
|
|
#endif
|
|
|
|
#endif //ETHERLIB_DYNMEM_H
|