Go to the documentation of this file.
40 #ifndef VS_SNAP_STRUCTS_H
41 #define VS_SNAP_STRUCTS_H
49 namespace VirgilIoTKit {
87 const uint16_t data_sz,
88 const uint8_t **packet_data,
89 uint16_t *packet_data_sz);
176 const uint8_t *request,
177 const uint16_t request_sz,
179 const uint16_t response_buf_sz,
180 uint16_t *response_sz);
198 const uint8_t *response,
199 const uint16_t response_sz);
234 #define ETH_ADDR_LEN (6)
235 #define ETH_TYPE_LEN (2)
236 #define ETH_CRC_LEN (4)
237 #define ETH_HEADER_LEN (ETH_ADDR_LEN + ETH_ADDR_LEN + ETH_TYPE_LEN)
238 #define ETH_MIN_LEN (64)
239 #define ETH_MTU (1500)
241 #define VS_ETHERTYPE_VIRGIL (HTONS_IN_COMPILE_TIME(0xABCD))
263 } vs_ethernet_header_t;
268 typedef struct __attribute__((__packed__)) {
280 typedef struct __attribute__((__packed__)) {
286 #define VS_NETIF_PACKET_BUF_SIZE (1024)
334 #endif // VS_SNAP_STRUCTS_H
vs_netif_deinit_t deinit
Destroy.
Definition: snap-structs.h:298
vs_status_e(* vs_netif_process_cb_t)(struct vs_netif_t *netif, const uint8_t *data, const uint16_t data_sz)
Preprocessed data.
Definition: snap-structs.h:102
vs_snap_header_t header
Packet header.
Definition: snap-structs.h:282
vs_status_e(* vs_netif_rx_cb_t)(struct vs_netif_t *netif, const uint8_t *data, const uint16_t data_sz, const uint8_t **packet_data, uint16_t *packet_data_sz)
Received data.
Definition: snap-structs.h:85
uint16_t packet_buf_filled
Packet size.
Definition: snap-structs.h:304
uint32_t vs_snap_service_id_t
SNAP service ID.
Definition: snap-structs.h:64
vs_status_e(* vs_netif_deinit_t)(struct vs_netif_t *netif)
Destructor.
Definition: snap-structs.h:157
vs_netif_init_t init
Initialization.
Definition: snap-structs.h:297
vs_snap_service_request_processor_t request_process
Reqeust processing.
Definition: snap-structs.h:315
vs_status_e(* vs_snap_service_periodical_processor_t)(void)
SNAP Periodical data.
Definition: snap-structs.h:209
vs_status_e
Status code.
Definition: status_code.h:77
#define ETH_ADDR_LEN
Definition: snap-structs.h:234
MAC address.
Definition: snap-structs.h:252
vs_status_e(* vs_snap_service_response_processor_t)(const struct vs_netif_t *netif, vs_snap_element_t element_id, bool is_ack, const uint8_t *response, const uint16_t response_sz)
SNAP Service Response Processor.
Definition: snap-structs.h:195
Provision interface structures.
uint32_t vs_snap_element_t
SNAP element ID.
Definition: snap-structs.h:70
vs_snap_service_periodical_processor_t periodical_process
Periodical task.
Definition: snap-structs.h:317
vs_status_e(* vs_netif_mac_t)(const struct vs_netif_t *netif, struct vs_mac_addr_t *mac_addr)
Get MAC address.
Definition: snap-structs.h:129
uint32_t received
Receives amount.
Definition: snap-structs.h:326
vs_netif_tx_t tx
Transmit data.
Definition: snap-structs.h:299
@ VS_SNAP_FLAG_ACK
Confirmation about receiving a correct packet.
Definition: snap-structs.h:245
vs_status_e(* vs_netif_tx_t)(struct vs_netif_t *netif, const uint8_t *data, const uint16_t data_sz)
Send data.
Definition: snap-structs.h:116
@ VS_SNAP_DEV_LOGGER
Logger role.
Definition: snap-structs.h:228
@ VS_SNAP_DEV_DEBUGGER
Debugger role.
Definition: snap-structs.h:230
@ VS_SNAP_DEV_CONTROL
Control role.
Definition: snap-structs.h:227
vs_snap_flags_e
SNAP Flags.
Definition: snap-structs.h:244
vs_status_e(* vs_snap_service_request_processor_t)(const struct vs_netif_t *netif, vs_snap_element_t element_id, const uint8_t *request, const uint16_t request_sz, uint8_t *response, const uint16_t response_buf_sz, uint16_t *response_sz)
SNAP Service Request Processor.
Definition: snap-structs.h:174
@ VS_SNAP_DEV_THING
Thing role.
Definition: snap-structs.h:226
void * user_data
User data.
Definition: snap-structs.h:294
SNAP service descriptor.
Definition: snap-structs.h:312
Network interface.
Definition: snap-structs.h:293
vs_status_e(* vs_snap_service_deinit_t)(void)
SNAP Service Destructor.
Definition: snap-structs.h:218
#define HTONL_IN_COMPILE_TIME(val)
Definition: provision-structs.h:87
void * user_data
User data.
Definition: snap-structs.h:313
@ VS_SNAP_DEV_GATEWAY
Gateway role.
Definition: snap-structs.h:225
#define VS_NETIF_PACKET_BUF_SIZE
Definition: snap-structs.h:286
vs_snap_service_id_t id
Service ID.
Definition: snap-structs.h:314
vs_ethernet_header_t eth_header
Ethernet header.
Definition: snap-structs.h:281
SNAP statistics.
Definition: snap-structs.h:324
vs_snap_device_role_e
Device roles.
Definition: snap-structs.h:224
vs_snap_service_response_processor_t response_process
Response processing.
Definition: snap-structs.h:316
vs_snap_service_deinit_t deinit
Destructor call.
Definition: snap-structs.h:318
uint32_t sent
Sends amount.
Definition: snap-structs.h:325
SNAP packet.
Definition: snap-structs.h:280
uint16_t vs_snap_transaction_id_t
SNAP transaction ID.
Definition: snap-structs.h:54
vs_netif_mac_t mac_addr
MAC address.
Definition: snap-structs.h:300
@ VS_SNAP_FLAG_NACK
Notification about rejecting a packet.
Definition: snap-structs.h:246
vs_status_e(* vs_netif_init_t)(struct vs_netif_t *netif, const vs_netif_rx_cb_t rx_cb, const vs_netif_process_cb_t process_cb)
Initializer.
Definition: snap-structs.h:143
@ VS_SNAP_DEV_INITIALIZER
Initializer role.
Definition: snap-structs.h:231
@ VS_SNAP_DEV_SNIFFER
Sniffer role.
Definition: snap-structs.h:229