Contiki-NG
Loading...
Searching...
No Matches
mac-sequence.h File Reference

Header file for MAC sequence numbers management. More...

Go to the source code of this file.

Functions

void mac_sequence_init (void)
 brief Initializes the destination sequence number to a random value.
 
void mac_sequence_set_dsn (void)
 Sets and increments the destination sequence number.
 
int mac_sequence_is_duplicate (void)
 Tell whether the packetbuf is a duplicate packet.
 
void mac_sequence_register_seqno (void)
 Register the sequence number of the packetbuf.
 

Detailed Description

Header file for 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

Definition in file mac-sequence.h.

Function Documentation

◆ mac_sequence_is_duplicate()

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 link-layer address.

Definition at line 87 of file mac-sequence.c.

References clock_time(), and linkaddr_cmp().

◆ mac_sequence_register_seqno()

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.

Definition at line 116 of file mac-sequence.c.

References clock_time(), linkaddr_cmp(), and linkaddr_copy().