diff options
Diffstat (limited to 'apf_interpreter.h')
-rw-r--r-- | apf_interpreter.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/apf_interpreter.h b/apf_interpreter.h index 78a0dd3..368ae04 100644 --- a/apf_interpreter.h +++ b/apf_interpreter.h @@ -27,26 +27,36 @@ extern "C" { * Version of APF instruction set processed by accept_packet(). * Should be returned by wifi_get_packet_filter_info. */ -#define APF_VERSION 3 +#define APF_VERSION 4 /** * Runs a packet filtering program over a packet. * - * @param program the program bytecode. - * @param program_len the length of {@code apf_program} in bytes. + * The text section containing the program instructions starts at address + * program and stops at + program_len - 1, and the writable data section + * begins at program + program_len and ends at program + ram_len - 1, + * as described in the following diagram: + * + * program program + program_len program + ram_len + * | text section | data section | + * +--------------------+------------------------+ + * + * @param program the program bytecode, followed by the writable data region. + * @param program_len the length in bytes of the read-only portion of the APF + * buffer pointed to by {@code program}. + * @param ram_len total length of the APF buffer pointed to by {@code program}, + * including the read-only bytecode portion and the read-write + * data portion. * @param packet the packet bytes, starting from the 802.3 header and not * including any CRC bytes at the end. * @param packet_len the length of {@code packet} in bytes. - * @param data writable data memory region (preserved between packets). - * @param data_len the length of {@code data} in bytes. * @param filter_age the number of seconds since the filter was programmed. * * @return non-zero if packet should be passed to AP, zero if * packet should be dropped. */ -int accept_packet(const uint8_t* program, uint32_t program_len, +int accept_packet(uint8_t* program, uint32_t program_len, uint32_t ram_len, const uint8_t* packet, uint32_t packet_len, - uint8_t* data, uint32_t data_len, uint32_t filter_age); #ifdef __cplusplus |