MAC sequence numbers management
#include <string.h>
#include "contiki-net.h"
#include "net/mac/mac-sequence.h"
#include "net/packetbuf.h"
#include "net/rime/rime.h"
Data Structures | |
struct | seqno |
Macros | |
#define | MAX_SEQNOS 16 |
Functions | |
int | mac_sequence_is_duplicate (void) |
Tell whether the packetbuf is a duplicate packet. More... | |
void | mac_sequence_register_seqno (void) |
Register the sequence number of the packetbuf. More... | |
Variables | |
static struct seqno | received_seqnos [MAX_SEQNOS] |
#define MAX_SEQNOS 16 |
Referenced by mac_sequence_is_duplicate(), and mac_sequence_register_seqno().
int mac_sequence_is_duplicate | ( | void | ) |
Tell whether the packetbuf is a duplicate packet.
This function is used to check for duplicate packet by comparing the sequence number of the incoming packet with the last few ones we saw, filtering with the Rime address.
References i, linkaddr_cmp(), MAX_SEQNOS, packetbuf_addr(), PACKETBUF_ADDR_SENDER, packetbuf_attr(), PACKETBUF_ATTR_PACKET_ID, received_seqnos, and seqno::sender.
Referenced by input_packet(), and packet_input().
void mac_sequence_register_seqno | ( | void | ) |
Register the sequence number of the packetbuf.
This function is used to add the sequence number of the incoming packet to the history.
References i, j, linkaddr_cmp(), linkaddr_copy(), MAX_SEQNOS, packetbuf_addr(), PACKETBUF_ADDR_SENDER, packetbuf_attr(), PACKETBUF_ATTR_PACKET_ID, received_seqnos, seqno::sender, and seqno::seqno.
Referenced by input_packet(), and packet_input().
|
static |
Referenced by mac_sequence_is_duplicate(), and mac_sequence_register_seqno().