Contiki-NG
|
Files | |
file | sixp-nbr.c |
Neighbor Management for 6top Protocol (6P) | |
file | sixp-nbr.h |
Neighbor Management APIs for 6top Protocol (6P) | |
file | sixp-pkt.c |
6top Protocol (6P) Packet Manipulation | |
file | sixp-pkt.h |
6top Protocol (6P) Packet Manipulation APIs | |
file | sixp-trans.c |
Transaction Management for 6top Protocol (6P) | |
file | sixp-trans.h |
Transaction Management APIs for 6top Protocol (6P) | |
file | sixp.c |
6top Protocol (6P) | |
file | sixp.h |
6top Protocol (6P) APIs | |
file | sixtop-conf.h |
6top Configuration | |
file | sixtop.c |
6TiSCH Operation Sublayer (6top) | |
file | sixtop.h |
6TiSCH Operation Sublayer (6top) APIs | |
Data Structures | |
union | sixp_pkt_code_t |
6P Codes integrating Command IDs and Return Codes More... | |
struct | sixp_pkt_t |
6top IE Structure More... | |
struct | sixtop_sf_t |
/brief Scheduling Function Driver More... | |
Macros | |
#define | SIXP_INITIAL_SEQUENCE_NUMBER 0 |
The initial sequence number used for 6P request. | |
#define | SIXTOP_MAX_SCHEDULING_FUNCTIONS 1 |
The maximum number of Scheduling Functions in the system. | |
#define | SIXTOP_MAX_TRANSACTIONS 1 |
The maximum number of transactions which the sixtop module can handle at the same time. | |
Typedefs | |
typedef struct sixp_nbr | sixp_nbr_t |
6P Neighbor Data Structure (for internal use) More... | |
typedef struct sixp_trans | sixp_trans_t |
6P Transaction Data Structure (for internal use) | |
typedef void(* | sixp_sent_callback_t) (void *arg, uint16_t arg_len, const linkaddr_t *dest_addr, sixp_output_status_t status) |
6P Packet Sent Handler | |
typedef void(* | sixtop_sf_input) (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t *body, uint16_t body_len, const linkaddr_t *src_addr) |
Input Handler of Scheduling Function. More... | |
typedef void(* | sixtop_sf_timeout) (sixp_pkt_cmd_t cmd, const linkaddr_t *peer_addr) |
Timeout Handler of Scheduling Function. More... | |
Functions | |
sixp_nbr_t * | sixp_nbr_find (const linkaddr_t *addr) |
Find a neighbor. More... | |
sixp_nbr_t * | sixp_nbr_alloc (const linkaddr_t *addr) |
Allocate a neighbor. More... | |
void | sixp_nbr_free (sixp_nbr_t *nbr) |
Free a neighbor. More... | |
int | sixp_nbr_get_next_seqno (sixp_nbr_t *nbr) |
Get the next sequence number of a neighbor. More... | |
int | sixp_nbr_set_next_seqno (sixp_nbr_t *nbr, uint16_t seqno) |
Set the specified value to the next sequence number of a neighbor. More... | |
int | sixp_nbr_reset_next_seqno (sixp_nbr_t *nbr) |
Reset the next sequence number of a neighbor to zero. More... | |
int | sixp_nbr_increment_next_seqno (sixp_nbr_t *nbr) |
Increment the next sequence number of a neighbor. More... | |
int | sixp_nbr_init (void) |
Initialize 6p Neighbor Table. | |
int | sixp_pkt_set_metadata (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_metadata_t metadata, uint8_t *body, uint16_t body_len) |
Write Metadata into "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_metadata (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_metadata_t *metadata, const uint8_t *body, uint16_t body_len) |
Read Metadata stored in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_cell_options (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_cell_options_t cell_options, uint8_t *body, uint16_t body_len) |
Write CellOptions in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_cell_options (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_cell_options_t *cell_options, const uint8_t *body, uint16_t body_len) |
Read CellOptions in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_num_cells (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_num_cells_t num_cells, uint8_t *body, uint16_t body_len) |
Write NumCells in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_num_cells (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_num_cells_t *num_cells, const uint8_t *body, uint16_t body_len) |
Read NumCells in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_reserved (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_reserved_t reserved, uint8_t *body, uint16_t body_len) |
Write Reserved in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_reserved (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_reserved_t *reserved, const uint8_t *body, uint16_t body_len) |
Read Reserved in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_offset (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_offset_t offset, uint8_t *body, uint16_t body_len) |
Write Offset in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_offset (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_offset_t *offset, const uint8_t *body, uint16_t body_len) |
Read Offset in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_max_num_cells (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_max_num_cells_t max_num_cells, uint8_t *body, uint16_t body_len) |
Write MaxNumCells in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_max_num_cells (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_max_num_cells_t *max_num_cells, const uint8_t *body, uint16_t body_len) |
Read MaxNumCells in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_cell_list (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t *cell_list, uint16_t cell_list_len, uint16_t offset, uint8_t *body, uint16_t body_len) |
Write CellList in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_cell_list (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t **cell_list, sixp_pkt_offset_t *cell_list_len, const uint8_t *body, uint16_t body_len) |
Read CellList in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_rel_cell_list (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t *rel_cell_list, uint16_t rel_cell_list_len, uint16_t offset, uint8_t *body, uint16_t body_len) |
Write RelCellList in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_rel_cell_list (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t **rel_cell_list, sixp_pkt_offset_t *rel_cell_list_len, const uint8_t *body, uint16_t body_len) |
Read RelCellList in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_cand_cell_list (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t *cand_cell_list, uint16_t cand_cell_list_len, uint16_t offset, uint8_t *body, uint16_t body_len) |
Write CandCellList in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_cand_cell_list (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t **cand_cell_list, sixp_pkt_offset_t *cand_cell_list_len, const uint8_t *body, uint16_t body_len) |
Read CandCellList in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_total_num_cells (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_total_num_cells_t total_num_cells, uint8_t *body, uint16_t body_len) |
Write TotalNumCells in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_total_num_cells (sixp_pkt_type_t type, sixp_pkt_code_t code, sixp_pkt_total_num_cells_t *total_num_cells, const uint8_t *body, uint16_t body_len) |
Read TotalNumCells in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_set_payload (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t *payload, uint16_t payload_len, uint8_t *body, uint16_t body_len) |
Write Payload in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_get_payload (sixp_pkt_type_t type, sixp_pkt_code_t code, uint8_t *buf, uint16_t buf_len, const uint8_t *body, uint16_t body_len) |
Read Payload in "Other Fields" of 6P packet. More... | |
int | sixp_pkt_parse (const uint8_t *buf, uint16_t len, sixp_pkt_t *pkt) |
Parse a 6P packet. More... | |
int | sixp_pkt_create (sixp_pkt_type_t type, sixp_pkt_code_t code, uint8_t sfid, uint8_t seqno, const uint8_t *body, uint16_t body_len, sixp_pkt_t *pkt) |
Create a 6P packet. More... | |
int | sixp_trans_transit_state (sixp_trans_t *trans, sixp_trans_state_t new_state) |
Change the state of a specified transaction. More... | |
sixp_pkt_cmd_t | sixp_trans_get_cmd (sixp_trans_t *trans) |
Return the command associated with a specified transaction. More... | |
sixp_trans_state_t | sixp_trans_get_state (sixp_trans_t *trans) |
Return the state of a specified transaction. More... | |
int16_t | sixp_trans_get_seqno (sixp_trans_t *trans) |
Return the sequence number associated with a specified transaction. More... | |
sixp_trans_mode_t | sixp_trans_get_mode (sixp_trans_t *trans) |
Return the mode, 2-step or 3-step, of a specified transaction. More... | |
void | sixp_trans_invoke_callback (sixp_trans_t *trans, sixp_output_status_t status) |
Invoke the output callback of a specified transaction. More... | |
void | sixp_trans_set_callback (sixp_trans_t *trans, sixp_sent_callback_t func, void *arg, uint16_t arg_len) |
Set an output callback to a specified transaction. More... | |
sixp_trans_t * | sixp_trans_alloc (const sixp_pkt_t *pkt, const linkaddr_t *peer_addr) |
Allocate a transaction. More... | |
sixp_trans_t * | sixp_trans_find (const linkaddr_t *peer_addr) |
Find a transaction. More... | |
int | sixp_trans_init (void) |
Initialize Memory and List for 6P transactions This function removes and frees existing transactions. | |
void | sixp_input (const uint8_t *buf, uint16_t len, const linkaddr_t *src_addr) |
Input a 6P packet. More... | |
int | sixp_output (sixp_pkt_type_t type, sixp_pkt_code_t code, uint8_t sfid, const uint8_t *body, uint16_t body_len, const linkaddr_t *dest_addr, sixp_sent_callback_t func, void *arg, uint16_t arg_len) |
Output a 6P packet. More... | |
void | sixp_init (void) |
Initialize 6P Module It invokes sixp_nbr_init() and sixp_trans_init(). | |
const sixtop_sf_t * | sixtop_find_sf (uint8_t sfid) |
Find a SF which has been added by SFID. More... | |
int | sixtop_add_sf (const sixtop_sf_t *sf) |
Add a Scheduling Function (SF) to 6top Sublayer. More... | |
void | sixtop_output (const linkaddr_t *dest_addr, mac_callback_t callback, void *arg) |
Output a 6P packet which is supposestored in packetbuf. More... | |
void | sixtop_input (void) |
Input a packet stored in packetbuf. | |
void | sixtop_init (void) |
Initialize 6top module This initialization function removes all the SFs which has been installed into the 6top sub-layer. More... | |
void | sixtop_init_sf (void) |
Initialize installed SFs which has been added in the system This function is supposed to be invoked every time the node gets associated. | |
Variables | |
uint8_t | sixtop_sf_t::sfid |
SFID. More... | |
typedef struct sixp_nbr sixp_nbr_t |
6P Neighbor Data Structure (for internal use)
XXX: for now, we have one nbr object per neighbor, which is shared with multiple SFs. It's unclear whether we should use a different generation counter for each SFs.
typedef void(* sixtop_sf_input) (sixp_pkt_type_t type, sixp_pkt_code_t code, const uint8_t *body, uint16_t body_len, const linkaddr_t *src_addr) |
Input Handler of Scheduling Function.
type | 6P Message Type of an input packet |
code | Code, 6P Command Identifier or Return Code, of an input packet |
body | Body, "Other Fields", of an input packet |
body_len | The length of body |
body | src_addr Source address of an input packet |
typedef void(* sixtop_sf_timeout) (sixp_pkt_cmd_t cmd, const linkaddr_t *peer_addr) |
enum sixp_output_status_t |
6P Send Status, which represents sixp_output() result.
Enumerator | |
---|---|
SIXP_OUTPUT_STATUS_SUCCESS | SUCCESS. |
SIXP_OUTPUT_STATUS_FAILURE | FAILURE. |
6P Cell Options
Enumerator | |
---|---|
SIXP_PKT_CELL_OPTION_TX | TX Cell. |
SIXP_PKT_CELL_OPTION_RX | RX Cell. |
SIXP_PKT_CELL_OPTION_SHARED | SHARED Cell. |
Definition at line 112 of file sixp-pkt.h.
enum sixp_pkt_cmd_t |
6P Command Identifiers
Definition at line 72 of file sixp-pkt.h.
enum sixp_pkt_rc_t |
6P Return Codes
Definition at line 86 of file sixp-pkt.h.
enum sixp_pkt_type_t |
6P Message Types
Enumerator | |
---|---|
SIXP_PKT_TYPE_REQUEST | 6P Request |
SIXP_PKT_TYPE_RESPONSE | 6P Response |
SIXP_PKT_TYPE_CONFIRMATION | 6P Confirmation |
SIXP_PKT_TYPE_RESERVED | Reserved. |
Definition at line 62 of file sixp-pkt.h.
void sixp_input | ( | const uint8_t * | buf, |
uint16_t | len, | ||
const linkaddr_t * | src_addr | ||
) |
sixp_nbr_t * sixp_nbr_alloc | ( | const linkaddr_t * | addr | ) |
Allocate a neighbor.
addr | The MAC address of a neighbor |
Definition at line 80 of file sixp-nbr.c.
References nbr.
sixp_nbr_t * sixp_nbr_find | ( | const linkaddr_t * | addr | ) |
Find a neighbor.
addr | The MAC address of a neighbor |
Definition at line 70 of file sixp-nbr.c.
void sixp_nbr_free | ( | sixp_nbr_t * | nbr | ) |
Free a neighbor.
nbr | The pointer to a neighbor to free |
Definition at line 112 of file sixp-nbr.c.
int16_t sixp_nbr_get_next_seqno | ( | sixp_nbr_t * | nbr | ) |
Get the next sequence number of a neighbor.
nbr | The pointer to a neighbor |
Definition at line 121 of file sixp-nbr.c.
int sixp_nbr_increment_next_seqno | ( | sixp_nbr_t * | nbr | ) |
Increment the next sequence number of a neighbor.
nbr | The pointer to a neighbor |
Definition at line 156 of file sixp-nbr.c.
int sixp_nbr_reset_next_seqno | ( | sixp_nbr_t * | nbr | ) |
Reset the next sequence number of a neighbor to zero.
nbr | The pointer to a neighbor |
Definition at line 144 of file sixp-nbr.c.
int sixp_nbr_set_next_seqno | ( | sixp_nbr_t * | nbr, |
uint16_t | seqno | ||
) |
Set the specified value to the next sequence number of a neighbor.
nbr | The pointer to a neighbor |
seqno | Value to be set |
Definition at line 132 of file sixp-nbr.c.
int sixp_output | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
uint8_t | sfid, | ||
const uint8_t * | body, | ||
uint16_t | body_len, | ||
const linkaddr_t * | dest_addr, | ||
sixp_sent_callback_t | func, | ||
void * | arg, | ||
uint16_t | arg_len | ||
) |
Output a 6P packet.
type | Message Type |
code | Message Code; Command ID or Return Code |
sfid | Scheduling Function Identifier |
body | 6top IE Content |
body_len | The length of 6top IE Content |
dest_addr | The destination Address |
func | callback function invoked after the transmission process |
arg | The pointer to an argument to be passed with the callback |
arg_len | The length of the argument |
Definition at line 294 of file sixp.c.
References nbr.
int sixp_pkt_create | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
uint8_t | sfid, | ||
uint8_t | seqno, | ||
const uint8_t * | body, | ||
uint16_t | body_len, | ||
sixp_pkt_t * | pkt | ||
) |
Create a 6P packet.
type | 6P Message Type |
code | 6P Message Code, Command Identifier or Return Code |
sfid | Scheduling Function Identifier |
seqno | Sequence Number |
body | The pointer to "Other Fields" in a buffer |
body_len | The length of body, typically "Other Fields" length |
pkt | The pointer to a sixp_pkt_t structure to store packet info (option) |
Definition at line 1081 of file sixp-pkt.c.
int sixp_pkt_get_cand_cell_list | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
const uint8_t ** | cand_cell_list, | ||
sixp_pkt_offset_t * | cand_cell_list_len, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read CandCellList in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
cand_cell_list | The double pointer to store the starting address of CandCellList |
cand_cell_list_len | Pointer to store the length of CandCellList |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 776 of file sixp-pkt.c.
int sixp_pkt_get_cell_list | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
const uint8_t ** | cell_list, | ||
sixp_pkt_offset_t * | cell_list_len, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read CellList in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
cell_list | The double pointer to store the starting address of CellList |
cell_list_len | Pointer to store the length of CellList |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 608 of file sixp-pkt.c.
int sixp_pkt_get_cell_options | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_cell_options_t * | cell_options, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read CellOptions in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
cell_options | The pointer to buffer to store CellOptions in |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 294 of file sixp-pkt.c.
int sixp_pkt_get_max_num_cells | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_max_num_cells_t * | max_num_cells, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read MaxNumCells in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
max_num_cells | The pointer to buffer to store MaxNumCells in |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 537 of file sixp-pkt.c.
int sixp_pkt_get_metadata | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_metadata_t * | metadata, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read Metadata stored in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
metadata | The pointer to a buffer to store Metadata in |
body | The pointer to the buffer having "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 229 of file sixp-pkt.c.
int sixp_pkt_get_num_cells | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_num_cells_t * | num_cells, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read NumCells in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
num_cells | The pointer to buffer to store NumCells in |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 349 of file sixp-pkt.c.
int sixp_pkt_get_offset | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_offset_t * | offset, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read Offset in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
offset | The pointer to buffer to store Offset in |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 468 of file sixp-pkt.c.
int sixp_pkt_get_payload | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
uint8_t * | buf, | ||
uint16_t | buf_len, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read Payload in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
buf | The pointer to buffer to store "Payload" in |
buf_len | The length of buf |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 913 of file sixp-pkt.c.
int sixp_pkt_get_rel_cell_list | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
const uint8_t ** | rel_cell_list, | ||
sixp_pkt_offset_t * | rel_cell_list_len, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read RelCellList in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
rel_cell_list | The double pointer to store the starting address of RelCellList |
rel_cell_list_len | Pointer to store the length of a returned RelCellList |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 691 of file sixp-pkt.c.
int sixp_pkt_get_reserved | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_reserved_t * | reserved, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read Reserved in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
reserved | The pointer to buffer to store Reserved in |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 409 of file sixp-pkt.c.
int sixp_pkt_get_total_num_cells | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_total_num_cells_t * | total_num_cells, | ||
const uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Read TotalNumCells in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
total_num_cells | The pointer to buffer to store TotalNumCells in |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 849 of file sixp-pkt.c.
int sixp_pkt_parse | ( | const uint8_t * | buf, |
uint16_t | len, | ||
sixp_pkt_t * | pkt | ||
) |
Parse a 6P packet.
buf | The pointer to a buffer pointing 6top IE Content |
len | The length of the buffer |
pkt | The pointer to a sixp_pkt_t structure to store packet info |
Definition at line 947 of file sixp-pkt.c.
int sixp_pkt_set_cand_cell_list | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
const uint8_t * | cand_cell_list, | ||
uint16_t | cand_cell_list_len, | ||
uint16_t | offset, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write CandCellList in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
cand_cell_list | The pointer to "CandCellList" to write |
cand_cell_list_len | Length to write |
offset | Offset in the "CandCellList" field to start writing |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 734 of file sixp-pkt.c.
int sixp_pkt_set_cell_list | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
const uint8_t * | cell_list, | ||
uint16_t | cell_list_len, | ||
uint16_t | offset, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write CellList in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
cell_list | The pointer to "CellList" to write |
cell_list_len | Length to write |
offset | Offset in the "CellList" field to start writing |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 572 of file sixp-pkt.c.
int sixp_pkt_set_cell_options | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_cell_options_t | cell_options, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write CellOptions in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
cell_options | "CellOptions" to write |
body | The pointer to buffer having "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 263 of file sixp-pkt.c.
int sixp_pkt_set_max_num_cells | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_max_num_cells_t | max_num_cells, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write MaxNumCells in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
max_num_cells | "MaxNumCells" to write |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 503 of file sixp-pkt.c.
int sixp_pkt_set_metadata | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_metadata_t | metadata, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write Metadata into "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
metadata | Metadata to write |
body | The pointer to "Other Fields" in a buffer |
body_len | The length of body, typically "Other Fields" length |
Definition at line 196 of file sixp-pkt.c.
int sixp_pkt_set_num_cells | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_num_cells_t | num_cells, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write NumCells in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
num_cells | "NumCells" to write |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 325 of file sixp-pkt.c.
int sixp_pkt_set_offset | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_offset_t | offset, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write Offset in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
offset | "Offset" to write |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 434 of file sixp-pkt.c.
int sixp_pkt_set_payload | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
const uint8_t * | payload, | ||
uint16_t | payload_len, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write Payload in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
payload | "Payload" to write |
payload_len | The length of "Payload" to write |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 880 of file sixp-pkt.c.
int sixp_pkt_set_rel_cell_list | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
const uint8_t * | rel_cell_list, | ||
uint16_t | rel_cell_list_len, | ||
uint16_t | offset, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write RelCellList in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
rel_cell_list | The pointer to "RelCellList" to write |
rel_cell_list_len | Length to write |
offset | Offset in the "RelCellList" field to start writing |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 645 of file sixp-pkt.c.
int sixp_pkt_set_reserved | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_reserved_t | reserved, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write Reserved in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
reserved | "Reserved" to write |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 379 of file sixp-pkt.c.
int sixp_pkt_set_total_num_cells | ( | sixp_pkt_type_t | type, |
sixp_pkt_code_t | code, | ||
sixp_pkt_total_num_cells_t | total_num_cells, | ||
uint8_t * | body, | ||
uint16_t | body_len | ||
) |
Write TotalNumCells in "Other Fields" of 6P packet.
type | 6P Message Type |
code | 6P Command Identifier or Return Code |
total_num_cells | "TotalNumCells" to write |
body | The pointer to buffer pointing to "Other Fields" |
body_len | The length of body, typically "Other Fields" length |
Definition at line 821 of file sixp-pkt.c.
sixp_trans_t * sixp_trans_alloc | ( | const sixp_pkt_t * | pkt, |
const linkaddr_t * | peer_addr | ||
) |
Allocate a transaction.
pkt | The pointer to a packet which triggers the allocation |
peer_addr | The peer address which will be associated |
Definition at line 341 of file sixp-trans.c.
sixp_trans_t * sixp_trans_find | ( | const linkaddr_t * | peer_addr | ) |
Find a transaction.
peer_addr | The peer address |
Definition at line 384 of file sixp-trans.c.
sixp_pkt_cmd_t sixp_trans_get_cmd | ( | sixp_trans_t * | trans | ) |
Return the command associated with a specified transaction.
trans | The pointer to a transaction |
Definition at line 274 of file sixp-trans.c.
sixp_trans_mode_t sixp_trans_get_mode | ( | sixp_trans_t * | trans | ) |
Return the mode, 2-step or 3-step, of a specified transaction.
trans | The pointer to a transaction |
Definition at line 305 of file sixp-trans.c.
int16_t sixp_trans_get_seqno | ( | sixp_trans_t * | trans | ) |
Return the sequence number associated with a specified transaction.
trans | The pointer of a transaction |
Definition at line 294 of file sixp-trans.c.
sixp_trans_state_t sixp_trans_get_state | ( | sixp_trans_t * | trans | ) |
Return the state of a specified transaction.
trans | The pointer to a transaction |
Definition at line 284 of file sixp-trans.c.
void sixp_trans_invoke_callback | ( | sixp_trans_t * | trans, |
sixp_output_status_t | status | ||
) |
Invoke the output callback of a specified transaction.
trans | The pointer to a transaction |
status | An output result value |
Definition at line 316 of file sixp-trans.c.
void sixp_trans_set_callback | ( | sixp_trans_t * | trans, |
sixp_sent_callback_t | func, | ||
void * | arg, | ||
uint16_t | arg_len | ||
) |
Set an output callback to a specified transaction.
trans | The pointer to a transaction |
func | The pointer to a callback function |
arg | The pointer to an argument which will be passed to func |
arg_len | The length of the argument |
Definition at line 328 of file sixp-trans.c.
int sixp_trans_transit_state | ( | sixp_trans_t * | trans, |
sixp_trans_state_t | new_state | ||
) |
Change the state of a specified transaction.
trans | The pointer to a transaction |
new_state | New state to move the transaction to |
Definition at line 206 of file sixp-trans.c.
References nbr.
int sixtop_add_sf | ( | const sixtop_sf_t * | sf | ) |
Add a Scheduling Function (SF) to 6top Sublayer.
sf | The pointer to a Scheduling Function Driver |
If there is a SF whose SF is identical to one of a SF specified to this API, the addition will fail and -1 will be returned. If there is no room to another SF, -1 will be returned as well. You can specify how many SFs can be added with SIXTOP_CONF_MAX_SCHEDULING_FUNCTIONS.
const sixtop_sf_t * sixtop_find_sf | ( | uint8_t | sfid | ) |
void sixtop_init | ( | void | ) |
Initialize 6top module This initialization function removes all the SFs which has been installed into the 6top sub-layer.
In addition, it invokes sixp_init().
void sixtop_output | ( | const linkaddr_t * | dest_addr, |
mac_callback_t | callback, | ||
void * | arg | ||
) |