Microchip® Advanced Software Framework

mac-sequence.c File Reference

    MAC sequence numbers management
Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se Benoît Thébaudeau benoi.nosp@m.t.th.nosp@m.ebaud.nosp@m.eau@.nosp@m.advan.nosp@m.see..nosp@m.com
#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

int mac_sequence_is_duplicate ( void  )

Tell whether the packetbuf is a duplicate packet.

Returns
Non-zero if the packetbuf is a duplicate packet, zero otherwise
        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().

struct seqno received_seqnos[MAX_SEQNOS]
static