Documentation

Documentation

Includes

stdint.h

#include <stdint.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_pin.h

#include "tuya_pin.h"
#include "tuya_pin.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_pin.h

#include "tuya_pin.h"
#include "tuya_pin.h"

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

tuya_error_code.h

#include "tuya_error_code.h"
#include "tuya_error_code.h"

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

stdarg.h

#include <stdarg.h>
#include 

ctype.h

#include <ctype.h>
#include 

stddef.h

#include <stddef.h>
#include 

tuya_cloud_error_code.h

#include "tuya_cloud_error_code.h"
#include "tuya_cloud_error_code.h"

tuya_error_code.h

#include "tuya_error_code.h"
#include "tuya_error_code.h"

lwip/sockets.h

#include "lwip/sockets.h"
#include "lwip/sockets.h"

lwip/if_api.h

#include "lwip/if_api.h"
#include "lwip/if_api.h"

lwip/netdb.h

#include "lwip/netdb.h"
#include "lwip/netdb.h"

lwip/sockets.h

#include "lwip/sockets.h"
#include "lwip/sockets.h"

lwip/errno.h

#include "lwip/errno.h"
#include "lwip/errno.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/tcpbase.h

#include "lwip/tcpbase.h"
#include "lwip/tcpbase.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/tcp.h

#include "lwip/tcp.h"
#include "lwip/tcp.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/altcp.h

#include "lwip/altcp.h"
#include "lwip/altcp.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/altcp.h

#include "lwip/altcp.h"
#include "lwip/altcp.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/netbuf.h

#include "lwip/netbuf.h"
#include "lwip/netbuf.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

httpd_opts.h

#include "httpd_opts.h"
#include "httpd_opts.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/altcp.h

#include "lwip/altcp.h"
#include "lwip/altcp.h"

lwip/prot/iana.h

#include "lwip/prot/iana.h"
#include "lwip/prot/iana.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

httpd_opts.h

#include "httpd_opts.h"
#include "httpd_opts.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/prot/iana.h

#include "lwip/prot/iana.h"
#include "lwip/prot/iana.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/apps/mdns_opts.h

#include "lwip/apps/mdns_opts.h"
#include "lwip/apps/mdns_opts.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/apps/mdns_opts.h

#include "lwip/apps/mdns_opts.h"
#include "lwip/apps/mdns_opts.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/apps/mqtt_opts.h

#include "lwip/apps/mqtt_opts.h"
#include "lwip/apps/mqtt_opts.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/prot/iana.h

#include "lwip/prot/iana.h"
#include "lwip/prot/iana.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/apps/mqtt.h

#include "lwip/apps/mqtt.h"
#include "lwip/apps/mqtt.h"

lwip/altcp.h

#include "lwip/altcp.h"
#include "lwip/altcp.h"

lwip/apps/netbiosns_opts.h

#include "lwip/apps/netbiosns_opts.h"
#include "lwip/apps/netbiosns_opts.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/apps/smtp_opts.h

#include "lwip/apps/smtp_opts.h"
#include "lwip/apps/smtp_opts.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/prot/iana.h

#include "lwip/prot/iana.h"
#include "lwip/prot/iana.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/apps/snmp_core.h

#include "lwip/apps/snmp_core.h"
#include "lwip/apps/snmp_core.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/apps/snmp_core.h

#include "lwip/apps/snmp_core.h"
#include "lwip/apps/snmp_core.h"

lwip/apps/snmp_threadsync.h

#include "lwip/apps/snmp_threadsync.h"
#include "lwip/apps/snmp_threadsync.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/apps/snmp_core.h

#include "lwip/apps/snmp_core.h"
#include "lwip/apps/snmp_core.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/apps/snmp_core.h

#include "lwip/apps/snmp_core.h"
#include "lwip/apps/snmp_core.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/apps/snmp_core.h

#include "lwip/apps/snmp_core.h"
#include "lwip/apps/snmp_core.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/apps/snmp_core.h

#include "lwip/apps/snmp_core.h"
#include "lwip/apps/snmp_core.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/apps/snmp_core.h

#include "lwip/apps/snmp_core.h"
#include "lwip/apps/snmp_core.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/apps/snmp_opts.h

#include "lwip/apps/snmp_opts.h"
#include "lwip/apps/snmp_opts.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/apps/sntp_opts.h

#include "lwip/apps/sntp_opts.h"
#include "lwip/apps/sntp_opts.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/prot/iana.h

#include "lwip/prot/iana.h"
#include "lwip/prot/iana.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/prot/iana.h

#include "lwip/prot/iana.h"
#include "lwip/prot/iana.h"

lwip/apps/tftp_opts.h

#include "lwip/apps/tftp_opts.h"
#include "lwip/apps/tftp_opts.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

arch/cc.h

#include "arch/cc.h"
#include "arch/cc.h"

stdio.h

#include <stdio.h>
#include 

stdlib.h

#include <stdlib.h>
#include 

stdio.h

#include <stdio.h>
#include 

stdlib.h

#include <stdlib.h>
#include 

stddef.h

#include <stddef.h> /* for size_t */
#include  /* for size_t */

stdint.h

#include <stdint.h>
#include 

inttypes.h

#include <inttypes.h>
#include 

limits.h

#include <limits.h>
#include 

unistd.h

#include <unistd.h>
#include 

ctype.h

#include <ctype.h>
#include 

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/etharp.h

#include "lwip/etharp.h"
#include "lwip/etharp.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

arch/perf.h

#include "arch/perf.h"
#include "arch/perf.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/udp.h

#include "lwip/udp.h"
#include "lwip/udp.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

errno.h

#include <errno.h>
#include 

LWIP_ERRNO_INCLUDE

#include LWIP_ERRNO_INCLUDE
#include LWIP_ERRNO_INCLUDE

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip4_addr.h

#include "lwip/ip4_addr.h"
#include "lwip/ip4_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/ip4.h

#include "lwip/ip4.h"
#include "lwip/ip4.h"

lwip/prot/ethernet.h

#include "lwip/prot/ethernet.h"
#include "lwip/prot/ethernet.h"

lwip/prot/etharp.h

#include "lwip/prot/etharp.h"
#include "lwip/prot/etharp.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip6.h

#include "lwip/ip6.h"
#include "lwip/ip6.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/prot/icmp.h

#include "lwip/prot/icmp.h"
#include "lwip/prot/icmp.h"

lwip/icmp6.h

#include "lwip/icmp6.h"
#include "lwip/icmp6.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/prot/icmp6.h

#include "lwip/prot/icmp6.h"
#include "lwip/prot/icmp6.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/ip4.h

#include "lwip/ip4.h"
#include "lwip/ip4.h"

lwip/ip6.h

#include "lwip/ip6.h"
#include "lwip/ip6.h"

lwip/prot/ip.h

#include "lwip/prot/ip.h"
#include "lwip/prot/ip.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip4_addr.h

#include "lwip/ip4_addr.h"
#include "lwip/ip4_addr.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/prot/ip4.h

#include "lwip/prot/ip4.h"
#include "lwip/prot/ip4.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/prot/ip6.h

#include "lwip/prot/ip6.h"
#include "lwip/prot/ip6.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

def.h

#include "def.h"
#include "def.h"

lwip/ip6_zone.h

#include "lwip/ip6_zone.h"
#include "lwip/ip6_zone.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/ip6.h

#include "lwip/ip6.h"
#include "lwip/ip6.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/ip4_addr.h

#include "lwip/ip4_addr.h"
#include "lwip/ip4_addr.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/priv/memp_std.h

#include "lwip/priv/memp_std.h"
#include "lwip/priv/memp_std.h"

lwip/priv/memp_priv.h

#include "lwip/priv/memp_priv.h"
#include "lwip/priv/memp_priv.h"

lwip/stats.h

#include "lwip/stats.h"
#include "lwip/stats.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/inet.h

#include "lwip/inet.h"
#include "lwip/inet.h"

lwip/sockets.h

#include "lwip/sockets.h"
#include "lwip/sockets.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/stats.h

#include "lwip/stats.h"
#include "lwip/stats.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/dhcp.h

#include "lwip/dhcp.h"
#include "lwip/dhcp.h"

lwip/autoip.h

#include "lwip/autoip.h"
#include "lwip/autoip.h"

lwip/priv/tcpip_priv.h

#include "lwip/priv/tcpip_priv.h"
#include "lwip/priv/tcpip_priv.h"

lwip/priv/api_msg.h

#include "lwip/priv/api_msg.h"
#include "lwip/priv/api_msg.h"

lwip/prot/ethernet.h

#include "lwip/prot/ethernet.h"
#include "lwip/prot/ethernet.h"

lwipopts.h

#include "lwipopts.h"
#include "lwipopts.h"

lwip/debug.h

#include "lwip/debug.h"
#include "lwip/debug.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/altcp.h

#include "lwip/altcp.h"
#include "lwip/altcp.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/igmp.h

#include "lwip/igmp.h"
#include "lwip/igmp.h"

lwip/api.h

#include "lwip/api.h"
#include "lwip/api.h"

lwip/priv/tcpip_priv.h

#include "lwip/priv/tcpip_priv.h"
#include "lwip/priv/tcpip_priv.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/mem.h

#include "lwip/mem.h"
#include "lwip/mem.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/mem.h

#include "lwip/mem.h"
#include "lwip/mem.h"

lwip/priv/mem_priv.h

#include "lwip/priv/mem_priv.h"
#include "lwip/priv/mem_priv.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/raw.h

#include "lwip/raw.h"
#include "lwip/raw.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/sockets.h

#include "lwip/sockets.h"
#include "lwip/sockets.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/tcp.h

#include "lwip/tcp.h"
#include "lwip/tcp.h"

lwip/mem.h

#include "lwip/mem.h"
#include "lwip/mem.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/icmp.h

#include "lwip/icmp.h"
#include "lwip/icmp.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/ip6.h

#include "lwip/ip6.h"
#include "lwip/ip6.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/prot/tcp.h

#include "lwip/prot/tcp.h"
#include "lwip/prot/tcp.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/tcpip.h

#include "lwip/tcpip.h"
#include "lwip/tcpip.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/timeouts.h

#include "lwip/timeouts.h"
#include "lwip/timeouts.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/prot/ip4.h

#include "lwip/prot/ip4.h"
#include "lwip/prot/ip4.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/prot/ethernet.h

#include "lwip/prot/ethernet.h"
#include "lwip/prot/ethernet.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/prot/ieee.h

#include "lwip/prot/ieee.h"
#include "lwip/prot/ieee.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/prot/ip4.h

#include "lwip/prot/ip4.h"
#include "lwip/prot/ip4.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/ip4_addr.h

#include "lwip/ip4_addr.h"
#include "lwip/ip4_addr.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/prot/ip6.h

#include "lwip/prot/ip6.h"
#include "lwip/prot/ip6.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/prot/ip6.h

#include "lwip/prot/ip6.h"
#include "lwip/prot/ip6.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/inet.h

#include "lwip/inet.h"
#include "lwip/inet.h"

lwip/errno.h

#include "lwip/errno.h"
#include "lwip/errno.h"

string.h

#include <string.h>
#include 

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/mem.h

#include "lwip/mem.h"
#include "lwip/mem.h"

lwip/memp.h

#include "lwip/memp.h"
#include "lwip/memp.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

arch/sys_arch.h

#include "arch/sys_arch.h"
#include "arch/sys_arch.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/tcpbase.h

#include "lwip/tcpbase.h"
#include "lwip/tcpbase.h"

lwip/mem.h

#include "lwip/mem.h"
#include "lwip/mem.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/icmp.h

#include "lwip/icmp.h"
#include "lwip/icmp.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/ip6.h

#include "lwip/ip6.h"
#include "lwip/ip6.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/timeouts.h

#include "lwip/timeouts.h"
#include "lwip/timeouts.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/prot/udp.h

#include "lwip/prot/udp.h"
#include "lwip/prot/udp.h"

netif/bridgeif_opts.h

#include "netif/bridgeif_opts.h"
#include "netif/bridgeif_opts.h"

lwip/err.h

#include "lwip/err.h"
#include "lwip/err.h"

lwip/prot/ethernet.h

#include "lwip/prot/ethernet.h"
#include "lwip/prot/ethernet.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/tcpip.h

#include "lwip/tcpip.h"
#include "lwip/tcpip.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/etharp.h

#include "lwip/etharp.h"
#include "lwip/etharp.h"

netif/ethernet.h

#include "netif/ethernet.h"
#include "netif/ethernet.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/prot/ethernet.h

#include "lwip/prot/ethernet.h"
#include "lwip/prot/ethernet.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

netif/lowpan6_opts.h

#include "netif/lowpan6_opts.h"
#include "netif/lowpan6_opts.h"

netif/lowpan6_common.h

#include "netif/lowpan6_common.h"
#include "netif/lowpan6_common.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

netif/lowpan6_opts.h

#include "netif/lowpan6_opts.h"
#include "netif/lowpan6_opts.h"

netif/lowpan6_common.h

#include "netif/lowpan6_common.h"
#include "netif/lowpan6_common.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/ip_addr.h

#include "lwip/ip_addr.h"
#include "lwip/ip_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

netif/lowpan6_opts.h

#include "netif/lowpan6_opts.h"
#include "netif/lowpan6_opts.h"

lwip/pbuf.h

#include "lwip/pbuf.h"
#include "lwip/pbuf.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

eui64.h

#include "eui64.h"
#include "eui64.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/pppcrypt.h

#include "netif/ppp/pppcrypt.h"
#include "netif/ppp/pppcrypt.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/stats.h

#include "lwip/stats.h"
#include "lwip/stats.h"

lwip/mem.h

#include "lwip/mem.h"
#include "lwip/mem.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/timeouts.h

#include "lwip/timeouts.h"
#include "lwip/timeouts.h"

lwip/ip6_addr.h

#include "lwip/ip6_addr.h"
#include "lwip/ip6_addr.h"

fsm.h

#include "fsm.h"
#include "fsm.h"

lcp.h

#include "lcp.h"
#include "lcp.h"

ccp.h

#include "ccp.h"
#include "ccp.h"

mppe.h

#include "mppe.h"
#include "mppe.h"

ipcp.h

#include "ipcp.h"
#include "ipcp.h"

ipv6cp.h

#include "ipv6cp.h"
#include "ipv6cp.h"

upap.h

#include "upap.h"
#include "upap.h"

chap-new.h

#include "chap-new.h"
#include "chap-new.h"

eap.h

#include "eap.h"
#include "eap.h"

vj.h

#include "vj.h"
#include "vj.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

ppp_settings.h

#include "ppp_settings.h"
#include "ppp_settings.h"

stdio.h

#include <stdio.h> /* formats */
#include  /* formats */

stdarg.h

#include <stdarg.h>
#include 

string.h

#include <string.h>
#include 

stdlib.h

#include <stdlib.h> /* strtol() */
#include  /* strtol() */

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/def.h

#include "lwip/def.h"
#include "lwip/def.h"

lwip/timeouts.h

#include "lwip/timeouts.h"
#include "lwip/timeouts.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

pppdebug.h

#include "pppdebug.h"
#include "pppdebug.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/priv/tcpip_priv.h

#include "lwip/priv/tcpip_priv.h"
#include "lwip/priv/tcpip_priv.h"

netif/ppp/ppp.h

#include "netif/ppp/ppp.h"
#include "netif/ppp/ppp.h"

netif/ppp/pppos.h

#include "netif/ppp/pppos.h"
#include "netif/ppp/pppos.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

lwip/arch.h

#include "lwip/arch.h"
#include "lwip/arch.h"

netif/ppp/polarssl/md4.h

#include "netif/ppp/polarssl/md4.h"
#include "netif/ppp/polarssl/md4.h"

netif/ppp/polarssl/md5.h

#include "netif/ppp/polarssl/md5.h"
#include "netif/ppp/polarssl/md5.h"

netif/ppp/polarssl/sha1.h

#include "netif/ppp/polarssl/sha1.h"
#include "netif/ppp/polarssl/sha1.h"

netif/ppp/polarssl/des.h

#include "netif/ppp/polarssl/des.h"
#include "netif/ppp/polarssl/des.h"

netif/ppp/polarssl/arc4.h

#include "netif/ppp/polarssl/arc4.h"
#include "netif/ppp/polarssl/arc4.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

lwip/etharp.h

#include "lwip/etharp.h"
#include "lwip/etharp.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

lwip/sys.h

#include "lwip/sys.h"
#include "lwip/sys.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

vj.h

#include "vj.h"
#include "vj.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

ppp.h

#include "ppp.h"
#include "ppp.h"

netif/ppp/ppp_opts.h

#include "netif/ppp/ppp_opts.h"
#include "netif/ppp/ppp_opts.h"

lwip/ip.h

#include "lwip/ip.h"
#include "lwip/ip.h"

lwip/priv/tcp_priv.h

#include "lwip/priv/tcp_priv.h"
#include "lwip/priv/tcp_priv.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

lwip/opt.h

#include "lwip/opt.h"
#include "lwip/opt.h"

netif/lowpan6.h

#include "netif/lowpan6.h"
#include "netif/lowpan6.h"

lwip/netif.h

#include "lwip/netif.h"
#include "lwip/netif.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

stdint.h

#include "stdint.h"
#include "stdint.h"

stdbool.h

#include "stdbool.h"
#include "stdbool.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_hal_mutex.h

#include "tuya_hal_mutex.h"
#include "tuya_hal_mutex.h"

tuya_hal_semaphore.h

#include "tuya_hal_semaphore.h"
#include "tuya_hal_semaphore.h"

uni_log.h

#include "uni_log.h"
#include "uni_log.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

time.h

#include "time.h"
#include "time.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

tuya_driver.h

#include "tuya_driver.h"
#include "tuya_driver.h"

tuya_uart_legacy.h

#include "tuya_uart_legacy.h"
#include "tuya_uart_legacy.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_wifi_defs.h

#include "tuya_cloud_wifi_defs.h"
#include "tuya_cloud_wifi_defs.h"

thing_config.h

#include "thing_config.h"
#include "thing_config.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_wifi_defs.h

#include "tuya_cloud_wifi_defs.h"
#include "tuya_cloud_wifi_defs.h"

tuya_iot_com_api.h

#include "tuya_iot_com_api.h"
#include "tuya_iot_com_api.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_base_defs.h

#include "tuya_cloud_base_defs.h"
#include "tuya_cloud_base_defs.h"

tuya_iot_com_api.h

#include "tuya_iot_com_api.h"
#include "tuya_iot_com_api.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

tuya_gw_audio_scene_api.h

#include "tuya_gw_audio_scene_api.h"
#include "tuya_gw_audio_scene_api.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_base_utilities.h

#include "tuya_base_utilities.h"
#include "tuya_base_utilities.h"

uni_msg_queue.h

#include "uni_msg_queue.h"
#include "uni_msg_queue.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_wifi_defs.h

#include "tuya_cloud_wifi_defs.h"
#include "tuya_cloud_wifi_defs.h"

tuya_hal_wifi.h

#include "tuya_hal_wifi.h"
#include "tuya_hal_wifi.h"

tuya_cloud_base_defs.h

#include "tuya_cloud_base_defs.h"
#include "tuya_cloud_base_defs.h"

tuya_iot_internal_api.h

#include "tuya_iot_internal_api.h"
#include "tuya_iot_internal_api.h"

tuya_error_code.h

#include "tuya_error_code.h"
#include "tuya_error_code.h"

hashmap.h

#include "hashmap.h"
#include "hashmap.h"

tuya_devos_activate.h

#include "tuya_devos_activate.h"
#include "tuya_devos_activate.h"

tuya_devos_entry.h

#include "tuya_devos_entry.h"
#include "tuya_devos_entry.h"

tuya_devos_netcfg.h

#include "tuya_devos_netcfg.h"
#include "tuya_devos_netcfg.h"

tuya_devos_netlink.h

#include "tuya_devos_netlink.h"
#include "tuya_devos_netlink.h"

tuya_devos_reset.h

#include "tuya_devos_reset.h"
#include "tuya_devos_reset.h"

tuya_devos_utils.h

#include "tuya_devos_utils.h"
#include "tuya_devos_utils.h"

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

tuya_hal_wired.h

#include "tuya_hal_wired.h"
#include "tuya_hal_wired.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

lan_protocol.h

#include "lan_protocol.h"
#include "lan_protocol.h"

tuya_cloud_wifi_defs.h

#include "tuya_cloud_wifi_defs.h"
#include "tuya_cloud_wifi_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

gw_intf.h

#include "gw_intf.h"
#include "gw_intf.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

gw_intf.h

#include "gw_intf.h"
#include "gw_intf.h"

tuya_ws_db.h

#include "tuya_ws_db.h"
#include "tuya_ws_db.h"

gw_intf.h

#include "gw_intf.h"
#include "gw_intf.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

gw_intf.h

#include "gw_intf.h"
#include "gw_intf.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

gw_intf.h

#include "gw_intf.h"
#include "gw_intf.h"

http_inf.h

#include "http_inf.h"
#include "http_inf.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

uni_log.h

#include "uni_log.h"
#include "uni_log.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

tuya_ir_ws_db.h

#include "tuya_ir_ws_db.h"
#include "tuya_ir_ws_db.h"

tuya_ir_code.h

#include "tuya_ir_code.h"
#include "tuya_ir_code.h"

mem_pool.h

#include "mem_pool.h"
#include "mem_pool.h"

tuya_system_dp.h

#include "tuya_system_dp.h"
#include "tuya_system_dp.h"

tuya_iot_com_api.h

#include "tuya_iot_com_api.h"
#include "tuya_iot_com_api.h"

uni_base64.h

#include "uni_base64.h"
#include "uni_base64.h"

tuya_system_dp.h

#include "tuya_system_dp.h"
#include "tuya_system_dp.h"

tuya_iot_internal_api.h

#include "tuya_iot_internal_api.h"
#include "tuya_iot_internal_api.h"

uni_msg_queue.h

#include "uni_msg_queue.h"
#include "uni_msg_queue.h"

string.h

#include "string.h"
#include "string.h"

tuya_cloud_error_code.h

#include "tuya_cloud_error_code.h"
#include "tuya_cloud_error_code.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

uni_log.h

#include "uni_log.h"
#include "uni_log.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

uni_network.h

#include "uni_network.h"
#include "uni_network.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

crc32i.h

#include "crc32i.h"
#include "crc32i.h"

uni_log.h

#include "uni_log.h"
#include "uni_log.h"

mem_pool.h"

#include "mem_pool.h" 
#include "mem_pool.h" 

aes_inf.h

#include "aes_inf.h"
#include "aes_inf.h"

mix_method.h

#include "mix_method.h"
#include "mix_method.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

lan_cluster_base.h

#include "lan_cluster_base.h"
#include "lan_cluster_base.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

lan_rpc.h

#include "lan_rpc.h"
#include "lan_rpc.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

lan_cluster_base.h

#include "lan_cluster_base.h"
#include "lan_cluster_base.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

lan_cluster_api.h

#include "lan_cluster_api.h"
#include "lan_cluster_api.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

lan_cluster_api.h

#include "lan_cluster_api.h"
#include "lan_cluster_api.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

lan_cluster_api.h

#include "lan_cluster_api.h"
#include "lan_cluster_api.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

lan_msg_reliable_trans.h

#include "lan_msg_reliable_trans.h"
#include "lan_msg_reliable_trans.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

mem_pool.h

#include "mem_pool.h"
#include "mem_pool.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

action.h

#include "action.h"
#include "action.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

scene_linkage.h

#include "scene_linkage.h"
#include "scene_linkage.h"

tuya_pin.h

#include "tuya_pin.h"
#include "tuya_pin.h"

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_wifi_defs.h

#include "tuya_cloud_wifi_defs.h"
#include "tuya_cloud_wifi_defs.h"

stdint.h

#include "stdint.h"
#include "stdint.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

mf_test.h

#include "mf_test.h"
#include "mf_test.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

mqtt_client.h

#include "mqtt_client.h"
#include "mqtt_client.h"

gw_intf.h

#include "gw_intf.h"
#include "gw_intf.h"

uni_rfc.h

#include "uni_rfc.h"
#include "uni_rfc.h"

tuya_hal_wifi.h

#include "tuya_hal_wifi.h"
#include "tuya_hal_wifi.h"

uni_pointer.h

#include "uni_pointer.h"
#include "uni_pointer.h"

stdint.h

#include <stdint.h>
#include 

stdbool.h

#include <stdbool.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

tuya_hal_wifi.h

#include "tuya_hal_wifi.h"
#include "tuya_hal_wifi.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

stdint.h

#include "stdint.h"
#include "stdint.h"

stdbool.h

#include "stdbool.h"
#include "stdbool.h"

stdint.h

#include "stdint.h"
#include "stdint.h"

stdbool.h

#include "stdbool.h"
#include "stdbool.h"

pegasus_frame.h

#include "pegasus_frame.h"
#include "pegasus_frame.h"

tuya_cloud_wifi_defs.h

#include "tuya_cloud_wifi_defs.h"
#include "tuya_cloud_wifi_defs.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_iot_dev_check.h

#include "tuya_iot_dev_check.h"
#include "tuya_iot_dev_check.h"

wifi_netcfg_frame_sniffer.h

#include "wifi_netcfg_frame_sniffer.h"
#include "wifi_netcfg_frame_sniffer.h"

wifi_netcfg_frame_transporter.h

#include "wifi_netcfg_frame_transporter.h"
#include "wifi_netcfg_frame_transporter.h"

netcfg_module.h

#include "netcfg_module.h"
#include "netcfg_module.h"

wl_cfg_com.h

#include "wl_cfg_com.h"
#include "wl_cfg_com.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

cJSON.h

#include "cJSON.h"
#include "cJSON.h"

rpc_udp.h

#include "rpc_udp.h"
#include "rpc_udp.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

base_rpc_com.h

#include "base_rpc_com.h"
#include "base_rpc_com.h"

hashmap.h

#include "hashmap.h"
#include "hashmap.h"

json_rpc.h

#include "json_rpc.h"
#include "json_rpc.h"

uni_thread.h

#include "uni_thread.h"
#include "uni_thread.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdio.h

#include <stdio.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_error_code.h

#include "tuya_error_code.h"
#include "tuya_error_code.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_svc_upgrade.h

#include "tuya_svc_upgrade.h"
#include "tuya_svc_upgrade.h"

tuya_base_utilities.h

#include "tuya_base_utilities.h"
#include "tuya_base_utilities.h"

stdint.h

#include <stdint.h>
#include 

assert.h

#include <assert.h>
#include 

stdint.h

#include <stdint.h>
#include 

string.h

#include <string.h>
#include 

sys/types.h

#include <sys/types.h>
#include 

libcoap.h

#include "libcoap.h"
#include "libcoap.h"

lwip/ip_addr.h

#include <lwip/ip_addr.h>
#include 

uip.h

#include "uip.h"
#include "uip.h"

coap_net.h

#include "coap_net.h"
#include "coap_net.h"

stdint.h

#include <stdint.h>
#include 

encode.h

#include "encode.h"
#include "encode.h"

option.h

#include "option.h"
#include "option.h"

pdu.h

#include "pdu.h"
#include "pdu.h"

coap_config.h

#include "coap_config.h"
#include "coap_config.h"

netinet/in.h

#include <netinet/in.h>
#include 

unistd.h

#include <unistd.h>
#include 

libcoap.h

#include "libcoap.h"
#include "libcoap.h"

address.h

#include "address.h"
#include "address.h"

async.h

#include "async.h"
#include "async.h"

bits.h

#include "bits.h"
#include "bits.h"

block.h

#include "block.h"
#include "block.h"

coap_dtls.h

#include "coap_dtls.h"
#include "coap_dtls.h"

coap_event.h

#include "coap_event.h"
#include "coap_event.h"

coap_io.h

#include "coap_io.h"
#include "coap_io.h"

coap_time.h

#include "coap_time.h"
#include "coap_time.h"

coap_debug.h

#include "coap_debug.h"
#include "coap_debug.h"

encode.h

#include "encode.h"
#include "encode.h"

coap_mem.h

#include "coap_mem.h"
#include "coap_mem.h"

coap_net.h

#include "coap_net.h"
#include "coap_net.h"

option.h

#include "option.h"
#include "option.h"

pdu.h

#include "pdu.h"
#include "pdu.h"

prng.h

#include "prng.h"
#include "prng.h"

resource.h

#include "resource.h"
#include "resource.h"

str.h

#include "str.h"
#include "str.h"

subscribe.h

#include "subscribe.h"
#include "subscribe.h"

uri.h

#include "uri.h"
#include "uri.h"

uni_log.h

#include "uni_log.h"
#include "uni_log.h"

syslog.h

#include <syslog.h>
#include 

pdu.h

#include "pdu.h"
#include "pdu.h"

coap_session.h

#include "coap_session.h"
#include "coap_session.h"

pdu.h

#include "pdu.h"
#include "pdu.h"

libcoap.h

#include "libcoap.h"
#include "libcoap.h"

libcoap.h

#include "libcoap.h"
#include "libcoap.h"

uthash.h

#include "uthash.h"
#include "uthash.h"

str.h

#include "str.h"
#include "str.h"

assert.h

#include <assert.h>
#include 

sys/types.h

#include <sys/types.h>
#include 

address.h

#include "address.h"
#include "address.h"

stdlib.h

#include <stdlib.h>
#include 

lwip/memp.h

#include <lwip/memp.h>
#include 

assert.h

#include <assert.h>
#include 

stdlib.h

#include <stdlib.h>
#include 

string.h

#include <string.h>
#include 

sys/time.h

#include <sys/time.h>
#include 

time.h

#include <time.h>
#include 

lwip/ip_addr.h

#include <lwip/ip_addr.h>
#include 

coap_io.h

#include "coap_io.h"
#include "coap_io.h"

coap_dtls.h

#include "coap_dtls.h"
#include "coap_dtls.h"

coap_event.h

#include "coap_event.h"
#include "coap_event.h"

coap_time.h

#include "coap_time.h"
#include "coap_time.h"

option.h

#include "option.h"
#include "option.h"

pdu.h

#include "pdu.h"
#include "pdu.h"

prng.h

#include "prng.h"
#include "prng.h"

coap_session.h

#include "coap_session.h"
#include "coap_session.h"

coap_io.h

#include "coap_io.h"
#include "coap_io.h"

coap_time.h

#include "coap_time.h"
#include "coap_time.h"

pdu.h

#include "pdu.h"
#include "pdu.h"

stdint.h

#include <stdint.h>
#include 

lwip/sys.h

#include <lwip/sys.h>
#include 

clock.h

#include "clock.h"
#include "clock.h"

stdint.h

#include <stdint.h>
#include 

stdint.h

#include <stdint.h>
#include 

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

uni_network.h

#include "uni_network.h"
#include "uni_network.h"

mem_pool.h

#include "mem_pool.h"
#include "mem_pool.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

coap_config.h

#include "coap_config.h"
#include "coap_config.h"

unistd.h

#include <unistd.h>
#include 

ws2tcpip.h

#include <ws2tcpip.h>
#include 

sys/socket.h

#include <sys/socket.h>
#include 

coap_config.h

#include "coap_config.h"
#include "coap_config.h"

net.h

#include <net.h>
#include 

resource.h

#include <resource.h>
#include 

subscribe.h

#include <subscribe.h>
#include 

bits.h

#include "bits.h"
#include "bits.h"

pdu.h

#include "pdu.h"
#include "pdu.h"

uri.h

#include "uri.h"
#include "uri.h"

lwip/pbuf.h

#include <lwip/pbuf.h>
#include 

stdint.h

#include <stdint.h>
#include 

string.h

#include <string.h>
#include 

stdlib.h

#include <stdlib.h>
#include 

uthash.h

#include "uthash.h"
#include "uthash.h"

async.h

#include "async.h"
#include "async.h"

str.h

#include "str.h"
#include "str.h"

pdu.h

#include "pdu.h"
#include "pdu.h"

coap_net.h

#include "coap_net.h"
#include "coap_net.h"

subscribe.h

#include "subscribe.h"
#include "subscribe.h"

string.h

#include <string.h>
#include 

address.h

#include "address.h"
#include "address.h"

coap_io.h

#include "coap_io.h"
#include "coap_io.h"

block.h

#include "block.h"
#include "block.h"

stdint.h

#include <stdint.h>
#include 

str.h

#include "str.h"
#include "str.h"

string.h

#include <string.h>  /* memcmp, memset, strlen */
#include   /* memcmp, memset, strlen */

stddef.h

#include <stddef.h>  /* ptrdiff_t */
#include   /* ptrdiff_t */

stdlib.h

#include <stdlib.h>  /* exit */
#include   /* exit */

stdint.h

#include <stdint.h>
#include 

stdint.h

#include <stdint.h>
#include 

stdint.h

#include <stdint.h>
#include 

assert.h

#include <assert.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

coap.h

#include "coap.h"
#include "coap.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

httpc.h

#include "httpc.h"
#include "httpc.h"

log_seq.h

#include "log_seq.h"
#include "log_seq.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

httpc.h

#include "httpc.h"
#include "httpc.h"

tuya_hal_mutex.h

#include "tuya_hal_mutex.h"
#include "tuya_hal_mutex.h"

time.h

#include <time.h>
#include 

uni_time.h

#include "uni_time.h"
#include "uni_time.h"

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

aes_alt.h

#include "aes_alt.h"
#include "aes_alt.h"

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

aes.h

#include "aes.h"
#include "aes.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

arc4_alt.h

#include "arc4_alt.h"
#include "arc4_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

platform_util.h

#include "platform_util.h"
#include "platform_util.h"

aria_alt.h

#include "aria_alt.h"
#include "aria_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

bignum.h

#include "bignum.h"
#include "bignum.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

asn1.h

#include "asn1.h"
#include "asn1.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

stdio.h

#include <stdio.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

platform_util.h

#include "platform_util.h"
#include "platform_util.h"

blowfish_alt.h

#include "blowfish_alt.h"
#include "blowfish_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

bignum.h

#include "bignum.h"
#include "bignum.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

platform_util.h

#include "platform_util.h"
#include "platform_util.h"

camellia_alt.h

#include "camellia_alt.h"
#include "camellia_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

cipher.h

#include "cipher.h"
#include "cipher.h"

ccm_alt.h

#include "ccm_alt.h"
#include "ccm_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stdint.h

#include <stdint.h>
#include 

stddef.h

#include <stddef.h>
#include 

chacha20_alt.h

#include "chacha20_alt.h"
#include "chacha20_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

poly1305.h

#include "poly1305.h"
#include "poly1305.h"

chacha20.h

#include "chacha20.h"
#include "chacha20.h"

chachapoly_alt.h

#include "chachapoly_alt.h"
#include "chachapoly_alt.h"

limits.h

#include <limits.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

platform_util.h

#include "platform_util.h"
#include "platform_util.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

cipher.h

#include "cipher.h"
#include "cipher.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

cipher.h

#include "cipher.h"
#include "cipher.h"

cmac_alt.h

#include "cmac_alt.h"
#include "cmac_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

tuya_tls_config_disable.h

#include "tuya_tls_config_disable.h"
#include "tuya_tls_config_disable.h"

tuya_tls_config_psk_only.h

#include "tuya_tls_config_psk_only.h"
#include "tuya_tls_config_psk_only.h"

tuya_tls_config_ecc_psk_cat1.h

#include "tuya_tls_config_ecc_psk_cat1.h"
#include "tuya_tls_config_ecc_psk_cat1.h"

tuya_tls_config_ecc_psk.h

#include "tuya_tls_config_ecc_psk.h"
#include "tuya_tls_config_ecc_psk.h"

tuya_tls_config_ecc_only_ipc.h

#include "tuya_tls_config_ecc_only_ipc.h"
#include "tuya_tls_config_ecc_only_ipc.h"

tuya_tls_config_ecc_only_nxp_se050.h

#include "tuya_tls_config_ecc_only_nxp_se050.h"
#include "tuya_tls_config_ecc_only_nxp_se050.h"

tuya_tls_config_ecc_only_homekit.h

#include "tuya_tls_config_ecc_only_homekit.h"
#include "tuya_tls_config_ecc_only_homekit.h"

tuya_tls_config_ecc_only.h

#include "tuya_tls_config_ecc_only.h"
#include "tuya_tls_config_ecc_only.h"

tuya_tls_config_no_strip.h

#include "tuya_tls_config_no_strip.h"
#include "tuya_tls_config_no_strip.h"

tuya_tls_config_ecc_only_nxp_se050.h

#include "tuya_tls_config_ecc_only_nxp_se050.h"
#include "tuya_tls_config_ecc_only_nxp_se050.h"

tuya_tls_config_ecc_client_auth.h

#include "tuya_tls_config_ecc_client_auth.h"
#include "tuya_tls_config_ecc_client_auth.h"

check_config.h

#include "check_config.h"
#include "check_config.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

aes.h

#include "aes.h"
#include "aes.h"

threading.h

#include "threading.h"
#include "threading.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ssl.h

#include "ssl.h"
#include "ssl.h"

ecp.h

#include "ecp.h"
#include "ecp.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

des_alt.h

#include "des_alt.h"
#include "des_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

bignum.h

#include "bignum.h"
#include "bignum.h"

dhm_alt.h

#include "dhm_alt.h"
#include "dhm_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ecp.h

#include "ecp.h"
#include "ecp.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ecp.h

#include "ecp.h"
#include "ecp.h"

md.h

#include "md.h"
#include "md.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ecp.h

#include "ecp.h"
#include "ecp.h"

md.h

#include "md.h"
#include "md.h"

ecjpake_alt.h

#include "ecjpake_alt.h"
#include "ecjpake_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

bignum.h

#include "bignum.h"
#include "bignum.h"

ecp_alt.h

#include "ecp_alt.h"
#include "ecp_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

sha512.h

#include "sha512.h"
#include "sha512.h"

sha256.h

#include "sha256.h"
#include "sha256.h"

threading.h

#include "threading.h"
#include "threading.h"

havege.h

#include "havege.h"
#include "havege.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

cipher.h

#include "cipher.h"
#include "cipher.h"

stdint.h

#include <stdint.h>
#include 

gcm_alt.h

#include "gcm_alt.h"
#include "gcm_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

md.h

#include "md.h"
#include "md.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

md.h

#include "md.h"
#include "md.h"

threading.h

#include "threading.h"
#include "threading.h"

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

md2_alt.h

#include "md2_alt.h"
#include "md2_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

md4_alt.h

#include "md4_alt.h"
#include "md4_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

md5_alt.h

#include "md5_alt.h"
#include "md5_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

md.h

#include "md.h"
#include "md.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

net_sockets.h

#include "net_sockets.h"
#include "net_sockets.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ssl.h

#include "ssl.h"
#include "ssl.h"

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

cipher.h

#include "cipher.h"
#include "cipher.h"

nist_kw_alt.h

#include "nist_kw_alt.h"
#include "nist_kw_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

asn1.h

#include "asn1.h"
#include "asn1.h"

pk.h

#include "pk.h"
#include "pk.h"

stddef.h

#include <stddef.h>
#include 

cipher.h

#include "cipher.h"
#include "cipher.h"

md.h

#include "md.h"
#include "md.h"

x509.h

#include "x509.h"
#include "x509.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

aes.h

#include "aes.h"
#include "aes.h"

stdint.h

#include <stdint.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

md.h

#include "md.h"
#include "md.h"

rsa.h

#include "rsa.h"
#include "rsa.h"

ecp.h

#include "ecp.h"
#include "ecp.h"

ecdsa.h

#include "ecdsa.h"
#include "ecdsa.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

pk.h

#include "pk.h"
#include "pk.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

x509_crt.h

#include "x509_crt.h"
#include "x509_crt.h"

pkcs11-helper-1.0/pkcs11h-certificate.h

#include <pkcs11-helper-1.0/pkcs11h-certificate.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

md.h

#include "md.h"
#include "md.h"

cipher.h

#include "cipher.h"
#include "cipher.h"

asn1.h

#include "asn1.h"
#include "asn1.h"

stddef.h

#include <stddef.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

asn1.h

#include "asn1.h"
#include "asn1.h"

md.h

#include "md.h"
#include "md.h"

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

platform_time.h

#include "platform_time.h"
#include "platform_time.h"

stdio.h

#include <stdio.h>
#include 

stdlib.h

#include <stdlib.h>
#include 

time.h

#include <time.h>
#include 

MBEDTLS_PLATFORM_STD_MEM_HDR

#include MBEDTLS_PLATFORM_STD_MEM_HDR
#include MBEDTLS_PLATFORM_STD_MEM_HDR

stddef.h

#include <stddef.h>
#include 

stdio.h

#include <stdio.h>
#include 

platform_alt.h

#include "platform_alt.h"
#include "platform_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

platform_time.h

#include "platform_time.h"
#include "platform_time.h"

time.h

#include <time.h>
#include 

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stdint.h

#include <stdint.h>
#include 

stddef.h

#include <stddef.h>
#include 

poly1305_alt.h

#include "poly1305_alt.h"
#include "poly1305_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

ripemd160.h

#include "ripemd160.h"
#include "ripemd160.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

bignum.h

#include "bignum.h"
#include "bignum.h"

md.h

#include "md.h"
#include "md.h"

threading.h

#include "threading.h"
#include "threading.h"

rsa_alt.h

#include "rsa_alt.h"
#include "rsa_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

bignum.h

#include "bignum.h"
#include "bignum.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

sha1_alt.h

#include "sha1_alt.h"
#include "sha1_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

sha256_alt.h

#include "sha256_alt.h"
#include "sha256_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

sha512_alt.h

#include "sha512_alt.h"
#include "sha512_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

bignum.h

#include "bignum.h"
#include "bignum.h"

ecp.h

#include "ecp.h"
#include "ecp.h"

ssl_ciphersuites.h

#include "ssl_ciphersuites.h"
#include "ssl_ciphersuites.h"

x509_crt.h

#include "x509_crt.h"
#include "x509_crt.h"

x509_crl.h

#include "x509_crl.h"
#include "x509_crl.h"

dhm.h

#include "dhm.h"
#include "dhm.h"

ecdh.h

#include "ecdh.h"
#include "ecdh.h"

zlib.h

#include "zlib.h"
#include "zlib.h"

platform_time.h

#include "platform_time.h"
#include "platform_time.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ssl.h

#include "ssl.h"
#include "ssl.h"

threading.h

#include "threading.h"
#include "threading.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

pk.h

#include "pk.h"
#include "pk.h"

cipher.h

#include "cipher.h"
#include "cipher.h"

md.h

#include "md.h"
#include "md.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ssl.h

#include "ssl.h"
#include "ssl.h"

threading.h

#include "threading.h"
#include "threading.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ssl.h

#include "ssl.h"
#include "ssl.h"

cipher.h

#include "cipher.h"
#include "cipher.h"

md5.h

#include "md5.h"
#include "md5.h"

sha1.h

#include "sha1.h"
#include "sha1.h"

sha256.h

#include "sha256.h"
#include "sha256.h"

sha512.h

#include "sha512.h"
#include "sha512.h"

ecjpake.h

#include "ecjpake.h"
#include "ecjpake.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

ssl.h

#include "ssl.h"
#include "ssl.h"

cipher.h

#include "cipher.h"
#include "cipher.h"

threading.h

#include "threading.h"
#include "threading.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stdlib.h

#include <stdlib.h>
#include 

pthread.h

#include <pthread.h>
#include 

threading_alt.h

#include "threading_alt.h"
#include "threading_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stdint.h

#include <stdint.h>
#include 

timing_alt.h

#include "timing_alt.h"
#include "timing_alt.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

asn1.h

#include "asn1.h"
#include "asn1.h"

pk.h

#include "pk.h"
#include "pk.h"

rsa.h

#include "rsa.h"
#include "rsa.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

x509.h

#include "x509.h"
#include "x509.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

x509.h

#include "x509.h"
#include "x509.h"

x509_crl.h

#include "x509_crl.h"
#include "x509_crl.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

x509.h

#include "x509.h"
#include "x509.h"

config.h

#include "config.h"
#include "config.h"

MBEDTLS_CONFIG_FILE

#include MBEDTLS_CONFIG_FILE
#include MBEDTLS_CONFIG_FILE

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

xtea_alt.h

#include "xtea_alt.h"
#include "xtea_alt.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

ssl.h

#include "ssl.h"
#include "ssl.h"

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

fsl_sss_ftr.h

#include "fsl_sss_ftr.h"
#include "fsl_sss_ftr.h"

fsl_sss_ftr_default.h

#include "fsl_sss_ftr_default.h"
#include "fsl_sss_ftr_default.h"

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_TARGET_CONFIG_FILE

YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE
#include YOTTA_CFG_MBEDTLS_USER_CONFIG_FILE

MBEDTLS_USER_CONFIG_FILE

#include MBEDTLS_USER_CONFIG_FILE
#include MBEDTLS_USER_CONFIG_FILE

stdint.h

#include "stdint.h"
#include "stdint.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_base_utilities.h

#include "tuya_base_utilities.h"
#include "tuya_base_utilities.h"

base_event_info.h

#include "base_event_info.h"
#include "base_event_info.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

uni_pointer.h

#include "uni_pointer.h"
#include "uni_pointer.h"

log_seq.h

#include "log_seq.h"
#include "log_seq.h"

log_seq.h

#include "log_seq.h"
#include "log_seq.h"

log_seq.h

#include "log_seq.h"
#include "log_seq.h"

log_seq.h

#include "log_seq.h"
#include "log_seq.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

uni_msg_queue.h

#include "uni_msg_queue.h"
#include "uni_msg_queue.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_base_utilities.h

#include "tuya_base_utilities.h"
#include "tuya_base_utilities.h"

uni_msg_queue.h

#include "uni_msg_queue.h"
#include "uni_msg_queue.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

uni_pointer.h

#include "uni_pointer.h"
#include "uni_pointer.h"

sys_timer.h

#include "sys_timer.h"
#include "sys_timer.h"

tuya_hal_system.h

#include "tuya_hal_system.h"
#include "tuya_hal_system.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdbool.h

#include <stdbool.h>
#include 

stdint.h

#include <stdint.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdbool.h

#include <stdbool.h>
#include 

stdint.h

#include <stdint.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdint.h

#include <stdint.h>
#include 

stdbool.h

#include <stdbool.h>
#include 

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdint.h

#include <stdint.h>
#include 

stdbool.h

#include <stdbool.h>
#include 

errno.h

#include <errno.h>
#include 

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdint.h

#include <stdint.h>
#include 

stdbool.h

#include <stdbool.h>
#include 

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdint.h

#include <stdint.h>
#include 

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdint.h

#include <stdint.h>
#include 

stdbool.h

#include <stdbool.h>
#include 

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdbool.h

#include <stdbool.h>
#include 

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdbool.h

#include <stdbool.h>
#include 

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

stddef.h

#include <stddef.h>
#include 

stdint.h

#include <stdint.h>
#include 

stdbool.h

#include <stdbool.h>
#include 

string.h

#include <string.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_os_adapter_error_code.h

#include "tuya_os_adapter_error_code.h"
#include "tuya_os_adapter_error_code.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

string.h

#include <string.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

sys_timer.h

#include "sys_timer.h"
#include "sys_timer.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

uni_time_queue.h

#include "uni_time_queue.h"
#include "uni_time_queue.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

stddef.h

#include <stddef.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

mem_pool.h

#include "mem_pool.h"
#include "mem_pool.h"

cJSON.h

#include "cJSON.h"
#include "cJSON.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

uni_pointer.h

#include "uni_pointer.h"
#include "uni_pointer.h"

uni_rfc.h

#include "uni_rfc.h"
#include "uni_rfc.h"

uni_queue.h

#include "uni_queue.h"
#include "uni_queue.h"

uni_slist.h

#include "uni_slist.h"
#include "uni_slist.h"

uni_hlist.h

#include "uni_hlist.h"
#include "uni_hlist.h"

uni_time.h

#include "uni_time.h"
#include "uni_time.h"

uni_thread.h

#include "uni_thread.h"
#include "uni_thread.h"

uni_network.h

#include "uni_network.h"
#include "uni_network.h"

mix_method.h

#include "mix_method.h"
#include "mix_method.h"

hashmap.h

#include "hashmap.h"
#include "hashmap.h"

tuya_hal_fs.h

#include "tuya_hal_fs.h"
#include "tuya_hal_fs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_iot_config.h

#include "tuya_iot_config.h"
#include "tuya_iot_config.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_error_code.h

#include "tuya_error_code.h"
#include "tuya_error_code.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

stdint.h

#include <stdint.h>
#include 

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_hal_mutex.h

#include "tuya_hal_mutex.h"
#include "tuya_hal_mutex.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_hal_system.h

#include "tuya_hal_system.h"
#include "tuya_hal_system.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

tuya_hal_wifi.h

#include "tuya_hal_wifi.h"
#include "tuya_hal_wifi.h"

tuya_hal_wifi.h

#include "tuya_hal_wifi.h"
#include "tuya_hal_wifi.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

tuya_hal_network.h

#include "tuya_hal_network.h"
#include "tuya_hal_network.h"

tuya_hal_wired.h

#include "tuya_hal_wired.h"
#include "tuya_hal_wired.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_base_utilities.h

#include "tuya_base_utilities.h"
#include "tuya_base_utilities.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

netcfg_module.h

#include "netcfg_module.h"
#include "netcfg_module.h"

lan_protocol.h

#include "lan_protocol.h"
#include "lan_protocol.h"

wifi_netcfg_frame_sniffer.h

#include "wifi_netcfg_frame_sniffer.h"
#include "wifi_netcfg_frame_sniffer.h"

tuya_ffs_inc.h

#include "tuya_ffs_inc.h"
#include "tuya_ffs_inc.h"

tuya_ffs_stream.h

#include "tuya_ffs_stream.h"
#include "tuya_ffs_stream.h"

wifi_netcfg_frame_transporter.h

#include "wifi_netcfg_frame_transporter.h"
#include "wifi_netcfg_frame_transporter.h"

http_manager.h

#include "http_manager.h"
#include "http_manager.h"

uni_time_queue.h

#include "uni_time_queue.h"
#include "uni_time_queue.h"

mbedtls/pk.h

#include "mbedtls/pk.h"
#include "mbedtls/pk.h"

tuya_ffs.h

#include "tuya_ffs.h"
#include "tuya_ffs.h"

tuya_ffs_config.h

#include "tuya_ffs_config.h"
#include "tuya_ffs_config.h"

netcfg_module.h

#include "netcfg_module.h"
#include "netcfg_module.h"

string.h

#include <string.h>
#include 

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

http_inf.h

#include "http_inf.h"
#include "http_inf.h"

ty_cJSON.h

#include "ty_cJSON.h"
#include "ty_cJSON.h"

tuya_hal_system.h

#include "tuya_hal_system.h"
#include "tuya_hal_system.h"

tuya_hal_thread.h

#include "tuya_hal_thread.h"
#include "tuya_hal_thread.h"

tuya_hal_wifi.h

#include "tuya_hal_wifi.h"
#include "tuya_hal_wifi.h"

uni_thread.h

#include "uni_thread.h"
#include "uni_thread.h"

uni_log.h

#include "uni_log.h"
#include "uni_log.h"

http_inf.h

#include "http_inf.h"
#include "http_inf.h"

tuya_tls.h

#include "tuya_tls.h"
#include "tuya_tls.h"

mem_pool.h

#include "mem_pool.h"
#include "mem_pool.h"

openssl/evp.h

#include <openssl/evp.h>
#include 

openssl/hmac.h

#include <openssl/hmac.h>
#include 

openssl/sha.h

#include <openssl/sha.h>
#include 

mbedtls/md.h

#include "mbedtls/md.h"
#include "mbedtls/md.h"

mbedtls/ecdh.h

#include "mbedtls/ecdh.h"
#include "mbedtls/ecdh.h"

mbedtls/ctr_drbg.h

#include "mbedtls/ctr_drbg.h"
#include "mbedtls/ctr_drbg.h"

mbedtls/sha256.h

#include "mbedtls/sha256.h"
#include "mbedtls/sha256.h"

mbedtls/base64.h

#include "mbedtls/base64.h"
#include "mbedtls/base64.h"

mbedtls/pk.h

#include "mbedtls/pk.h"
#include "mbedtls/pk.h"

tuya_cloud_com_defs.h

#include "tuya_cloud_com_defs.h"
#include "tuya_cloud_com_defs.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

wl_cfg_com.h

#include "wl_cfg_com.h"
#include "wl_cfg_com.h"

netcfg_module.h

#include "netcfg_module.h"
#include "netcfg_module.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

wl_cfg_com.h

#include "wl_cfg_com.h"
#include "wl_cfg_com.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

wl_cfg_com.h

#include "wl_cfg_com.h"
#include "wl_cfg_com.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

wl_cfg_com.h

#include "wl_cfg_com.h"
#include "wl_cfg_com.h"

netcfg_module.h

#include "netcfg_module.h"
#include "netcfg_module.h"

tuya_os_adapter.h

#include "tuya_os_adapter.h"
#include "tuya_os_adapter.h"

tuya_cloud_types.h

#include "tuya_cloud_types.h"
#include "tuya_cloud_types.h"

wf_basic_intf.h

#include "wf_basic_intf.h"
#include "wf_basic_intf.h"

Macros

Marco __TUYA_KEY_H

#define __TUYA_KEY_H


      

Marco __TUYA_LED_H

#define __TUYA_LED_H


      

Marco LED_TIMER_UNINIT

#define LED_TIMER_UNINIT 65535


      

Marco _SDK_VERSION_H

#define _SDK_VERSION_H


      

Marco BS_VER

#define BS_VER "40.00"


      

Marco PT_VER

#define PT_VER "2.2"


      

Marco LAN_PRO_VER

#define LAN_PRO_VER "3.4"  //必须3.3版本及以上才支持局域网加密功能


      

Marco LAN_PRO_VER

#define LAN_PRO_VER "3.2"  //3.3以下不支持局域网加密


      

Marco CAD_VER

#define CAD_VER "1.0.5" 
//1.0.5:支持mqtt和蓝牙通道同时在线时;互斥上报DP业务;云端对蓝牙上报数据不再过滤(解决数据去重问题).

Marco CD_VER

#define CD_VER "1.0.0" //固件支持mqtt消息确认


      

Marco DEV_ATTR_THINGCONFIG

#define DEV_ATTR_THINGCONFIG       (1 << 0)


      

Marco DEV_ATTR_THINGCONFIG

#define DEV_ATTR_THINGCONFIG       (0)


      

Marco DEV_ATTR_LOCAL_DEV_DP_QUERY

#define DEV_ATTR_LOCAL_DEV_DP_QUERY          (1<<1)


      

Marco DEV_ATTR_LOCAL_SCENE_LINKAGE

#define DEV_ATTR_LOCAL_SCENE_LINKAGE     (1<<2)


      

Marco DEV_ATTR_LOCAL_SCENE_LINKAGE

#define DEV_ATTR_LOCAL_SCENE_LINKAGE     (0)


      

Marco DEV_WIFI_SCAN_SUPPORT

#define DEV_WIFI_SCAN_SUPPORT            (1<<3)


      

Marco DEV_WIFI_SCAN_SUPPORT

#define DEV_WIFI_SCAN_SUPPORT            (0)


      

Marco DEV_ATTR_GOOGLE_LOCAL_HOME

#define DEV_ATTR_GOOGLE_LOCAL_HOME          (1<<4)


      

Marco DEV_ATTR_GOOGLE_LOCAL_HOME

#define DEV_ATTR_GOOGLE_LOCAL_HOME          (0<<4)


      

Marco DEV_ATTR_PEGASUS_CONFIG

#define DEV_ATTR_PEGASUS_CONFIG    (1 << 5)


      

Marco DEV_ATTR_PEGASUS_CONFIG

#define DEV_ATTR_PEGASUS_CONFIG    (0)


      

Marco DEV_ATTR_BLT_CONTROL

#define DEV_ATTR_BLT_CONTROL       (1 << 6)


      

Marco DEV_ATTR_BLT_CONTROL

#define DEV_ATTR_BLT_CONTROL       (0)


      

Marco DEV_ATTR_HOME_SECURITY

#define DEV_ATTR_HOME_SECURITY          (1<<7)


      

Marco DEV_ATTR_HOME_SECURITY

#define DEV_ATTR_HOME_SECURITY          (0<<7)


      

Marco DEV_ATTR_ASTRO_TIMER

#define DEV_ATTR_ASTRO_TIMER               (1<<9)


      

Marco DEV_ATTR_ASTRO_TIMER

#define DEV_ATTR_ASTRO_TIMER               (0)


      

Marco DEV_ATTR_WIFI_PROTECT

#define DEV_ATTR_WIFI_PROTECT              (1<<12)


      

Marco DEV_ATTR_WIFI_PROTECT

#define DEV_ATTR_WIFI_PROTECT              (0)


      

Marco DEV_ATTR_OTA

#define DEV_ATTR_OTA               (1<<11)


      

Marco DEV_ATTRIBUTE

#define DEV_ATTRIBUTE              (DEV_ATTR_THINGCONFIG | DEV_ATTR_LOCAL_DEV_DP_QUERY | DEV_ATTR_LOCAL_SCENE_LINKAGE | DEV_WIFI_SCAN_SUPPORT | DEV_ATTR_BLT_CONTROL | DEV_ATTR_GOOGLE_LOCAL_HOME | DEV_ATTR_ASTRO_TIMER | DEV_ATTR_PEGASUS_CONFIG | DEV_ATTR_WIFI_PROTECT)
//设备属性,采用按位与方式

Marco INT2STR(NUM)

#define INT2STR(NUM) #NUM


      

Marco I2S(R)

#define I2S(R) INT2STR(R)


      

Marco SDK_INFO_1

#define SDK_INFO_1 "< TUYA IOT SDK V:"IOT_SDK_VER" BS:"BS_VER"_PT:"PT_VER"_LAN:"LAN_PRO_VER"_CAD:"CAD_VER"_CD:"CD_VER" >"


      

Marco SDK_INFO_2

#define SDK_INFO_2 "< BUILD AT:"BUILD_DATE"_"BUILD_TIME" BY "GIT_USER" FOR "PROJECT_NAME" AT "TARGET_PLATFORM" >"


      

Marco SDK_IOT_ATTR

#define SDK_IOT_ATTR "IOT DEFS <"\
" WIFI_GW:"I2S(WIFI_GW)\
" DEBUG:"I2S(TUYA_IOT_DEBUG)\
" KV_FILE:"I2S(KV_FILE)\
" SHUTDOWN_MODE:"I2S(SHUTDOWN_MODE)\
" LITTLE_END:"I2S(LITTLE_END)\
" TLS_MODE:"I2S(TLS_MODE)\
" ENABLE_CLOUD_OPERATION:"I2S(ENABLE_CLOUD_OPERATION)\
" OPERATING_SYSTEM:"I2S(OPERATING_SYSTEM)\
" ENABLE_SYS_RPC:"I2S(ENABLE_SYS_RPC)\
" RELIABLE_TRANSFER:"I2S(RELIABLE_TRANSFER)\
" ENABLE_LAN_ENCRYPTION:"I2S(ENABLE_LAN_ENCRYPTION)\
" ENABLE_LAN_LINKAGE:"I2S(ENABLE_LAN_LINKAGE)\
" ENABLE_LAN_DEV:"I2S(ENABLE_LAN_DEV)\
" >"


      

Marco SDK_INFO

#define SDK_INFO SDK_INFO_1"\r\n"SDK_INFO_2"\r\n"SDK_IOT_ATTR"\r\n"


      

Marco TUYA_CLOUD_ERROR_CODE_H

#define TUYA_CLOUD_ERROR_CODE_H


      

Marco OPRT_INIT_MUTEX_ATTR_FAILED

#define OPRT_INIT_MUTEX_ATTR_FAILED        (-101)


      

Marco OPRT_SET_MUTEX_ATTR_FAILED

#define OPRT_SET_MUTEX_ATTR_FAILED         (-102)


      

Marco OPRT_DESTROY_MUTEX_ATTR_FAILED

#define OPRT_DESTROY_MUTEX_ATTR_FAILED     (-103)


      

Marco OPRT_INIT_MUTEX_FAILED

#define OPRT_INIT_MUTEX_FAILED             (-104)


      

Marco OPRT_MUTEX_LOCK_FAILED

#define OPRT_MUTEX_LOCK_FAILED             (-105)


      

Marco OPRT_MUTEX_TRYLOCK_FAILED

#define OPRT_MUTEX_TRYLOCK_FAILED          (-106)


      

Marco OPRT_MUTEX_LOCK_BUSY

#define OPRT_MUTEX_LOCK_BUSY               (-107)


      

Marco OPRT_MUTEX_UNLOCK_FAILED

#define OPRT_MUTEX_UNLOCK_FAILED           (-108)


      

Marco OPRT_MUTEX_RELEASE_FAILED

#define OPRT_MUTEX_RELEASE_FAILED          (-109)


      

Marco OPRT_MEM_PARTITION_EMPTY

#define OPRT_MEM_PARTITION_EMPTY           (-111)
//#define OPRT_CR_MUTEX_ERR                   (-110)

Marco OPRT_MEM_PARTITION_FULL

#define OPRT_MEM_PARTITION_FULL            (-112)


      

Marco OPRT_MEM_PARTITION_NOT_FOUND

#define OPRT_MEM_PARTITION_NOT_FOUND       (-113)


      

Marco OPRT_DONOT_FOUND_MODULE

#define OPRT_DONOT_FOUND_MODULE            (-114)


      

Marco OPRT_INIT_SEM_FAILED

#define OPRT_INIT_SEM_FAILED               (-201)


      

Marco OPRT_WAIT_SEM_FAILED

#define OPRT_WAIT_SEM_FAILED               (-202)


      

Marco OPRT_POST_SEM_FAILED

#define OPRT_POST_SEM_FAILED               (-203)


      

Marco OPRT_THRD_STA_UNVALID

#define OPRT_THRD_STA_UNVALID              (-301)


      

Marco OPRT_THRD_CR_FAILED

#define OPRT_THRD_CR_FAILED                (-302)


      

Marco OPRT_THRD_JOIN_FAILED

#define OPRT_THRD_JOIN_FAILED              (-303)


      

Marco OPRT_THRD_SELF_CAN_NOT_JOIN

#define OPRT_THRD_SELF_CAN_NOT_JOIN        (-304)


      

Marco OPRT_TIMERID_EXIST

#define OPRT_TIMERID_EXIST                 (-401)


      

Marco OPRT_TIMERID_NOT_FOUND

#define OPRT_TIMERID_NOT_FOUND             (-402)


      

Marco OPRT_TIMERID_UNVALID

#define OPRT_TIMERID_UNVALID               (-403)


      

Marco OPRT_GET_IDLE_TIMERID_ERROR

#define OPRT_GET_IDLE_TIMERID_ERROR        (-404)


      

Marco OPRT_MSG_NOT_FOUND

#define OPRT_MSG_NOT_FOUND                 (-501)


      

Marco OPRT_MSG_LIST_EMPTY

#define OPRT_MSG_LIST_EMPTY                (-502)


      

Marco OPRT_WIFI_SCAN_FAIL

#define OPRT_WIFI_SCAN_FAIL                (-601)


      

Marco OPRT_WF_MAC_SET_FAIL

#define OPRT_WF_MAC_SET_FAIL               (-602)


      

Marco OPRT_WF_CONN_FAIL

#define OPRT_WF_CONN_FAIL                  (-603)


      

Marco OPRT_WF_NW_CFG_FAIL

#define OPRT_WF_NW_CFG_FAIL                (-604)


      

Marco OPRT_WF_AP_SACN_FAIL

#define OPRT_WF_AP_SACN_FAIL               (-605)


      

Marco OPRT_WF_NOT_FIND_ASS_AP

#define OPRT_WF_NOT_FIND_ASS_AP            (-606)


      

Marco OPRT_DISCONNECTED_WITH_ROUTER

#define OPRT_DISCONNECTED_WITH_ROUTER      (-607)


      

Marco OPRT_BUF_NOT_ENOUGH

#define OPRT_BUF_NOT_ENOUGH                (-704)
//#define OPRT_SOCK_CONN_ERR                  (-703)

Marco OPRT_URL_PARAM_OUT_LIMIT

#define OPRT_URL_PARAM_OUT_LIMIT           (-705)


      

Marco OPRT_HTTP_OS_ERROR

#define OPRT_HTTP_OS_ERROR                 (-706)


      

Marco OPRT_HTTP_PR_REQ_ERROR

#define OPRT_HTTP_PR_REQ_ERROR             (-707)


      

Marco OPRT_HTTP_SD_REQ_ERROR

#define OPRT_HTTP_SD_REQ_ERROR             (-708)


      

Marco OPRT_HTTP_RD_ERROR

#define OPRT_HTTP_RD_ERROR                 (-709)


      

Marco OPRT_HTTP_AD_HD_ERROR

#define OPRT_HTTP_AD_HD_ERROR              (-710)


      

Marco OPRT_HTTP_GET_RESP_ERROR

#define OPRT_HTTP_GET_RESP_ERROR           (-711)


      

Marco OPRT_HTTP_AES_INIT_ERR

#define OPRT_HTTP_AES_INIT_ERR             (-712)


      

Marco OPRT_HTTP_AES_OPEN_ERR

#define OPRT_HTTP_AES_OPEN_ERR             (-713)


      

Marco OPRT_HTTP_AES_SET_KEY_ERR

#define OPRT_HTTP_AES_SET_KEY_ERR          (-714)


      

Marco OPRT_HTTP_AES_ENCRYPT_ERR

#define OPRT_HTTP_AES_ENCRYPT_ERR          (-715)


      

Marco OPRT_CR_HTTP_URL_H_ERR

#define OPRT_CR_HTTP_URL_H_ERR             (-716)


      

Marco OPRT_HTTPS_HANDLE_FAIL

#define OPRT_HTTPS_HANDLE_FAIL             (-717)


      

Marco OPRT_HTTPS_RESP_UNVALID

#define OPRT_HTTPS_RESP_UNVALID            (-718)


      

Marco OPRT_HTTPS_NO_SUPPORT_RANGE

#define OPRT_HTTPS_NO_SUPPORT_RANGE        (-719)


      

Marco OPRT_HTTPS_NOT_ENCRYPT_RET

#define OPRT_HTTPS_NOT_ENCRYPT_RET         (-720)


      

Marco OPRT_HTTP_FILL_URL_H_ERR

#define OPRT_HTTP_FILL_URL_H_ERR           (-721)


      

Marco OPRT_HTTP_FILL_URL_FULL_ERR

#define OPRT_HTTP_FILL_URL_FULL_ERR        (-722)


      

Marco OPRT_HTTP_FILL_DATA_ERR

#define OPRT_HTTP_FILL_DATA_ERR            (-723)


      

Marco OPRT_HTTP_URL_CFG_AI_SPEAKER_ERR

#define OPRT_HTTP_URL_CFG_AI_SPEAKER_ERR   (-724)


      

Marco OPRT_HTTP_URL_CFG_URL_ERR

#define OPRT_HTTP_URL_CFG_URL_ERR          (-725)


      

Marco OPRT_HTTP_URL_CFG_URL2IP_ERR

#define OPRT_HTTP_URL_CFG_URL2IP_ERR       (-726)


      

Marco OPRT_HTTP_URL_CFG_URL2IP_SELF_ERR

#define OPRT_HTTP_URL_CFG_URL2IP_SELF_ERR  (-727)


      

Marco OPRT_HTTP_URL_CFG_URL2IP_PSK_ERR

#define OPRT_HTTP_URL_CFG_URL2IP_PSK_ERR   (-728)


      

Marco OPRT_DP_ATTR_ILLEGAL

#define OPRT_DP_ATTR_ILLEGAL               (-902)
//#define OPRT_NOT_FOUND                      (-901)

Marco OPRT_DP_TYPE_PROP_ILLEGAL

#define OPRT_DP_TYPE_PROP_ILLEGAL          (-903)


      

Marco OPRT_DP_REPORT_CLOUD_ERR

#define OPRT_DP_REPORT_CLOUD_ERR           (-904)


      

Marco OPRT_NO_NEED_SET_PRODINFO

#define OPRT_NO_NEED_SET_PRODINFO          (-905)


      

Marco OPRT_NW_INVALID

#define OPRT_NW_INVALID                    (-906)


      

Marco OPRT_SELECT_ERR

#define OPRT_SELECT_ERR                    (-907)


      

Marco OPRT_SELECT_TM

#define OPRT_SELECT_TM                     (-908)


      

Marco OPRT_DEV_NOT_BIND

#define OPRT_DEV_NOT_BIND                  (-910)
//#define OPRT_SEND_ERR                       (-909)

Marco OPRT_FW_UG_FAILED

#define OPRT_FW_UG_FAILED                  (-911)


      

Marco OPRT_VER_FMT_ERR

#define OPRT_VER_FMT_ERR                   (-912)


      

Marco OPRT_FW_NOT_EXIST

#define OPRT_FW_NOT_EXIST                  (-913)


      

Marco OPRT_SEM_CR_ERR

#define OPRT_SEM_CR_ERR                    (-914)


      

Marco OPRT_SELECT_TIMEOUT

#define OPRT_SELECT_TIMEOUT                (-915)


      

Marco OPRT_GW_MQ_OFFLILNE

#define OPRT_GW_MQ_OFFLILNE                (-916)


      

Marco OPRT_NOT_SPT_CLX_DP

#define OPRT_NOT_SPT_CLX_DP                (-917)


      

Marco OPRT_UG_PKG_NOT_ENOUGH

#define OPRT_UG_PKG_NOT_ENOUGH             (-919)
//#define OPRT_RECV_ERR                       (-918)

Marco OPRT_SCMA_INVALID

#define OPRT_SCMA_INVALID                  (-920)


      

Marco OPRT_PRODECT_KEY_NULL

#define OPRT_PRODECT_KEY_NULL              (-921)


      

Marco OPRT_DEVICE_VER_NULL

#define OPRT_DEVICE_VER_NULL               (-922)


      

Marco OPRT_MSG_OUT_OF_LMT

#define OPRT_MSG_OUT_OF_LMT                (-923)


      

Marco OPRT_NOT_FOUND_AUTH_SSID

#define OPRT_NOT_FOUND_AUTH_SSID           (-924)


      

Marco OPRT_SOCKET_FAULT

#define OPRT_SOCKET_FAULT                  (-925)


      

Marco OPRT_MQ_PUBLISH_TIMEOUT

#define OPRT_MQ_PUBLISH_TIMEOUT            (-926)


      

Marco OPRT_GW_NOT_EXIST

#define OPRT_GW_NOT_EXIST                  (-927)


      

Marco OPRT_GW_SCHEMA_SIZE_LMT_OUT

#define OPRT_GW_SCHEMA_SIZE_LMT_OUT        (-928)


      

Marco OPRT_DEV_DP_CNT_INVALID

#define OPRT_DEV_DP_CNT_INVALID            (-929)


      

Marco OPRT_TOKEN_OVERTIME

#define OPRT_TOKEN_OVERTIME                (-930)


      

Marco OPRT_WF_NW_CFG_RECV_CONTINUE

#define OPRT_WF_NW_CFG_RECV_CONTINUE       (-931)


      

Marco OPRT_SERV_VRFY_FAIL

#define OPRT_SERV_VRFY_FAIL                (-933)
//#define OPRT_RECV_DA_NOT_ENOUGH             (-932)

Marco OPRT_NO_AUTHENTICATION

#define OPRT_NO_AUTHENTICATION             (-936)
//#define OPRT_KVS_RD_FAIL                    (-935)

Marco OPRT_CMD_OUT_OF_TIME_NOT_EXEC

#define OPRT_CMD_OUT_OF_TIME_NOT_EXEC      (-937)


      

Marco OPRT_CMD_NOT_EXEC

#define OPRT_CMD_NOT_EXEC                  (-938)


      

Marco OPRT_LAN_NO_CLIENT

#define OPRT_LAN_NO_CLIENT                 (-940)
//#define OPRT_CRC32_FAILED                   (-939)

Marco OPRT_WF_INTF_LACK_REG_CB

#define OPRT_WF_INTF_LACK_REG_CB           (-941)


      

Marco OPRT_WF_INTF_NO_REG_CB

#define OPRT_WF_INTF_NO_REG_CB             (-942)


      

Marco OPRT_STORAGE_UPLOAD

#define OPRT_STORAGE_UPLOAD                (-943)


      

Marco OPRT_DP_ID_NOT_FOUND

#define OPRT_DP_ID_NOT_FOUND               (-944)


      

Marco OPRT_DP_TP_NOT_MATCH

#define OPRT_DP_TP_NOT_MATCH               (-945)


      

Marco OPRT_DEV_NEED_REGISTER

#define OPRT_DEV_NEED_REGISTER             (-946)


      

Marco OPRT_DEV_RESET_FACTORY

#define OPRT_DEV_RESET_FACTORY             (-947)


      

Marco OPRT_API_VERSION_WRONG

#define OPRT_API_VERSION_WRONG             (-948)


      

Marco OPRT_DEV_ALREADY_BIND

#define OPRT_DEV_ALREADY_BIND              (-949)


      

Marco OPRT_API_DECODE_FAILED

#define OPRT_API_DECODE_FAILED             (-950)


      

Marco OPRT_API_TOKEN_EXPIRE

#define OPRT_API_TOKEN_EXPIRE              (-951)


      

Marco OPRT_NOT_EXISTS

#define OPRT_NOT_EXISTS                    (-952)


      

Marco OPRT_DP_ALREADY_PROCESS

#define OPRT_DP_ALREADY_PROCESS            (-953)


      

Marco OPRT_API_VERIFY_FAILED

#define OPRT_API_VERIFY_FAILED             (-954)


      

Marco OPRT_FILE_IS_FULL

#define OPRT_FILE_IS_FULL                  (-999)


      

Marco OPRT_WRITE_FILE_FAILED

#define OPRT_WRITE_FILE_FAILED             (-1000)


      

Marco OPRT_OPEN_FILE_FAILED

#define OPRT_OPEN_FILE_FAILED              (-1001)


      

Marco OPRT_PRINT_LOG_LEVEL_HIGHER

#define OPRT_PRINT_LOG_LEVEL_HIGHER        (-1002)


      

Marco OPRT_FORMAT_STRING_FAILED

#define OPRT_FORMAT_STRING_FAILED          (-1003)


      

Marco OPRT_STRING_TOO_LONG

#define OPRT_STRING_TOO_LONG               (-1004)


      

Marco OPRT_WR_FLASH_ERROR

#define OPRT_WR_FLASH_ERROR                (-1005)


      

Marco OPRT_ROUTER_NOT_FIND

#define OPRT_ROUTER_NOT_FIND               (-1006)


      

Marco OPRT_SECURITY_VERIFY_NOT_OK

#define OPRT_SECURITY_VERIFY_NOT_OK        (-1008)
//#define OPRT_EXCEED_UPPER_LIMIT             (-1007)

Marco OPRT_FLASH_NOT_ENOUGH_PAGE

#define OPRT_FLASH_NOT_ENOUGH_PAGE         (-1009)


      

Marco OPRT_ERASE_FLASH_ERROR

#define OPRT_ERASE_FLASH_ERROR             (-1088) // check the return value by custom


      

Marco OPRT_OSS_OPERATION_INIT_FAILED

#define OPRT_OSS_OPERATION_INIT_FAILED     (-1100)


      

Marco OPRT_OSS_OPERATION_UPDATE_FAILED

#define OPRT_OSS_OPERATION_UPDATE_FAILED   (-1101)


      

Marco OPRT_OSS_OPERATION_UPLOAD_FAILED

#define OPRT_OSS_OPERATION_UPLOAD_FAILED   (-1102)


      

Marco OPRT_MOTION_DETECTION_ALARM_PACK_REPORT_FAILED

#define OPRT_MOTION_DETECTION_ALARM_PACK_REPORT_FAILED     (-1103)


      

Marco OPRT_TRANSFER_INIT_FAILED

#define OPRT_TRANSFER_INIT_FAILED          (-1104)


      

Marco OPRT_LOG_SEQ_LOCKED

#define OPRT_LOG_SEQ_LOCKED                (-1200)


      

Marco OPRT_LOG_SEQ_DONT_LOCKED

#define OPRT_LOG_SEQ_DONT_LOCKED           (-1201)


      
      
#define OPRT_LOCAL_LINK_IGNORE             (-1300)


      
      
#define OPRT_LOCAL_LINK_CONTINUE           (-1301)


      

Marco OPRT_IMG_PROC_IMG_TYPE

#define OPRT_IMG_PROC_IMG_TYPE             (-1201)   


      

Marco OPRT_IMG_PROC_IMG_SIZE

#define OPRT_IMG_PROC_IMG_SIZE             (-1202) 


      

Marco OPRT_IMG_PROC_PTR_NULL

#define OPRT_IMG_PROC_PTR_NULL             (-1203)


      

Marco OPRT_IMG_PROC_ARRAY_SIZE

#define OPRT_IMG_PROC_ARRAY_SIZE           (-1204) 


      

Marco OPRT_IMG_PROC_SCALE_SIZE

#define OPRT_IMG_PROC_SCALE_SIZE           (-1205) 


      

Marco OPRT_IMG_PROC_PARA_ERROR

#define OPRT_IMG_PROC_PARA_ERROR           (-1206)


      

Marco OPRT_EVENT_STATUS_INVALID

#define OPRT_EVENT_STATUS_INVALID          (-2000)
/* ipc related */

Marco OPRT_ENCRYPT_KEY_UPDATED

#define OPRT_ENCRYPT_KEY_UPDATED           (-2001)


      

Marco OPRT_ORDER_EXPIRE

#define OPRT_ORDER_EXPIRE                  (-2002)


      

Marco OPRT_NO_MORE_DATA

#define OPRT_NO_MORE_DATA                  (-2003)


      

Marco OPRT_CLOUD_STORAGE_OFF

#define OPRT_CLOUD_STORAGE_OFF			    (-2004)


      

Marco OPRT_CLOUD_STORAGE_STATUS_INVALID

#define OPRT_CLOUD_STORAGE_STATUS_INVALID  (-2005)


      

Marco OPRT_REMOTE_API_RUN_UNKNOW_FAILED

#define OPRT_REMOTE_API_RUN_UNKNOW_FAILED  (-2006)


      

Marco OPRT_DEVICE_REMOVED

#define OPRT_DEVICE_REMOVED                (-2007)


      

Marco OPRT_SIGNATURE_ERROR

#define OPRT_SIGNATURE_ERROR               (-2008)


      

Marco OPRT_DEVICE_NOT_WRONG

#define OPRT_DEVICE_NOT_WRONG              (-2009)


      

Marco OPRT_WORK_NUM_EXIST

#define OPRT_WORK_NUM_EXIST                (-2010)


      

Marco OPRT_SERVER_NOT_CONNECTED

#define OPRT_SERVER_NOT_CONNECTED          (-2011)


      

Marco OPRT_AUTH_FAIL

#define OPRT_AUTH_FAIL                     (-2012)


      

Marco OPRT_LOCAL_AI_FACE_NOT_INIT

#define OPRT_LOCAL_AI_FACE_NOT_INIT        (-2013)


      

Marco OPRT_LOCAL_AI_FACE_DB_ERROR

#define OPRT_LOCAL_AI_FACE_DB_ERROR        (-2014)


      

Marco OPRT_UPLOAD_INTERRUPT_ERROR

#define OPRT_UPLOAD_INTERRUPT_ERROR        (-2015)


      

Marco OPRT_DEVICE_IS_SUB_NODE_OR_IN_ELECTION

#define OPRT_DEVICE_IS_SUB_NODE_OR_IN_ELECTION        (-2016)


      

Marco OPRT_WARN_LIVING_CHROMECAST

#define OPRT_WARN_LIVING_CHROMECAST        (148)


      

Marco OPRT_WARN_LIVING_ECHOSHOW

#define OPRT_WARN_LIVING_ECHOSHOW          (149)


      

Marco OPRT_INFO_QUIT_CHROMECAST

#define OPRT_INFO_QUIT_CHROMECAST          (150)


      

Marco OPRT_INFO_QUIT_ECHOSHOW

#define OPRT_INFO_QUIT_ECHOSHOW            (151)


      

Marco MQTT_DEF_ERR

#define MQTT_DEF_ERR                       (-3000)
//mqtt

Marco MQTT_INVALID_PARM

#define MQTT_INVALID_PARM                  (-3001)


      

Marco MQTT_MALLOC_FAILED

#define MQTT_MALLOC_FAILED                 (-3002)


      

Marco MQTT_DNS_PARSED_FAILED

#define MQTT_DNS_PARSED_FAILED             (-3010)


      

Marco MQTT_SOCK_CREAT_FAILED

#define MQTT_SOCK_CREAT_FAILED             (-3011)


      

Marco MQTT_SOCK_CET_FAILED

#define MQTT_SOCK_CET_FAILED               (-3012)


      

Marco MQTT_TCP_CONNECD_FAILED

#define MQTT_TCP_CONNECD_FAILED            (-3013)


      

Marco MQTT_TCP_TLS_CONNECD_FAILED

#define MQTT_TCP_TLS_CONNECD_FAILED        (-3014)


      

Marco MQTT_PACK_SEND_FAILED

#define MQTT_PACK_SEND_FAILED              (-3015)


      

Marco MQTT_RECV_DATA_FORMAT_WRONG

#define MQTT_RECV_DATA_FORMAT_WRONG        (-3016)


      

Marco MQTT_RECV_DATA_MSGID_NOT_MATCH

#define MQTT_RECV_DATA_MSGID_NOT_MATCH     (-3017)


      

Marco MQTT_START_TM_MSG_ERR

#define MQTT_START_TM_MSG_ERR              (-3018)


      

Marco MQTT_OVER_MAX_MESSAGE_LEN

#define MQTT_OVER_MAX_MESSAGE_LEN          (-3019)


      

Marco MQTT_PING_SEND_ERR

#define MQTT_PING_SEND_ERR                 (-3020)


      

Marco TUYA_CLOUD_TYPES_H

#define TUYA_CLOUD_TYPES_H


      

Marco FALSE

#define FALSE 0


      

Marco TRUE

#define TRUE 1


      

Marco IN

#define IN


      

Marco OUT

#define OUT


      

Marco INOUT

#define INOUT


      

Marco VOID

#define VOID void


      

Marco VOID_T

#define VOID_T void


      

Marco CONST

#define CONST const


      

Marco STATIC

#define STATIC static


      

Marco SIZEOF

#define SIZEOF sizeof


      

Marco INLINE

#define INLINE inline


      

Marco NULL

#define NULL 0


      

Marco NULL

#define NULL ((void *)0)


      

Marco true

#define true 1


      

Marco false

#define false 0


      

Marco MAX(a,b)

#define MAX(a,b) (((a) > (b)) ? (a) : (b))


      

Marco MIN(a,b)

#define MIN(a,b) (((a) < (b)) ? (a) : (b))


      

Marco BIT(nr)

#define BIT(nr)    (1UL << (nr))


      

Marco MAKEWORD(a, b)

#define MAKEWORD(a, b) ((WORD_T)(((BYTE_T)(a)) | ((WORD_T)((BYTE_T)(b))) << 8))


      

Marco MAKELONG(a, b)

#define MAKELONG(a, b) ((LONG_T)(((WORD_T)(a)) | ((DWORD_T)((WORD_T)(b))) << 16))


      

Marco LOWORD(l)

#define LOWORD(l) ((WORD_T)(l))


      

Marco HIWORD(l)

#define HIWORD(l) ((WORD_T)(((DWORD_T)(l) >> 16) & 65535))


      

Marco LOBYTE(w)

#define LOBYTE(w) ((BYTE_T)(w))


      

Marco HIBYTE(w)

#define HIBYTE(w) ((BYTE_T)(((WORD_T)(w) >> 8) & 255))


      

Marco WORD_SWAP(X)

#define WORD_SWAP(X)   (((X << 8) | (X >> 8))&65535)


      

Marco DWORD_SWAP(X)

#define DWORD_SWAP(X)  ( (((X)&255)<<24) + \
                         (((X)&65280)<<8) + \
                         (((X)&16711680)>>8) + \
                         (((X)&4278190080)>>24) )


      

Marco DDWORD_SWAP(X)

#define DDWORD_SWAP(X) { \
   unsigned long temp_low, temp_high; \
   temp_low = DWORD_SWAP((unsigned long)((X) & 4294967295)); \
   temp_high = DWORD_SWAP((unsigned long)((X) >> 32)); \
   X = 0; \
   X |= temp_low; \
   X <<= 32; \
   X |= temp_high;\
}


      

Marco UNI_NTOHS(X)

#define UNI_NTOHS(X) WORD_SWAP(X)


      

Marco UNI_HTONS(X)

#define UNI_HTONS(X) WORD_SWAP(X)


      

Marco UNI_NTOHL(X)

#define UNI_NTOHL(X) DWORD_SWAP(X)


      

Marco UNI_HTONL(X)

#define UNI_HTONL(X) DWORD_SWAP(X)


      

Marco UNI_NTOHLL(X)

#define UNI_NTOHLL(X) DDWORD_SWAP(X)


      

Marco UNI_HTONLL(X)

#define UNI_HTONLL(X) DDWORD_SWAP(X)


      

Marco UNI_NTOHS(X)

#define UNI_NTOHS(X) X


      

Marco UNI_HTONS(X)

#define UNI_HTONS(X) X


      

Marco UNI_NTOHL(X)

#define UNI_NTOHL(X) X


      

Marco UNI_HTONL(X)

#define UNI_HTONL(X) X


      

Marco UNI_NTOHLL(X)

#define UNI_NTOHLL(X) X


      

Marco UNI_HTONLL(X)

#define UNI_HTONLL(X) X


      

Marco OFFSOF(s,m)

#define OFFSOF(s,m) ((SIZE_T)(&(((s*)0)->m)))


      

Marco CNTSOF(a)

#define CNTSOF(a)  (sizeof(a)/sizeof(a[0]))


      

Marco CNTR_OF(ptr, type, member)

#define CNTR_OF(ptr, type, member) \
       ({(type *)( (char *)ptr - OFFSOF(type,member) );}) // continer of


      

Marco TUYA_ERROR_CODE_H

#define TUYA_ERROR_CODE_H


      

Marco OPRT_OK

#define OPRT_OK                                           (0) //0, 执行成功
/****************************************************************************
            the error code marco define for module GLOBAL 
****************************************************************************/

Marco OPRT_COM_ERROR

#define OPRT_COM_ERROR                                    (-1) //-1, 通用错误


      

Marco OPRT_INVALID_PARM

#define OPRT_INVALID_PARM                                 (-2) //-2, 无效的入参


      

Marco OPRT_MALLOC_FAILED

#define OPRT_MALLOC_FAILED                                (-3) //-3, 内存分配失败


      

Marco OPRT_NOT_SUPPORTED

#define OPRT_NOT_SUPPORTED                                (-4) //-4, 不支持


      

Marco OPRT_NETWORK_ERROR

#define OPRT_NETWORK_ERROR                                (-5) //-5, 网络错误


      

Marco OPRT_NOT_FOUND

#define OPRT_NOT_FOUND                                    (-6) //-6, 没有找到对象


      

Marco OPRT_CR_CJSON_ERR

#define OPRT_CR_CJSON_ERR                                 (-7) //-7, 创建json对象失败


      

Marco OPRT_CJSON_PARSE_ERR

#define OPRT_CJSON_PARSE_ERR                              (-8) //-8, json解析失败


      

Marco OPRT_CJSON_GET_ERR

#define OPRT_CJSON_GET_ERR                                (-9) //-9, 获取json对象失败


      

Marco OPRT_CR_MUTEX_ERR

#define OPRT_CR_MUTEX_ERR                                 (0a) //-10, 创建信号量失败


      

Marco OPRT_SOCK_ERR

#define OPRT_SOCK_ERR                                     (0b) //-11, 创建socket失败


      

Marco OPRT_SET_SOCK_ERR

#define OPRT_SET_SOCK_ERR                                 (0c) //-12, socket设置失败


      

Marco OPRT_SOCK_CONN_ERR

#define OPRT_SOCK_CONN_ERR                                (0d) //-13, socket连接失败


      

Marco OPRT_SEND_ERR

#define OPRT_SEND_ERR                                     (0e) //-14, 发送失败


      

Marco OPRT_RECV_ERR

#define OPRT_RECV_ERR                                     (-15) //-15, 接收失败


      

Marco OPRT_RECV_DA_NOT_ENOUGH

#define OPRT_RECV_DA_NOT_ENOUGH                           (-16) //-16, 接收数据不完整


      

Marco OPRT_KVS_WR_FAIL

#define OPRT_KVS_WR_FAIL                                  (-17) //-17, KV写失败


      

Marco OPRT_KVS_RD_FAIL

#define OPRT_KVS_RD_FAIL                                  (-18) //-18, KV读失败


      

Marco OPRT_CRC32_FAILED

#define OPRT_CRC32_FAILED                                 (-19) //-19, CRC校验失败


      

Marco OPRT_TIMEOUT

#define OPRT_TIMEOUT                                      (-20) //-20, 超时


      

Marco OPRT_INIT_MORE_THAN_ONCE

#define OPRT_INIT_MORE_THAN_ONCE                          (-21) //-21, 初始化超过一次


      

Marco OPRT_INDEX_OUT_OF_BOUND

#define OPRT_INDEX_OUT_OF_BOUND                           (-22) //-22, 索引越界


      

Marco OPRT_RESOURCE_NOT_READY

#define OPRT_RESOURCE_NOT_READY                           (-23) //-23, 资源未完善


      

Marco OPRT_EXCEED_UPPER_LIMIT

#define OPRT_EXCEED_UPPER_LIMIT                           (-24) //-24, 超过上限


      

Marco OPRT_FILE_NOT_FIND

#define OPRT_FILE_NOT_FIND                                (-25) //-25, 文件未找到


      

Marco OPRT_GLOBAL_ERRCODE_MAX_CNT

#define OPRT_GLOBAL_ERRCODE_MAX_CNT 26


      

Marco OPRT_BASE_OS_ADAPTER_REG_NULL_ERROR

#define OPRT_BASE_OS_ADAPTER_REG_NULL_ERROR               (-256) //-256, 系统适配注册失败
/****************************************************************************
            the error code marco define for module BASE_OS_ADAPTER 
****************************************************************************/

Marco OPRT_BASE_OS_ADAPTER_INIT_MUTEX_ATTR_FAILED

#define OPRT_BASE_OS_ADAPTER_INIT_MUTEX_ATTR_FAILED       (-257) //-257, 初始化同步属性失败


      

Marco OPRT_BASE_OS_ADAPTER_SET_MUTEX_ATTR_FAILED

#define OPRT_BASE_OS_ADAPTER_SET_MUTEX_ATTR_FAILED        (-258) //-258, 设置同步属性失败


      

Marco OPRT_BASE_OS_ADAPTER_DESTROY_MUTEX_ATTR_FAILED

#define OPRT_BASE_OS_ADAPTER_DESTROY_MUTEX_ATTR_FAILED    (-259) //-259, 销毁同步属性失败


      

Marco OPRT_BASE_OS_ADAPTER_INIT_MUTEX_FAILED

#define OPRT_BASE_OS_ADAPTER_INIT_MUTEX_FAILED            (-260) //-260, 初始化互斥量失败


      

Marco OPRT_BASE_OS_ADAPTER_MUTEX_LOCK_FAILED

#define OPRT_BASE_OS_ADAPTER_MUTEX_LOCK_FAILED            (-261) //-261, 互斥量加锁失败


      

Marco OPRT_BASE_OS_ADAPTER_MUTEX_TRYLOCK_FAILED

#define OPRT_BASE_OS_ADAPTER_MUTEX_TRYLOCK_FAILED         (-262) //-262, 互斥量尝试加锁失败


      

Marco OPRT_BASE_OS_ADAPTER_MUTEX_LOCK_BUSY

#define OPRT_BASE_OS_ADAPTER_MUTEX_LOCK_BUSY              (-263) //-263, 互斥量忙


      

Marco OPRT_BASE_OS_ADAPTER_MUTEX_UNLOCK_FAILED

#define OPRT_BASE_OS_ADAPTER_MUTEX_UNLOCK_FAILED          (-264) //-264, 互斥量解锁失败


      

Marco OPRT_BASE_OS_ADAPTER_MUTEX_RELEASE_FAILED

#define OPRT_BASE_OS_ADAPTER_MUTEX_RELEASE_FAILED         (-265) //-265, 互斥量释放失败


      

Marco OPRT_BASE_OS_ADAPTER_CR_MUTEX_ERR

#define OPRT_BASE_OS_ADAPTER_CR_MUTEX_ERR                 (-16a) //-266, 互斥量创建失败


      

Marco OPRT_BASE_OS_ADAPTER_MEM_PARTITION_EMPTY

#define OPRT_BASE_OS_ADAPTER_MEM_PARTITION_EMPTY          (-16b) //-267, 内存分区空


      

Marco OPRT_BASE_OS_ADAPTER_MEM_PARTITION_FULL

#define OPRT_BASE_OS_ADAPTER_MEM_PARTITION_FULL           (-16c) //-268, 内存分区满


      

Marco OPRT_BASE_OS_ADAPTER_MEM_PARTITION_NOT_FOUND

#define OPRT_BASE_OS_ADAPTER_MEM_PARTITION_NOT_FOUND      (-16d) //-269, 内存分区不存在


      

Marco OPRT_BASE_OS_ADAPTER_INIT_SEM_FAILED

#define OPRT_BASE_OS_ADAPTER_INIT_SEM_FAILED              (-16e) //-270, 初始化信号量失败


      

Marco OPRT_BASE_OS_ADAPTER_WAIT_SEM_FAILED

#define OPRT_BASE_OS_ADAPTER_WAIT_SEM_FAILED              (-271) //-271, 等待信号量失败


      

Marco OPRT_BASE_OS_ADAPTER_POST_SEM_FAILED

#define OPRT_BASE_OS_ADAPTER_POST_SEM_FAILED              (-272) //-272, 释放信号量失败


      

Marco OPRT_BASE_OS_ADAPTER_THRD_STA_UNVALID

#define OPRT_BASE_OS_ADAPTER_THRD_STA_UNVALID             (-273) //-273, 线程状态非法


      

Marco OPRT_BASE_OS_ADAPTER_THRD_CR_FAILED

#define OPRT_BASE_OS_ADAPTER_THRD_CR_FAILED               (-274) //-274, 线程创建失败


      

Marco OPRT_BASE_OS_ADAPTER_THRD_JOIN_FAILED

#define OPRT_BASE_OS_ADAPTER_THRD_JOIN_FAILED             (-275) //-275, 线程JOIN函数调用失败


      

Marco OPRT_BASE_OS_ADAPTER_THRD_SELF_CAN_NOT_JOIN

#define OPRT_BASE_OS_ADAPTER_THRD_SELF_CAN_NOT_JOIN       (-276) //-276, 自身线程不能调用JOIN函数


      

Marco OPRT_BASE_OS_ADAPTER_ERRCODE_MAX_CNT

#define OPRT_BASE_OS_ADAPTER_ERRCODE_MAX_CNT 21


      

Marco OPRT_BASE_UTILITIES_PARTITION_EMPTY

#define OPRT_BASE_UTILITIES_PARTITION_EMPTY               (-512) //-512, 无空闲链表
/****************************************************************************
            the error code marco define for module BASE_UTILITIES 
****************************************************************************/

Marco OPRT_BASE_UTILITIES_PARTITION_FULL

#define OPRT_BASE_UTILITIES_PARTITION_FULL                (-513) //-513, 链表已满


      

Marco OPRT_BASE_UTILITIES_PARTITION_NOT_FOUND

#define OPRT_BASE_UTILITIES_PARTITION_NOT_FOUND           (-514) //-514, 链表未遍历到


      

Marco OPRT_BASE_UTILITIES_ERRCODE_MAX_CNT

#define OPRT_BASE_UTILITIES_ERRCODE_MAX_CNT 3


      

Marco OPRT_BASE_SECURITY_CRC32_FAILED

#define OPRT_BASE_SECURITY_CRC32_FAILED                   (-768) //-768, CRC32错误
/****************************************************************************
            the error code marco define for module BASE_SECURITY 
****************************************************************************/

Marco OPRT_BASE_SECURITY_ERRCODE_MAX_CNT

#define OPRT_BASE_SECURITY_ERRCODE_MAX_CNT 1


      

Marco OPRT_BASE_LOG_MNG_DONOT_FOUND_MODULE

#define OPRT_BASE_LOG_MNG_DONOT_FOUND_MODULE              (-1024) //-1024, 未发现log模块
/****************************************************************************
            the error code marco define for module BASE_LOG_MNG 
****************************************************************************/

Marco OPRT_BASE_LOG_MNG_PRINT_LOG_LEVEL_HIGHER

#define OPRT_BASE_LOG_MNG_PRINT_LOG_LEVEL_HIGHER          (-1025) //-1025, log级别低


      

Marco OPRT_BASE_LOG_MNG_FORMAT_STRING_FAILED

#define OPRT_BASE_LOG_MNG_FORMAT_STRING_FAILED            (-1026) //-1026, log字符串格式化失败


      

Marco OPRT_BASE_LOG_MNG_LOG_SEQ_OPEN_FILE_FAIL

#define OPRT_BASE_LOG_MNG_LOG_SEQ_OPEN_FILE_FAIL          (-1027) //-1027, 打开日志序文件失败


      

Marco OPRT_BASE_LOG_MNG_LOG_SEQ_WRITE_FILE_FAIL

#define OPRT_BASE_LOG_MNG_LOG_SEQ_WRITE_FILE_FAIL         (-1028) //-1028, 写日志序文件失败


      

Marco OPRT_BASE_LOG_MNG_LOG_SEQ_FILE_FULL

#define OPRT_BASE_LOG_MNG_LOG_SEQ_FILE_FULL               (-1029) //-1029, 日志序文件满


      

Marco OPRT_BASE_LOG_MNG_LOG_SEQ_FILE_NOT_EXIST

#define OPRT_BASE_LOG_MNG_LOG_SEQ_FILE_NOT_EXIST          (-1030) //-1030, 日志序文件不存在


      

Marco OPRT_BASE_LOG_MNG_LOG_SEQ_NAME_INVALIDE

#define OPRT_BASE_LOG_MNG_LOG_SEQ_NAME_INVALIDE           (-1031) //-1031, 日志序名称无效


      

Marco OPRT_BASE_LOG_MNG_LOG_SEQ_CREATE_FAIL

#define OPRT_BASE_LOG_MNG_LOG_SEQ_CREATE_FAIL             (-1032) //-1032, 日志序创建失败


      

Marco OPRT_BASE_LOG_MNG_ERRCODE_MAX_CNT

#define OPRT_BASE_LOG_MNG_ERRCODE_MAX_CNT 9


      

Marco OPRT_BASE_TIMEQ_TIMERID_EXIST

#define OPRT_BASE_TIMEQ_TIMERID_EXIST                     (-1536) //-1536, 定时器ID已存在
/****************************************************************************
            the error code marco define for module BASE_TIMEQ 
****************************************************************************/

Marco OPRT_BASE_TIMEQ_TIMERID_NOT_FOUND

#define OPRT_BASE_TIMEQ_TIMERID_NOT_FOUND                 (-1537) //-1537, 未找到指定定时器ID


      

Marco OPRT_BASE_TIMEQ_TIMERID_UNVALID

#define OPRT_BASE_TIMEQ_TIMERID_UNVALID                   (-1538) //-1538, 定时器ID非法


      

Marco OPRT_BASE_TIMEQ_GET_IDLE_TIMERID_ERROR

#define OPRT_BASE_TIMEQ_GET_IDLE_TIMERID_ERROR            (-1539) //-1539, 获取空闲定时器ID错误


      

Marco OPRT_BASE_TIMEQ_ERRCODE_MAX_CNT

#define OPRT_BASE_TIMEQ_ERRCODE_MAX_CNT 4


      

Marco OPRT_BASE_MSGQ_NOT_FOUND

#define OPRT_BASE_MSGQ_NOT_FOUND                          (-1792) //-1792, 消息未找到
/****************************************************************************
            the error code marco define for module BASE_MSGQ 
****************************************************************************/

Marco OPRT_BASE_MSGQ_LIST_EMPTY

#define OPRT_BASE_MSGQ_LIST_EMPTY                         (-1793) //-1793, 列表为空


      

Marco OPRT_BASE_MSGQ_ERRCODE_MAX_CNT

#define OPRT_BASE_MSGQ_ERRCODE_MAX_CNT 2


      

Marco OPRT_MID_HTTP_BUF_NOT_ENOUGH

#define OPRT_MID_HTTP_BUF_NOT_ENOUGH                      (-2048) //-2048, 缓冲区长度不足
/****************************************************************************
            the error code marco define for module MID_HTTP 
****************************************************************************/

Marco OPRT_MID_HTTP_URL_PARAM_OUT_LIMIT

#define OPRT_MID_HTTP_URL_PARAM_OUT_LIMIT                 (-2049) //-2049, URL长度超出限制


      

Marco OPRT_MID_HTTP_OS_ERROR

#define OPRT_MID_HTTP_OS_ERROR                            (-2050) //-2050, 系统错误


      

Marco OPRT_MID_HTTP_PR_REQ_ERROR

#define OPRT_MID_HTTP_PR_REQ_ERROR                        (-2051) //-2051, 准备请求错误


      

Marco OPRT_MID_HTTP_SD_REQ_ERROR

#define OPRT_MID_HTTP_SD_REQ_ERROR                        (-2052) //-2052, 发送请求错误


      

Marco OPRT_MID_HTTP_RD_ERROR

#define OPRT_MID_HTTP_RD_ERROR                            (-2053) //-2053, 读取错误


      

Marco OPRT_MID_HTTP_AD_HD_ERROR

#define OPRT_MID_HTTP_AD_HD_ERROR                         (-2054) //-2054, 添加头错误


      

Marco OPRT_MID_HTTP_GET_RESP_ERROR

#define OPRT_MID_HTTP_GET_RESP_ERROR                      (-2055) //-2055, 获取应答错误


      

Marco OPRT_MID_HTTP_AES_INIT_ERR

#define OPRT_MID_HTTP_AES_INIT_ERR                        (-2056) //-2056, AES初始化错误


      

Marco OPRT_MID_HTTP_AES_OPEN_ERR

#define OPRT_MID_HTTP_AES_OPEN_ERR                        (-2057) //-2057, AES打开错误


      

Marco OPRT_MID_HTTP_AES_SET_KEY_ERR

#define OPRT_MID_HTTP_AES_SET_KEY_ERR                     (-128a) //-2058, AES设置KEY错误


      

Marco OPRT_MID_HTTP_AES_ENCRYPT_ERR

#define OPRT_MID_HTTP_AES_ENCRYPT_ERR                     (-128b) //-2059, AES加密错误


      

Marco OPRT_MID_HTTP_CR_HTTP_URL_H_ERR

#define OPRT_MID_HTTP_CR_HTTP_URL_H_ERR                   (-128c) //-2060, 创建HTTP URL头错误


      

Marco OPRT_MID_HTTP_HTTPS_HANDLE_FAIL

#define OPRT_MID_HTTP_HTTPS_HANDLE_FAIL                   (-128d) //-2061, HTTPS句柄错误


      

Marco OPRT_MID_HTTP_HTTPS_RESP_UNVALID

#define OPRT_MID_HTTP_HTTPS_RESP_UNVALID                  (-128e) //-2062, HTTPS无效应答


      

Marco OPRT_MID_HTTP_NO_SUPPORT_RANGE

#define OPRT_MID_HTTP_NO_SUPPORT_RANGE                    (-2063) //-2063, 不支持断点续传


      

Marco OPRT_MID_HTTP_ERRCODE_MAX_CNT

#define OPRT_MID_HTTP_ERRCODE_MAX_CNT 16


      

Marco OPRT_MID_MQTT_DEF_ERR

#define OPRT_MID_MQTT_DEF_ERR                             (-2304) //-2304, 定义失败
/****************************************************************************
            the error code marco define for module MID_MQTT 
****************************************************************************/

Marco OPRT_MID_MQTT_INVALID_PARM

#define OPRT_MID_MQTT_INVALID_PARM                        (-2305) //-2305, 参数无效


      

Marco OPRT_MID_MQTT_MALLOC_FAILED

#define OPRT_MID_MQTT_MALLOC_FAILED                       (-2306) //-2306, 内存申请失败


      

Marco OPRT_MID_MQTT_DNS_PARSED_FAILED

#define OPRT_MID_MQTT_DNS_PARSED_FAILED                   (-2307) //-2307, DNS解析失败


      

Marco OPRT_MID_MQTT_SOCK_CREAT_FAILED

#define OPRT_MID_MQTT_SOCK_CREAT_FAILED                   (-2308) //-2308, socket创建失败


      

Marco OPRT_MID_MQTT_SOCK_SET_FAILED

#define OPRT_MID_MQTT_SOCK_SET_FAILED                     (-2309) //-2309, socket set失败


      

Marco OPRT_MID_MQTT_TCP_CONNECD_FAILED

#define OPRT_MID_MQTT_TCP_CONNECD_FAILED                  (-2310) //-2310, tcp连接失败


      

Marco OPRT_MID_MQTT_TCP_TLS_CONNECD_FAILED

#define OPRT_MID_MQTT_TCP_TLS_CONNECD_FAILED              (-2311) //-2311, tcp tls连接失败


      

Marco OPRT_MID_MQTT_PACK_SEND_FAILED

#define OPRT_MID_MQTT_PACK_SEND_FAILED                    (-2312) //-2312, 包发送失败


      

Marco OPRT_MID_MQTT_RECV_DATA_FORMAT_WRONG

#define OPRT_MID_MQTT_RECV_DATA_FORMAT_WRONG              (-2313) //-2313, 接收数据格式错误


      

Marco OPRT_MID_MQTT_MSGID_NOT_MATCH

#define OPRT_MID_MQTT_MSGID_NOT_MATCH                     (-144a) //-2314, 接收数据msgid未找到


      

Marco OPRT_MID_MQTT_START_TM_MSG_ERR

#define OPRT_MID_MQTT_START_TM_MSG_ERR                    (-144b) //-2315, 开始事件msg错误


      

Marco OPRT_MID_MQTT_OVER_MAX_MESSAGE_LEN

#define OPRT_MID_MQTT_OVER_MAX_MESSAGE_LEN                (-144c) //-2316, 超过消息最大长度


      

Marco OPRT_MID_MQTT_PING_SEND_ERR

#define OPRT_MID_MQTT_PING_SEND_ERR                       (-144d) //-2317, ping发送失败


      

Marco OPRT_MID_MQTT_PUBLISH_TIMEOUT

#define OPRT_MID_MQTT_PUBLISH_TIMEOUT                     (-144e) //-2318, 发布超时


      

Marco OPRT_MID_MQTT_ERRCODE_MAX_CNT

#define OPRT_MID_MQTT_ERRCODE_MAX_CNT 15


      

Marco OPRT_MID_TLS_NET_SOCKET_ERROR

#define OPRT_MID_TLS_NET_SOCKET_ERROR                     (0a00) //-2560, Failed to open a socket
/****************************************************************************
            the error code marco define for module MID_TLS 
****************************************************************************/

Marco OPRT_MID_TLS_NET_CONNECT_ERROR

#define OPRT_MID_TLS_NET_CONNECT_ERROR                    (0a01) //-2561, The connection to the given server / port failed.


      

Marco OPRT_MID_TLS_UNKNOWN_HOST_ERROR

#define OPRT_MID_TLS_UNKNOWN_HOST_ERROR                   (0a02) //-2562, Failed to get an IP address for the given hostname.


      

Marco OPRT_MID_TLS_CONNECTION_ERROR

#define OPRT_MID_TLS_CONNECTION_ERROR                     (0a03) //-2563, TLS连接失败


      

Marco OPRT_MID_TLS_DRBG_ENTROPY_ERROR

#define OPRT_MID_TLS_DRBG_ENTROPY_ERROR                   (0a04) //-2564, mbedtls随机种子生成失败


      

Marco OPRT_MID_TLS_X509_ROOT_CRT_PARSE_ERROR

#define OPRT_MID_TLS_X509_ROOT_CRT_PARSE_ERROR            (0a05) //-2565, X509根证书解析失败


      

Marco OPRT_MID_TLS_X509_DEVICE_CRT_PARSE_ERROR

#define OPRT_MID_TLS_X509_DEVICE_CRT_PARSE_ERROR          (0a06) //-2566, X509设备证书解析失败


      

Marco OPRT_MID_TLS_CTR_DRBG_ENTROPY_SOURCE_ERROR

#define OPRT_MID_TLS_CTR_DRBG_ENTROPY_SOURCE_ERROR        (0a07) //-2567, The entropy source failed


      

Marco OPRT_MID_TLS_PK_PRIVATE_KEY_PARSE_ERROR

#define OPRT_MID_TLS_PK_PRIVATE_KEY_PARSE_ERROR           (0a08) //-2568, 秘钥解析失败


      

Marco OPRT_MID_TLS_ERRCODE_MAX_CNT

#define OPRT_MID_TLS_ERRCODE_MAX_CNT 9


      

Marco OPRT_SVC_WIFI_NETCFG_RECV_CONTINUE

#define OPRT_SVC_WIFI_NETCFG_RECV_CONTINUE                (0b00) //-2816, 继续接收配网包
/****************************************************************************
            the error code marco define for module SVC_WIFI_NETCFG 
****************************************************************************/

Marco OPRT_SVC_WIFI_NETCFG_ERRCODE_MAX_CNT

#define OPRT_SVC_WIFI_NETCFG_ERRCODE_MAX_CNT 1


      

Marco OPRT_SVC_MF_TEST_UPDATE_DATA_LEN_EXECED

#define OPRT_SVC_MF_TEST_UPDATE_DATA_LEN_EXECED           (0d00) //-3328, 升级数据长度超过处理上限
/****************************************************************************
            the error code marco define for module SVC_MF_TEST 
****************************************************************************/

Marco OPRT_SVC_MF_TEST_UPDATE_CRC_ERROR

#define OPRT_SVC_MF_TEST_UPDATE_CRC_ERROR                 (0d01) //-3329, 升级crc校验失败


      

Marco OPRT_SVC_MF_TEST_ERRCODE_MAX_CNT

#define OPRT_SVC_MF_TEST_ERRCODE_MAX_CNT 2


      

Marco OPRT_SVC_DP_ALREADY_PROCESS

#define OPRT_SVC_DP_ALREADY_PROCESS                       (0e00) //-3584, DP已经处理
/****************************************************************************
            the error code marco define for module SVC_DP 
****************************************************************************/

Marco OPRT_SVC_DP_ID_NOT_FOUND

#define OPRT_SVC_DP_ID_NOT_FOUND                          (0e01) //-3585, DP ID没有发现


      

Marco OPRT_SVC_DP_TP_NOT_MATCH

#define OPRT_SVC_DP_TP_NOT_MATCH                          (0e02) //-3586, DP 类型未匹配


      

Marco OPRT_SVC_DP_DEVICE_NOT_BINDED

#define OPRT_SVC_DP_DEVICE_NOT_BINDED                     (0e03) //-3587, 设备未绑定


      

Marco OPRT_SVC_DP_TYPE_PROP_ILLEGAL

#define OPRT_SVC_DP_TYPE_PROP_ILLEGAL                     (0e04) //-3588, 类型属性不合法


      

Marco OPRT_SVC_DP_NW_INVALID

#define OPRT_SVC_DP_NW_INVALID                            (0e05) //-3589, 网络无效


      

Marco OPRT_SVC_DP_SECURITY_VERIFY_ERR

#define OPRT_SVC_DP_SECURITY_VERIFY_ERR                   (0e06) //-3590, 安全校验失败


      

Marco OPRT_SVC_DP_REPORT_FINISH

#define OPRT_SVC_DP_REPORT_FINISH                         (0e07) //-3591, DP上报已结束


      

Marco OPRT_SVC_DP_ERRCODE_MAX_CNT

#define OPRT_SVC_DP_ERRCODE_MAX_CNT 8


      

Marco OPRT_BASE_EVENT_INVALID_EVENT_NAME

#define OPRT_BASE_EVENT_INVALID_EVENT_NAME                (-3840) //-3840, 无效的事件名
/****************************************************************************
            the error code marco define for module BASE_EVENT 
****************************************************************************/

Marco OPRT_BASE_EVENT_INVALID_EVENT_DESC

#define OPRT_BASE_EVENT_INVALID_EVENT_DESC                (-3841) //-3841, 无效的事件描述


      

Marco OPRT_BASE_EVENT_ERRCODE_MAX_CNT

#define OPRT_BASE_EVENT_ERRCODE_MAX_CNT 2


      

Marco OPRT_SVC_TIMER_TASK_LOAD_INVALID_CJSON

#define OPRT_SVC_TIMER_TASK_LOAD_INVALID_CJSON            (-4096) //-4096, K/V中保存的数据JSON格式错误
/****************************************************************************
            the error code marco define for module SVC_TIMER_TASK 
****************************************************************************/

Marco OPRT_SVC_TIMER_TASK_LOAD_INVALID_DATA

#define OPRT_SVC_TIMER_TASK_LOAD_INVALID_DATA             (-4097) //-4097, K/V中保存的数据缺少cnt字段


      

Marco OPRT_SVC_TIMER_TASK_UPDATE_LAST_FETCH_INVALID

#define OPRT_SVC_TIMER_TASK_UPDATE_LAST_FETCH_INVALID     (-4098) //-4098, 云端返回的数据缺少lastFetchTime字段


      

Marco OPRT_SVC_TIMER_TASK_UPDATE_TIMER_CNT_INVALID

#define OPRT_SVC_TIMER_TASK_UPDATE_TIMER_CNT_INVALID      (-4099) //-4099, 云端返回的数据缺少count字段


      

Marco OPRT_SVC_TIMER_TASK_UPDATE_TIMER_CNT_EXCEED

#define OPRT_SVC_TIMER_TASK_UPDATE_TIMER_CNT_EXCEED       (-4100) //-4100, 云端返回的定时任务数量超过30个


      

Marco OPRT_SVC_TIMER_TASK_ERRCODE_MAX_CNT

#define OPRT_SVC_TIMER_TASK_ERRCODE_MAX_CNT 5


      

Marco OPRT_SVC_HTTP_NOT_ENCRYPT_RET

#define OPRT_SVC_HTTP_NOT_ENCRYPT_RET                     (-4352) //-4352, 结果未加密
/****************************************************************************
            the error code marco define for module SVC_HTTP 
****************************************************************************/

Marco OPRT_SVC_HTTP_FILL_URL_H_ERR

#define OPRT_SVC_HTTP_FILL_URL_H_ERR                      (-4353) //-4353, 构造header错误


      

Marco OPRT_SVC_HTTP_FILL_URL_FULL_ERR

#define OPRT_SVC_HTTP_FILL_URL_FULL_ERR                   (-4354) //-4354, 构造整个URL错误


      

Marco OPRT_SVC_HTTP_FILL_DATA_ERR

#define OPRT_SVC_HTTP_FILL_DATA_ERR                       (-4355) //-4355, 构造data错误


      

Marco OPRT_SVC_HTTP_URL_CFG_AI_SPEAKER_ERR

#define OPRT_SVC_HTTP_URL_CFG_AI_SPEAKER_ERR              (-4356) //-4356, 音响配置失败


      

Marco OPRT_SVC_HTTP_URL_CFG_URL_ERR

#define OPRT_SVC_HTTP_URL_CFG_URL_ERR                     (-4357) //-4357, httpUrl/mqttUrl字段缺失


      

Marco OPRT_SVC_HTTP_URL_CFG_URL2IP_ERR

#define OPRT_SVC_HTTP_URL_CFG_URL2IP_ERR                  (-4358) //-4358, httpUrl/mqttUrl解析错误


      

Marco OPRT_SVC_HTTP_URL_CFG_URL2IP_SELF_ERR

#define OPRT_SVC_HTTP_URL_CFG_URL2IP_SELF_ERR             (-4359) //-4359, httpsSelfUrl/mqttsSelfUrl解析错误


      

Marco OPRT_SVC_HTTP_URL_CFG_URL2IP_VERIFY_ERR

#define OPRT_SVC_HTTP_URL_CFG_URL2IP_VERIFY_ERR           (-4360) //-4360, httpsVerifyUrl/mqttsVerifyUrl解析错误


      

Marco OPRT_SVC_HTTP_URL_CFG_URL2IP_PSK_ERR

#define OPRT_SVC_HTTP_URL_CFG_URL2IP_PSK_ERR              (-4361) //-4361, httpsPSKUrl/mqttsPSKUrl解析错误


      

Marco OPRT_SVC_HTTP_RECV_ERR

#define OPRT_SVC_HTTP_RECV_ERR                            (-272a) //-4362, 接收数据错误


      

Marco OPRT_SVC_HTTP_RECV_DA_NOT_ENOUGH

#define OPRT_SVC_HTTP_RECV_DA_NOT_ENOUGH                  (-272b) //-4363, 接收数据不足


      

Marco OPRT_SVC_HTTP_API_VERIFY_FAILED

#define OPRT_SVC_HTTP_API_VERIFY_FAILED                   (-272c) //-4364, 数据校验错误


      

Marco OPRT_SVC_HTTP_GW_NOT_EXIST

#define OPRT_SVC_HTTP_GW_NOT_EXIST                        (-272d) //-4365, 网关信息不存在


      

Marco OPRT_SVC_HTTP_API_TOKEN_EXPIRE

#define OPRT_SVC_HTTP_API_TOKEN_EXPIRE                    (-272e) //-4366, TOKEN过期


      

Marco OPRT_SVC_HTTP_DEV_RESET_FACTORY

#define OPRT_SVC_HTTP_DEV_RESET_FACTORY                   (-4367) //-4367, 设备需要恢复出厂


      

Marco OPRT_SVC_HTTP_DEV_NEED_REGISTER

#define OPRT_SVC_HTTP_DEV_NEED_REGISTER                   (-4368) //-4368, 设备未注册


      

Marco OPRT_SVC_HTTP_ORDER_EXPIRE

#define OPRT_SVC_HTTP_ORDER_EXPIRE                        (-4369) //-4369, 订单已过期


      

Marco OPRT_SVC_HTTP_NOT_EXISTS

#define OPRT_SVC_HTTP_NOT_EXISTS                          (-4370) //-4370, 不存在


      

Marco OPRT_SVC_HTTP_SIGNATURE_ERROR

#define OPRT_SVC_HTTP_SIGNATURE_ERROR                     (-4371) //-4371, 签名错误


      

Marco OPRT_SVC_HTTP_API_VERSION_WRONG

#define OPRT_SVC_HTTP_API_VERSION_WRONG                   (-4372) //-4372, API版本错误


      

Marco OPRT_SVC_HTTP_DEVICE_REMOVED

#define OPRT_SVC_HTTP_DEVICE_REMOVED                      (-4373) //-4373, 设备已移除


      

Marco OPRT_SVC_HTTP_DEV_ALREADY_BIND

#define OPRT_SVC_HTTP_DEV_ALREADY_BIND                    (-4374) //-4374, 设备已经绑定


      

Marco OPRT_SVC_HTTP_REMOTE_API_RUN_UNKNOW_FAILED

#define OPRT_SVC_HTTP_REMOTE_API_RUN_UNKNOW_FAILED        (-4375) //-4375, 无法识别API


      

Marco OPRT_SVC_HTTP_FORMAT_STRING_FAILED

#define OPRT_SVC_HTTP_FORMAT_STRING_FAILED                (-4376) //-4376, 字符串格式化错误


      

Marco OPRT_SVC_HTTP_API_DECODE_FAILED

#define OPRT_SVC_HTTP_API_DECODE_FAILED                   (-4377) //-4377, 数据解密失败


      

Marco OPRT_SVC_HTTP_SERV_VRFY_FAIL

#define OPRT_SVC_HTTP_SERV_VRFY_FAIL                      (-273a) //-4378, 服务端校验失败


      

Marco OPRT_SVC_HTTP_ERRCODE_MAX_CNT

#define OPRT_SVC_HTTP_ERRCODE_MAX_CNT 27


      

Marco OPRT_SVC_LAN_SOCKET_FAULT

#define OPRT_SVC_LAN_SOCKET_FAULT                         (-5376) //-5376, socket错误
/****************************************************************************
            the error code marco define for module SVC_LAN 
****************************************************************************/

Marco OPRT_SVC_LAN_SEND_ERR

#define OPRT_SVC_LAN_SEND_ERR                             (-5377) //-5377, socket发送错误


      

Marco OPRT_SVC_LAN_NO_CLIENT_CONNECTED

#define OPRT_SVC_LAN_NO_CLIENT_CONNECTED                  (-5378) //-5378, 没有可以上报的局域网设备连接


      

Marco OPRT_SVC_LAN_ERRCODE_MAX_CNT

#define OPRT_SVC_LAN_ERRCODE_MAX_CNT 3


      

Marco OPRT_SVC_MQTT_CMD_NOT_EXEC

#define OPRT_SVC_MQTT_CMD_NOT_EXEC                        (-5888) //-5888, 命令未执行
/****************************************************************************
            the error code marco define for module SVC_MQTT 
****************************************************************************/

Marco OPRT_SVC_MQTT_CMD_OUT_OF_TIME

#define OPRT_SVC_MQTT_CMD_OUT_OF_TIME                     (-5889) //-5889, 命令未在规定时间内执行


      

Marco OPRT_SVC_MQTT_GW_MQ_OFFLILNE

#define OPRT_SVC_MQTT_GW_MQ_OFFLILNE                      (-5890) //-5890, MQTT离线


      

Marco OPRT_SVC_MQTT_ERRCODE_MAX_CNT

#define OPRT_SVC_MQTT_ERRCODE_MAX_CNT 3


      

Marco OPRT_SVC_PEGASUS_DECODE_FAILED

#define OPRT_SVC_PEGASUS_DECODE_FAILED                    (-6144) //-6144, 解码失败
/****************************************************************************
            the error code marco define for module SVC_PEGASUS 
****************************************************************************/

Marco OPRT_SVC_PEGASUS_DONOT_FOUND_MODULE

#define OPRT_SVC_PEGASUS_DONOT_FOUND_MODULE               (-6145) //-6145, 模块未找到


      

Marco OPRT_SVC_PEGASUS_ERRCODE_MAX_CNT

#define OPRT_SVC_PEGASUS_ERRCODE_MAX_CNT 2


      

Marco OPRT_SVC_UPGRADE_APP_NOT_READY

#define OPRT_SVC_UPGRADE_APP_NOT_READY                    (-6400) //-6400, 应用尚未就绪
/****************************************************************************
            the error code marco define for module SVC_UPGRADE 
****************************************************************************/

Marco OPRT_SVC_UPGRADE_NO_VALID_FIRMWARE

#define OPRT_SVC_UPGRADE_NO_VALID_FIRMWARE                (-6401) //-6401, 升级信息字段校验失败


      

Marco OPRT_SVC_UPGRADE_ERRCODE_MAX_CNT

#define OPRT_SVC_UPGRADE_ERRCODE_MAX_CNT 2


      

Marco OPRT_SVC_API_IOT_DISCONNECTED_WITH_ROUTER

#define OPRT_SVC_API_IOT_DISCONNECTED_WITH_ROUTER         (-1a00) //-6656, 路由器断开
/****************************************************************************
            the error code marco define for module SVC_API_IOT 
****************************************************************************/

Marco OPRT_SVC_API_IOT_DEV_NOT_BIND

#define OPRT_SVC_API_IOT_DEV_NOT_BIND                     (-1a01) //-6657, 设备未绑定


      

Marco OPRT_SVC_API_IOT_ERRCODE_MAX_CNT

#define OPRT_SVC_API_IOT_ERRCODE_MAX_CNT 2


      

Marco OPRT_SVC_DEVOS_NOT_EXISTS

#define OPRT_SVC_DEVOS_NOT_EXISTS                         (-1c00) //-7168, 不存在
/****************************************************************************
            the error code marco define for module SVC_DEVOS 
****************************************************************************/

Marco OPRT_SVC_DEVOS_SCMA_INVALID

#define OPRT_SVC_DEVOS_SCMA_INVALID                       (-1c01) //-7169, SCMA无效


      

Marco OPRT_SVC_DEVOS_DEV_DP_CNT_INVALID

#define OPRT_SVC_DEVOS_DEV_DP_CNT_INVALID                 (-1c02) //-7170, 设备DP数量无效


      

Marco OPRT_SVC_DEVOS_NO_AUTHENTICATION

#define OPRT_SVC_DEVOS_NO_AUTHENTICATION                  (-1c03) //-7171, 无授权


      

Marco OPRT_SVC_DEVOS_ROUTER_NOT_FIND

#define OPRT_SVC_DEVOS_ROUTER_NOT_FIND                    (-1c04) //-7172, 路由器未找到


      

Marco OPRT_SVC_DEVOS_ERRCODE_MAX_CNT

#define OPRT_SVC_DEVOS_ERRCODE_MAX_CNT 5


      

Marco OPRT_BASE_DB_FLASH_NOT_ENOUGH_PAGE

#define OPRT_BASE_DB_FLASH_NOT_ENOUGH_PAGE                (-1d00) //-7424, flash页不够
/****************************************************************************
            the error code marco define for module BASE_DB 
****************************************************************************/

Marco OPRT_BASE_DB_ERRCODE_MAX_CNT

#define OPRT_BASE_DB_ERRCODE_MAX_CNT 1


      

Marco OPRT_SVC_BT_API_TRSMITR_CONTINUE

#define OPRT_SVC_BT_API_TRSMITR_CONTINUE                  (-7936) //-7936, 传输未结束
/****************************************************************************
            the error code marco define for module SVC_BT 
****************************************************************************/

Marco OPRT_SVC_BT_API_TRSMITR_ERROR

#define OPRT_SVC_BT_API_TRSMITR_ERROR                     (-7937) //-7937, 传输错误


      

Marco OPRT_SVC_BT_NETCFG_ERROR_ACK

#define OPRT_SVC_BT_NETCFG_ERROR_ACK                      (-7938) //-7938, bt命令出错,给app发送ack


      

Marco OPRT_SVC_BT_ERRCODE_MAX_CNT

#define OPRT_SVC_BT_ERRCODE_MAX_CNT 3


      

Marco TUYA_CHECK_NULL_RETURN(x, y)\ do{\

#define TUYA_CHECK_NULL_RETURN(x, y)\
do{\
   if (NULL == (x)){\
       PR_ERR("%s null", #x);\
       return (y);\
   }\
}while(0)


      

Marco TUYA_CHECK_NULL_GOTO(x, label)\ do{\

#define TUYA_CHECK_NULL_GOTO(x, label)\
do{\
   if (NULL == (x)){\
       PR_ERR("%s null", #x);\
       goto label;\
   }\
}while(0)


      

Marco TUYA_CALL_ERR_LOG(func)\ do{\

#define TUYA_CALL_ERR_LOG(func)\
do{\
   rt = (func);\
   if (OPRT_OK != (rt))\
       PR_ERR("ret:%d", rt);\
}while(0)


      

Marco TUYA_CALL_ERR_GOTO(func, label)\ do{\

#define TUYA_CALL_ERR_GOTO(func, label)\
do{\
   rt = (func);\
   if (OPRT_OK != (rt)){\
       PR_ERR("ret:%d", rt);\
       goto label;\
   }\
}while(0)


      

Marco TUYA_CALL_ERR_RETURN(func)\ do{\

#define TUYA_CALL_ERR_RETURN(func)\
do{\
   rt = (func);\
   if (OPRT_OK != (rt)){\
      PR_ERR("ret:%d", rt);\
      return (rt);\
   }\
}while(0)


      

Marco TUYA_CALL_ERR_RETURN_VAL(func, y)\ do{\

#define TUYA_CALL_ERR_RETURN_VAL(func, y)\
do{\
   rt = (func);\
   if (OPRT_OK != (rt)){\
       PR_ERR("ret:%d", rt);\
       return (y);\
   }\
}while(0)


      

Marco TUYA_CALL_ERR_LOG_SEQ_RETURN_VAL(func, y, point)\ do{\

#define TUYA_CALL_ERR_LOG_SEQ_RETURN_VAL(func, y, point)\
do{\
   rt = (func);\
   if (OPRT_OK != (rt)){\
       PR_ERR("ret:%d", rt);\
       INSERT_ERROR_LOG_SEQ_DEC((point), rt);\
       return (y);\
   }\
}while(0)


      

Marco TUYA_CALL_ERR_LOG_SEQ_RETURN(func, point)\ do{\

#define TUYA_CALL_ERR_LOG_SEQ_RETURN(func, point)\
do{\
   rt = (func);\
   if (OPRT_OK != (rt)){\
       PR_ERR("ret:%d", rt);\
       INSERT_ERROR_LOG_SEQ_DEC((point), rt);\
       return (rt);\
   }\
}while(0)


      

Marco TUYA_CALL_ERR_LOG_SEQ_GOTO(func, label)\ do{\

#define TUYA_CALL_ERR_LOG_SEQ_GOTO(func, label)\
do{\
   rt = (func);\
   if (OPRT_OK != (rt)){\
       PR_ERR("ret:%d", rt);\
       INSERT_ERROR_LOG_SEQ_DEC((point), rt);\
       goto label;\
   }\
}while(0)


      

Marco TUYA_CALL_ERR_LOG_SEQ(func)\ do{\

#define TUYA_CALL_ERR_LOG_SEQ(func)\
do{\
   rt = (func);\
   if (OPRT_OK != (rt)) {\
       PR_ERR("ret:%d", rt);\
       INSERT_ERROR_LOG_SEQ_DEC((point), rt);\
   }\
}while(0)


      

Marco TUYA_CHECK_NULL_LOG_SEQ_RETURN(x, y, point)\ do{\

#define TUYA_CHECK_NULL_LOG_SEQ_RETURN(x, y, point)\
do{\
   if (NULL == (x)){\
       PR_ERR("%s null", #x);\
       INSERT_ERROR_LOG_SEQ_DEC((point), y);\
       return (y);\
   }\
}while(0)


      

Marco TUYA_CHECK_NULL_LOG_SEQ_GOTO(x, point, label)\ do{\

#define TUYA_CHECK_NULL_LOG_SEQ_GOTO(x, point, label)\
do{\
   if (NULL == (x)){\
       PR_ERR("%s null", #x);\
       INSERT_ERROR_LOG_SEQ_NULL((point));\
       goto label;\
   }\
}while(0)


      

Marco TUYA_IOT_CONFIG_H

#define TUYA_IOT_CONFIG_H


      

Marco SYSTEM_SMALL_MEMORY_BEGIN

#define SYSTEM_SMALL_MEMORY_BEGIN      0      /*small memory systems begin */


      

Marco SYSTEM_REALTEK8710_1M

#define SYSTEM_REALTEK8710_1M          1


      

Marco SYSTEM_REALTEK8710_2M

#define SYSTEM_REALTEK8710_2M          2


      

Marco SYSTEM_FREERTOS

#define SYSTEM_FREERTOS                98


      

Marco SYSTEM_SMALL_MEMORY_END

#define SYSTEM_SMALL_MEMORY_END        99     /*small memory systems end */


      

Marco SYSTEM_LINUX

#define SYSTEM_LINUX                   100


      

Marco SYSTEM_LITEOS

#define SYSTEM_LITEOS                  120


      

Marco TLS_DISABLE

#define TLS_DISABLE                    0      /* disable tls function */


      

Marco TLS_TUYA_PSK_ONLY

#define TLS_TUYA_PSK_ONLY              2      /* only enable ciper 0xAE */


      

Marco TLS_TUYA_ECC_PSK

#define TLS_TUYA_ECC_PSK               3      /* enable ciper 0xAE && 0xC027 */


      

Marco TLS_TUYA_ECC_ONLY

#define TLS_TUYA_ECC_ONLY              4      /* only enable ciper 0xC027 */


      

Marco TLS_TUYA_ECC_ONLY_NOSTRIP

#define TLS_TUYA_ECC_ONLY_NOSTRIP      5      /* only enable ciper 0xC027, but enable most of mbed-tls configs */


      

Marco TLS_TUYA_ECC_CLIENT_AUTH

#define TLS_TUYA_ECC_CLIENT_AUTH       6      /* TLS Client Authentication and Server Authentication mode */


      

Marco TUYA_OPERATOR_DISABLE

#define TUYA_OPERATOR_DISABLE          0


      

Marco TUYA_OPERATOR_CUCC

#define TUYA_OPERATOR_CUCC             1


      

Marco TUYA_OPERATOR_CTCC

#define TUYA_OPERATOR_CTCC             2


      

Marco TUYA_OPERATOR_CMCC

#define TUYA_OPERATOR_CMCC             4


      
      
#define TUYA_OPERATOR_CMCC_ANDLINK     8


      

Marco TUYA_OPERATOR_ALL

#define TUYA_OPERATOR_ALL              (TUYA_OPERATOR_CUCC | TUYA_OPERATOR_CTCC | TUYA_OPERATOR_CMCC)


      

Marco GW_RTL8196E

#define GW_RTL8196E    3
/*gateway platform*/

Marco GW_RTL8197F

#define GW_RTL8197F    1


      

Marco GW_RTL8711AM

#define GW_RTL8711AM 2


      

Marco GW_ROKIDK18

#define GW_ROKIDK18    6


      

Marco BUILD_DATE

#define BUILD_DATE   "2022_07_27"
/* custom settings */

Marco BUILD_TIME

#define BUILD_TIME   "22_50_03"


      

Marco GIT_USER

#define GIT_USER   "ci_manage"


      

Marco IOT_SDK_VER

#define IOT_SDK_VER   "2.3.3"


      

Marco SDK_BETA_VER

#define SDK_BETA_VER   "beta.347"


      

Marco PROJECT_NAME

#define PROJECT_NAME   "ty_iot_sdk"


      

Marco TARGET_PLATFORM

#define TARGET_PLATFORM   "BK7231NL"


      

Marco KV_KEY_SEED

#define KV_KEY_SEED   "8710_2M"


      

Marco SDK_ID

#define SDK_ID   "TuyaOS2.3.3_ty_iot_sdk_2.3.3-beta.347_BK7231NL_bk7231nl_update_adc_0.0.5"


      

Marco ENABLE_BASE_IOT_CONFIG

#define ENABLE_BASE_IOT_CONFIG 1


      

Marco TUYA_IOT_DEBUG

#define TUYA_IOT_DEBUG 1


      

Marco ENABLE_LAN_ENCRYPTION

#define ENABLE_LAN_ENCRYPTION 1


      

Marco ENABLE_HTTP_TRUNK

#define ENABLE_HTTP_TRUNK 0


      

Marco ENABLE_ASTRO_TIMER

#define ENABLE_ASTRO_TIMER 1


      

Marco TUYA_REDUCE_BIN

#define TUYA_REDUCE_BIN 2


      

Marco TUYA_BLE_VER

#define TUYA_BLE_VER 3


      

Marco TY_GPIO_TEST_V2

#define TY_GPIO_TEST_V2 1


      

Marco WIFI_GW

#define WIFI_GW 1


      

Marco TY_GET_RFTEST_STAT

#define TY_GET_RFTEST_STAT 1


      

Marco TY_WIFI_FFC

#define TY_WIFI_FFC 1


      

Marco TY_FFS_NETCFG

#define TY_FFS_NETCFG 0


      

Marco TY_PEGASUS_NETCFG

#define TY_PEGASUS_NETCFG 0


      

Marco TY_BT_MOD

#define TY_BT_MOD 1


      

Marco BT_NETCFG

#define BT_NETCFG 1


      

Marco BT_CTRL

#define BT_CTRL 1


      

Marco BT_REMOTE_CTRL

#define BT_REMOTE_CTRL 1


      

Marco MF_BT

#define MF_BT 1


      

Marco BT_VIRTUAL

#define BT_VIRTUAL 0


      

Marco BT_ACTIVE

#define BT_ACTIVE 0


      

Marco TY_BT_MESH_PROV

#define TY_BT_MESH_PROV 0


      

Marco GW_SUPPORT_WIRED_WIFI

#define GW_SUPPORT_WIRED_WIFI 0


      

Marco ENABLE_CLOUD_OPERATION

#define ENABLE_CLOUD_OPERATION 0


      

Marco KV_FILE

#define KV_FILE 0


      

Marco TY_LEGACY_HANDLE_UF

#define TY_LEGACY_HANDLE_UF 0


      

Marco SHUTDOWN_MODE

#define SHUTDOWN_MODE 0


      

Marco LITTLE_END

#define LITTLE_END 1


      

Marco ENABLE_NXP_SE050

#define ENABLE_NXP_SE050 0


      

Marco TLS_MODE

#define TLS_MODE 2


      

Marco TLS_SESSION

#define TLS_SESSION 0


      

Marco ENABLE_LAN_DEV

#define ENABLE_LAN_DEV 0


      

Marco ENABLE_LAN_LINKAGE

#define ENABLE_LAN_LINKAGE 0


      

Marco ENABLE_SYS_RPC

#define ENABLE_SYS_RPC 0


      

Marco TUYA_OPERATOR_TYPE

#define TUYA_OPERATOR_TYPE 0


      

Marco OPERATING_SYSTEM

#define OPERATING_SYSTEM 2


      

Marco TY_RTC

#define TY_RTC 0


      

Marco TY_WATCHDOG

#define TY_WATCHDOG 1


      

Marco ENABLE_STATION_AP_MODE

#define ENABLE_STATION_AP_MODE 0


      

Marco AP_SNIFFER_EN

#define AP_SNIFFER_EN 1


      

Marco ENABLE_AP_FAST_CONNECT

#define ENABLE_AP_FAST_CONNECT 0


      

Marco KV_PROTECTED_ENABLE

#define KV_PROTECTED_ENABLE 1


      

Marco ENABLE_CALENDAR_TIMER

#define ENABLE_CALENDAR_TIMER 1


      

Marco EVENT_NAME_MAX_LEN

#define EVENT_NAME_MAX_LEN 16


      

Marco WIFI_GW

#define WIFI_GW 0


      

Marco TUYA_IOT_DEBUG

#define TUYA_IOT_DEBUG 1


      

Marco KV_FILE

#define KV_FILE 1


      

Marco KV_SWAP_EQUAL_USER

#define KV_SWAP_EQUAL_USER 0


      

Marco ENABLE_LAN

#define ENABLE_LAN 1


      

Marco SHUTDOWN_MODE

#define SHUTDOWN_MODE 1


      

Marco LITTLE_END

#define LITTLE_END 1


      

Marco TLS_MODE

#define TLS_MODE TLS_TUYA_ECC_PSK


      

Marco ENABLE_LOCAL_LINKAGE

#define ENABLE_LOCAL_LINKAGE 0


      

Marco ENABLE_CLOUD_OPERATION

#define ENABLE_CLOUD_OPERATION 0


      

Marco ENABLE_SUBDEVICE

#define ENABLE_SUBDEVICE 0


      

Marco ENABLE_SIGMESH

#define ENABLE_SIGMESH 0


      

Marco ENABLE_ENGINEER_TO_NORMAL

#define ENABLE_ENGINEER_TO_NORMAL 0


      

Marco OPERATING_SYSTEM

#define OPERATING_SYSTEM SYSTEM_LINUX


      

Marco ENABLE_SYS_RPC

#define ENABLE_SYS_RPC 0


      

Marco TY_SECURITY_CHIP

#define TY_SECURITY_CHIP 0


      

Marco ENABLE_IPC

#define ENABLE_IPC 0


      

Marco ENABLE_AI_SPEAKER

#define ENABLE_AI_SPEAKER 0


      

Marco ENABLE_EXTRA_MQTT

#define ENABLE_EXTRA_MQTT 0


      

Marco TY_RTC

#define TY_RTC 0


      

Marco TY_GPIO_TEST_V2

#define TY_GPIO_TEST_V2 1


      

Marco RELIABLE_TRANSFER

#define RELIABLE_TRANSFER 0


      

Marco TY_WATCHDOG

#define TY_WATCHDOG 0


      

Marco ENABLE_LAN_ENCRYPTION

#define ENABLE_LAN_ENCRYPTION 1


      

Marco TUYA_OPERATOR_TYPE

#define TUYA_OPERATOR_TYPE TUYA_OPERATOR_DISABLE


      

Marco ENABLE_HTTP_TRUNK

#define ENABLE_HTTP_TRUNK 0


      

Marco ENABLE_AP_FAST_CONNECT

#define ENABLE_AP_FAST_CONNECT 0


      

Marco TY_WIFI_FFC

#define TY_WIFI_FFC 0


      

Marco TY_BT_MOD

#define TY_BT_MOD 0


      

Marco BT_NETCFG

#define BT_NETCFG 1


      

Marco BT_CTRL

#define BT_CTRL 1


      

Marco BT_REMOTE_CTRL

#define BT_REMOTE_CTRL 1


      

Marco MF_BT

#define MF_BT 1


      

Marco BT_VIRTUAL

#define BT_VIRTUAL 0


      

Marco BT_ACTIVE

#define BT_ACTIVE 1


      

Marco TY_FFS_NETCFG

#define TY_FFS_NETCFG 0


      

Marco TY_PEGASUS_NETCFG

#define TY_PEGASUS_NETCFG 0


      

Marco ENABLE_LAN_LINKAGE

#define ENABLE_LAN_LINKAGE 0


      

Marco ENABLE_LAN_LINKAGE_MASTER

#define ENABLE_LAN_LINKAGE_MASTER 0


      

Marco ENABLE_LAN_DEV

#define ENABLE_LAN_DEV 0


      

Marco ENABLE_LAN_DEV_MASTER

#define ENABLE_LAN_DEV_MASTER 0


      

Marco RECORD_DB

#define RECORD_DB 0


      

Marco TUYA_P2P

#define TUYA_P2P 1


      

Marco ENABLE_ECHO_SHOW

#define ENABLE_ECHO_SHOW 0


      

Marco ENABLE_CHROMECAST

#define ENABLE_CHROMECAST 0


      

Marco ENABLE_CLOUD_STORAGE

#define ENABLE_CLOUD_STORAGE 0


      

Marco LOW_POWER_ENABLE

#define LOW_POWER_ENABLE 0


      

Marco TUYA_REDUCE_BIN

#define TUYA_REDUCE_BIN 0


      

Marco TUYA_BLE_VER

#define TUYA_BLE_VER 3


      

Marco LWIP_HDR_ALTCP_H

#define LWIP_HDR_ALTCP_H


      

Marco altcp_listen_with_backlog(conn, backlog)

#define altcp_listen_with_backlog(conn, backlog) altcp_listen_with_backlog_and_err(conn, backlog, NULL)


      

Marco altcp_listen(conn)

#define altcp_listen(conn) altcp_listen_with_backlog_and_err(conn, TCP_DEFAULT_LISTEN_BACKLOG, NULL)
/** @ingroup altcp */

Marco altcp_accept_fn

#define altcp_accept_fn tcp_accept_fn


      

Marco altcp_connected_fn

#define altcp_connected_fn tcp_connected_fn


      

Marco altcp_recv_fn

#define altcp_recv_fn tcp_recv_fn


      

Marco altcp_sent_fn

#define altcp_sent_fn tcp_sent_fn


      

Marco altcp_poll_fn

#define altcp_poll_fn tcp_poll_fn


      

Marco altcp_err_fn

#define altcp_err_fn tcp_err_fn


      

Marco altcp_pcb

#define altcp_pcb tcp_pcb


      

Marco altcp_tcp_new_ip_type

#define altcp_tcp_new_ip_type tcp_new_ip_type


      

Marco altcp_tcp_new

#define altcp_tcp_new tcp_new


      

Marco altcp_tcp_new_ip6

#define altcp_tcp_new_ip6 tcp_new_ip6


      

Marco altcp_new(allocator)

#define altcp_new(allocator) tcp_new()


      

Marco altcp_new_ip6(allocator)

#define altcp_new_ip6(allocator) tcp_new_ip6()


      

Marco altcp_new_ip_type(allocator, ip_type)

#define altcp_new_ip_type(allocator, ip_type) tcp_new_ip_type(ip_type)


      

Marco altcp_arg

#define altcp_arg tcp_arg


      

Marco altcp_accept

#define altcp_accept tcp_accept


      

Marco altcp_recv

#define altcp_recv tcp_recv


      

Marco altcp_sent

#define altcp_sent tcp_sent


      

Marco altcp_poll

#define altcp_poll tcp_poll


      

Marco altcp_err

#define altcp_err tcp_err


      

Marco altcp_recved

#define altcp_recved tcp_recved


      

Marco altcp_bind

#define altcp_bind tcp_bind


      

Marco altcp_connect

#define altcp_connect tcp_connect


      

Marco altcp_listen_with_backlog_and_err

#define altcp_listen_with_backlog_and_err tcp_listen_with_backlog_and_err


      

Marco altcp_listen_with_backlog

#define altcp_listen_with_backlog tcp_listen_with_backlog


      

Marco altcp_listen

#define altcp_listen tcp_listen


      

Marco altcp_abort

#define altcp_abort tcp_abort


      

Marco altcp_close

#define altcp_close tcp_close


      

Marco altcp_shutdown

#define altcp_shutdown tcp_shutdown


      

Marco altcp_write

#define altcp_write tcp_write


      

Marco altcp_output

#define altcp_output tcp_output


      

Marco altcp_mss

#define altcp_mss tcp_mss


      

Marco altcp_sndbuf

#define altcp_sndbuf tcp_sndbuf


      

Marco altcp_sndqueuelen

#define altcp_sndqueuelen tcp_sndqueuelen


      

Marco altcp_nagle_disable

#define altcp_nagle_disable tcp_nagle_disable


      

Marco altcp_nagle_enable

#define altcp_nagle_enable tcp_nagle_enable


      

Marco altcp_nagle_disabled

#define altcp_nagle_disabled tcp_nagle_disabled


      

Marco altcp_setprio

#define altcp_setprio tcp_setprio


      

Marco altcp_get_tcp_addrinfo

#define altcp_get_tcp_addrinfo tcp_get_tcp_addrinfo


      

Marco altcp_get_ip(pcb, local)

#define altcp_get_ip(pcb, local) ((local) ? (&(pcb)->local_ip) : (&(pcb)->remote_ip))


      

Marco altcp_dbg_get_tcp_state

#define altcp_dbg_get_tcp_state tcp_dbg_get_tcp_state


      

Marco LWIP_HDR_ALTCP_TCP_H

#define LWIP_HDR_ALTCP_TCP_H


      

Marco altcp_tcp_new()

#define altcp_tcp_new() altcp_tcp_new_ip_type(IPADDR_TYPE_V4)


      

Marco altcp_tcp_new_ip6()

#define altcp_tcp_new_ip6() altcp_tcp_new_ip_type(IPADDR_TYPE_V6)


      

Marco LWIP_HDR_ALTCP_TLS_H

#define LWIP_HDR_ALTCP_TLS_H


      

Marco LWIP_HDR_API_H

#define LWIP_HDR_API_H


      

Marco NETCONN_NOFLAG

#define NETCONN_NOFLAG     0
/* Flags for netconn_write (u8_t) */

Marco NETCONN_NOCOPY

#define NETCONN_NOCOPY     0 /* Only for source code compatibility */


      

Marco NETCONN_COPY

#define NETCONN_COPY       1


      

Marco NETCONN_MORE

#define NETCONN_MORE       2


      

Marco NETCONN_DONTBLOCK

#define NETCONN_DONTBLOCK  4


      

Marco NETCONN_NOAUTORCVD

#define NETCONN_NOAUTORCVD 8 /* prevent netconn_recv_data_tcp() from updating the tcp window - must be done manually via netconn_tcp_recvd() */


      

Marco NETCONN_NOFIN

#define NETCONN_NOFIN      16 /* upper layer already received data, leave FIN in queue until called again */


      

Marco NETCONN_FLAG_MBOXCLOSED

#define NETCONN_FLAG_MBOXCLOSED              1
/** This netconn had an error, don't block on recvmbox/acceptmbox any more */

Marco NETCONN_FLAG_NON_BLOCKING

#define NETCONN_FLAG_NON_BLOCKING            2
/** Should this netconn avoid blocking? */

Marco NETCONN_FLAG_IN_NONBLOCKING_CONNECT

#define NETCONN_FLAG_IN_NONBLOCKING_CONNECT  4
/** Was the last connect action a non-blocking one? */

Marco NETCONN_FLAG_MBOXINVALID

#define NETCONN_FLAG_MBOXINVALID             8
/** The mbox of this netconn is being deallocated, don't use it anymore */

Marco NETCONN_FLAG_CHECK_WRITESPACE

#define NETCONN_FLAG_CHECK_WRITESPACE        16
/** If a nonblocking write has been rejected before, poll_tcp needs to
    check if the netconn is writable again */

Marco NETCONN_FLAG_IPV6_V6ONLY

#define NETCONN_FLAG_IPV6_V6ONLY             32
/** If this flag is set then only IPv6 communication is allowed on the
    netconn. As per RFC#3493 this features defaults to OFF allowing
    dual-stack usage by default. */

Marco NETCONN_FLAG_PKTINFO

#define NETCONN_FLAG_PKTINFO                 64
/** Received packet info will be recorded for this netconn */

Marco NETCONN_FIN_RX_PENDING

#define NETCONN_FIN_RX_PENDING               128
/** A FIN has been received but not passed to the application yet */

Marco NETCONNTYPE_GROUP(t)

#define NETCONNTYPE_GROUP(t)        ((t)&240)
/* Helpers to process several netconn_types by the same code */

Marco NETCONNTYPE_DATAGRAM(t)

#define NETCONNTYPE_DATAGRAM(t)     ((t)&0xE0)


      

Marco NETCONN_TYPE_IPV6

#define NETCONN_TYPE_IPV6           8


      

Marco NETCONNTYPE_ISIPV6(t)

#define NETCONNTYPE_ISIPV6(t)       (((t)&NETCONN_TYPE_IPV6) != 0)


      

Marco NETCONNTYPE_ISUDPLITE(t)

#define NETCONNTYPE_ISUDPLITE(t)    (((t)&243) == NETCONN_UDPLITE)


      

Marco NETCONNTYPE_ISUDPNOCHKSUM(t)

#define NETCONNTYPE_ISUDPNOCHKSUM(t) (((t)&243) == NETCONN_UDPNOCHKSUM)


      

Marco NETCONNTYPE_ISIPV6(t)

#define NETCONNTYPE_ISIPV6(t)       (0)


      

Marco NETCONNTYPE_ISUDPLITE(t)

#define NETCONNTYPE_ISUDPLITE(t)    ((t) == NETCONN_UDPLITE)


      

Marco NETCONNTYPE_ISUDPNOCHKSUM(t)

#define NETCONNTYPE_ISUDPNOCHKSUM(t) ((t) == NETCONN_UDPNOCHKSUM)


      

Marco NETCONN_DNS_DEFAULT

#define NETCONN_DNS_DEFAULT  NETCONN_DNS_IPV4_IPV6
/* Used for netconn_gethostbyname_addrtype(), these should match the DNS_ADDRTYPE defines in dns.h */

Marco NETCONN_DNS_IPV4

#define NETCONN_DNS_IPV4     0


      

Marco NETCONN_DNS_IPV6

#define NETCONN_DNS_IPV6     1


      

Marco NETCONN_DNS_IPV4_IPV6

#define NETCONN_DNS_IPV4_IPV6 2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */


      

Marco NETCONN_DNS_IPV6_IPV4

#define NETCONN_DNS_IPV6_IPV4 3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */


      

Marco API_EVENT(c,e,l)

#define API_EVENT(c,e,l) if (c->callback) {        \
                          (*c->callback)(c, e, l); \
                        }
/** Register an Network connection event */

Marco netconn_new(t)

#define netconn_new(t)                 netconn_new_with_proto_and_callback(t, 0, NULL)
/** @ingroup netconn_common
 * Create new netconn connection
 * @param t @ref netconn_type */

Marco netconn_new_with_callback(t, c)

#define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c)


      

Marco netconn_type(conn)

#define netconn_type(conn) (conn->type)
/** Get the type of a netconn (as enum netconn_type). */

Marco netconn_peer(c,i,p)

#define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0)
/** @ingroup netconn_common */

Marco netconn_addr(c,i,p)

#define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1)
/** @ingroup netconn_common */

Marco netconn_listen(conn)

#define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG)
/** @ingroup netconn_tcp */

Marco netconn_write(conn, dataptr, size, apiflags)

#define netconn_write(conn, dataptr, size, apiflags) \
         netconn_write_partly(conn, dataptr, size, apiflags, NULL)
/** @ingroup netconn_tcp */

Marco netconn_gethostbyname(name, addr)

#define netconn_gethostbyname(name, addr) netconn_gethostbyname_addrtype(name, addr, NETCONN_DNS_DEFAULT)


      

Marco netconn_gethostbyname_addrtype(name, addr, dns_addrtype)

#define netconn_gethostbyname_addrtype(name, addr, dns_addrtype) netconn_gethostbyname(name, addr)


      

Marco netconn_recv_bufsize(conn)

#define netconn_recv_bufsize(conn)     ((conn)->recv_bufsize)


      

Marco netconn_set_flags(conn, set_flags)

#define netconn_set_flags(conn, set_flags)    do { (conn)->flags = (u8_t)((conn)->flags | (set_flags)); } while(0)


      

Marco netconn_clear_flags(conn, clr_flags)

#define netconn_clear_flags(conn, clr_flags)  do { (conn)->flags = (u8_t)((conn)->flags & (u8_t)(~(clr_flags) & 255)); } while(0)


      

Marco netconn_is_flag_set(conn, flag)

#define netconn_is_flag_set(conn, flag)       (((conn)->flags & (flag)) != 0)


      

Marco netconn_set_nonblocking(conn, val)

#define netconn_set_nonblocking(conn, val) do { if(val) { \
 netconn_set_flags(conn, NETCONN_FLAG_NON_BLOCKING); \
} else { \
 netconn_clear_flags(conn, NETCONN_FLAG_NON_BLOCKING); }} while(0)
/** Set the blocking status of netconn calls (@todo: write/send is missing) */

Marco netconn_is_nonblocking(conn)

#define netconn_is_nonblocking(conn)       (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0)
/** Get the blocking status of netconn calls (@todo: write/send is missing) */

Marco netconn_set_ipv6only(conn, val)

#define netconn_set_ipv6only(conn, val) do { if(val) { \
 netconn_set_flags(conn, NETCONN_FLAG_IPV6_V6ONLY); \
} else { \
 netconn_clear_flags(conn, NETCONN_FLAG_IPV6_V6ONLY); }} while(0)
/** @ingroup netconn_common
 * TCP: Set the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY)
 */

Marco netconn_get_ipv6only(conn)

#define netconn_get_ipv6only(conn)       (((conn)->flags & NETCONN_FLAG_IPV6_V6ONLY) != 0)
/** @ingroup netconn_common
 * TCP: Get the IPv6 ONLY status of netconn calls (see NETCONN_FLAG_IPV6_V6ONLY)
 */

Marco netconn_set_sendtimeout(conn, timeout)

#define netconn_set_sendtimeout(conn, timeout)     ((conn)->send_timeout = (timeout))
/** Set the send timeout in milliseconds */

Marco netconn_get_sendtimeout(conn)

#define netconn_get_sendtimeout(conn)              ((conn)->send_timeout)
/** Get the send timeout in milliseconds */

Marco netconn_set_recvtimeout(conn, timeout)

#define netconn_set_recvtimeout(conn, timeout)     ((conn)->recv_timeout = (timeout))
/** Set the receive timeout in milliseconds */

Marco netconn_get_recvtimeout(conn)

#define netconn_get_recvtimeout(conn)              ((conn)->recv_timeout)
/** Get the receive timeout in milliseconds */

Marco netconn_set_recvbufsize(conn, recvbufsize)

#define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize))
/** Set the receive buffer in bytes */

Marco netconn_get_recvbufsize(conn)

#define netconn_get_recvbufsize(conn)              ((conn)->recv_bufsize)
/** Get the receive buffer in bytes */

Marco netconn_thread_init

#define netconn_thread_init 


      

Marco netconn_thread_cleanup

#define netconn_thread_cleanup 


      

Marco LWIP_HDR_APPS_ALTCP_PROXYCONNECT_H

#define LWIP_HDR_APPS_ALTCP_PROXYCONNECT_H


      

Marco LWIP_HDR_ALTCP_TLS_OPTS_H

#define LWIP_HDR_ALTCP_TLS_OPTS_H


      

Marco LWIP_ALTCP_TLS_MBEDTLS

#define LWIP_ALTCP_TLS_MBEDTLS                       0


      

Marco ALTCP_MBEDTLS_DEBUG

#define ALTCP_MBEDTLS_DEBUG                          LWIP_DBG_OFF


      

Marco ALTCP_MBEDTLS_SESSION_CACHE_TIMEOUT_SECONDS

#define ALTCP_MBEDTLS_SESSION_CACHE_TIMEOUT_SECONDS  0


      

Marco LWIP_HDR_APPS_FS_H

#define LWIP_HDR_APPS_FS_H


      

Marco FS_READ_EOF

#define FS_READ_EOF    -1


      

Marco FS_READ_DELAYED

#define FS_READ_DELAYED -2


      

Marco FS_FILE_FLAGS_HEADER_INCLUDED

#define FS_FILE_FLAGS_HEADER_INCLUDED    1


      

Marco FS_FILE_FLAGS_HEADER_PERSISTENT

#define FS_FILE_FLAGS_HEADER_PERSISTENT  2


      

Marco FS_FILE_FLAGS_HEADER_HTTPVER_1_1

#define FS_FILE_FLAGS_HEADER_HTTPVER_1_1 4


      

Marco FS_FILE_FLAGS_SSI

#define FS_FILE_FLAGS_SSI                8


      

Marco LWIP_HDR_APPS_HTTP_CLIENT_H

#define LWIP_HDR_APPS_HTTP_CLIENT_H


      

Marco LWIP_HTTPC_HAVE_FILE_IO

#define LWIP_HTTPC_HAVE_FILE_IO  0


      

Marco HTTP_DEFAULT_PORT

#define HTTP_DEFAULT_PORT        LWIP_IANA_PORT_HTTP
/**
 * @ingroup httpc 
 * The default TCP port used for HTTP
 */

Marco LWIP_HDR_APPS_HTTPD_H

#define LWIP_HDR_APPS_HTTPD_H


      

Marco HTTPD_SSI_TAG_UNKNOWN

#define HTTPD_SSI_TAG_UNKNOWN 65535
/** For LWIP_HTTPD_SSI_RAW==1, return this to indicate the tag is unknown.
 * In this case, the webserver writes a warning into the page.
 * You can also just return 0 to write nothing for unknown tags.
 */

Marco LWIP_HDR_APPS_HTTPD_OPTS_H

#define LWIP_HDR_APPS_HTTPD_OPTS_H


      

Marco LWIP_HTTPD_CGI

#define LWIP_HTTPD_CGI           0


      

Marco LWIP_HTTPD_CGI_SSI

#define LWIP_HTTPD_CGI_SSI       0


      

Marco LWIP_HTTPD_SSI

#define LWIP_HTTPD_SSI           0


      

Marco LWIP_HTTPD_SSI_RAW

#define LWIP_HTTPD_SSI_RAW       0


      

Marco LWIP_HTTPD_SSI_BY_FILE_EXTENSION

#define LWIP_HTTPD_SSI_BY_FILE_EXTENSION 1


      

Marco LWIP_HTTPD_SUPPORT_POST

#define LWIP_HTTPD_SUPPORT_POST  0


      

Marco LWIP_HTTPD_MAX_CGI_PARAMETERS

#define LWIP_HTTPD_MAX_CGI_PARAMETERS 16


      

Marco LWIP_HTTPD_SSI_MULTIPART

#define LWIP_HTTPD_SSI_MULTIPART   0


      

Marco LWIP_HTTPD_MAX_TAG_NAME_LEN

#define LWIP_HTTPD_MAX_TAG_NAME_LEN 8


      

Marco LWIP_HTTPD_MAX_TAG_INSERT_LEN

#define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192


      

Marco LWIP_HTTPD_POST_MANUAL_WND

#define LWIP_HTTPD_POST_MANUAL_WND 0


      

Marco HTTPD_SERVER_AGENT

#define HTTPD_SERVER_AGENT "lwIP/" LWIP_VERSION_STRING " (http://savannah.nongnu.org/projects/lwip)"


      

Marco LWIP_HTTPD_DYNAMIC_HEADERS

#define LWIP_HTTPD_DYNAMIC_HEADERS 0


      

Marco HTTPD_DEBUG

#define HTTPD_DEBUG        LWIP_DBG_OFF


      

Marco HTTPD_USE_MEM_POOL

#define HTTPD_USE_MEM_POOL 0


      

Marco HTTPD_SERVER_PORT

#define HTTPD_SERVER_PORT                  LWIP_IANA_PORT_HTTP


      

Marco HTTPD_SERVER_PORT_HTTPS

#define HTTPD_SERVER_PORT_HTTPS            LWIP_IANA_PORT_HTTPS


      

Marco HTTPD_ENABLE_HTTPS

#define HTTPD_ENABLE_HTTPS                 0


      

Marco HTTPD_MAX_RETRIES

#define HTTPD_MAX_RETRIES                  4


      

Marco HTTPD_POLL_INTERVAL

#define HTTPD_POLL_INTERVAL                4


      

Marco HTTPD_TCP_PRIO

#define HTTPD_TCP_PRIO                     TCP_PRIO_MIN


      

Marco LWIP_HTTPD_TIMING

#define LWIP_HTTPD_TIMING                  0


      

Marco HTTPD_DEBUG_TIMING

#define HTTPD_DEBUG_TIMING                 LWIP_DBG_OFF


      

Marco LWIP_HTTPD_SUPPORT_EXTSTATUS

#define LWIP_HTTPD_SUPPORT_EXTSTATUS       0


      

Marco LWIP_HTTPD_SUPPORT_V09

#define LWIP_HTTPD_SUPPORT_V09             1


      

Marco LWIP_HTTPD_SUPPORT_11_KEEPALIVE

#define LWIP_HTTPD_SUPPORT_11_KEEPALIVE    0


      

Marco LWIP_HTTPD_SUPPORT_REQUESTLIST

#define LWIP_HTTPD_SUPPORT_REQUESTLIST     1


      

Marco LWIP_HTTPD_REQ_QUEUELEN

#define LWIP_HTTPD_REQ_QUEUELEN            5


      

Marco LWIP_HTTPD_REQ_BUFSIZE

#define LWIP_HTTPD_REQ_BUFSIZE             LWIP_HTTPD_MAX_REQ_LENGTH


      

Marco LWIP_HTTPD_MAX_REQ_LENGTH

#define LWIP_HTTPD_MAX_REQ_LENGTH          LWIP_MIN(1023, (LWIP_HTTPD_REQ_QUEUELEN * PBUF_POOL_BUFSIZE))


      

Marco LWIP_HTTPD_MAX_REQUEST_URI_LEN

#define LWIP_HTTPD_MAX_REQUEST_URI_LEN     63


      

Marco LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN

#define LWIP_HTTPD_POST_MAX_RESPONSE_URI_LEN 63


      

Marco LWIP_HTTPD_SSI_INCLUDE_TAG

#define LWIP_HTTPD_SSI_INCLUDE_TAG          1


      

Marco LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR

#define LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR 0


      

Marco LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED

#define LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED 0


      

Marco LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI

#define LWIP_HTTPD_OMIT_HEADER_FOR_EXTENSIONLESS_URI 0


      

Marco HTTP_IS_TAG_VOLATILE(ptr)

#define HTTP_IS_TAG_VOLATILE(ptr) TCP_WRITE_FLAG_COPY


      

Marco HTTPD_LIMIT_SENDING_TO_2MSS

#define HTTPD_LIMIT_SENDING_TO_2MSS 1


      

Marco HTTPD_MAX_WRITE_LEN(pcb)

#define HTTPD_MAX_WRITE_LEN(pcb)   ((u16_t)(2 * altcp_mss(pcb)))


      

Marco LWIP_HTTPD_CUSTOM_FILES

#define LWIP_HTTPD_CUSTOM_FILES      0


      

Marco LWIP_HTTPD_DYNAMIC_FILE_READ

#define LWIP_HTTPD_DYNAMIC_FILE_READ 0


      

Marco LWIP_HTTPD_FILE_STATE

#define LWIP_HTTPD_FILE_STATE        0


      

Marco HTTPD_PRECALCULATED_CHECKSUM

#define HTTPD_PRECALCULATED_CHECKSUM 0


      

Marco LWIP_HTTPD_FS_ASYNC_READ

#define LWIP_HTTPD_FS_ASYNC_READ     0


      

Marco HTTPD_FSDATA_FILE

#define HTTPD_FSDATA_FILE "fsdata_custom.c"


      

Marco HTTPD_FSDATA_FILE

#define HTTPD_FSDATA_FILE "fsdata.c"


      

Marco LWIP_HDR_APPS_LWIPERF_H

#define LWIP_HDR_APPS_LWIPERF_H


      

Marco LWIPERF_TCP_PORT_DEFAULT

#define LWIPERF_TCP_PORT_DEFAULT 5001


      

Marco LWIP_HDR_APPS_MDNS_H

#define LWIP_HDR_APPS_MDNS_H


      

Marco MDNS_PROBING_CONFLICT

#define MDNS_PROBING_CONFLICT  0


      

Marco MDNS_PROBING_SUCCESSFUL

#define MDNS_PROBING_SUCCESSFUL 1


      

Marco MDNS_LABEL_MAXLEN

#define MDNS_LABEL_MAXLEN 63


      

Marco mdns_resp_netif_settings_changed(netif)

#define mdns_resp_netif_settings_changed(netif) mdns_resp_announce(netif)
/**
 * @ingroup mdns
 * Announce IP settings have changed on netif.
 * Call this in your callback registered by netif_set_status_callback().
 * No need to call this function when LWIP_NETIF_EXT_STATUS_CALLBACK==1,
 * this handled automatically for you.
 * @param netif The network interface where settings have changed.
 */

Marco LWIP_HDR_APPS_MDNS_OPTS_H

#define LWIP_HDR_APPS_MDNS_OPTS_H


      

Marco LWIP_MDNS_RESPONDER

#define LWIP_MDNS_RESPONDER            0


      

Marco MDNS_MAX_SERVICES

#define MDNS_MAX_SERVICES              1


      

Marco MDNS_RESP_USENETIF_EXTCALLBACK

#define MDNS_RESP_USENETIF_EXTCALLBACK LWIP_NETIF_EXT_STATUS_CALLBACK


      

Marco MDNS_DEBUG

#define MDNS_DEBUG                      LWIP_DBG_OFF


      

Marco LWIP_HDR_MDNS_PRIV_H

#define LWIP_HDR_MDNS_PRIV_H


      

Marco MDNS_DOMAIN_MAXLEN

#define MDNS_DOMAIN_MAXLEN 256


      

Marco MDNS_READNAME_ERROR

#define MDNS_READNAME_ERROR 65535


      

Marco LWIP_HDR_APPS_MQTT_CLIENT_H

#define LWIP_HDR_APPS_MQTT_CLIENT_H


      

Marco MQTT_PORT

#define MQTT_PORT    LWIP_IANA_PORT_MQTT
/** @ingroup mqtt
 * Default MQTT port (non-TLS) */

Marco MQTT_TLS_PORT

#define MQTT_TLS_PORT LWIP_IANA_PORT_SECURE_MQTT
/** @ingroup mqtt
 * Default MQTT TLS port */

Marco mqtt_subscribe(client, topic, qos, cb, arg)

#define mqtt_subscribe(client, topic, qos, cb, arg) mqtt_sub_unsub(client, topic, qos, cb, arg, 1)
/** @ingroup mqtt
 *Subscribe to topic */

Marco mqtt_unsubscribe(client, topic, cb, arg)

#define mqtt_unsubscribe(client, topic, cb, arg) mqtt_sub_unsub(client, topic, 0, cb, arg, 0)
/** @ingroup mqtt
 *  Unsubscribe to topic */

Marco LWIP_HDR_APPS_MQTT_OPTS_H

#define LWIP_HDR_APPS_MQTT_OPTS_H


      

Marco MQTT_OUTPUT_RINGBUF_SIZE

#define MQTT_OUTPUT_RINGBUF_SIZE 256


      

Marco MQTT_VAR_HEADER_BUFFER_LEN

#define MQTT_VAR_HEADER_BUFFER_LEN 128


      

Marco MQTT_REQ_MAX_IN_FLIGHT

#define MQTT_REQ_MAX_IN_FLIGHT 4


      

Marco MQTT_CYCLIC_TIMER_INTERVAL

#define MQTT_CYCLIC_TIMER_INTERVAL 5


      

Marco MQTT_REQ_TIMEOUT

#define MQTT_REQ_TIMEOUT 30


      

Marco MQTT_CONNECT_TIMOUT

#define MQTT_CONNECT_TIMOUT 100


      

Marco LWIP_HDR_APPS_MQTT_PRIV_H

#define LWIP_HDR_APPS_MQTT_PRIV_H


      

Marco LWIP_HDR_APPS_NETBIOS_H

#define LWIP_HDR_APPS_NETBIOS_H


      

Marco LWIP_HDR_APPS_NETBIOS_OPTS_H

#define LWIP_HDR_APPS_NETBIOS_OPTS_H


      

Marco NETBIOS_LWIP_NAME

#define NETBIOS_LWIP_NAME "NETBIOSLWIPDEV"


      

Marco LWIP_NETBIOS_RESPOND_NAME_QUERY

#define LWIP_NETBIOS_RESPOND_NAME_QUERY  0


      

Marco LWIP_HDR_APPS_SMTP_H

#define LWIP_HDR_APPS_SMTP_H


      

Marco SMTP_DEFAULT_PORT

#define SMTP_DEFAULT_PORT        LWIP_IANA_PORT_SMTP
/** The default TCP port used for SMTP */

Marco SMTPS_DEFAULT_PORT

#define SMTPS_DEFAULT_PORT       LWIP_IANA_PORT_SMTPS
/** The default TCP port used for SMTPS */

Marco SMTP_RESULT_OK

#define SMTP_RESULT_OK           0
/** Email successfully sent */

Marco SMTP_RESULT_ERR_UNKNOWN

#define SMTP_RESULT_ERR_UNKNOWN  1
/** Unknown error */

Marco SMTP_RESULT_ERR_CONNECT

#define SMTP_RESULT_ERR_CONNECT  2
/** Connection to server failed */

Marco SMTP_RESULT_ERR_HOSTNAME

#define SMTP_RESULT_ERR_HOSTNAME 3
/** Failed to resolve server hostname */

Marco SMTP_RESULT_ERR_CLOSED

#define SMTP_RESULT_ERR_CLOSED   4
/** Connection unexpectedly closed by remote server */

Marco SMTP_RESULT_ERR_TIMEOUT

#define SMTP_RESULT_ERR_TIMEOUT  5
/** Connection timed out (server didn't respond in time) */

Marco SMTP_RESULT_ERR_SVR_RESP

#define SMTP_RESULT_ERR_SVR_RESP 6
/** Server responded with an unknown response code */

Marco SMTP_RESULT_ERR_MEM

#define SMTP_RESULT_ERR_MEM      7
/** Out of resources locally */

Marco SMTP_BODYDH_BUFFER_SIZE

#define SMTP_BODYDH_BUFFER_SIZE 256


      

Marco LWIP_HDR_APPS_SMTP_OPTS_H

#define LWIP_HDR_APPS_SMTP_OPTS_H


      

Marco LWIP_HDR_APPS_SNMP_H

#define LWIP_HDR_APPS_SNMP_H


      

Marco SNMP_GENTRAP_COLDSTART

#define SNMP_GENTRAP_COLDSTART 0
/** Generic trap: cold start */

Marco SNMP_GENTRAP_WARMSTART

#define SNMP_GENTRAP_WARMSTART 1
/** Generic trap: warm start */

Marco SNMP_GENTRAP_LINKDOWN

#define SNMP_GENTRAP_LINKDOWN 2
/** Generic trap: link down */

Marco SNMP_GENTRAP_LINKUP

#define SNMP_GENTRAP_LINKUP 3
/** Generic trap: link up */

Marco SNMP_GENTRAP_AUTH_FAILURE

#define SNMP_GENTRAP_AUTH_FAILURE 4
/** Generic trap: authentication failure */

Marco SNMP_GENTRAP_EGP_NEIGHBOR_LOSS

#define SNMP_GENTRAP_EGP_NEIGHBOR_LOSS 5
/** Generic trap: EGP neighbor lost */

Marco SNMP_GENTRAP_ENTERPRISE_SPECIFIC

#define SNMP_GENTRAP_ENTERPRISE_SPECIFIC 6
/** Generic trap: enterprise specific */

Marco SNMP_AUTH_TRAPS_DISABLED

#define SNMP_AUTH_TRAPS_DISABLED 0


      

Marco SNMP_AUTH_TRAPS_ENABLED

#define SNMP_AUTH_TRAPS_ENABLED 1


      

Marco LWIP_HDR_APPS_SNMP_CORE_H

#define LWIP_HDR_APPS_SNMP_CORE_H


      

Marco SNMP_ASN1_CLASS_UNIVERSAL

#define SNMP_ASN1_CLASS_UNIVERSAL  0
/* basic ASN1 defines */

Marco SNMP_ASN1_CLASS_APPLICATION

#define SNMP_ASN1_CLASS_APPLICATION 64


      

Marco SNMP_ASN1_CLASS_CONTEXT

#define SNMP_ASN1_CLASS_CONTEXT    128


      

Marco SNMP_ASN1_CLASS_PRIVATE

#define SNMP_ASN1_CLASS_PRIVATE    0xC0


      

Marco SNMP_ASN1_CONTENTTYPE_PRIMITIVE

#define SNMP_ASN1_CONTENTTYPE_PRIMITIVE  0


      

Marco SNMP_ASN1_CONTENTTYPE_CONSTRUCTED

#define SNMP_ASN1_CONTENTTYPE_CONSTRUCTED 32


      

Marco SNMP_ASN1_UNIVERSAL_END_OF_CONTENT

#define SNMP_ASN1_UNIVERSAL_END_OF_CONTENT 0
/* universal tags (from ASN.1 spec.) */

Marco SNMP_ASN1_UNIVERSAL_INTEGER

#define SNMP_ASN1_UNIVERSAL_INTEGER        2


      

Marco SNMP_ASN1_UNIVERSAL_OCTET_STRING

#define SNMP_ASN1_UNIVERSAL_OCTET_STRING   4


      

Marco SNMP_ASN1_UNIVERSAL_NULL

#define SNMP_ASN1_UNIVERSAL_NULL           5


      

Marco SNMP_ASN1_UNIVERSAL_OBJECT_ID

#define SNMP_ASN1_UNIVERSAL_OBJECT_ID      6


      

Marco SNMP_ASN1_UNIVERSAL_SEQUENCE_OF

#define SNMP_ASN1_UNIVERSAL_SEQUENCE_OF   16


      

Marco SNMP_ASN1_APPLICATION_IPADDR

#define SNMP_ASN1_APPLICATION_IPADDR   0 /* [APPLICATION 0] IMPLICIT OCTET STRING (SIZE (4)) */
/* application specific (SNMP) tags (from SNMPv2-SMI) */

Marco SNMP_ASN1_APPLICATION_COUNTER

#define SNMP_ASN1_APPLICATION_COUNTER  1 /* [APPLICATION 1] IMPLICIT INTEGER (0..4294967295) => u32_t */


      

Marco SNMP_ASN1_APPLICATION_GAUGE

#define SNMP_ASN1_APPLICATION_GAUGE    2 /* [APPLICATION 2] IMPLICIT INTEGER (0..4294967295) => u32_t */


      

Marco SNMP_ASN1_APPLICATION_TIMETICKS

#define SNMP_ASN1_APPLICATION_TIMETICKS 3 /* [APPLICATION 3] IMPLICIT INTEGER (0..4294967295) => u32_t */


      

Marco SNMP_ASN1_APPLICATION_OPAQUE

#define SNMP_ASN1_APPLICATION_OPAQUE   4 /* [APPLICATION 4] IMPLICIT OCTET STRING */


      

Marco SNMP_ASN1_APPLICATION_COUNTER64

#define SNMP_ASN1_APPLICATION_COUNTER64 6 /* [APPLICATION 6] IMPLICIT INTEGER (0..18446744073709551615) */


      

Marco SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE

#define SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE 1
/* context specific (SNMP) tags (from RFC 1905) */

Marco SNMP_ASN1_TYPE_END_OF_CONTENT

#define SNMP_ASN1_TYPE_END_OF_CONTENT (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_END_OF_CONTENT)
/* full ASN1 type defines */

Marco SNMP_ASN1_TYPE_INTEGER

#define SNMP_ASN1_TYPE_INTEGER       (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_INTEGER)


      

Marco SNMP_ASN1_TYPE_OCTET_STRING

#define SNMP_ASN1_TYPE_OCTET_STRING  (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_OCTET_STRING)


      

Marco SNMP_ASN1_TYPE_NULL

#define SNMP_ASN1_TYPE_NULL          (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_NULL)


      

Marco SNMP_ASN1_TYPE_OBJECT_ID

#define SNMP_ASN1_TYPE_OBJECT_ID     (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_UNIVERSAL_OBJECT_ID)


      

Marco SNMP_ASN1_TYPE_SEQUENCE

#define SNMP_ASN1_TYPE_SEQUENCE      (SNMP_ASN1_CLASS_UNIVERSAL | SNMP_ASN1_CONTENTTYPE_CONSTRUCTED | SNMP_ASN1_UNIVERSAL_SEQUENCE_OF)


      

Marco SNMP_ASN1_TYPE_IPADDR

#define SNMP_ASN1_TYPE_IPADDR        (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_IPADDR)


      

Marco SNMP_ASN1_TYPE_IPADDRESS

#define SNMP_ASN1_TYPE_IPADDRESS     SNMP_ASN1_TYPE_IPADDR


      

Marco SNMP_ASN1_TYPE_COUNTER

#define SNMP_ASN1_TYPE_COUNTER       (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_COUNTER)


      

Marco SNMP_ASN1_TYPE_COUNTER32

#define SNMP_ASN1_TYPE_COUNTER32     SNMP_ASN1_TYPE_COUNTER


      

Marco SNMP_ASN1_TYPE_GAUGE

#define SNMP_ASN1_TYPE_GAUGE         (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_GAUGE)


      

Marco SNMP_ASN1_TYPE_GAUGE32

#define SNMP_ASN1_TYPE_GAUGE32       SNMP_ASN1_TYPE_GAUGE


      

Marco SNMP_ASN1_TYPE_UNSIGNED32

#define SNMP_ASN1_TYPE_UNSIGNED32    SNMP_ASN1_TYPE_GAUGE


      

Marco SNMP_ASN1_TYPE_TIMETICKS

#define SNMP_ASN1_TYPE_TIMETICKS     (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_TIMETICKS)


      

Marco SNMP_ASN1_TYPE_OPAQUE

#define SNMP_ASN1_TYPE_OPAQUE        (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_OPAQUE)


      

Marco SNMP_ASN1_TYPE_COUNTER64

#define SNMP_ASN1_TYPE_COUNTER64     (SNMP_ASN1_CLASS_APPLICATION | SNMP_ASN1_CONTENTTYPE_PRIMITIVE | SNMP_ASN1_APPLICATION_COUNTER64)


      

Marco SNMP_VARBIND_EXCEPTION_OFFSET

#define SNMP_VARBIND_EXCEPTION_OFFSET 240


      

Marco SNMP_VARBIND_EXCEPTION_MASK

#define SNMP_VARBIND_EXCEPTION_MASK  15


      

Marco SNMP_NODE_TREE

#define SNMP_NODE_TREE        0
/**
SNMP MIB node types
 tree node is the only node the stack can process in order to walk the tree,
 all other nodes are assumed to be leaf nodes.
 This cannot be an enum because users may want to define their own node types.
*/

Marco SNMP_NODE_SCALAR

#define SNMP_NODE_SCALAR      1
/* predefined leaf node types */

Marco SNMP_NODE_SCALAR_ARRAY

#define SNMP_NODE_SCALAR_ARRAY 2


      

Marco SNMP_NODE_TABLE

#define SNMP_NODE_TABLE       3


      

Marco SNMP_NODE_THREADSYNC

#define SNMP_NODE_THREADSYNC  4


      

Marco SNMP_GET_VALUE_RAW_DATA

#define SNMP_GET_VALUE_RAW_DATA 16384 /* do not use 0x8000 because return value of node_instance_get_value_method is signed16 and 0x8000 would be the signed bit */


      

Marco SNMP_CREATE_TREE_NODE(oid, subnodes)

#define SNMP_CREATE_TREE_NODE(oid, subnodes) \
 {{ SNMP_NODE_TREE, (oid) }, \
 (u16_t)LWIP_ARRAYSIZE(subnodes), (subnodes) }


      

Marco SNMP_CREATE_EMPTY_TREE_NODE(oid)

#define SNMP_CREATE_EMPTY_TREE_NODE(oid) \
 {{ SNMP_NODE_TREE, (oid) }, \
 0, NULL }


      

Marco SNMP_MIB_CREATE(oid_list, root_node)

#define SNMP_MIB_CREATE(oid_list, root_node) { (oid_list), (u8_t)LWIP_ARRAYSIZE(oid_list), root_node }


      

Marco LWIP_HDR_APPS_SNMP_MIB2_H

#define LWIP_HDR_APPS_SNMP_MIB2_H


      

Marco SNMP_SYSSERVICES

#define SNMP_SYSSERVICES ((1 << 6) | (1 << 3) | ((IP_FORWARD) << 2))


      

Marco LWIP_HDR_SNMP_OPTS_H

#define LWIP_HDR_SNMP_OPTS_H


      

Marco LWIP_SNMP

#define LWIP_SNMP                      0


      

Marco SNMP_USE_NETCONN

#define SNMP_USE_NETCONN          0


      

Marco SNMP_USE_RAW

#define SNMP_USE_RAW              1


      

Marco SNMP_STACK_SIZE

#define SNMP_STACK_SIZE           DEFAULT_THREAD_STACKSIZE


      

Marco SNMP_THREAD_PRIO

#define SNMP_THREAD_PRIO          DEFAULT_THREAD_PRIO


      

Marco SNMP_TRAP_DESTINATIONS

#define SNMP_TRAP_DESTINATIONS         1


      

Marco SNMP_SAFE_REQUESTS

#define SNMP_SAFE_REQUESTS             1


      

Marco SNMP_MAX_OCTET_STRING_LEN

#define SNMP_MAX_OCTET_STRING_LEN      127


      

Marco SNMP_MAX_OBJ_ID_LEN

#define SNMP_MAX_OBJ_ID_LEN            50


      

Marco SNMP_MIN_VALUE_SIZE

#define SNMP_MIN_VALUE_SIZE            (2 * sizeof(u32_t*)) /* size required to store the basic types (8 bytes for counter64) */
/**
 * The minimum size of a value.
 */

Marco SNMP_MAX_VALUE_SIZE

#define SNMP_MAX_VALUE_SIZE            LWIP_MAX(LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN), sizeof(u32_t)*(SNMP_MAX_OBJ_ID_LEN)), SNMP_MIN_VALUE_SIZE)
/**
 * The maximum size of a value.
 */

Marco SNMP_COMMUNITY

#define SNMP_COMMUNITY                 "public"


      

Marco SNMP_COMMUNITY_WRITE

#define SNMP_COMMUNITY_WRITE           "private"


      

Marco SNMP_COMMUNITY_TRAP

#define SNMP_COMMUNITY_TRAP            "public"


      

Marco SNMP_MAX_COMMUNITY_STR_LEN

#define SNMP_MAX_COMMUNITY_STR_LEN LWIP_MAX(LWIP_MAX(sizeof(SNMP_COMMUNITY), sizeof(SNMP_COMMUNITY_WRITE)), sizeof(SNMP_COMMUNITY_TRAP))


      

Marco SNMP_LWIP_ENTERPRISE_OID

#define SNMP_LWIP_ENTERPRISE_OID 26381


      

Marco SNMP_DEVICE_ENTERPRISE_OID

#define SNMP_DEVICE_ENTERPRISE_OID {1, 3, 6, 1, 4, 1, SNMP_LWIP_ENTERPRISE_OID}
/**
 * IANA assigned enterprise ID for lwIP is 26381
 * @see http://www.iana.org/assignments/enterprise-numbers
 *
 * @note this enterprise ID is assigned to the lwIP project,
 * all object identifiers living under this ID are assigned
 * by the lwIP maintainers!
 * @note don't change this define, use snmp_set_device_enterprise_oid()
 *
 * If you need to create your own private MIB you'll need
 * to apply for your own enterprise ID with IANA:
 * http://www.iana.org/numbers.html
 */

Marco SNMP_DEVICE_ENTERPRISE_OID_LEN

#define SNMP_DEVICE_ENTERPRISE_OID_LEN 7
/**
 * Length of SNMP_DEVICE_ENTERPRISE_OID
 */

Marco SNMP_DEBUG

#define SNMP_DEBUG                     LWIP_DBG_OFF


      

Marco SNMP_MIB_DEBUG

#define SNMP_MIB_DEBUG                 LWIP_DBG_OFF


      

Marco SNMP_LWIP_MIB2

#define SNMP_LWIP_MIB2                     LWIP_SNMP


      

Marco SNMP_LWIP_MIB2_SYSDESC

#define SNMP_LWIP_MIB2_SYSDESC             "lwIP"


      

Marco SNMP_LWIP_MIB2_SYSNAME

#define SNMP_LWIP_MIB2_SYSNAME             "FQDN-unk"


      

Marco SNMP_LWIP_MIB2_SYSCONTACT

#define SNMP_LWIP_MIB2_SYSCONTACT          ""


      

Marco SNMP_LWIP_MIB2_SYSLOCATION

#define SNMP_LWIP_MIB2_SYSLOCATION         ""


      

Marco SNMP_LWIP_GETBULK_MAX_REPETITIONS

#define SNMP_LWIP_GETBULK_MAX_REPETITIONS 0


      

Marco LWIP_SNMP_V3

#define LWIP_SNMP_V3              0


      

Marco LWIP_SNMP_V3_MBEDTLS

#define LWIP_SNMP_V3_MBEDTLS      LWIP_SNMP_V3


      

Marco LWIP_SNMP_V3_CRYPTO

#define LWIP_SNMP_V3_CRYPTO       LWIP_SNMP_V3_MBEDTLS


      

Marco LWIP_SNMP_CONFIGURE_VERSIONS

#define LWIP_SNMP_CONFIGURE_VERSIONS 0


      

Marco LWIP_HDR_APPS_SNMP_SCALAR_H

#define LWIP_HDR_APPS_SNMP_SCALAR_H


      

Marco SNMP_SCALAR_CREATE_NODE(oid, access, asn1_type, get_value_method, set_test_method, set_value_method)

#define SNMP_SCALAR_CREATE_NODE(oid, access, asn1_type, get_value_method, set_test_method, set_value_method) \
 {{{ SNMP_NODE_SCALAR, (oid) }, \
   snmp_scalar_get_instance, \
   snmp_scalar_get_next_instance }, \
   (asn1_type), (access), (get_value_method), (set_test_method), (set_value_method) }


      

Marco SNMP_SCALAR_CREATE_NODE_READONLY(oid, asn1_type, get_value_method)

#define SNMP_SCALAR_CREATE_NODE_READONLY(oid, asn1_type, get_value_method) SNMP_SCALAR_CREATE_NODE(oid, SNMP_NODE_INSTANCE_READ_ONLY, asn1_type, get_value_method, NULL, NULL)


      

Marco SNMP_SCALAR_CREATE_ARRAY_NODE(oid, array_nodes, get_value_method, set_test_method, set_value_method)

#define SNMP_SCALAR_CREATE_ARRAY_NODE(oid, array_nodes, get_value_method, set_test_method, set_value_method) \
 {{{ SNMP_NODE_SCALAR_ARRAY, (oid) }, \
   snmp_scalar_array_get_instance, \
   snmp_scalar_array_get_next_instance }, \
   (u16_t)LWIP_ARRAYSIZE(array_nodes), (array_nodes), (get_value_method), (set_test_method), (set_value_method) }


      

Marco LWIP_HDR_APPS_SNMP_FRAMEWORK_MIB_H

#define LWIP_HDR_APPS_SNMP_FRAMEWORK_MIB_H


      

Marco LWIP_HDR_APPS_SNMP_USER_BASED_SM_MIB_H

#define LWIP_HDR_APPS_SNMP_USER_BASED_SM_MIB_H


      

Marco LWIP_HDR_APPS_SNMP_TABLE_H

#define LWIP_HDR_APPS_SNMP_TABLE_H


      

Marco SNMP_TABLE_CREATE(oid, columns, get_cell_instance_method, get_next_cell_instance_method, get_value_method, set_test_method, set_value_method)

#define SNMP_TABLE_CREATE(oid, columns, get_cell_instance_method, get_next_cell_instance_method, get_value_method, set_test_method, set_value_method) \
 {{{ SNMP_NODE_TABLE, (oid) }, \
 snmp_table_get_instance, \
 snmp_table_get_next_instance }, \
 (u16_t)LWIP_ARRAYSIZE(columns), (columns), \
 (get_cell_instance_method), (get_next_cell_instance_method), \
 (get_value_method), (set_test_method), (set_value_method)}


      

Marco SNMP_TABLE_GET_COLUMN_FROM_OID(oid)

#define SNMP_TABLE_GET_COLUMN_FROM_OID(oid) ((oid)[1]) /* first array value is (fixed) row entry (fixed to 1) and 2nd value is column, follow3ed by instance */


      

Marco SNMP_TABLE_CREATE_SIMPLE(oid, columns, get_cell_value_method, get_next_cell_instance_and_value_method)

#define SNMP_TABLE_CREATE_SIMPLE(oid, columns, get_cell_value_method, get_next_cell_instance_and_value_method) \
 {{{ SNMP_NODE_TABLE, (oid) }, \
 snmp_table_simple_get_instance, \
 snmp_table_simple_get_next_instance }, \
 (u16_t)LWIP_ARRAYSIZE(columns), (columns), (get_cell_value_method), (get_next_cell_instance_and_value_method) }


      

Marco LWIP_HDR_APPS_SNMP_THREADSYNC_H

#define LWIP_HDR_APPS_SNMP_THREADSYNC_H


      

Marco SNMP_CREATE_THREAD_SYNC_NODE(oid, target_leaf_node, threadsync_instance)

#define SNMP_CREATE_THREAD_SYNC_NODE(oid, target_leaf_node, threadsync_instance) \
 {{{ SNMP_NODE_THREADSYNC, (oid) }, \
   snmp_threadsync_get_instance, \
   snmp_threadsync_get_next_instance }, \
   (target_leaf_node), \
   (threadsync_instance) }
/** Create thread sync proxy node */

Marco LWIP_HDR_APPS_SNMP_V3_H

#define LWIP_HDR_APPS_SNMP_V3_H


      

Marco LWIP_HDR_APPS_SNTP_H

#define LWIP_HDR_APPS_SNTP_H


      

Marco SNTP_OPMODE_POLL

#define SNTP_OPMODE_POLL           0
/* SNTP operating modes: default is to poll using unicast.
   The mode has to be set before calling sntp_init(). */

Marco SNTP_OPMODE_LISTENONLY

#define SNTP_OPMODE_LISTENONLY     1


      

Marco sntp_servermode_dhcp

#define sntp_servermode_dhcp(x)


      

Marco LWIP_HDR_APPS_SNTP_OPTS_H

#define LWIP_HDR_APPS_SNTP_OPTS_H


      

Marco SNTP_SET_SYSTEM_TIME(sec)

#define SNTP_SET_SYSTEM_TIME(sec)  LWIP_UNUSED_ARG(sec)


      

Marco SNTP_MAX_SERVERS

#define SNTP_MAX_SERVERS          LWIP_DHCP_MAX_NTP_SERVERS


      

Marco SNTP_GET_SERVERS_FROM_DHCP

#define SNTP_GET_SERVERS_FROM_DHCP LWIP_DHCP_GET_NTP_SRV


      

Marco SNTP_SERVER_DNS

#define SNTP_SERVER_DNS           0


      

Marco SNTP_DEBUG

#define SNTP_DEBUG                 LWIP_DBG_OFF


      

Marco SNTP_PORT

#define SNTP_PORT                  LWIP_IANA_PORT_SNTP


      

Marco SNTP_CHECK_RESPONSE

#define SNTP_CHECK_RESPONSE        0


      

Marco SNTP_COMP_ROUNDTRIP

#define SNTP_COMP_ROUNDTRIP        0


      

Marco SNTP_STARTUP_DELAY

#define SNTP_STARTUP_DELAY         1


      

Marco SNTP_STARTUP_DELAY

#define SNTP_STARTUP_DELAY         0


      

Marco SNTP_STARTUP_DELAY_FUNC

#define SNTP_STARTUP_DELAY_FUNC    (LWIP_RAND() % 5000)


      

Marco SNTP_RECV_TIMEOUT

#define SNTP_RECV_TIMEOUT          15000


      

Marco SNTP_UPDATE_DELAY

#define SNTP_UPDATE_DELAY          3600000


      

Marco SNTP_GET_SYSTEM_TIME(sec, us)

#define SNTP_GET_SYSTEM_TIME(sec, us)    do { (sec) = 0; (us) = 0; } while(0)


      

Marco SNTP_RETRY_TIMEOUT

#define SNTP_RETRY_TIMEOUT         SNTP_RECV_TIMEOUT


      

Marco SNTP_RETRY_TIMEOUT_MAX

#define SNTP_RETRY_TIMEOUT_MAX     (SNTP_RETRY_TIMEOUT * 10)


      

Marco SNTP_RETRY_TIMEOUT_EXP

#define SNTP_RETRY_TIMEOUT_EXP     1


      

Marco SNTP_MONITOR_SERVER_REACHABILITY

#define SNTP_MONITOR_SERVER_REACHABILITY 1


      

Marco LWIP_HDR_APPS_TFTP_OPTS_H

#define LWIP_HDR_APPS_TFTP_OPTS_H


      

Marco TFTP_DEBUG

#define TFTP_DEBUG           LWIP_DBG_OFF


      

Marco TFTP_PORT

#define TFTP_PORT            LWIP_IANA_PORT_TFTP


      

Marco TFTP_TIMEOUT_MSECS

#define TFTP_TIMEOUT_MSECS   10000


      

Marco TFTP_MAX_RETRIES

#define TFTP_MAX_RETRIES     5


      

Marco TFTP_TIMER_MSECS

#define TFTP_TIMER_MSECS     (TFTP_TIMEOUT_MSECS / 10)


      

Marco TFTP_MAX_FILENAME_LEN

#define TFTP_MAX_FILENAME_LEN 20


      

Marco TFTP_MAX_MODE_LEN

#define TFTP_MAX_MODE_LEN    7


      

Marco LWIP_HDR_APPS_TFTP_SERVER_H

#define LWIP_HDR_APPS_TFTP_SERVER_H


      

Marco LWIP_HDR_ARCH_H

#define LWIP_HDR_ARCH_H


      

Marco LITTLE_ENDIAN

#define LITTLE_ENDIAN 1234


      

Marco BIG_ENDIAN

#define BIG_ENDIAN 4321


      

Marco BYTE_ORDER

#define BYTE_ORDER LITTLE_ENDIAN


      

Marco LWIP_RAND()

#define LWIP_RAND() ((u32_t)rand())


      

Marco LWIP_PLATFORM_DIAG(x)

#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)


      

Marco LWIP_PLATFORM_ASSERT(x)

#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \
                                    x, __LINE__, __FILE__); fflush(NULL); abort();} while(0)


      

Marco LWIP_NO_STDDEF_H

#define LWIP_NO_STDDEF_H 0


      

Marco LWIP_NO_STDINT_H

#define LWIP_NO_STDINT_H 0


      

Marco LWIP_HAVE_INT64

#define LWIP_HAVE_INT64 1


      

Marco LWIP_NO_INTTYPES_H

#define LWIP_NO_INTTYPES_H 0


      

Marco X8_F

#define X8_F "02" PRIx8


      

Marco U16_F

#define U16_F PRIu16


      

Marco S16_F

#define S16_F PRId16


      

Marco X16_F

#define X16_F PRIx16


      

Marco U32_F

#define U32_F PRIu32


      

Marco S32_F

#define S32_F PRId32


      

Marco X32_F

#define X32_F PRIx32


      

Marco SZT_F

#define SZT_F PRIuPTR


      

Marco LWIP_NO_LIMITS_H

#define LWIP_NO_LIMITS_H 0


      

Marco LWIP_NO_UNISTD_H

#define LWIP_NO_UNISTD_H 0


      

Marco LWIP_UINT32_MAX

#define LWIP_UINT32_MAX 4294967295
/* some maximum values needed in lwip code */

Marco LWIP_NO_CTYPE_H

#define LWIP_NO_CTYPE_H 0


      

Marco lwip_in_range(c, lo, up)

#define lwip_in_range(c, lo, up) ((u8_t)(c) >= (lo) && (u8_t)(c) <= (up))


      

Marco lwip_isdigit(c)

#define lwip_isdigit(c)          lwip_in_range((c), '0', '9')


      

Marco lwip_isxdigit(c)

#define lwip_isxdigit(c)         (lwip_isdigit(c) || lwip_in_range((c), 'a', 'f') || lwip_in_range((c), 'A', 'F'))


      

Marco lwip_islower(c)

#define lwip_islower(c)          lwip_in_range((c), 'a', 'z')


      

Marco lwip_isspace(c)

#define lwip_isspace(c)          ((c) == ' ' || (c) == '\f' || (c) == '\n' || (c) == '\r' || (c) == '\t' || (c) == '\v')


      

Marco lwip_isupper(c)

#define lwip_isupper(c)          lwip_in_range((c), 'A', 'Z')


      

Marco lwip_tolower(c)

#define lwip_tolower(c)          (lwip_isupper(c) ? (c) - 'A' + 'a' : c)


      

Marco lwip_toupper(c)

#define lwip_toupper(c)          (lwip_islower(c) ? (c) - 'a' + 'A' : c)


      

Marco lwip_isdigit(c)

#define lwip_isdigit(c)          isdigit((unsigned char)(c))


      

Marco lwip_isxdigit(c)

#define lwip_isxdigit(c)         isxdigit((unsigned char)(c))


      

Marco lwip_islower(c)

#define lwip_islower(c)          islower((unsigned char)(c))


      

Marco lwip_isspace(c)

#define lwip_isspace(c)          isspace((unsigned char)(c))


      

Marco lwip_isupper(c)

#define lwip_isupper(c)          isupper((unsigned char)(c))


      

Marco lwip_tolower(c)

#define lwip_tolower(c)          tolower((unsigned char)(c))


      

Marco lwip_toupper(c)

#define lwip_toupper(c)          toupper((unsigned char)(c))


      

Marco LWIP_CONST_CAST(target_type, val)

#define LWIP_CONST_CAST(target_type, val) ((target_type)((ptrdiff_t)val))


      

Marco LWIP_ALIGNMENT_CAST(target_type, val)

#define LWIP_ALIGNMENT_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)


      

Marco LWIP_PTR_NUMERIC_CAST(target_type, val)

#define LWIP_PTR_NUMERIC_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)


      

Marco LWIP_PACKED_CAST(target_type, val)

#define LWIP_PACKED_CAST(target_type, val) LWIP_CONST_CAST(target_type, val)


      

Marco LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size)

#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size) u8_t variable_name[LWIP_MEM_ALIGN_BUFFER(size)]


      

Marco LWIP_MEM_ALIGN_SIZE(size)

#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1U) & ~(MEM_ALIGNMENT-1U))


      

Marco LWIP_MEM_ALIGN_BUFFER(size)

#define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1U))


      

Marco LWIP_MEM_ALIGN(addr)

#define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1)))


      

Marco PACK_STRUCT_BEGIN

#define PACK_STRUCT_BEGIN


      

Marco PACK_STRUCT_END

#define PACK_STRUCT_END


      

Marco PACK_STRUCT_STRUCT

#define PACK_STRUCT_STRUCT __attribute__((packed))


      

Marco PACK_STRUCT_STRUCT

#define PACK_STRUCT_STRUCT


      

Marco PACK_STRUCT_FIELD(x)

#define PACK_STRUCT_FIELD(x) x


      

Marco PACK_STRUCT_FLD_8(x)

#define PACK_STRUCT_FLD_8(x) PACK_STRUCT_FIELD(x)


      

Marco PACK_STRUCT_FLD_S(x)

#define PACK_STRUCT_FLD_S(x) PACK_STRUCT_FIELD(x)


      

Marco PACK_STRUCT_USE_INCLUDES

#define PACK_STRUCT_USE_INCLUDES


      

Marco LWIP_UNUSED_ARG(x)

#define LWIP_UNUSED_ARG(x) (void)x


      

Marco LWIP_PROVIDE_ERRNO

#define LWIP_PROVIDE_ERRNO


      

Marco LWIP_HDR_AUTOIP_H

#define LWIP_HDR_AUTOIP_H


      

Marco AUTOIP_TMR_INTERVAL

#define AUTOIP_TMR_INTERVAL     100
/** AutoIP Timing */

Marco AUTOIP_TICKS_PER_SECOND

#define AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL)


      

Marco autoip_remove_struct(netif)

#define autoip_remove_struct(netif) do { (netif)->autoip = NULL; } while (0)
/** Remove a struct autoip previously set to the netif using autoip_set_struct() */

Marco netif_autoip_data(netif)

#define netif_autoip_data(netif) ((struct autoip*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_AUTOIP))


      

Marco LWIP_HDR_DEBUG_H

#define LWIP_HDR_DEBUG_H


      

Marco LWIP_DBG_LEVEL_ALL

#define LWIP_DBG_LEVEL_ALL    0
/** Debug level: ALL messages*/

Marco LWIP_DBG_LEVEL_WARNING

#define LWIP_DBG_LEVEL_WARNING 1
/** Debug level: Warnings. bad checksums, dropped packets, ... */

Marco LWIP_DBG_LEVEL_SERIOUS

#define LWIP_DBG_LEVEL_SERIOUS 2
/** Debug level: Serious. memory allocation failures, ... */

Marco LWIP_DBG_LEVEL_SEVERE

#define LWIP_DBG_LEVEL_SEVERE 3
/** Debug level: Severe */

Marco LWIP_DBG_MASK_LEVEL

#define LWIP_DBG_MASK_LEVEL   3


      

Marco LWIP_DBG_LEVEL_OFF

#define LWIP_DBG_LEVEL_OFF    LWIP_DBG_LEVEL_ALL
/* compatibility define only */

Marco LWIP_DBG_ON

#define LWIP_DBG_ON           0x80U
/** flag for LWIP_DEBUGF to enable that debug message */

Marco LWIP_DBG_OFF

#define LWIP_DBG_OFF          0x00U
/** flag for LWIP_DEBUGF to disable that debug message */

Marco LWIP_DBG_TRACE

#define LWIP_DBG_TRACE        0x40U
/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */

Marco LWIP_DBG_STATE

#define LWIP_DBG_STATE        0x20U
/** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */

Marco LWIP_DBG_FRESH

#define LWIP_DBG_FRESH        0x10U
/** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */

Marco LWIP_DBG_HALT

#define LWIP_DBG_HALT         0x08U
/** flag for LWIP_DEBUGF to halt after printing this debug message */

Marco LWIP_NOASSERT

#define LWIP_NOASSERT


      

Marco LWIP_ASSERT(message, assertion)

#define LWIP_ASSERT(message, assertion) do { if (!(assertion)) { \
 LWIP_PLATFORM_ASSERT(message); }} while(0)


      

Marco LWIP_ASSERT

#define LWIP_ASSERT(message, assertion)


      

Marco LWIP_PLATFORM_ERROR(message)

#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_ASSERT(message)


      

Marco LWIP_PLATFORM_ERROR(message)

#define LWIP_PLATFORM_ERROR(message) LWIP_PLATFORM_DIAG((message))


      

Marco LWIP_PLATFORM_ERROR

#define LWIP_PLATFORM_ERROR(message)


      

Marco LWIP_ERROR(message, expression, handler)

#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \
 LWIP_PLATFORM_ERROR(message); handler;}} while(0)
/* if "expression" isn't true, then print "message" and execute "handler" expression */

Marco LWIP_DEBUG

#define LWIP_DEBUG


      

Marco LWIP_DEBUGF(debug, message)

#define LWIP_DEBUGF(debug, message) do { \
                              if ( \
                                  ((debug) & LWIP_DBG_ON) && \
                                  ((debug) & LWIP_DBG_TYPES_ON) && \
                                  ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \
                                LWIP_PLATFORM_DIAG(message); \
                                if ((debug) & LWIP_DBG_HALT) { \
                                  while(1); \
                                } \
                              } \
                            } while(0)


      

Marco LWIP_DEBUGF

#define LWIP_DEBUGF(debug, message)


      

Marco LWIP_HDR_DEF_H

#define LWIP_HDR_DEF_H


      

Marco PERF_START

#define PERF_START   /* null definition */


      

Marco PERF_STOP(x)

#define PERF_STOP(x) /* null definition */


      

Marco LWIP_MAX(x , y)

#define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y))


      

Marco LWIP_MIN(x , y)

#define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y))


      

Marco LWIP_ARRAYSIZE(x)

#define LWIP_ARRAYSIZE(x) (sizeof(x)/sizeof((x)[0]))
/* Get the number of entries in an array ('x' must NOT be a pointer!) */

Marco LWIP_MAKEU32(a,b,c,d)

#define LWIP_MAKEU32(a,b,c,d) (((u32_t)((a) & 255) << 24) | \
                              ((u32_t)((b) & 255) << 16) | \
                              ((u32_t)((c) & 255) << 8) | \
                               (u32_t)((d) & 255))
/** Create u32_t value from bytes */

Marco NULL

#define NULL 0


      

Marco NULL

#define NULL ((void *)0)


      

Marco lwip_htons(x)

#define lwip_htons(x) ((u16_t)(x))


      

Marco lwip_ntohs(x)

#define lwip_ntohs(x) ((u16_t)(x))


      

Marco lwip_htonl(x)

#define lwip_htonl(x) ((u32_t)(x))


      

Marco lwip_ntohl(x)

#define lwip_ntohl(x) ((u32_t)(x))


      

Marco PP_HTONS(x)

#define PP_HTONS(x)  ((u16_t)(x))


      

Marco PP_NTOHS(x)

#define PP_NTOHS(x)  ((u16_t)(x))


      

Marco PP_HTONL(x)

#define PP_HTONL(x)  ((u32_t)(x))


      

Marco PP_NTOHL(x)

#define PP_NTOHL(x)  ((u32_t)(x))


      

Marco lwip_ntohs(x)

#define lwip_ntohs(x) lwip_htons(x)


      

Marco lwip_ntohl(x)

#define lwip_ntohl(x) lwip_htonl(x)


      

Marco PP_HTONS(x)

#define PP_HTONS(x) ((u16_t)((((x) & (u16_t)0x00ffU) << 8) | (((x) & (u16_t)0xff00U) >> 8)))
/* These macros should be calculated by the preprocessor and are used
   with compile-time constants only (so that there is no little-endian
   overhead at runtime). */

Marco PP_NTOHS(x)

#define PP_NTOHS(x) PP_HTONS(x)


      

Marco PP_HTONL(x)

#define PP_HTONL(x) ((((x) & (u32_t)0x000000ffUL) << 24) | \
                    (((x) & (u32_t)0x0000ff00UL) << 8) | \
                    (((x) & (u32_t)0x00ff0000UL) >> 8) | \
                    (((x) & (u32_t)0xff000000UL) >> 24))


      

Marco PP_NTOHL(x)

#define PP_NTOHL(x) PP_HTONL(x)


      

Marco htons(x)

#define htons(x) lwip_htons(x)


      

Marco ntohs(x)

#define ntohs(x) lwip_ntohs(x)


      

Marco htonl(x)

#define htonl(x) lwip_htonl(x)


      

Marco ntohl(x)

#define ntohl(x) lwip_ntohl(x)


      

Marco LWIP_HDR_DHCP_H

#define LWIP_HDR_DHCP_H


      

Marco DHCP_COARSE_TIMER_SECS

#define DHCP_COARSE_TIMER_SECS 60


      

Marco DHCP_COARSE_TIMER_MSECS

#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL)
/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */

Marco DHCP_FINE_TIMER_MSECS

#define DHCP_FINE_TIMER_MSECS  500
/** period (in milliseconds) of the application calling dhcp_fine_tmr() */

Marco DHCP_BOOT_FILE_LEN

#define DHCP_BOOT_FILE_LEN     128U


      

Marco dhcp_remove_struct(netif)

#define dhcp_remove_struct(netif) netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, NULL)
/** Remove a struct dhcp previously set to the netif using dhcp_set_struct() */

Marco netif_dhcp_data(netif)

#define netif_dhcp_data(netif) ((struct dhcp*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP))


      

Marco LWIP_HDR_IP6_DHCP6_H

#define LWIP_HDR_IP6_DHCP6_H


      

Marco DHCP6_TIMER_MSECS

#define DHCP6_TIMER_MSECS  500
/** period (in milliseconds) of the application calling dhcp6_tmr() */

Marco dhcp6_remove_struct(netif)

#define dhcp6_remove_struct(netif) netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6, NULL)
/** Remove a struct dhcp6 previously set to the netif using dhcp6_set_struct() */

Marco netif_dhcp6_data(netif)

#define netif_dhcp6_data(netif) ((struct dhcp6*)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP6))


      

Marco LWIP_HDR_DNS_H

#define LWIP_HDR_DNS_H


      

Marco DNS_TMR_INTERVAL

#define DNS_TMR_INTERVAL         1000
/** DNS timer period */

Marco LWIP_DNS_ADDRTYPE_IPV4

#define LWIP_DNS_ADDRTYPE_IPV4     0
/* DNS resolve types: */

Marco LWIP_DNS_ADDRTYPE_IPV6

#define LWIP_DNS_ADDRTYPE_IPV6     1


      

Marco LWIP_DNS_ADDRTYPE_IPV4_IPV6

#define LWIP_DNS_ADDRTYPE_IPV4_IPV6 2 /* try to resolve IPv4 first, try IPv6 if IPv4 fails only */


      

Marco LWIP_DNS_ADDRTYPE_IPV6_IPV4

#define LWIP_DNS_ADDRTYPE_IPV6_IPV4 3 /* try to resolve IPv6 first, try IPv4 if IPv6 fails only */


      

Marco LWIP_DNS_ADDRTYPE_DEFAULT

#define LWIP_DNS_ADDRTYPE_DEFAULT  LWIP_DNS_ADDRTYPE_IPV4_IPV6


      

Marco LWIP_DNS_ADDRTYPE_DEFAULT

#define LWIP_DNS_ADDRTYPE_DEFAULT  LWIP_DNS_ADDRTYPE_IPV4


      

Marco LWIP_DNS_ADDRTYPE_DEFAULT

#define LWIP_DNS_ADDRTYPE_DEFAULT  LWIP_DNS_ADDRTYPE_IPV6


      

Marco DNS_LOCAL_HOSTLIST_ELEM(name, addr_init)

#define DNS_LOCAL_HOSTLIST_ELEM(name, addr_init) {name, addr_init, NULL}


      

Marco DNS_LOCAL_HOSTLIST_MAX_NAMELEN

#define DNS_LOCAL_HOSTLIST_MAX_NAMELEN DNS_MAX_NAME_LENGTH


      

Marco LOCALHOSTLIST_ELEM_SIZE

#define LOCALHOSTLIST_ELEM_SIZE ((sizeof(struct local_hostlist_entry) + DNS_LOCAL_HOSTLIST_MAX_NAMELEN + 1))


      

Marco LWIP_HDR_ERR_H

#define LWIP_HDR_ERR_H


      

Marco lwip_strerr(x)

#define lwip_strerr(x) ""


      

Marco LWIP_HDR_ERRNO_H

#define LWIP_HDR_ERRNO_H


      

Marco EPERM

#define EPERM           1 /* Operation not permitted */


      

Marco ENOENT

#define ENOENT          2 /* No such file or directory */


      

Marco ESRCH

#define ESRCH           3 /* No such process */


      

Marco EINTR

#define EINTR           4 /* Interrupted system call */


      

Marco EIO

#define EIO             5 /* I/O error */


      

Marco ENXIO

#define ENXIO           6 /* No such device or address */


      

Marco E2BIG

#define E2BIG           7 /* Arg list too long */


      

Marco ENOEXEC

#define ENOEXEC         8 /* Exec format error */


      

Marco EBADF

#define EBADF           9 /* Bad file number */


      

Marco ECHILD

#define ECHILD         10 /* No child processes */


      

Marco EAGAIN

#define EAGAIN         11 /* Try again */


      

Marco ENOMEM

#define ENOMEM         12 /* Out of memory */


      

Marco EACCES

#define EACCES         13 /* Permission denied */


      

Marco EFAULT

#define EFAULT         14 /* Bad address */


      

Marco ENOTBLK

#define ENOTBLK        15 /* Block device required */


      

Marco EBUSY

#define EBUSY          16 /* Device or resource busy */


      

Marco EEXIST

#define EEXIST         17 /* File exists */


      

Marco EXDEV

#define EXDEV          18 /* Cross-device link */


      

Marco ENODEV

#define ENODEV         19 /* No such device */


      

Marco ENOTDIR

#define ENOTDIR        20 /* Not a directory */


      

Marco EISDIR

#define EISDIR         21 /* Is a directory */


      

Marco EINVAL

#define EINVAL         22 /* Invalid argument */


      

Marco ENFILE

#define ENFILE         23 /* File table overflow */


      

Marco EMFILE

#define EMFILE         24 /* Too many open files */


      

Marco ENOTTY

#define ENOTTY         25 /* Not a typewriter */


      

Marco ETXTBSY

#define ETXTBSY        26 /* Text file busy */


      

Marco EFBIG

#define EFBIG          27 /* File too large */


      

Marco ENOSPC

#define ENOSPC         28 /* No space left on device */


      

Marco ESPIPE

#define ESPIPE         29 /* Illegal seek */


      

Marco EROFS

#define EROFS          30 /* Read-only file system */


      
      
#define EMLINK         31 /* Too many links */


      

Marco EPIPE

#define EPIPE          32 /* Broken pipe */


      

Marco EDOM

#define EDOM           33 /* Math argument out of domain of func */


      

Marco ERANGE

#define ERANGE         34 /* Math result not representable */


      

Marco EDEADLK

#define EDEADLK        35 /* Resource deadlock would occur */


      

Marco ENAMETOOLONG

#define ENAMETOOLONG   36 /* File name too long */


      

Marco ENOLCK

#define ENOLCK         37 /* No record locks available */


      

Marco ENOSYS

#define ENOSYS         38 /* Function not implemented */


      

Marco ENOTEMPTY

#define ENOTEMPTY      39 /* Directory not empty */


      

Marco ELOOP

#define ELOOP          40 /* Too many symbolic links encountered */


      

Marco EWOULDBLOCK

#define EWOULDBLOCK    EAGAIN /* Operation would block */


      

Marco ENOMSG

#define ENOMSG         42 /* No message of desired type */


      

Marco EIDRM

#define EIDRM          43 /* Identifier removed */


      

Marco ECHRNG

#define ECHRNG         44 /* Channel number out of range */


      

Marco EL2NSYNC

#define EL2NSYNC       45 /* Level 2 not synchronized */


      

Marco EL3HLT

#define EL3HLT         46 /* Level 3 halted */


      

Marco EL3RST

#define EL3RST         47 /* Level 3 reset */


      

Marco ELNRNG

#define ELNRNG         48 /* Link number out of range */


      

Marco EUNATCH

#define EUNATCH        49 /* Protocol driver not attached */


      

Marco ENOCSI

#define ENOCSI         50 /* No CSI structure available */


      

Marco EL2HLT

#define EL2HLT         51 /* Level 2 halted */


      

Marco EBADE

#define EBADE          52 /* Invalid exchange */


      

Marco EBADR

#define EBADR          53 /* Invalid request descriptor */


      

Marco EXFULL

#define EXFULL         54 /* Exchange full */


      

Marco ENOANO

#define ENOANO         55 /* No anode */


      

Marco EBADRQC

#define EBADRQC        56 /* Invalid request code */


      

Marco EBADSLT

#define EBADSLT        57 /* Invalid slot */


      

Marco EDEADLOCK

#define EDEADLOCK      EDEADLK


      

Marco EBFONT

#define EBFONT         59 /* Bad font file format */


      

Marco ENOSTR

#define ENOSTR         60 /* Device not a stream */


      

Marco ENODATA

#define ENODATA        61 /* No data available */


      

Marco ETIME

#define ETIME          62 /* Timer expired */


      

Marco ENOSR

#define ENOSR          63 /* Out of streams resources */


      

Marco ENONET

#define ENONET         64 /* Machine is not on the network */


      

Marco ENOPKG

#define ENOPKG         65 /* Package not installed */


      

Marco EREMOTE

#define EREMOTE        66 /* Object is remote */


      
      
#define ENOLINK        67 /* Link has been severed */


      

Marco EADV

#define EADV           68 /* Advertise error */


      

Marco ESRMNT

#define ESRMNT         69 /* Srmount error */


      

Marco ECOMM

#define ECOMM          70 /* Communication error on send */


      

Marco EPROTO

#define EPROTO         71 /* Protocol error */


      

Marco EMULTIHOP

#define EMULTIHOP      72 /* Multihop attempted */


      

Marco EDOTDOT

#define EDOTDOT        73 /* RFS specific error */


      

Marco EBADMSG

#define EBADMSG        74 /* Not a data message */


      

Marco EOVERFLOW

#define EOVERFLOW      75 /* Value too large for defined data type */


      

Marco ENOTUNIQ

#define ENOTUNIQ       76 /* Name not unique on network */


      

Marco EBADFD

#define EBADFD         77 /* File descriptor in bad state */


      

Marco EREMCHG

#define EREMCHG        78 /* Remote address changed */


      

Marco ELIBACC

#define ELIBACC        79 /* Can not access a needed shared library */


      

Marco ELIBBAD

#define ELIBBAD        80 /* Accessing a corrupted shared library */


      

Marco ELIBSCN

#define ELIBSCN        81 /* .lib section in a.out corrupted */


      

Marco ELIBMAX

#define ELIBMAX        82 /* Attempting to link in too many shared libraries */


      

Marco ELIBEXEC

#define ELIBEXEC       83 /* Cannot exec a shared library directly */


      

Marco EILSEQ

#define EILSEQ         84 /* Illegal byte sequence */


      

Marco ERESTART

#define ERESTART       85 /* Interrupted system call should be restarted */


      

Marco ESTRPIPE

#define ESTRPIPE       86 /* Streams pipe error */


      

Marco EUSERS

#define EUSERS         87 /* Too many users */


      

Marco ENOTSOCK

#define ENOTSOCK       88 /* Socket operation on non-socket */


      

Marco EDESTADDRREQ

#define EDESTADDRREQ   89 /* Destination address required */


      

Marco EMSGSIZE

#define EMSGSIZE       90 /* Message too long */


      

Marco EPROTOTYPE

#define EPROTOTYPE     91 /* Protocol wrong type for socket */


      

Marco ENOPROTOOPT

#define ENOPROTOOPT    92 /* Protocol not available */


      

Marco EPROTONOSUPPORT

#define EPROTONOSUPPORT 93 /* Protocol not supported */


      

Marco ESOCKTNOSUPPORT

#define ESOCKTNOSUPPORT 94 /* Socket type not supported */


      

Marco EOPNOTSUPP

#define EOPNOTSUPP     95 /* Operation not supported on transport endpoint */


      

Marco EPFNOSUPPORT

#define EPFNOSUPPORT   96 /* Protocol family not supported */


      

Marco EAFNOSUPPORT

#define EAFNOSUPPORT   97 /* Address family not supported by protocol */


      

Marco EADDRINUSE

#define EADDRINUSE     98 /* Address already in use */


      

Marco EADDRNOTAVAIL

#define EADDRNOTAVAIL  99 /* Cannot assign requested address */


      

Marco ENETDOWN

#define ENETDOWN      100 /* Network is down */


      

Marco ENETUNREACH

#define ENETUNREACH   101 /* Network is unreachable */


      

Marco ENETRESET

#define ENETRESET     102 /* Network dropped connection because of reset */


      

Marco ECONNABORTED

#define ECONNABORTED  103 /* Software caused connection abort */


      

Marco ECONNRESET

#define ECONNRESET    104 /* Connection reset by peer */


      

Marco ENOBUFS

#define ENOBUFS       105 /* No buffer space available */


      

Marco EISCONN

#define EISCONN       106 /* Transport endpoint is already connected */


      

Marco ENOTCONN

#define ENOTCONN      107 /* Transport endpoint is not connected */


      

Marco ESHUTDOWN

#define ESHUTDOWN     108 /* Cannot send after transport endpoint shutdown */


      

Marco ETOOMANYREFS

#define ETOOMANYREFS  109 /* Too many references: cannot splice */


      

Marco ETIMEDOUT

#define ETIMEDOUT     110 /* Connection timed out */


      

Marco ECONNREFUSED

#define ECONNREFUSED  111 /* Connection refused */


      

Marco EHOSTDOWN

#define EHOSTDOWN     112 /* Host is down */


      

Marco EHOSTUNREACH

#define EHOSTUNREACH  113 /* No route to host */


      

Marco EALREADY

#define EALREADY      114 /* Operation already in progress */


      

Marco EINPROGRESS

#define EINPROGRESS   115 /* Operation now in progress */


      

Marco ESTALE

#define ESTALE        116 /* Stale NFS file handle */


      

Marco EUCLEAN

#define EUCLEAN       117 /* Structure needs cleaning */


      

Marco ENOTNAM

#define ENOTNAM       118 /* Not a XENIX named type file */


      

Marco ENAVAIL

#define ENAVAIL       119 /* No XENIX semaphores available */


      

Marco EISNAM

#define EISNAM        120 /* Is a named type file */


      

Marco EREMOTEIO

#define EREMOTEIO     121 /* Remote I/O error */


      

Marco EDQUOT

#define EDQUOT        122 /* Quota exceeded */


      

Marco ENOMEDIUM

#define ENOMEDIUM     123 /* No medium found */


      

Marco EMEDIUMTYPE

#define EMEDIUMTYPE   124 /* Wrong medium type */


      

Marco LWIP_HDR_NETIF_ETHARP_H

#define LWIP_HDR_NETIF_ETHARP_H


      

Marco ARP_TMR_INTERVAL

#define ARP_TMR_INTERVAL 1000
/** 1 seconds period */

Marco etharp_init()

#define etharp_init() /* Compatibility define, no init needed. */


      

Marco etharp_gratuitous(netif)

#define etharp_gratuitous(netif) etharp_request((netif), netif_ip4_addr(netif))
/** For Ethernet network interfaces, we might want to send "gratuitous ARP";
 *  this is an ARP packet sent by a node in order to spontaneously cause other
 *  nodes to update an entry in their ARP cache.
 *  From RFC 3220 "IP Mobility Support for IPv4" section 4.6. */

Marco LWIP_HDR_ETHIP6_H

#define LWIP_HDR_ETHIP6_H


      

Marco LWIP_HDR_ICMP_H

#define LWIP_HDR_ICMP_H


      

Marco icmp_port_unreach(isipv6, pbuf)

#define icmp_port_unreach(isipv6, pbuf) ((isipv6) ? \
                                        icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT) : \
                                        icmp_dest_unreach(pbuf, ICMP_DUR_PORT))


      

Marco icmp_port_unreach(isipv6, pbuf)

#define icmp_port_unreach(isipv6, pbuf) do{ if(!(isipv6)) { icmp_dest_unreach(pbuf, ICMP_DUR_PORT);}}while(0)


      

Marco icmp_port_unreach(isipv6, pbuf)

#define icmp_port_unreach(isipv6, pbuf) do{ if(isipv6) { icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT);}}while(0)


      

Marco icmp_port_unreach

#define icmp_port_unreach(isipv6, pbuf)


      

Marco icmp_port_unreach(isipv6, pbuf)

#define icmp_port_unreach(isipv6, pbuf) icmp6_dest_unreach(pbuf, ICMP6_DUR_PORT)


      

Marco icmp_port_unreach(isipv6, pbuf)

#define icmp_port_unreach(isipv6, pbuf) icmp_dest_unreach(pbuf, ICMP_DUR_PORT)


      

Marco icmp_port_unreach

#define icmp_port_unreach(isipv6, pbuf)


      

Marco LWIP_HDR_ICMP6_H

#define LWIP_HDR_ICMP6_H


      

Marco LWIP_HDR_IF_H

#define LWIP_HDR_IF_H


      

Marco IF_NAMESIZE

#define IF_NAMESIZE NETIF_NAMESIZE


      

Marco if_indextoname(ifindex, ifname)

#define if_indextoname(ifindex, ifname) lwip_if_indextoname(ifindex,ifname)


      

Marco if_nametoindex(ifname)

#define if_nametoindex(ifname)          lwip_if_nametoindex(ifname)


      

Marco LWIP_HDR_IGMP_H

#define LWIP_HDR_IGMP_H


      

Marco IGMP_TMR_INTERVAL

#define IGMP_TMR_INTERVAL             100 /* Milliseconds */
/* IGMP timer */

Marco IGMP_V1_DELAYING_MEMBER_TMR

#define IGMP_V1_DELAYING_MEMBER_TMR  (1000/IGMP_TMR_INTERVAL)


      

Marco IGMP_JOIN_DELAYING_MEMBER_TMR

#define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL)


      

Marco IGMP_DEL_MAC_FILTER

#define IGMP_DEL_MAC_FILTER           NETIF_DEL_MAC_FILTER
/* Compatibility defines (don't use for new code) */

Marco IGMP_ADD_MAC_FILTER

#define IGMP_ADD_MAC_FILTER           NETIF_ADD_MAC_FILTER


      

Marco netif_igmp_data(netif)

#define netif_igmp_data(netif) ((struct igmp_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_IGMP))
/** @ingroup igmp 
 * Get list head of IGMP groups for netif.
 * Note: The allsystems group IP is contained in the list as first entry.
 * @see @ref netif_set_igmp_mac_filter()
 */

Marco LWIP_HDR_INET_H

#define LWIP_HDR_INET_H


      

Marco s6_addr

#define s6_addr un.u8_addr


      

Marco INADDR_NONE

#define INADDR_NONE        IPADDR_NONE
/** 255.255.255.255 */

Marco INADDR_LOOPBACK

#define INADDR_LOOPBACK    IPADDR_LOOPBACK
/** 127.0.0.1 */

Marco INADDR_ANY

#define INADDR_ANY         IPADDR_ANY
/** 0.0.0.0 */

Marco INADDR_BROADCAST

#define INADDR_BROADCAST   IPADDR_BROADCAST
/** 255.255.255.255 */

Marco IN6ADDR_ANY_INIT

#define IN6ADDR_ANY_INIT {{{0,0,0,0}}}
/** This macro can be used to initialize a variable of type struct in6_addr
    to the IPv6 wildcard address. */

Marco IN6ADDR_LOOPBACK_INIT

#define IN6ADDR_LOOPBACK_INIT {{{0,0,0,PP_HTONL(1)}}}
/** This macro can be used to initialize a variable of type struct in6_addr
    to the IPv6 loopback address. */

Marco IN_CLASSA(a)

#define IN_CLASSA(a)       IP_CLASSA(a)
/* Definitions of the bits in an (IPv4) Internet address integer.

   On subnets, host and network parts are found according to
   the subnet mask, not these masks.  */

Marco IN_CLASSA_NET

#define IN_CLASSA_NET      IP_CLASSA_NET


      

Marco IN_CLASSA_NSHIFT

#define IN_CLASSA_NSHIFT   IP_CLASSA_NSHIFT


      

Marco IN_CLASSA_HOST

#define IN_CLASSA_HOST     IP_CLASSA_HOST


      

Marco IN_CLASSA_MAX

#define IN_CLASSA_MAX      IP_CLASSA_MAX


      

Marco IN_CLASSB(b)

#define IN_CLASSB(b)       IP_CLASSB(b)


      

Marco IN_CLASSB_NET

#define IN_CLASSB_NET      IP_CLASSB_NET


      

Marco IN_CLASSB_NSHIFT

#define IN_CLASSB_NSHIFT   IP_CLASSB_NSHIFT


      

Marco IN_CLASSB_HOST

#define IN_CLASSB_HOST     IP_CLASSB_HOST


      

Marco IN_CLASSB_MAX

#define IN_CLASSB_MAX      IP_CLASSB_MAX


      

Marco IN_CLASSC(c)

#define IN_CLASSC(c)       IP_CLASSC(c)


      

Marco IN_CLASSC_NET

#define IN_CLASSC_NET      IP_CLASSC_NET


      

Marco IN_CLASSC_NSHIFT

#define IN_CLASSC_NSHIFT   IP_CLASSC_NSHIFT


      

Marco IN_CLASSC_HOST

#define IN_CLASSC_HOST     IP_CLASSC_HOST


      

Marco IN_CLASSC_MAX

#define IN_CLASSC_MAX      IP_CLASSC_MAX


      

Marco IN_CLASSD(d)

#define IN_CLASSD(d)       IP_CLASSD(d)


      

Marco IN_CLASSD_NET

#define IN_CLASSD_NET      IP_CLASSD_NET    /* These ones aren't really */


      

Marco IN_CLASSD_NSHIFT

#define IN_CLASSD_NSHIFT   IP_CLASSD_NSHIFT /*   net and host fields, but */


      

Marco IN_CLASSD_HOST

#define IN_CLASSD_HOST     IP_CLASSD_HOST   /*   routing needn't know. */


      

Marco IN_CLASSD_MAX

#define IN_CLASSD_MAX      IP_CLASSD_MAX


      

Marco IN_MULTICAST(a)

#define IN_MULTICAST(a)    IP_MULTICAST(a)


      

Marco IN_EXPERIMENTAL(a)

#define IN_EXPERIMENTAL(a) IP_EXPERIMENTAL(a)


      

Marco IN_BADCLASS(a)

#define IN_BADCLASS(a)     IP_BADCLASS(a)


      

Marco IN_LOOPBACKNET

#define IN_LOOPBACKNET     IP_LOOPBACKNET


      

Marco INET_ADDRSTRLEN

#define INET_ADDRSTRLEN    IP4ADDR_STRLEN_MAX


      

Marco INET6_ADDRSTRLEN

#define INET6_ADDRSTRLEN   IP6ADDR_STRLEN_MAX


      

Marco inet_addr_from_ip4addr(target_inaddr, source_ipaddr)

#define inet_addr_from_ip4addr(target_inaddr, source_ipaddr) ((target_inaddr)->s_addr = ip4_addr_get_u32(source_ipaddr))


      

Marco inet_addr_to_ip4addr(target_ipaddr, source_inaddr)

#define inet_addr_to_ip4addr(target_ipaddr, source_inaddr)  (ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr))


      

Marco inet_addr(cp)

#define inet_addr(cp)                  ipaddr_addr(cp)
/* directly map this to the lwip internal functions */

Marco inet_aton(cp, addr)

#define inet_aton(cp, addr)            ip4addr_aton(cp, (ip4_addr_t*)addr)


      

Marco inet_ntoa(addr)

#define inet_ntoa(addr)                ip4addr_ntoa((const ip4_addr_t*)&(addr))


      

Marco inet_ntoa_r(addr, buf, buflen)

#define inet_ntoa_r(addr, buf, buflen) ip4addr_ntoa_r((const ip4_addr_t*)&(addr), buf, buflen)


      

Marco inet6_addr_from_ip6addr(target_in6addr, source_ip6addr)

#define inet6_addr_from_ip6addr(target_in6addr, source_ip6addr) {(target_in6addr)->un.u32_addr[0] = (source_ip6addr)->addr[0]; \
                                                                (target_in6addr)->un.u32_addr[1] = (source_ip6addr)->addr[1]; \
                                                                (target_in6addr)->un.u32_addr[2] = (source_ip6addr)->addr[2]; \
                                                                (target_in6addr)->un.u32_addr[3] = (source_ip6addr)->addr[3];}


      

Marco inet6_addr_to_ip6addr(target_ip6addr, source_in6addr)

#define inet6_addr_to_ip6addr(target_ip6addr, source_in6addr)  {(target_ip6addr)->addr[0] = (source_in6addr)->un.u32_addr[0]; \
                                                                (target_ip6addr)->addr[1] = (source_in6addr)->un.u32_addr[1]; \
                                                                (target_ip6addr)->addr[2] = (source_in6addr)->un.u32_addr[2]; \
                                                                (target_ip6addr)->addr[3] = (source_in6addr)->un.u32_addr[3]; \
                                                                ip6_addr_clear_zone(target_ip6addr);}


      

Marco inet6_aton(cp, addr)

#define inet6_aton(cp, addr)           ip6addr_aton(cp, (ip6_addr_t*)addr)
/* directly map this to the lwip internal functions */

Marco inet6_ntoa(addr)

#define inet6_ntoa(addr)               ip6addr_ntoa((const ip6_addr_t*)&(addr))


      

Marco inet6_ntoa_r(addr, buf, buflen)

#define inet6_ntoa_r(addr, buf, buflen) ip6addr_ntoa_r((const ip6_addr_t*)&(addr), buf, buflen)


      

Marco LWIP_HDR_INET_CHKSUM_H

#define LWIP_HDR_INET_CHKSUM_H


      

Marco SWAP_BYTES_IN_WORD(w)

#define SWAP_BYTES_IN_WORD(w) (((w) & 255) << 8) | (((w) & 65280) >> 8)


      

Marco FOLD_U32T(u)

#define FOLD_U32T(u)         ((u32_t)(((u) >> 16) + ((u) & 0x0000ffffUL)))


      

Marco LWIP_HDR_INIT_H

#define LWIP_HDR_INIT_H


      

Marco LWIP_VERSION_MAJOR

#define LWIP_VERSION_MAJOR     2
/** X.x.x: Major version of the stack */

Marco LWIP_VERSION_MINOR

#define LWIP_VERSION_MINOR     1
/** x.X.x: Minor version of the stack */

Marco LWIP_VERSION_REVISION

#define LWIP_VERSION_REVISION  2
/** x.x.X: Revision of the stack */

Marco LWIP_VERSION_RC

#define LWIP_VERSION_RC        LWIP_RC_RELEASE
/** For release candidates, this is set to 1..254
  * For official releases, this is set to 255 (LWIP_RC_RELEASE)
  * For development versions (Git), this is set to 0 (LWIP_RC_DEVELOPMENT) */

Marco LWIP_RC_RELEASE

#define LWIP_RC_RELEASE        255
/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */

Marco LWIP_RC_DEVELOPMENT

#define LWIP_RC_DEVELOPMENT    0
/** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for Git versions */

Marco LWIP_VERSION_IS_RELEASE

#define LWIP_VERSION_IS_RELEASE    (LWIP_VERSION_RC == LWIP_RC_RELEASE)


      

Marco LWIP_VERSION_IS_DEVELOPMENT

#define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT)


      

Marco LWIP_VERSION_IS_RC

#define LWIP_VERSION_IS_RC         ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT))


      

Marco LWIP_VERSTR2(x)

#define LWIP_VERSTR2(x) #x
/* Some helper defines to get a version string */

Marco LWIP_VERSTR(x)

#define LWIP_VERSTR(x) LWIP_VERSTR2(x)


      

Marco LWIP_VERSION_STRING_SUFFIX

#define LWIP_VERSION_STRING_SUFFIX ""


      

Marco LWIP_VERSION_STRING_SUFFIX

#define LWIP_VERSION_STRING_SUFFIX "d"


      

Marco LWIP_VERSION_STRING_SUFFIX

#define LWIP_VERSION_STRING_SUFFIX "rc" LWIP_VERSTR(LWIP_VERSION_RC)


      

Marco LWIP_VERSION

#define LWIP_VERSION  ((LWIP_VERSION_MAJOR) << 24  | (LWIP_VERSION_MINOR) << 16 | \
                       (LWIP_VERSION_REVISION) << 8 | (LWIP_VERSION_RC))
/** Provides the version of the stack */

Marco LWIP_VERSION_STRING

#define LWIP_VERSION_STRING    LWIP_VERSTR(LWIP_VERSION_MAJOR) "." LWIP_VERSTR(LWIP_VERSION_MINOR) "." LWIP_VERSTR(LWIP_VERSION_REVISION) LWIP_VERSION_STRING_SUFFIX
/** Provides the version of the stack as string */

Marco LWIP_HDR_IP_H

#define LWIP_HDR_IP_H


      

Marco LWIP_IP_HDRINCL

#define LWIP_IP_HDRINCL NULL
/* This is passed as the destination address to ip_output_if (not
   to ip_output), meaning that an IP header already is constructed
   in the pbuf. This is used when TCP retransmits. */

Marco LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p)

#define LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p) LWIP_ASSERT("p->ref == 1", (p)->ref == 1)


      

Marco IP_PCB_NETIFHINT

#define IP_PCB_NETIFHINT ;struct netif_hint netif_hints


      

Marco IP_PCB_NETIFHINT

#define IP_PCB_NETIFHINT


      

Marco IP_PCB

#define IP_PCB                            \
 /* ip addresses in network byte order */ \
 ip_addr_t local_ip;                     \
 ip_addr_t remote_ip;                    \
 /* Bound netif index */                 \
 u8_t netif_idx;                         \
 /* Socket options */                    \
 u8_t so_options;                        \
 /* Type Of Service */                   \
 u8_t tos;                               \
 /* Time To Live */                      \
 u8_t ttl                                \
 /* link layer address resolution hint */ \
 IP_PCB_NETIFHINT
/** This is the common part of all PCB types. It needs to be at the
   beginning of a PCB type definition. It is located here so that
   changes to this common part are made in one location instead of
   having to change all PCB structs. */

Marco SOF_REUSEADDR

#define SOF_REUSEADDR    0x04U /* allow local address reuse */
/*
 * Option flags per-socket. These are the same like SO_XXX in sockets.h
 */

Marco SOF_KEEPALIVE

#define SOF_KEEPALIVE    0x08U /* keep connections alive */


      

Marco SOF_BROADCAST

#define SOF_BROADCAST    0x20U /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */


      

Marco SOF_INHERITED

#define SOF_INHERITED  (SOF_REUSEADDR|SOF_KEEPALIVE)
/* These flags are inherited (e.g. from a listen-pcb to a connection-pcb): */

Marco ip_current_netif()

#define ip_current_netif()     (ip_data.current_netif)
/** Get the interface that accepted the current packet.
 * This may or may not be the receiving netif, depending on your netif/network setup.
 * This function must only be called from a receive callback (udp_recv,
 * raw_recv, tcp_accept). It will return NULL otherwise. */

Marco ip_current_input_netif()

#define ip_current_input_netif() (ip_data.current_input_netif)
/** Get the interface that received the current packet.
 * This function must only be called from a receive callback (udp_recv,
 * raw_recv, tcp_accept). It will return NULL otherwise. */

Marco ip_current_header_tot_len()

#define ip_current_header_tot_len() (ip_data.current_ip_header_tot_len)
/** Total header length of ip(6)_current_header() (i.e. after this, the UDP/TCP header starts) */

Marco ip_current_src_addr()

#define ip_current_src_addr()  (&ip_data.current_iphdr_src)
/** Source IP address of current_header */

Marco ip_current_dest_addr()

#define ip_current_dest_addr() (&ip_data.current_iphdr_dest)
/** Destination IP address of current_header */

Marco ip4_current_header()

#define ip4_current_header()    ip_data.current_ip4_header
/** Get the IPv4 header of the current packet.
 * This function must only be called from a receive callback (udp_recv,
 * raw_recv, tcp_accept). It will return NULL otherwise. */

Marco ip6_current_header()

#define ip6_current_header()     ((const struct ip6_hdr*)(ip_data.current_ip6_header))
/** Get the IPv6 header of the current packet.
 * This function must only be called from a receive callback (udp_recv,
 * raw_recv, tcp_accept). It will return NULL otherwise. */

Marco ip_current_is_v6()

#define ip_current_is_v6()       (ip6_current_header() != NULL)
/** Returns TRUE if the current IP input packet is IPv6, FALSE if it is IPv4 */

Marco ip6_current_src_addr()

#define ip6_current_src_addr()   (ip_2_ip6(&ip_data.current_iphdr_src))
/** Source IPv6 address of current_header */

Marco ip6_current_dest_addr()

#define ip6_current_dest_addr()  (ip_2_ip6(&ip_data.current_iphdr_dest))
/** Destination IPv6 address of current_header */

Marco ip_current_header_proto()

#define ip_current_header_proto() (ip_current_is_v6() ? \
                                  IP6H_NEXTH(ip6_current_header()) :\
                                  IPH_PROTO(ip4_current_header()))
/** Get the transport layer protocol */

Marco ip_next_header_ptr()

#define ip_next_header_ptr()    ((const void*)((ip_current_is_v6() ? \
 (const u8_t*)ip6_current_header() : (const u8_t*)ip4_current_header()) + ip_current_header_tot_len()))
/** Get the transport layer header */

Marco ip4_current_src_addr()

#define ip4_current_src_addr()    (ip_2_ip4(&ip_data.current_iphdr_src))
/** Source IP4 address of current_header */

Marco ip4_current_dest_addr()

#define ip4_current_dest_addr()   (ip_2_ip4(&ip_data.current_iphdr_dest))
/** Destination IP4 address of current_header */

Marco ip4_current_header()

#define ip4_current_header()    ip_data.current_ip4_header
/** Get the IPv4 header of the current packet.
 * This function must only be called from a receive callback (udp_recv,
 * raw_recv, tcp_accept). It will return NULL otherwise. */

Marco ip_current_is_v6()

#define ip_current_is_v6()       0
/** Always returns FALSE when only supporting IPv4 only */

Marco ip_current_header_proto()

#define ip_current_header_proto() IPH_PROTO(ip4_current_header())
/** Get the transport layer protocol */

Marco ip_next_header_ptr()

#define ip_next_header_ptr()    ((const void*)((const u8_t*)ip4_current_header() + ip_current_header_tot_len()))
/** Get the transport layer header */

Marco ip4_current_src_addr()

#define ip4_current_src_addr()    (&ip_data.current_iphdr_src)
/** Source IP4 address of current_header */

Marco ip4_current_dest_addr()

#define ip4_current_dest_addr()   (&ip_data.current_iphdr_dest)
/** Destination IP4 address of current_header */

Marco ip6_current_header()

#define ip6_current_header()     ((const struct ip6_hdr*)(ip_data.current_ip6_header))
/** Get the IPv6 header of the current packet.
 * This function must only be called from a receive callback (udp_recv,
 * raw_recv, tcp_accept). It will return NULL otherwise. */

Marco ip_current_is_v6()

#define ip_current_is_v6()       1
/** Always returns TRUE when only supporting IPv6 only */

Marco ip_current_header_proto()

#define ip_current_header_proto() IP6H_NEXTH(ip6_current_header())
/** Get the transport layer protocol */

Marco ip_next_header_ptr()

#define ip_next_header_ptr()    ((const void*)(((const u8_t*)ip6_current_header()) + ip_current_header_tot_len()))
/** Get the transport layer header */

Marco ip6_current_src_addr()

#define ip6_current_src_addr()   (&ip_data.current_iphdr_src)
/** Source IP6 address of current_header */

Marco ip6_current_dest_addr()

#define ip6_current_dest_addr()  (&ip_data.current_iphdr_dest)
/** Destination IP6 address of current_header */

Marco ip_current_src_addr()

#define ip_current_src_addr()   (&ip_data.current_iphdr_src)
/** Union source address of current_header */

Marco ip_current_dest_addr()

#define ip_current_dest_addr()  (&ip_data.current_iphdr_dest)
/** Union destination address of current_header */

Marco ip_get_option(pcb, opt)

#define ip_get_option(pcb, opt)  ((pcb)->so_options & (opt))
/** Gets an IP pcb option (SOF_* flags) */

Marco ip_set_option(pcb, opt)

#define ip_set_option(pcb, opt)  ((pcb)->so_options = (u8_t)((pcb)->so_options | (opt)))
/** Sets an IP pcb option (SOF_* flags) */

Marco ip_reset_option(pcb, opt)

#define ip_reset_option(pcb, opt) ((pcb)->so_options = (u8_t)((pcb)->so_options & ~(opt)))
/** Resets an IP pcb option (SOF_* flags) */

Marco ip_output(p, src, dest, ttl, tos, proto)

#define ip_output(p, src, dest, ttl, tos, proto) \
       (IP_IS_V6(dest) ? \
       ip6_output(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto) : \
       ip4_output(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto))
/**
 * @ingroup ip
 * Output IP packet, netif is selected by source address
 */

Marco ip_output_if(p, src, dest, ttl, tos, proto, netif)

#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
       (IP_IS_V6(dest) ? \
       ip6_output_if(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \
       ip4_output_if(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif))
/**
 * @ingroup ip
 * Output IP packet to specified interface
 */

Marco ip_output_if_src(p, src, dest, ttl, tos, proto, netif)

#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \
       (IP_IS_V6(dest) ? \
       ip6_output_if_src(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \
       ip4_output_if_src(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif))
/**
 * @ingroup ip
 * Output IP packet to interface specifying source address
 */

Marco ip_output_if_hdrincl(p, src, dest, netif)

#define ip_output_if_hdrincl(p, src, dest, netif) \
       (IP_IS_V6(dest) ? \
       ip6_output_if(p, ip_2_ip6(src), LWIP_IP_HDRINCL, 0, 0, 0, netif) : \
       ip4_output_if(p, ip_2_ip4(src), LWIP_IP_HDRINCL, 0, 0, 0, netif))
/** Output IP packet that already includes an IP header. */

Marco ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint)

#define ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint) \
       (IP_IS_V6(dest) ? \
       ip6_output_hinted(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif_hint) : \
       ip4_output_hinted(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif_hint))
/** Output IP packet with netif_hint */

Marco ip_route(src, dest)

#define ip_route(src, dest) \
       (IP_IS_V6(dest) ? \
       ip6_route(ip_2_ip6(src), ip_2_ip6(dest)) : \
       ip4_route_src(ip_2_ip4(src), ip_2_ip4(dest)))
/**
 * @ingroup ip
 * Get netif for address combination. See \ref ip6_route and \ref ip4_route
 */

Marco ip_netif_get_local_ip(netif, dest)

#define ip_netif_get_local_ip(netif, dest) (IP_IS_V6(dest) ? \
       ip6_netif_get_local_ip(netif, ip_2_ip6(dest)) : \
       ip4_netif_get_local_ip(netif))
/**
 * @ingroup ip
 * Get netif for IP.
 */

Marco ip_debug_print(is_ipv6, p)

#define ip_debug_print(is_ipv6, p) ((is_ipv6) ? ip6_debug_print(p) : ip4_debug_print(p))


      

Marco ip_output(p, src, dest, ttl, tos, proto)

#define ip_output(p, src, dest, ttl, tos, proto) \
       ip4_output(p, src, dest, ttl, tos, proto)


      

Marco ip_output_if(p, src, dest, ttl, tos, proto, netif)

#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
       ip4_output_if(p, src, dest, ttl, tos, proto, netif)


      

Marco ip_output_if_src(p, src, dest, ttl, tos, proto, netif)

#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \
       ip4_output_if_src(p, src, dest, ttl, tos, proto, netif)


      

Marco ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint)

#define ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint) \
       ip4_output_hinted(p, src, dest, ttl, tos, proto, netif_hint)


      

Marco ip_output_if_hdrincl(p, src, dest, netif)

#define ip_output_if_hdrincl(p, src, dest, netif) \
       ip4_output_if(p, src, LWIP_IP_HDRINCL, 0, 0, 0, netif)


      

Marco ip_route(src, dest)

#define ip_route(src, dest) \
       ip4_route_src(src, dest)


      

Marco ip_netif_get_local_ip(netif, dest)

#define ip_netif_get_local_ip(netif, dest) \
       ip4_netif_get_local_ip(netif)


      

Marco ip_debug_print(is_ipv6, p)

#define ip_debug_print(is_ipv6, p) ip4_debug_print(p)


      

Marco ip_input

#define ip_input ip4_input


      

Marco ip_output(p, src, dest, ttl, tos, proto)

#define ip_output(p, src, dest, ttl, tos, proto) \
       ip6_output(p, src, dest, ttl, tos, proto)


      

Marco ip_output_if(p, src, dest, ttl, tos, proto, netif)

#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
       ip6_output_if(p, src, dest, ttl, tos, proto, netif)


      

Marco ip_output_if_src(p, src, dest, ttl, tos, proto, netif)

#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \
       ip6_output_if_src(p, src, dest, ttl, tos, proto, netif)


      

Marco ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint)

#define ip_output_hinted(p, src, dest, ttl, tos, proto, netif_hint) \
       ip6_output_hinted(p, src, dest, ttl, tos, proto, netif_hint)


      

Marco ip_output_if_hdrincl(p, src, dest, netif)

#define ip_output_if_hdrincl(p, src, dest, netif) \
       ip6_output_if(p, src, LWIP_IP_HDRINCL, 0, 0, 0, netif)


      

Marco ip_route(src, dest)

#define ip_route(src, dest) \
       ip6_route(src, dest)


      

Marco ip_netif_get_local_ip(netif, dest)

#define ip_netif_get_local_ip(netif, dest) \
       ip6_netif_get_local_ip(netif, dest)


      

Marco ip_debug_print(is_ipv6, p)

#define ip_debug_print(is_ipv6, p) ip6_debug_print(p)


      

Marco ip_input

#define ip_input ip6_input


      

Marco ip_route_get_local_ip(src, dest, netif, ipaddr)

#define ip_route_get_local_ip(src, dest, netif, ipaddr) do { \
 (netif) = ip_route(src, dest); \
 (ipaddr) = ip_netif_get_local_ip(netif, dest); \
}while(0)


      

Marco LWIP_HDR_IP4_H

#define LWIP_HDR_IP4_H


      

Marco LWIP_IPV4_SRC_ROUTING

#define LWIP_IPV4_SRC_ROUTING  1


      

Marco LWIP_IPV4_SRC_ROUTING

#define LWIP_IPV4_SRC_ROUTING  0


      

Marco IP_OPTIONS_SEND

#define IP_OPTIONS_SEND  (LWIP_IPV4 && LWIP_IGMP)
/** Currently, the function ip_output_if_opt() is only used with IGMP */

Marco ip_init()

#define ip_init() /* Compatibility define, no init needed. */


      

Marco ip4_route_src(src, dest)

#define ip4_route_src(src, dest) ip4_route(dest)


      

Marco ip4_netif_get_local_ip(netif)

#define ip4_netif_get_local_ip(netif) (((netif) != NULL) ? netif_ip_addr4(netif) : NULL)


      

Marco ip4_debug_print

#define ip4_debug_print(p)


      

Marco LWIP_HDR_IP4_ADDR_H

#define LWIP_HDR_IP4_ADDR_H


      

Marco IPADDR_NONE

#define IPADDR_NONE        ((u32_t)0xffffffffUL)
/** 255.255.255.255 */

Marco IPADDR_LOOPBACK

#define IPADDR_LOOPBACK    ((u32_t)0x7f000001UL)
/** 127.0.0.1 */

Marco IPADDR_ANY

#define IPADDR_ANY         ((u32_t)0x00000000UL)
/** 0.0.0.0 */

Marco IPADDR_BROADCAST

#define IPADDR_BROADCAST   ((u32_t)0xffffffffUL)
/** 255.255.255.255 */

Marco IP_CLASSA(a)

#define IP_CLASSA(a)       ((((u32_t)(a)) & 0x80000000UL) == 0)
/* Definitions of the bits in an Internet address integer.

   On subnets, host and network parts are found according to
   the subnet mask, not these masks.  */

Marco IP_CLASSA_NET

#define IP_CLASSA_NET      4278190080


      

Marco IP_CLASSA_NSHIFT

#define IP_CLASSA_NSHIFT   24


      

Marco IP_CLASSA_HOST

#define IP_CLASSA_HOST     (4294967295 & ~IP_CLASSA_NET)


      

Marco IP_CLASSA_MAX

#define IP_CLASSA_MAX      128


      

Marco IP_CLASSB(a)

#define IP_CLASSB(a)       ((((u32_t)(a)) & 0xc0000000UL) == 0x80000000UL)


      

Marco IP_CLASSB_NET

#define IP_CLASSB_NET      4294901760


      

Marco IP_CLASSB_NSHIFT

#define IP_CLASSB_NSHIFT   16


      

Marco IP_CLASSB_HOST

#define IP_CLASSB_HOST     (4294967295 & ~IP_CLASSB_NET)


      

Marco IP_CLASSB_MAX

#define IP_CLASSB_MAX      65536


      

Marco IP_CLASSC(a)

#define IP_CLASSC(a)       ((((u32_t)(a)) & 0xe0000000UL) == 0xc0000000UL)


      

Marco IP_CLASSC_NET

#define IP_CLASSC_NET      4294967040


      

Marco IP_CLASSC_NSHIFT

#define IP_CLASSC_NSHIFT   8


      

Marco IP_CLASSC_HOST

#define IP_CLASSC_HOST     (4294967295 & ~IP_CLASSC_NET)


      

Marco IP_CLASSD(a)

#define IP_CLASSD(a)       (((u32_t)(a) & 0xf0000000UL) == 0xe0000000UL)


      

Marco IP_CLASSD_NET

#define IP_CLASSD_NET      4026531840         /* These ones aren't really */


      

Marco IP_CLASSD_NSHIFT

#define IP_CLASSD_NSHIFT   28                 /*   net and host fields, but */


      

Marco IP_CLASSD_HOST

#define IP_CLASSD_HOST     268435455         /*   routing needn't know. */


      

Marco IP_MULTICAST(a)

#define IP_MULTICAST(a)    IP_CLASSD(a)


      

Marco IP_EXPERIMENTAL(a)

#define IP_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL)


      

Marco IP_BADCLASS(a)

#define IP_BADCLASS(a)     (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL)


      

Marco IP_LOOPBACKNET

#define IP_LOOPBACKNET     127                /* official! */


      

Marco IP4_ADDR(ipaddr, a,b,c,d)

#define IP4_ADDR(ipaddr, a,b,c,d) (ipaddr)->addr = PP_HTONL(LWIP_MAKEU32(a,b,c,d))
/** Set an IP address given by the four byte-parts */

Marco ip4_addr_copy(dest, src)

#define ip4_addr_copy(dest, src) ((dest).addr = (src).addr)
/** Copy IP address - faster than ip4_addr_set: no NULL check */

Marco ip4_addr_set(dest, src)

#define ip4_addr_set(dest, src) ((dest)->addr = \
                                   ((src) == NULL ? 0 : \
                                   (src)->addr))
/** Safely copy one IP address to another (src may be NULL) */

Marco ip4_addr_set_zero(ipaddr)

#define ip4_addr_set_zero(ipaddr)    ((ipaddr)->addr = 0)
/** Set complete address to zero */

Marco ip4_addr_set_any(ipaddr)

#define ip4_addr_set_any(ipaddr)     ((ipaddr)->addr = IPADDR_ANY)
/** Set address to IPADDR_ANY (no need for lwip_htonl()) */

Marco ip4_addr_set_loopback(ipaddr)

#define ip4_addr_set_loopback(ipaddr) ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK))
/** Set address to loopback address */

Marco ip4_addr_isloopback(ipaddr)

#define ip4_addr_isloopback(ipaddr)   (((ipaddr)->addr & PP_HTONL(IP_CLASSA_NET)) == PP_HTONL(((u32_t)IP_LOOPBACKNET) << 24))
/** Check if an address is in the loopback region */

Marco ip4_addr_set_hton(dest, src)

#define ip4_addr_set_hton(dest, src) ((dest)->addr = \
                              ((src) == NULL ? 0:\
                              lwip_htonl((src)->addr)))
/** Safely copy one IP address to another and change byte order
 * from host- to network-order. */

Marco ip4_addr_set_u32(dest_ipaddr, src_u32)

#define ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32))
/** IPv4 only: set the IP address given as an u32_t */

Marco ip4_addr_get_u32(src_ipaddr)

#define ip4_addr_get_u32(src_ipaddr) ((src_ipaddr)->addr)
/** IPv4 only: get the IP address as an u32_t */

Marco ip4_addr_get_network(target, host, netmask)

#define ip4_addr_get_network(target, host, netmask) do { ((target)->addr = ((host)->addr) & ((netmask)->addr)); } while(0)
/** Get the network address by combining host address with netmask */

Marco ip4_addr_netcmp(addr1, addr2, mask)

#define ip4_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \
                                             (mask)->addr) == \
                                            ((addr2)->addr & \
                                             (mask)->addr))
/**
 * Determine if two address are on the same network.
 *
 * @arg addr1 IP address 1
 * @arg addr2 IP address 2
 * @arg mask network identifier mask
 * @return !0 if the network identifiers of both address match
 */

Marco ip4_addr_cmp(addr1, addr2)

#define ip4_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr)


      

Marco ip4_addr_isany_val(addr1)

#define ip4_addr_isany_val(addr1)  ((addr1).addr == IPADDR_ANY)


      

Marco ip4_addr_isany(addr1)

#define ip4_addr_isany(addr1) ((addr1) == NULL || ip4_addr_isany_val(*(addr1)))


      

Marco ip4_addr_isbroadcast(addr1, netif)

#define ip4_addr_isbroadcast(addr1, netif) ip4_addr_isbroadcast_u32((addr1)->addr, netif)


      

Marco ip_addr_netmask_valid(netmask)

#define ip_addr_netmask_valid(netmask) ip4_addr_netmask_valid((netmask)->addr)


      

Marco ip4_addr_ismulticast(addr1)

#define ip4_addr_ismulticast(addr1) (((addr1)->addr & PP_HTONL(0xf0000000UL)) == PP_HTONL(0xe0000000UL))


      

Marco ip4_addr_islinklocal(addr1)

#define ip4_addr_islinklocal(addr1) (((addr1)->addr & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xa9fe0000UL))


      

Marco ip4_addr_debug_print_parts(debug, a, b, c, d)

#define ip4_addr_debug_print_parts(debug, a, b, c, d) \
 LWIP_DEBUGF(debug, ("%" U16_F ".%" U16_F ".%" U16_F ".%" U16_F, a, b, c, d))


      

Marco ip4_addr_debug_print(debug, ipaddr)

#define ip4_addr_debug_print(debug, ipaddr) \
 ip4_addr_debug_print_parts(debug, \
                     (u16_t)((ipaddr) != NULL ? ip4_addr1_16(ipaddr) : 0),      \
                     (u16_t)((ipaddr) != NULL ? ip4_addr2_16(ipaddr) : 0),      \
                     (u16_t)((ipaddr) != NULL ? ip4_addr3_16(ipaddr) : 0),      \
                     (u16_t)((ipaddr) != NULL ? ip4_addr4_16(ipaddr) : 0))


      

Marco ip4_addr_debug_print_val(debug, ipaddr)

#define ip4_addr_debug_print_val(debug, ipaddr) \
 ip4_addr_debug_print_parts(debug, \
                     ip4_addr1_16_val(ipaddr),      \
                     ip4_addr2_16_val(ipaddr),      \
                     ip4_addr3_16_val(ipaddr),      \
                     ip4_addr4_16_val(ipaddr))


      

Marco ip4_addr_get_byte(ipaddr, idx)

#define ip4_addr_get_byte(ipaddr, idx) (((const u8_t*)(&(ipaddr)->addr))[idx])
/* Get one byte from the 4-byte address */

Marco ip4_addr1(ipaddr)

#define ip4_addr1(ipaddr) ip4_addr_get_byte(ipaddr, 0)


      

Marco ip4_addr2(ipaddr)

#define ip4_addr2(ipaddr) ip4_addr_get_byte(ipaddr, 1)


      

Marco ip4_addr3(ipaddr)

#define ip4_addr3(ipaddr) ip4_addr_get_byte(ipaddr, 2)


      

Marco ip4_addr4(ipaddr)

#define ip4_addr4(ipaddr) ip4_addr_get_byte(ipaddr, 3)


      

Marco ip4_addr_get_byte_val(ipaddr, idx)

#define ip4_addr_get_byte_val(ipaddr, idx) ((u8_t)(((ipaddr).addr >> (idx * 8)) & 255))
/* Get one byte from the 4-byte address, but argument is 'ip4_addr_t',
 * not a pointer */

Marco ip4_addr1_val(ipaddr)

#define ip4_addr1_val(ipaddr) ip4_addr_get_byte_val(ipaddr, 0)


      

Marco ip4_addr2_val(ipaddr)

#define ip4_addr2_val(ipaddr) ip4_addr_get_byte_val(ipaddr, 1)


      

Marco ip4_addr3_val(ipaddr)

#define ip4_addr3_val(ipaddr) ip4_addr_get_byte_val(ipaddr, 2)


      

Marco ip4_addr4_val(ipaddr)

#define ip4_addr4_val(ipaddr) ip4_addr_get_byte_val(ipaddr, 3)


      

Marco ip4_addr1_16(ipaddr)

#define ip4_addr1_16(ipaddr) ((u16_t)ip4_addr1(ipaddr))
/* These are cast to u16_t, with the intent that they are often arguments
 * to printf using the U16_F format from cc.h. */

Marco ip4_addr2_16(ipaddr)

#define ip4_addr2_16(ipaddr) ((u16_t)ip4_addr2(ipaddr))


      

Marco ip4_addr3_16(ipaddr)

#define ip4_addr3_16(ipaddr) ((u16_t)ip4_addr3(ipaddr))


      

Marco ip4_addr4_16(ipaddr)

#define ip4_addr4_16(ipaddr) ((u16_t)ip4_addr4(ipaddr))


      

Marco ip4_addr1_16_val(ipaddr)

#define ip4_addr1_16_val(ipaddr) ((u16_t)ip4_addr1_val(ipaddr))


      

Marco ip4_addr2_16_val(ipaddr)

#define ip4_addr2_16_val(ipaddr) ((u16_t)ip4_addr2_val(ipaddr))


      

Marco ip4_addr3_16_val(ipaddr)

#define ip4_addr3_16_val(ipaddr) ((u16_t)ip4_addr3_val(ipaddr))


      

Marco ip4_addr4_16_val(ipaddr)

#define ip4_addr4_16_val(ipaddr) ((u16_t)ip4_addr4_val(ipaddr))


      

Marco IP4ADDR_STRLEN_MAX

#define IP4ADDR_STRLEN_MAX 16


      

Marco ip_ntoa(ipaddr)

#define ip_ntoa(ipaddr) ipaddr_ntoa(ipaddr)
/** For backwards compatibility */

Marco LWIP_HDR_IP4_FRAG_H

#define LWIP_HDR_IP4_FRAG_H


      

Marco IP_TMR_INTERVAL

#define IP_TMR_INTERVAL 1000
/* The IP reassembly timer interval in milliseconds. */

Marco LWIP_PBUF_CUSTOM_REF_DEFINED

#define LWIP_PBUF_CUSTOM_REF_DEFINED


      

Marco LWIP_HDR_IP6_H

#define LWIP_HDR_IP6_H


      

Marco ip6_netif_get_local_ip(netif, dest)

#define ip6_netif_get_local_ip(netif, dest) (((netif) != NULL) ? \
 ip6_select_source_address(netif, dest) : NULL)


      

Marco ip6_debug_print

#define ip6_debug_print(p)


      

Marco LWIP_HDR_IP6_ADDR_H

#define LWIP_HDR_IP6_ADDR_H


      

Marco IP6_ADDR_PART(ip6addr, index, a,b,c,d)

#define IP6_ADDR_PART(ip6addr, index, a,b,c,d) \
 (ip6addr)->addr[index] = PP_HTONL(LWIP_MAKEU32(a,b,c,d))
/** Set an IPv6 partial address given by byte-parts */

Marco IP6_ADDR(ip6addr, idx0, idx1, idx2, idx3)

#define IP6_ADDR(ip6addr, idx0, idx1, idx2, idx3) do { \
 (ip6addr)->addr[0] = idx0; \
 (ip6addr)->addr[1] = idx1; \
 (ip6addr)->addr[2] = idx2; \
 (ip6addr)->addr[3] = idx3; \
 ip6_addr_clear_zone(ip6addr); } while(0)
/** Set a full IPv6 address by passing the 4 u32_t indices in network byte order
    (use PP_HTONL() for constants) */

Marco IP6_ADDR_BLOCK1(ip6addr)

#define IP6_ADDR_BLOCK1(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0]) >> 16) & 65535))
/** Access address in 16-bit block */

Marco IP6_ADDR_BLOCK2(ip6addr)

#define IP6_ADDR_BLOCK2(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[0])) & 65535))
/** Access address in 16-bit block */

Marco IP6_ADDR_BLOCK3(ip6addr)

#define IP6_ADDR_BLOCK3(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1]) >> 16) & 65535))
/** Access address in 16-bit block */

Marco IP6_ADDR_BLOCK4(ip6addr)

#define IP6_ADDR_BLOCK4(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[1])) & 65535))
/** Access address in 16-bit block */

Marco IP6_ADDR_BLOCK5(ip6addr)

#define IP6_ADDR_BLOCK5(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2]) >> 16) & 65535))
/** Access address in 16-bit block */

Marco IP6_ADDR_BLOCK6(ip6addr)

#define IP6_ADDR_BLOCK6(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[2])) & 65535))
/** Access address in 16-bit block */

Marco IP6_ADDR_BLOCK7(ip6addr)

#define IP6_ADDR_BLOCK7(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3]) >> 16) & 65535))
/** Access address in 16-bit block */

Marco IP6_ADDR_BLOCK8(ip6addr)

#define IP6_ADDR_BLOCK8(ip6addr) ((u16_t)((lwip_htonl((ip6addr)->addr[3])) & 65535))
/** Access address in 16-bit block */

Marco ip6_addr_copy(dest, src)

#define ip6_addr_copy(dest, src) do{(dest).addr[0] = (src).addr[0]; \
                                   (dest).addr[1] = (src).addr[1]; \
                                   (dest).addr[2] = (src).addr[2]; \
                                   (dest).addr[3] = (src).addr[3]; \
                                   ip6_addr_copy_zone((dest), (src)); }while(0)
/** Copy IPv6 address - faster than ip6_addr_set: no NULL check */

Marco ip6_addr_set(dest, src)

#define ip6_addr_set(dest, src) do{(dest)->addr[0] = (src) == NULL ? 0 : (src)->addr[0]; \
                                  (dest)->addr[1] = (src) == NULL ? 0 : (src)->addr[1]; \
                                  (dest)->addr[2] = (src) == NULL ? 0 : (src)->addr[2]; \
                                  (dest)->addr[3] = (src) == NULL ? 0 : (src)->addr[3]; \
                                  ip6_addr_set_zone((dest), (src) == NULL ? IP6_NO_ZONE : ip6_addr_zone(src)); }while(0)
/** Safely copy one IPv6 address to another (src may be NULL) */

Marco ip6_addr_copy_from_packed(dest, src)

#define ip6_addr_copy_from_packed(dest, src) do{(dest).addr[0] = (src).addr[0]; \
                                   (dest).addr[1] = (src).addr[1]; \
                                   (dest).addr[2] = (src).addr[2]; \
                                   (dest).addr[3] = (src).addr[3]; \
                                   ip6_addr_clear_zone(&dest); }while(0)
/** Copy packed IPv6 address to unpacked IPv6 address; zone is not set */

Marco ip6_addr_copy_to_packed(dest, src)

#define ip6_addr_copy_to_packed(dest, src) do{(dest).addr[0] = (src).addr[0]; \
                                   (dest).addr[1] = (src).addr[1]; \
                                   (dest).addr[2] = (src).addr[2]; \
                                   (dest).addr[3] = (src).addr[3]; }while(0)
/** Copy unpacked IPv6 address to packed IPv6 address; zone is lost */

Marco ip6_addr_set_zero(ip6addr)

#define ip6_addr_set_zero(ip6addr)   do{(ip6addr)->addr[0] = 0; \
                                        (ip6addr)->addr[1] = 0; \
                                        (ip6addr)->addr[2] = 0; \
                                        (ip6addr)->addr[3] = 0; \
                                        ip6_addr_clear_zone(ip6addr);}while(0)
/** Set complete address to zero */

Marco ip6_addr_set_any(ip6addr)

#define ip6_addr_set_any(ip6addr)      ip6_addr_set_zero(ip6addr)
/** Set address to ipv6 'any' (no need for lwip_htonl()) */

Marco ip6_addr_set_loopback(ip6addr)

#define ip6_addr_set_loopback(ip6addr) do{(ip6addr)->addr[0] = 0; \
                                         (ip6addr)->addr[1] = 0; \
                                         (ip6addr)->addr[2] = 0; \
                                         (ip6addr)->addr[3] = PP_HTONL(0x00000001UL); \
                                         ip6_addr_clear_zone(ip6addr);}while(0)
/** Set address to ipv6 loopback address */

Marco ip6_addr_set_hton(dest, src)

#define ip6_addr_set_hton(dest, src) do{(dest)->addr[0] = (src) == NULL ? 0 : lwip_htonl((src)->addr[0]); \
                                       (dest)->addr[1] = (src) == NULL ? 0 : lwip_htonl((src)->addr[1]); \
                                       (dest)->addr[2] = (src) == NULL ? 0 : lwip_htonl((src)->addr[2]); \
                                       (dest)->addr[3] = (src) == NULL ? 0 : lwip_htonl((src)->addr[3]); \
                                       ip6_addr_set_zone((dest), (src) == NULL ? IP6_NO_ZONE : ip6_addr_zone(src));}while(0)
/** Safely copy one IPv6 address to another and change byte order
 * from host- to network-order. */

Marco ip6_addr_netcmp_zoneless(addr1, addr2)

#define ip6_addr_netcmp_zoneless(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \
                                              ((addr1)->addr[1] == (addr2)->addr[1]))
/** Compare IPv6 networks, ignoring zone information. To be used sparingly! */

Marco ip6_addr_netcmp(addr1, addr2)

#define ip6_addr_netcmp(addr1, addr2) (ip6_addr_netcmp_zoneless((addr1), (addr2)) && \
                                      ip6_addr_cmp_zone((addr1), (addr2)))
/**
 * Determine if two IPv6 address are on the same network.
 *
 * @param addr1 IPv6 address 1
 * @param addr2 IPv6 address 2
 * @return 1 if the network identifiers of both address match, 0 if not
 */

Marco ip6_addr_nethostcmp(addr1, addr2)

#define ip6_addr_nethostcmp(addr1, addr2) (((addr1)->addr[2] == (addr2)->addr[2]) && \
                                          ((addr1)->addr[3] == (addr2)->addr[3]))
/* Exact-host comparison *after* ip6_addr_netcmp() succeeded, for efficiency. */

Marco ip6_addr_cmp_zoneless(addr1, addr2)

#define ip6_addr_cmp_zoneless(addr1, addr2) (((addr1)->addr[0] == (addr2)->addr[0]) && \
                                   ((addr1)->addr[1] == (addr2)->addr[1]) && \
                                   ((addr1)->addr[2] == (addr2)->addr[2]) && \
                                   ((addr1)->addr[3] == (addr2)->addr[3]))
/** Compare IPv6 addresses, ignoring zone information. To be used sparingly! */

Marco ip6_addr_cmp(addr1, addr2)

#define ip6_addr_cmp(addr1, addr2) (ip6_addr_cmp_zoneless((addr1), (addr2)) && \
                                   ip6_addr_cmp_zone((addr1), (addr2)))
/**
 * Determine if two IPv6 addresses are the same. In particular, the address
 * part of both must be the same, and the zone must be compatible.
 *
 * @param addr1 IPv6 address 1
 * @param addr2 IPv6 address 2
 * @return 1 if the addresses are considered equal, 0 if not
 */

Marco ip6_addr_cmp_packed(ip6addr, paddr, zone_idx)

#define ip6_addr_cmp_packed(ip6addr, paddr, zone_idx) (((ip6addr)->addr[0] == (paddr)->addr[0]) && \
                                   ((ip6addr)->addr[1] == (paddr)->addr[1]) && \
                                   ((ip6addr)->addr[2] == (paddr)->addr[2]) && \
                                   ((ip6addr)->addr[3] == (paddr)->addr[3]) && \
                                   ip6_addr_equals_zone((ip6addr), (zone_idx)))
/** Compare IPv6 address to packed address and zone */

Marco ip6_get_subnet_id(ip6addr)

#define ip6_get_subnet_id(ip6addr)  (lwip_htonl((ip6addr)->addr[2]) & 0x0000ffffUL)


      

Marco ip6_addr_isany_val(ip6addr)

#define ip6_addr_isany_val(ip6addr) (((ip6addr).addr[0] == 0) && \
                                    ((ip6addr).addr[1] == 0) && \
                                    ((ip6addr).addr[2] == 0) && \
                                    ((ip6addr).addr[3] == 0))


      

Marco ip6_addr_isany(ip6addr)

#define ip6_addr_isany(ip6addr) (((ip6addr) == NULL) || ip6_addr_isany_val(*(ip6addr)))


      

Marco ip6_addr_isloopback(ip6addr)

#define ip6_addr_isloopback(ip6addr) (((ip6addr)->addr[0] == 0UL) && \
                                     ((ip6addr)->addr[1] == 0UL) && \
                                     ((ip6addr)->addr[2] == 0UL) && \
                                     ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))


      

Marco ip6_addr_isglobal(ip6addr)

#define ip6_addr_isglobal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xe0000000UL)) == PP_HTONL(0x20000000UL))


      

Marco ip6_addr_islinklocal(ip6addr)

#define ip6_addr_islinklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(255c00000UL)) == PP_HTONL(15e800000UL))


      

Marco ip6_addr_issitelocal(ip6addr)

#define ip6_addr_issitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(255c00000UL)) == PP_HTONL(15ec00000UL))


      

Marco ip6_addr_isuniquelocal(ip6addr)

#define ip6_addr_isuniquelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(15e000000UL)) == PP_HTONL(15c000000UL))


      

Marco ip6_addr_isipv4mappedipv6(ip6addr)

#define ip6_addr_isipv4mappedipv6(ip6addr) (((ip6addr)->addr[0] == 0) && ((ip6addr)->addr[1] == 0) && (((ip6addr)->addr[2]) == PP_HTONL(0x0000FFFFUL)))


      

Marco ip6_addr_ismulticast(ip6addr)

#define ip6_addr_ismulticast(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL))


      

Marco ip6_addr_multicast_transient_flag(ip6addr)

#define ip6_addr_multicast_transient_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00100000UL))


      

Marco ip6_addr_multicast_prefix_flag(ip6addr)

#define ip6_addr_multicast_prefix_flag(ip6addr)    ((ip6addr)->addr[0] & PP_HTONL(0x00200000UL))


      

Marco ip6_addr_multicast_rendezvous_flag(ip6addr)

#define ip6_addr_multicast_rendezvous_flag(ip6addr) ((ip6addr)->addr[0] & PP_HTONL(0x00400000UL))


      

Marco ip6_addr_multicast_scope(ip6addr)

#define ip6_addr_multicast_scope(ip6addr) ((lwip_htonl((ip6addr)->addr[0]) >> 16) & 15)


      

Marco IP6_MULTICAST_SCOPE_RESERVED

#define IP6_MULTICAST_SCOPE_RESERVED           0


      

Marco IP6_MULTICAST_SCOPE_RESERVED0

#define IP6_MULTICAST_SCOPE_RESERVED0          0


      

Marco IP6_MULTICAST_SCOPE_INTERFACE_LOCAL

#define IP6_MULTICAST_SCOPE_INTERFACE_LOCAL    1


      
      
#define IP6_MULTICAST_SCOPE_LINK_LOCAL         2


      

Marco IP6_MULTICAST_SCOPE_RESERVED3

#define IP6_MULTICAST_SCOPE_RESERVED3          3


      

Marco IP6_MULTICAST_SCOPE_ADMIN_LOCAL

#define IP6_MULTICAST_SCOPE_ADMIN_LOCAL        4


      

Marco IP6_MULTICAST_SCOPE_SITE_LOCAL

#define IP6_MULTICAST_SCOPE_SITE_LOCAL         5


      

Marco IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL

#define IP6_MULTICAST_SCOPE_ORGANIZATION_LOCAL 8


      

Marco IP6_MULTICAST_SCOPE_GLOBAL

#define IP6_MULTICAST_SCOPE_GLOBAL             0xe


      

Marco IP6_MULTICAST_SCOPE_RESERVEDF

#define IP6_MULTICAST_SCOPE_RESERVEDF          15


      

Marco ip6_addr_ismulticast_iflocal(ip6addr)

#define ip6_addr_ismulticast_iflocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff010000UL))


      

Marco ip6_addr_ismulticast_linklocal(ip6addr)

#define ip6_addr_ismulticast_linklocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff020000UL))


      

Marco ip6_addr_ismulticast_adminlocal(ip6addr)

#define ip6_addr_ismulticast_adminlocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff040000UL))


      

Marco ip6_addr_ismulticast_sitelocal(ip6addr)

#define ip6_addr_ismulticast_sitelocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff050000UL))


      

Marco ip6_addr_ismulticast_orglocal(ip6addr)

#define ip6_addr_ismulticast_orglocal(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(0xff080000UL))


      

Marco ip6_addr_ismulticast_global(ip6addr)

#define ip6_addr_ismulticast_global(ip6addr) (((ip6addr)->addr[0] & PP_HTONL(0xff8f0000UL)) == PP_HTONL(4080e0000UL))


      

Marco ip6_addr_isallnodes_iflocal(ip6addr)

#define ip6_addr_isallnodes_iflocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff010000UL)) && \
   ((ip6addr)->addr[1] == 0UL) && \
   ((ip6addr)->addr[2] == 0UL) && \
   ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))


      

Marco ip6_addr_isallnodes_linklocal(ip6addr)

#define ip6_addr_isallnodes_linklocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
   ((ip6addr)->addr[1] == 0UL) && \
   ((ip6addr)->addr[2] == 0UL) && \
   ((ip6addr)->addr[3] == PP_HTONL(0x00000001UL)))


      

Marco ip6_addr_set_allnodes_linklocal(ip6addr)

#define ip6_addr_set_allnodes_linklocal(ip6addr) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
               (ip6addr)->addr[1] = 0; \
               (ip6addr)->addr[2] = 0; \
               (ip6addr)->addr[3] = PP_HTONL(0x00000001UL); \
               ip6_addr_clear_zone(ip6addr); }while(0)


      

Marco ip6_addr_isallrouters_linklocal(ip6addr)

#define ip6_addr_isallrouters_linklocal(ip6addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
   ((ip6addr)->addr[1] == 0UL) && \
   ((ip6addr)->addr[2] == 0UL) && \
   ((ip6addr)->addr[3] == PP_HTONL(0x00000002UL)))


      

Marco ip6_addr_set_allrouters_linklocal(ip6addr)

#define ip6_addr_set_allrouters_linklocal(ip6addr) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
               (ip6addr)->addr[1] = 0; \
               (ip6addr)->addr[2] = 0; \
               (ip6addr)->addr[3] = PP_HTONL(0x00000002UL); \
               ip6_addr_clear_zone(ip6addr); }while(0)


      

Marco ip6_addr_issolicitednode(ip6addr)

#define ip6_addr_issolicitednode(ip6addr) ( ((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
       ((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \
       (((ip6addr)->addr[3] & PP_HTONL(0xff000000UL)) == PP_HTONL(0xff000000UL)) )


      

Marco ip6_addr_set_solicitednode(ip6addr, if_id)

#define ip6_addr_set_solicitednode(ip6addr, if_id) do{(ip6addr)->addr[0] = PP_HTONL(0xff020000UL); \
               (ip6addr)->addr[1] = 0; \
               (ip6addr)->addr[2] = PP_HTONL(0x00000001UL); \
               (ip6addr)->addr[3] = (PP_HTONL(0xff000000UL) | (if_id)); \
               ip6_addr_clear_zone(ip6addr); }while(0)


      

Marco ip6_addr_cmp_solicitednode(ip6addr, sn_addr)

#define ip6_addr_cmp_solicitednode(ip6addr, sn_addr) (((ip6addr)->addr[0] == PP_HTONL(0xff020000UL)) && \
                                   ((ip6addr)->addr[1] == 0) && \
                                   ((ip6addr)->addr[2] == PP_HTONL(0x00000001UL)) && \
                                   ((ip6addr)->addr[3] == (PP_HTONL(0xff000000UL) | (sn_addr)->addr[3])))


      

Marco IP6_ADDR_INVALID

#define IP6_ADDR_INVALID     0
/* IPv6 address states. */

Marco IP6_ADDR_TENTATIVE

#define IP6_ADDR_TENTATIVE   8


      

Marco IP6_ADDR_TENTATIVE_1

#define IP6_ADDR_TENTATIVE_1 9 /* 1 probe sent */


      

Marco IP6_ADDR_TENTATIVE_2

#define IP6_ADDR_TENTATIVE_2 0a /* 2 probes sent */


      

Marco IP6_ADDR_TENTATIVE_3

#define IP6_ADDR_TENTATIVE_3 0b /* 3 probes sent */


      

Marco IP6_ADDR_TENTATIVE_4

#define IP6_ADDR_TENTATIVE_4 0c /* 4 probes sent */


      

Marco IP6_ADDR_TENTATIVE_5

#define IP6_ADDR_TENTATIVE_5 0d /* 5 probes sent */


      

Marco IP6_ADDR_TENTATIVE_6

#define IP6_ADDR_TENTATIVE_6 0e /* 6 probes sent */


      

Marco IP6_ADDR_TENTATIVE_7

#define IP6_ADDR_TENTATIVE_7 15 /* 7 probes sent */


      

Marco IP6_ADDR_VALID

#define IP6_ADDR_VALID       16 /* This bit marks an address as valid (preferred or deprecated) */


      

Marco IP6_ADDR_PREFERRED

#define IP6_ADDR_PREFERRED   48


      

Marco IP6_ADDR_DEPRECATED

#define IP6_ADDR_DEPRECATED  16 /* Same as VALID (valid but not preferred) */


      

Marco IP6_ADDR_DUPLICATED

#define IP6_ADDR_DUPLICATED  64 /* Failed DAD test, not valid */


      

Marco IP6_ADDR_TENTATIVE_COUNT_MASK

#define IP6_ADDR_TENTATIVE_COUNT_MASK 7 /* 1-7 probes sent */


      

Marco ip6_addr_isinvalid(addr_state)

#define ip6_addr_isinvalid(addr_state) (addr_state == IP6_ADDR_INVALID)


      

Marco ip6_addr_istentative(addr_state)

#define ip6_addr_istentative(addr_state) (addr_state & IP6_ADDR_TENTATIVE)


      

Marco ip6_addr_isvalid(addr_state)

#define ip6_addr_isvalid(addr_state) (addr_state & IP6_ADDR_VALID) /* Include valid, preferred, and deprecated. */


      

Marco ip6_addr_ispreferred(addr_state)

#define ip6_addr_ispreferred(addr_state) (addr_state == IP6_ADDR_PREFERRED)


      

Marco ip6_addr_isdeprecated(addr_state)

#define ip6_addr_isdeprecated(addr_state) (addr_state == IP6_ADDR_DEPRECATED)


      

Marco ip6_addr_isduplicated(addr_state)

#define ip6_addr_isduplicated(addr_state) (addr_state == IP6_ADDR_DUPLICATED)


      

Marco IP6_ADDR_LIFE_STATIC

#define IP6_ADDR_LIFE_STATIC  (0)


      

Marco IP6_ADDR_LIFE_INFINITE

#define IP6_ADDR_LIFE_INFINITE (0xffffffffUL)


      

Marco ip6_addr_life_isstatic(addr_life)

#define ip6_addr_life_isstatic(addr_life) ((addr_life) == IP6_ADDR_LIFE_STATIC)


      

Marco ip6_addr_life_isinfinite(addr_life)

#define ip6_addr_life_isinfinite(addr_life) ((addr_life) == IP6_ADDR_LIFE_INFINITE)


      

Marco ip6_addr_debug_print_parts(debug, a, b, c, d, e, f, g, h)

#define ip6_addr_debug_print_parts(debug, a, b, c, d, e, f, g, h) \
 LWIP_DEBUGF(debug, ("%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F ":%" X16_F, \
                     a, b, c, d, e, f, g, h))


      

Marco ip6_addr_debug_print(debug, ipaddr)

#define ip6_addr_debug_print(debug, ipaddr) \
 ip6_addr_debug_print_parts(debug, \
                     (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK1(ipaddr) : 0),   \
                     (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK2(ipaddr) : 0),   \
                     (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK3(ipaddr) : 0),   \
                     (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK4(ipaddr) : 0),   \
                     (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK5(ipaddr) : 0),   \
                     (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK6(ipaddr) : 0),   \
                     (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK7(ipaddr) : 0),   \
                     (u16_t)((ipaddr) != NULL ? IP6_ADDR_BLOCK8(ipaddr) : 0))


      

Marco ip6_addr_debug_print_val(debug, ipaddr)

#define ip6_addr_debug_print_val(debug, ipaddr) \
 ip6_addr_debug_print_parts(debug, \
                     IP6_ADDR_BLOCK1(&(ipaddr)),   \
                     IP6_ADDR_BLOCK2(&(ipaddr)),   \
                     IP6_ADDR_BLOCK3(&(ipaddr)),   \
                     IP6_ADDR_BLOCK4(&(ipaddr)),   \
                     IP6_ADDR_BLOCK5(&(ipaddr)),   \
                     IP6_ADDR_BLOCK6(&(ipaddr)),   \
                     IP6_ADDR_BLOCK7(&(ipaddr)),   \
                     IP6_ADDR_BLOCK8(&(ipaddr)))


      

Marco IP6ADDR_STRLEN_MAX

#define IP6ADDR_STRLEN_MAX   46


      

Marco LWIP_HDR_IP6_FRAG_H

#define LWIP_HDR_IP6_FRAG_H


      

Marco IP6_REASS_TMR_INTERVAL

#define IP6_REASS_TMR_INTERVAL 1000
/** The IPv6 reassembly timer interval in milliseconds. */

Marco IPV6_FRAG_COPYHEADER

#define IPV6_FRAG_COPYHEADER  0


      

Marco IPV6_FRAG_SRC(ipr)

#define IPV6_FRAG_SRC(ipr) ((ipr)->src)


      

Marco IPV6_FRAG_DEST(ipr)

#define IPV6_FRAG_DEST(ipr) ((ipr)->dest)


      

Marco IPV6_FRAG_SRC(ipr)

#define IPV6_FRAG_SRC(ipr) ((ipr)->iphdr->src)


      

Marco IPV6_FRAG_DEST(ipr)

#define IPV6_FRAG_DEST(ipr) ((ipr)->iphdr->dest)


      

Marco ip6_reass_init()

#define ip6_reass_init() /* Compatibility define */


      

Marco LWIP_PBUF_CUSTOM_REF_DEFINED

#define LWIP_PBUF_CUSTOM_REF_DEFINED


      

Marco LWIP_HDR_IP6_ZONE_H

#define LWIP_HDR_IP6_ZONE_H


      

Marco IP6_NO_ZONE

#define IP6_NO_ZONE 0
/** Identifier for "no zone". */

Marco IPADDR6_ZONE_INIT

#define IPADDR6_ZONE_INIT , IP6_NO_ZONE
/** Zone initializer for static IPv6 address initialization, including comma. */

Marco ip6_addr_zone(ip6addr)

#define ip6_addr_zone(ip6addr) ((ip6addr)->zone)
/** Return the zone index of the given IPv6 address; possibly "no zone". */

Marco ip6_addr_has_zone(ip6addr)

#define ip6_addr_has_zone(ip6addr) (ip6_addr_zone(ip6addr) != IP6_NO_ZONE)
/** Does the given IPv6 address have a zone set? (0/1) */

Marco ip6_addr_set_zone(ip6addr, zone_idx)

#define ip6_addr_set_zone(ip6addr, zone_idx) ((ip6addr)->zone = (zone_idx))
/** Set the zone field of an IPv6 address to a particular value. */

Marco ip6_addr_clear_zone(ip6addr)

#define ip6_addr_clear_zone(ip6addr) ((ip6addr)->zone = IP6_NO_ZONE)
/** Clear the zone field of an IPv6 address, setting it to "no zone". */

Marco ip6_addr_copy_zone(ip6addr1, ip6addr2)

#define ip6_addr_copy_zone(ip6addr1, ip6addr2) ((ip6addr1).zone = (ip6addr2).zone)
/** Copy the zone field from the second IPv6 address to the first one. */

Marco ip6_addr_equals_zone(ip6addr, zone_idx)

#define ip6_addr_equals_zone(ip6addr, zone_idx) ((ip6addr)->zone == (zone_idx))
/** Is the zone field of the given IPv6 address equal to the given zone index? (0/1) */

Marco ip6_addr_cmp_zone(ip6addr1, ip6addr2)

#define ip6_addr_cmp_zone(ip6addr1, ip6addr2) ((ip6addr1)->zone == (ip6addr2)->zone)
/** Are the zone fields of the given IPv6 addresses equal? (0/1)
 * This macro must only be used on IPv6 addresses of the same scope. */

Marco IPV6_CUSTOM_SCOPES

#define IPV6_CUSTOM_SCOPES 0


      

Marco ip6_addr_has_scope(ip6addr, type)

#define ip6_addr_has_scope(ip6addr, type) \
 (ip6_addr_islinklocal(ip6addr) || (((type) != IP6_UNICAST) && \
  (ip6_addr_ismulticast_iflocal(ip6addr) || \
   ip6_addr_ismulticast_linklocal(ip6addr))))
/**
 * Determine whether an IPv6 address has a constrained scope, and as such is
 * meaningful only if accompanied by a zone index to identify the scope's zone.
 * The given address type may be used to eliminate at compile time certain
 * checks that will evaluate to false at run time anyway.
 *
 * This default implementation follows the default model of RFC 4007, where
 * only interface-local and link-local scopes are defined.
 *
 * Even though the unicast loopback address does have an implied link-local
 * scope, in this implementation it does not have an explicitly assigned zone
 * index. As such it should not be tested for in this macro.
 *
 * @param ip6addr the IPv6 address (const); only its address part is examined.
 * @param type address type; see @ref lwip_ipv6_scope_type.
 * @return 1 if the address has a constrained scope, 0 if it does not.
 */

Marco ip6_addr_assign_zone(ip6addr, type, netif)

#define ip6_addr_assign_zone(ip6addr, type, netif) \
   (ip6_addr_set_zone((ip6addr), \
     ip6_addr_has_scope((ip6addr), (type)) ? netif_get_index(netif) : 0))
/**
 * Assign a zone index to an IPv6 address, based on a network interface. If the
 * given address has a scope, the assigned zone index is that scope's zone of
 * the given netif; otherwise, the assigned zone index is "no zone".
 *
 * This default implementation follows the default model of RFC 4007, where
 * only interface-local and link-local scopes are defined, and the zone index
 * of both of those scopes always equals the index of the network interface.
 * As such, this default implementation need not distinguish between different
 * constrained scopes when assigning the zone.
 *
 * @param ip6addr the IPv6 address; its address part is examined, and its zone
 *                index is assigned.
 * @param type address type; see @ref lwip_ipv6_scope_type.
 * @param netif the network interface (const).
 */

Marco ip6_addr_test_zone(ip6addr, netif)

#define ip6_addr_test_zone(ip6addr, netif) \
   (ip6_addr_equals_zone((ip6addr), netif_get_index(netif)))
/**
 * Test whether an IPv6 address is "zone-compatible" with a network interface.
 * That is, test whether the network interface is part of the zone associated
 * with the address. For efficiency, this macro is only ever called if the
 * given address is either scoped or zoned, and thus, it need not test this.
 * If an address is scoped but not zoned, or zoned and not scoped, it is
 * considered not zone-compatible with any netif.
 *
 * This default implementation follows the default model of RFC 4007, where
 * only interface-local and link-local scopes are defined, and the zone index
 * of both of those scopes always equals the index of the network interface.
 * As such, there is always only one matching netif for a specific zone index,
 * but all call sites of this macro currently support multiple matching netifs
 * as well (at no additional expense in the common case).
 *
 * @param ip6addr the IPv6 address (const).
 * @param netif the network interface (const).
 * @return 1 if the address is scope-compatible with the netif, 0 if not.
 */

Marco ip6_addr_lacks_zone(ip6addr, type)

#define ip6_addr_lacks_zone(ip6addr, type) \
   (!ip6_addr_has_zone(ip6addr) && ip6_addr_has_scope((ip6addr), (type)))
/** Does the given IPv6 address have a scope, and as such should also have a
 * zone to be meaningful, but does not actually have a zone? (0/1) */

Marco ip6_addr_select_zone(dest, src)

#define ip6_addr_select_zone(dest, src) do { struct netif *selected_netif; \
 selected_netif = ip6_route((src), (dest)); \
 if (selected_netif != NULL) { \
   ip6_addr_assign_zone((dest), IP6_UNKNOWN, selected_netif); \
 } } while (0)
/**
 * Try to select a zone for a scoped address that does not yet have a zone.
 * Called from PCB bind and connect routines, for two reasons: 1) to save on
 * this (relatively expensive) selection for every individual packet route
 * operation and 2) to allow the application to obtain the selected zone from
 * the PCB as is customary for e.g. getsockname/getpeername BSD socket calls.
 *
 * Ideally, callers would always supply a properly zoned address, in which case
 * this function would not be needed. It exists both for compatibility with the
 * BSD socket API (which accepts zoneless destination addresses) and for
 * backward compatibility with pre-scoping lwIP code.
 *
 * It may be impossible to select a zone, e.g. if there are no netifs.  In that
 * case, the address's zone field will be left as is.
 *
 * @param dest the IPv6 address for which to select and set a zone.
 * @param src source IPv6 address (const); may be equal to dest.
 */

Marco IPADDR6_ZONE_INIT

#define IPADDR6_ZONE_INIT


      

Marco ip6_addr_zone(ip6addr)

#define ip6_addr_zone(ip6addr) (IP6_NO_ZONE)


      

Marco ip6_addr_has_zone(ip6addr)

#define ip6_addr_has_zone(ip6addr) (0)


      

Marco ip6_addr_set_zone

#define ip6_addr_set_zone(ip6addr, zone_idx)


      

Marco ip6_addr_clear_zone

#define ip6_addr_clear_zone(ip6addr)


      

Marco ip6_addr_copy_zone

#define ip6_addr_copy_zone(ip6addr1, ip6addr2)


      

Marco ip6_addr_equals_zone(ip6addr, zone_idx)

#define ip6_addr_equals_zone(ip6addr, zone_idx) (1)


      

Marco ip6_addr_cmp_zone(ip6addr1, ip6addr2)

#define ip6_addr_cmp_zone(ip6addr1, ip6addr2) (1)


      

Marco IPV6_CUSTOM_SCOPES

#define IPV6_CUSTOM_SCOPES 0


      

Marco ip6_addr_has_scope(ip6addr, type)

#define ip6_addr_has_scope(ip6addr, type) (0)


      

Marco ip6_addr_assign_zone

#define ip6_addr_assign_zone(ip6addr, type, netif)


      

Marco ip6_addr_test_zone(ip6addr, netif)

#define ip6_addr_test_zone(ip6addr, netif) (1)


      

Marco ip6_addr_lacks_zone(ip6addr, type)

#define ip6_addr_lacks_zone(ip6addr, type) (0)


      

Marco ip6_addr_select_zone

#define ip6_addr_select_zone(ip6addr, src)


      

Marco IP6_ADDR_ZONECHECK(ip6addr)

#define IP6_ADDR_ZONECHECK(ip6addr) LWIP_ASSERT("IPv6 zone check failed", \
   ip6_addr_has_scope(ip6addr, IP6_UNKNOWN) == ip6_addr_has_zone(ip6addr))
/** Verify that the given IPv6 address is properly zoned. */

Marco IP6_ADDR_ZONECHECK_NETIF(ip6addr, netif)

#define IP6_ADDR_ZONECHECK_NETIF(ip6addr, netif) LWIP_ASSERT("IPv6 netif zone check failed", \
   ip6_addr_has_scope(ip6addr, IP6_UNKNOWN) ? \
   (ip6_addr_has_zone(ip6addr) && \
    (((netif) == NULL) || ip6_addr_test_zone((ip6addr), (netif)))) : \
   !ip6_addr_has_zone(ip6addr))
/** Verify that the given IPv6 address is properly zoned for the given netif. */

Marco IP6_ADDR_ZONECHECK

#define IP6_ADDR_ZONECHECK(ip6addr)


      

Marco IP6_ADDR_ZONECHECK_NETIF

#define IP6_ADDR_ZONECHECK_NETIF(ip6addr, netif)


      

Marco LWIP_HDR_IP_ADDR_H

#define LWIP_HDR_IP_ADDR_H


      

Marco IPADDR4_INIT(u32val)

#define IPADDR4_INIT(u32val)         { { { { u32val, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V4 }
/** @ingroup ip4addr */

Marco IPADDR4_INIT_BYTES(a,b,c,d)

#define IPADDR4_INIT_BYTES(a,b,c,d)  IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d)))
/** @ingroup ip4addr */

Marco IPADDR6_INIT(a, b, c, d)

#define IPADDR6_INIT(a, b, c, d)     { { { { a, b, c, d } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 }
/** @ingroup ip6addr */

Marco IPADDR6_INIT_HOST(a, b, c, d)

#define IPADDR6_INIT_HOST(a, b, c, d) { { { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_V6 }
/** @ingroup ip6addr */

Marco IP_IS_ANY_TYPE_VAL(ipaddr)

#define IP_IS_ANY_TYPE_VAL(ipaddr)   (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_ANY)
/** @ingroup ipaddr */

Marco IPADDR_ANY_TYPE_INIT

#define IPADDR_ANY_TYPE_INIT         { { { { 0ul, 0ul, 0ul, 0ul } IPADDR6_ZONE_INIT } }, IPADDR_TYPE_ANY }
/** @ingroup ipaddr */

Marco IP_IS_V4_VAL(ipaddr)

#define IP_IS_V4_VAL(ipaddr)         (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4)
/** @ingroup ip4addr */

Marco IP_IS_V6_VAL(ipaddr)

#define IP_IS_V6_VAL(ipaddr)         (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V6)
/** @ingroup ip6addr */

Marco IP_IS_V4(ipaddr)

#define IP_IS_V4(ipaddr)             (((ipaddr) == NULL) || IP_IS_V4_VAL(*(ipaddr)))
/** @ingroup ip4addr */

Marco IP_IS_V6(ipaddr)

#define IP_IS_V6(ipaddr)             (((ipaddr) != NULL) && IP_IS_V6_VAL(*(ipaddr)))
/** @ingroup ip6addr */

Marco IP_SET_TYPE_VAL(ipaddr, iptype)

#define IP_SET_TYPE_VAL(ipaddr, iptype) do { (ipaddr).type = (iptype); }while(0)


      

Marco IP_SET_TYPE(ipaddr, iptype)

#define IP_SET_TYPE(ipaddr, iptype)    do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr), iptype); }}while(0)


      

Marco IP_GET_TYPE(ipaddr)

#define IP_GET_TYPE(ipaddr)          ((ipaddr)->type)


      

Marco IP_ADDR_RAW_SIZE(ipaddr)

#define IP_ADDR_RAW_SIZE(ipaddr)     (IP_GET_TYPE(&ipaddr) == IPADDR_TYPE_V4 ? sizeof(ip4_addr_t) : sizeof(ip6_addr_t))


      

Marco IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr)

#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) (IP_GET_TYPE(&pcb->local_ip) == IP_GET_TYPE(ipaddr))


      

Marco IP_ADDR_PCB_VERSION_MATCH(pcb, ipaddr)

#define IP_ADDR_PCB_VERSION_MATCH(pcb, ipaddr) (IP_IS_ANY_TYPE_VAL(pcb->local_ip) || IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr))


      

Marco ip_2_ip6(ipaddr)

#define ip_2_ip6(ipaddr)  (&((ipaddr)->u_addr.ip6))
/** @ingroup ip6addr
 * Convert generic ip address to specific protocol version
 */

Marco ip_2_ip4(ipaddr)

#define ip_2_ip4(ipaddr)  (&((ipaddr)->u_addr.ip4))
/** @ingroup ip4addr
 * Convert generic ip address to specific protocol version
 */

Marco IP_ADDR4(ipaddr,a,b,c,d)

#define IP_ADDR4(ipaddr,a,b,c,d)     do { IP4_ADDR(ip_2_ip4(ipaddr),a,b,c,d); \
                                          IP_SET_TYPE_VAL(*(ipaddr), IPADDR_TYPE_V4); } while(0)
/** @ingroup ip4addr */

Marco IP_ADDR6(ipaddr,i0,i1,i2,i3)

#define IP_ADDR6(ipaddr,i0,i1,i2,i3) do { IP6_ADDR(ip_2_ip6(ipaddr),i0,i1,i2,i3); \
                                          IP_SET_TYPE_VAL(*(ipaddr), IPADDR_TYPE_V6); } while(0)
/** @ingroup ip6addr */

Marco IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3)

#define IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3) IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3))
/** @ingroup ip6addr */

Marco ip_clear_no4(ipaddr)

#define ip_clear_no4(ipaddr) do { ip_2_ip6(ipaddr)->addr[1] = \
                                  ip_2_ip6(ipaddr)->addr[2] = \
                                  ip_2_ip6(ipaddr)->addr[3] = 0; \
                                  ip6_addr_clear_zone(ip_2_ip6(ipaddr)); }while(0)


      

Marco ip_addr_copy(dest, src)

#define ip_addr_copy(dest, src)     do{ IP_SET_TYPE_VAL(dest, IP_GET_TYPE(&src)); if(IP_IS_V6_VAL(src)){ \
 ip6_addr_copy(*ip_2_ip6(&(dest)), *ip_2_ip6(&(src))); }else{ \
 ip4_addr_copy(*ip_2_ip4(&(dest)), *ip_2_ip4(&(src))); ip_clear_no4(&dest); }}while(0)
/** @ingroup ipaddr */

Marco ip_addr_copy_from_ip6(dest, src)

#define ip_addr_copy_from_ip6(dest, src)     do{ \
 ip6_addr_copy(*ip_2_ip6(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V6); }while(0)
/** @ingroup ip6addr */

Marco ip_addr_copy_from_ip6_packed(dest, src)

#define ip_addr_copy_from_ip6_packed(dest, src)     do{ \
 ip6_addr_copy_from_packed(*ip_2_ip6(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V6); }while(0)
/** @ingroup ip6addr */

Marco ip_addr_copy_from_ip4(dest, src)

#define ip_addr_copy_from_ip4(dest, src)     do{ \
 ip4_addr_copy(*ip_2_ip4(&(dest)), src); IP_SET_TYPE_VAL(dest, IPADDR_TYPE_V4); ip_clear_no4(&dest); }while(0)
/** @ingroup ip4addr */

Marco ip_addr_set_ip4_u32(ipaddr, val)

#define ip_addr_set_ip4_u32(ipaddr, val) do{if(ipaddr){ip4_addr_set_u32(ip_2_ip4(ipaddr), val); \
 IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(ipaddr); }}while(0)
/** @ingroup ip4addr */

Marco ip_addr_set_ip4_u32_val(ipaddr, val)

#define ip_addr_set_ip4_u32_val(ipaddr, val) do{ ip4_addr_set_u32(ip_2_ip4(&(ipaddr)), val); \
 IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(&ipaddr); }while(0)
/** @ingroup ip4addr */

Marco ip_addr_get_ip4_u32(ipaddr)

#define ip_addr_get_ip4_u32(ipaddr) (((ipaddr) && IP_IS_V4(ipaddr)) ? \
 ip4_addr_get_u32(ip_2_ip4(ipaddr)) : 0)
/** @ingroup ip4addr */

Marco ip_addr_set(dest, src)

#define ip_addr_set(dest, src) do{ IP_SET_TYPE(dest, IP_GET_TYPE(src)); if(IP_IS_V6(src)){ \
 ip6_addr_set(ip_2_ip6(dest), ip_2_ip6(src)); }else{ \
 ip4_addr_set(ip_2_ip4(dest), ip_2_ip4(src)); ip_clear_no4(dest); }}while(0)
/** @ingroup ipaddr */

Marco ip_addr_set_ipaddr(dest, src)

#define ip_addr_set_ipaddr(dest, src) ip_addr_set(dest, src)
/** @ingroup ipaddr */

Marco ip_addr_set_zero(ipaddr)

#define ip_addr_set_zero(ipaddr)    do{ \
 ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, 0); }while(0)
/** @ingroup ipaddr */

Marco ip_addr_set_zero_ip4(ipaddr)

#define ip_addr_set_zero_ip4(ipaddr)    do{ \
 ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); }while(0)
/** @ingroup ip5addr */

Marco ip_addr_set_zero_ip6(ipaddr)

#define ip_addr_set_zero_ip6(ipaddr)    do{ \
 ip6_addr_set_zero(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }while(0)
/** @ingroup ip6addr */

Marco ip_addr_set_any(is_ipv6, ipaddr)

#define ip_addr_set_any(is_ipv6, ipaddr)     do{if(is_ipv6){ \
 ip6_addr_set_any(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }else{ \
 ip4_addr_set_any(ip_2_ip4(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(ipaddr); }}while(0)
/** @ingroup ipaddr */

Marco ip_addr_set_any_val(is_ipv6, ipaddr)

#define ip_addr_set_any_val(is_ipv6, ipaddr)     do{if(is_ipv6){ \
 ip6_addr_set_any(ip_2_ip6(&(ipaddr))); IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V6); }else{ \
 ip4_addr_set_any(ip_2_ip4(&(ipaddr))); IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(&ipaddr); }}while(0)
/** @ingroup ipaddr */

Marco ip_addr_set_loopback(is_ipv6, ipaddr)

#define ip_addr_set_loopback(is_ipv6, ipaddr) do{if(is_ipv6){ \
 ip6_addr_set_loopback(ip_2_ip6(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V6); }else{ \
 ip4_addr_set_loopback(ip_2_ip4(ipaddr)); IP_SET_TYPE(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(ipaddr); }}while(0)
/** @ingroup ipaddr */

Marco ip_addr_set_loopback_val(is_ipv6, ipaddr)

#define ip_addr_set_loopback_val(is_ipv6, ipaddr) do{if(is_ipv6){ \
 ip6_addr_set_loopback(ip_2_ip6(&(ipaddr))); IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V6); }else{ \
 ip4_addr_set_loopback(ip_2_ip4(&(ipaddr))); IP_SET_TYPE_VAL(ipaddr, IPADDR_TYPE_V4); ip_clear_no4(&ipaddr); }}while(0)
/** @ingroup ipaddr */

Marco ip_addr_set_hton(dest, src)

#define ip_addr_set_hton(dest, src) do{if(IP_IS_V6(src)){ \
 ip6_addr_set_hton(ip_2_ip6(dest), ip_2_ip6(src)); IP_SET_TYPE(dest, IPADDR_TYPE_V6); }else{ \
 ip4_addr_set_hton(ip_2_ip4(dest), ip_2_ip4(src)); IP_SET_TYPE(dest, IPADDR_TYPE_V4); ip_clear_no4(ipaddr); }}while(0)
/** @ingroup ipaddr */

Marco ip_addr_get_network(target, host, netmask)

#define ip_addr_get_network(target, host, netmask) do{if(IP_IS_V6(host)){ \
 ip4_addr_set_zero(ip_2_ip4(target)); IP_SET_TYPE(target, IPADDR_TYPE_V6); } else { \
 ip4_addr_get_network(ip_2_ip4(target), ip_2_ip4(host), ip_2_ip4(netmask)); IP_SET_TYPE(target, IPADDR_TYPE_V4); }}while(0)
/** @ingroup ipaddr */

Marco ip_addr_netcmp(addr1, addr2, mask)

#define ip_addr_netcmp(addr1, addr2, mask) ((IP_IS_V6(addr1) && IP_IS_V6(addr2)) ? \
 0 : \
 ip4_addr_netcmp(ip_2_ip4(addr1), ip_2_ip4(addr2), mask))
/** @ingroup ipaddr */

Marco ip_addr_cmp(addr1, addr2)

#define ip_addr_cmp(addr1, addr2)   ((IP_GET_TYPE(addr1) != IP_GET_TYPE(addr2)) ? 0 : (IP_IS_V6_VAL(*(addr1)) ? \
 ip6_addr_cmp(ip_2_ip6(addr1), ip_2_ip6(addr2)) : \
 ip4_addr_cmp(ip_2_ip4(addr1), ip_2_ip4(addr2))))
/** @ingroup ipaddr */

Marco ip_addr_cmp_zoneless(addr1, addr2)

#define ip_addr_cmp_zoneless(addr1, addr2)   ((IP_GET_TYPE(addr1) != IP_GET_TYPE(addr2)) ? 0 : (IP_IS_V6_VAL(*(addr1)) ? \
 ip6_addr_cmp_zoneless(ip_2_ip6(addr1), ip_2_ip6(addr2)) : \
 ip4_addr_cmp(ip_2_ip4(addr1), ip_2_ip4(addr2))))
/** @ingroup ipaddr */

Marco ip_addr_isany(ipaddr)

#define ip_addr_isany(ipaddr)       (((ipaddr) == NULL) ? 1 : ((IP_IS_V6(ipaddr)) ? \
 ip6_addr_isany(ip_2_ip6(ipaddr)) : \
 ip4_addr_isany(ip_2_ip4(ipaddr))))
/** @ingroup ipaddr */

Marco ip_addr_isany_val(ipaddr)

#define ip_addr_isany_val(ipaddr)       ((IP_IS_V6_VAL(ipaddr)) ? \
 ip6_addr_isany_val(*ip_2_ip6(&(ipaddr))) : \
 ip4_addr_isany_val(*ip_2_ip4(&(ipaddr))))
/** @ingroup ipaddr */

Marco ip_addr_isbroadcast(ipaddr, netif)

#define ip_addr_isbroadcast(ipaddr, netif) ((IP_IS_V6(ipaddr)) ? \
 0 : \
 ip4_addr_isbroadcast(ip_2_ip4(ipaddr), netif))
/** @ingroup ipaddr */

Marco ip_addr_ismulticast(ipaddr)

#define ip_addr_ismulticast(ipaddr) ((IP_IS_V6(ipaddr)) ? \
 ip6_addr_ismulticast(ip_2_ip6(ipaddr)) : \
 ip4_addr_ismulticast(ip_2_ip4(ipaddr)))
/** @ingroup ipaddr */

Marco ip_addr_isloopback(ipaddr)

#define ip_addr_isloopback(ipaddr) ((IP_IS_V6(ipaddr)) ? \
 ip6_addr_isloopback(ip_2_ip6(ipaddr)) : \
 ip4_addr_isloopback(ip_2_ip4(ipaddr)))
/** @ingroup ipaddr */

Marco ip_addr_islinklocal(ipaddr)

#define ip_addr_islinklocal(ipaddr) ((IP_IS_V6(ipaddr)) ? \
 ip6_addr_islinklocal(ip_2_ip6(ipaddr)) : \
 ip4_addr_islinklocal(ip_2_ip4(ipaddr)))
/** @ingroup ipaddr */

Marco ip_addr_debug_print(debug, ipaddr)

#define ip_addr_debug_print(debug, ipaddr) do { if(IP_IS_V6(ipaddr)) { \
 ip6_addr_debug_print(debug, ip_2_ip6(ipaddr)); } else { \
 ip4_addr_debug_print(debug, ip_2_ip4(ipaddr)); }}while(0)


      

Marco ip_addr_debug_print_val(debug, ipaddr)

#define ip_addr_debug_print_val(debug, ipaddr) do { if(IP_IS_V6_VAL(ipaddr)) { \
 ip6_addr_debug_print_val(debug, *ip_2_ip6(&(ipaddr))); } else { \
 ip4_addr_debug_print_val(debug, *ip_2_ip4(&(ipaddr))); }}while(0)


      

Marco IPADDR_STRLEN_MAX

#define IPADDR_STRLEN_MAX  IP6ADDR_STRLEN_MAX
/** @ingroup ipaddr */

Marco ip4_2_ipv4_mapped_ipv6(ip6addr, ip4addr)

#define ip4_2_ipv4_mapped_ipv6(ip6addr, ip4addr) do { \
 (ip6addr)->addr[3] = (ip4addr)->addr; \
 (ip6addr)->addr[2] = PP_HTONL(0x0000FFFFUL); \
 (ip6addr)->addr[1] = 0; \
 (ip6addr)->addr[0] = 0; \
 ip6_addr_clear_zone(ip6addr); } while(0);
/** @ingroup ipaddr */

Marco unmap_ipv4_mapped_ipv6(ip4addr, ip6addr)

#define unmap_ipv4_mapped_ipv6(ip4addr, ip6addr) \
 (ip4addr)->addr = (ip6addr)->addr[3];
/** @ingroup ipaddr */

Marco IP46_ADDR_ANY(type)

#define IP46_ADDR_ANY(type) (((type) == IPADDR_TYPE_V6)? IP6_ADDR_ANY : IP4_ADDR_ANY)


      

Marco IP_ADDR_PCB_VERSION_MATCH(addr, pcb)

#define IP_ADDR_PCB_VERSION_MATCH(addr, pcb)         1


      

Marco IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr)

#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) 1


      

Marco ip_addr_set_any_val(is_ipv6, ipaddr)

#define ip_addr_set_any_val(is_ipv6, ipaddr)         ip_addr_set_any(is_ipv6, &(ipaddr))


      

Marco ip_addr_set_loopback_val(is_ipv6, ipaddr)

#define ip_addr_set_loopback_val(is_ipv6, ipaddr)    ip_addr_set_loopback(is_ipv6, &(ipaddr))


      

Marco ip_addr_copy(dest, src)

#define ip_addr_copy(dest, src)                ip4_addr_copy(dest, src)


      

Marco ip_addr_copy_from_ip4(dest, src)

#define ip_addr_copy_from_ip4(dest, src)       ip4_addr_copy(dest, src)


      

Marco ip_addr_set_ip4_u32(ipaddr, val)

#define ip_addr_set_ip4_u32(ipaddr, val)       ip4_addr_set_u32(ip_2_ip4(ipaddr), val)


      

Marco ip_addr_set_ip4_u32_val(ipaddr, val)

#define ip_addr_set_ip4_u32_val(ipaddr, val)   ip_addr_set_ip4_u32(&(ipaddr), val)


      

Marco ip_addr_get_ip4_u32(ipaddr)

#define ip_addr_get_ip4_u32(ipaddr)            ip4_addr_get_u32(ip_2_ip4(ipaddr))


      

Marco ip_addr_set(dest, src)

#define ip_addr_set(dest, src)                 ip4_addr_set(dest, src)


      

Marco ip_addr_set_ipaddr(dest, src)

#define ip_addr_set_ipaddr(dest, src)          ip4_addr_set(dest, src)


      

Marco ip_addr_set_zero(ipaddr)

#define ip_addr_set_zero(ipaddr)               ip4_addr_set_zero(ipaddr)


      

Marco ip_addr_set_zero_ip4(ipaddr)

#define ip_addr_set_zero_ip4(ipaddr)           ip4_addr_set_zero(ipaddr)


      

Marco ip_addr_set_any(is_ipv6, ipaddr)

#define ip_addr_set_any(is_ipv6, ipaddr)       ip4_addr_set_any(ipaddr)


      

Marco ip_addr_set_loopback(is_ipv6, ipaddr)

#define ip_addr_set_loopback(is_ipv6, ipaddr)  ip4_addr_set_loopback(ipaddr)


      

Marco ip_addr_set_hton(dest, src)

#define ip_addr_set_hton(dest, src)            ip4_addr_set_hton(dest, src)


      

Marco ip_addr_get_network(target, host, mask)

#define ip_addr_get_network(target, host, mask) ip4_addr_get_network(target, host, mask)


      

Marco ip_addr_netcmp(addr1, addr2, mask)

#define ip_addr_netcmp(addr1, addr2, mask)     ip4_addr_netcmp(addr1, addr2, mask)


      

Marco ip_addr_cmp(addr1, addr2)

#define ip_addr_cmp(addr1, addr2)              ip4_addr_cmp(addr1, addr2)


      

Marco ip_addr_isany(ipaddr)

#define ip_addr_isany(ipaddr)                  ip4_addr_isany(ipaddr)


      

Marco ip_addr_isany_val(ipaddr)

#define ip_addr_isany_val(ipaddr)              ip4_addr_isany_val(ipaddr)


      

Marco ip_addr_isloopback(ipaddr)

#define ip_addr_isloopback(ipaddr)             ip4_addr_isloopback(ipaddr)


      

Marco ip_addr_islinklocal(ipaddr)

#define ip_addr_islinklocal(ipaddr)            ip4_addr_islinklocal(ipaddr)


      

Marco ip_addr_isbroadcast(addr, netif)

#define ip_addr_isbroadcast(addr, netif)       ip4_addr_isbroadcast(addr, netif)


      

Marco ip_addr_ismulticast(ipaddr)

#define ip_addr_ismulticast(ipaddr)            ip4_addr_ismulticast(ipaddr)


      

Marco ip_addr_debug_print(debug, ipaddr)

#define ip_addr_debug_print(debug, ipaddr)     ip4_addr_debug_print(debug, ipaddr)


      

Marco ip_addr_debug_print_val(debug, ipaddr)

#define ip_addr_debug_print_val(debug, ipaddr) ip4_addr_debug_print_val(debug, ipaddr)


      

Marco ipaddr_ntoa(ipaddr)

#define ipaddr_ntoa(ipaddr)                    ip4addr_ntoa(ipaddr)


      

Marco ipaddr_ntoa_r(ipaddr, buf, buflen)

#define ipaddr_ntoa_r(ipaddr, buf, buflen)     ip4addr_ntoa_r(ipaddr, buf, buflen)


      

Marco ipaddr_aton(cp, addr)

#define ipaddr_aton(cp, addr)                  ip4addr_aton(cp, addr)


      

Marco IPADDR_STRLEN_MAX

#define IPADDR_STRLEN_MAX  IP4ADDR_STRLEN_MAX


      

Marco IP46_ADDR_ANY(type)

#define IP46_ADDR_ANY(type) (IP4_ADDR_ANY)


      

Marco ip_addr_copy(dest, src)

#define ip_addr_copy(dest, src)                ip6_addr_copy(dest, src)


      

Marco ip_addr_copy_from_ip6(dest, src)

#define ip_addr_copy_from_ip6(dest, src)       ip6_addr_copy(dest, src)


      

Marco ip_addr_copy_from_ip6_packed(dest, src)

#define ip_addr_copy_from_ip6_packed(dest, src) ip6_addr_copy_from_packed(dest, src)


      

Marco ip_addr_set(dest, src)

#define ip_addr_set(dest, src)                 ip6_addr_set(dest, src)


      

Marco ip_addr_set_ipaddr(dest, src)

#define ip_addr_set_ipaddr(dest, src)          ip6_addr_set(dest, src)


      

Marco ip_addr_set_zero(ipaddr)

#define ip_addr_set_zero(ipaddr)               ip6_addr_set_zero(ipaddr)


      

Marco ip_addr_set_zero_ip6(ipaddr)

#define ip_addr_set_zero_ip6(ipaddr)           ip6_addr_set_zero(ipaddr)


      

Marco ip_addr_set_any(is_ipv6, ipaddr)

#define ip_addr_set_any(is_ipv6, ipaddr)       ip6_addr_set_any(ipaddr)


      

Marco ip_addr_set_loopback(is_ipv6, ipaddr)

#define ip_addr_set_loopback(is_ipv6, ipaddr)  ip6_addr_set_loopback(ipaddr)


      

Marco ip_addr_set_hton(dest, src)

#define ip_addr_set_hton(dest, src)            ip6_addr_set_hton(dest, src)


      

Marco ip_addr_get_network(target, host, mask)

#define ip_addr_get_network(target, host, mask) ip6_addr_set_zero(target)


      

Marco ip_addr_netcmp(addr1, addr2, mask)

#define ip_addr_netcmp(addr1, addr2, mask)     0


      

Marco ip_addr_cmp(addr1, addr2)

#define ip_addr_cmp(addr1, addr2)              ip6_addr_cmp(addr1, addr2)


      

Marco ip_addr_cmp_zoneless(addr1, addr2)

#define ip_addr_cmp_zoneless(addr1, addr2)     ip6_addr_cmp_zoneless(addr1, addr2)


      

Marco ip_addr_isany(ipaddr)

#define ip_addr_isany(ipaddr)                  ip6_addr_isany(ipaddr)


      

Marco ip_addr_isany_val(ipaddr)

#define ip_addr_isany_val(ipaddr)              ip6_addr_isany_val(ipaddr)


      

Marco ip_addr_isloopback(ipaddr)

#define ip_addr_isloopback(ipaddr)             ip6_addr_isloopback(ipaddr)


      

Marco ip_addr_islinklocal(ipaddr)

#define ip_addr_islinklocal(ipaddr)            ip6_addr_islinklocal(ipaddr)


      

Marco ip_addr_isbroadcast(addr, netif)

#define ip_addr_isbroadcast(addr, netif)       0


      

Marco ip_addr_ismulticast(ipaddr)

#define ip_addr_ismulticast(ipaddr)            ip6_addr_ismulticast(ipaddr)


      

Marco ip_addr_debug_print(debug, ipaddr)

#define ip_addr_debug_print(debug, ipaddr)     ip6_addr_debug_print(debug, ipaddr)


      

Marco ip_addr_debug_print_val(debug, ipaddr)

#define ip_addr_debug_print_val(debug, ipaddr) ip6_addr_debug_print_val(debug, ipaddr)


      

Marco ipaddr_ntoa(ipaddr)

#define ipaddr_ntoa(ipaddr)                    ip6addr_ntoa(ipaddr)


      

Marco ipaddr_ntoa_r(ipaddr, buf, buflen)

#define ipaddr_ntoa_r(ipaddr, buf, buflen)     ip6addr_ntoa_r(ipaddr, buf, buflen)


      

Marco ipaddr_aton(cp, addr)

#define ipaddr_aton(cp, addr)                  ip6addr_aton(cp, addr)


      

Marco IPADDR_STRLEN_MAX

#define IPADDR_STRLEN_MAX  IP6ADDR_STRLEN_MAX


      

Marco IP46_ADDR_ANY(type)

#define IP46_ADDR_ANY(type) (IP6_ADDR_ANY)


      

Marco IP_ADDR_ANY

#define IP_ADDR_ANY        IP4_ADDR_ANY
/**
 * @ingroup ip4addr
 * Can be used as a fixed/const ip_addr_t
 * for the IP wildcard.
 * Defined to @ref IP4_ADDR_ANY when IPv4 is enabled.
 * Defined to @ref IP6_ADDR_ANY in IPv6 only systems.
 * Use this if you can handle IPv4 _AND_ IPv6 addresses.
 * Use @ref IP4_ADDR_ANY or @ref IP6_ADDR_ANY when the IP
 * type matters.
 */

Marco IP4_ADDR_ANY

#define IP4_ADDR_ANY       (&ip_addr_any)
/**
 * @ingroup ip4addr
 * Can be used as a fixed/const ip_addr_t
 * for the IPv4 wildcard and the broadcast address
 */

Marco IP4_ADDR_ANY4

#define IP4_ADDR_ANY4      (ip_2_ip4(&ip_addr_any))
/**
 * @ingroup ip4addr
 * Can be used as a fixed/const ip4_addr_t
 * for the wildcard and the broadcast address
 */

Marco IP_ADDR_BROADCAST

#define IP_ADDR_BROADCAST  (&ip_addr_broadcast)
/** @ingroup ip4addr */

Marco IP4_ADDR_BROADCAST

#define IP4_ADDR_BROADCAST (ip_2_ip4(&ip_addr_broadcast))
/** @ingroup ip4addr */

Marco IP6_ADDR_ANY

#define IP6_ADDR_ANY  (&ip6_addr_any)
/** 
 * @ingroup ip6addr
 * IP6_ADDR_ANY can be used as a fixed ip_addr_t
 * for the IPv6 wildcard address
 */

Marco IP6_ADDR_ANY6

#define IP6_ADDR_ANY6 (ip_2_ip6(&ip6_addr_any))
/**
 * @ingroup ip6addr
 * IP6_ADDR_ANY6 can be used as a fixed ip6_addr_t
 * for the IPv6 wildcard address
 */

Marco IP_ADDR_ANY

#define IP_ADDR_ANY IP6_ADDR_ANY
/** IPv6-only configurations */

Marco IP_ANY_TYPE

#define IP_ANY_TYPE   (&ip_addr_any_type)
/** @ingroup ipaddr */

Marco IP_ANY_TYPE

#define IP_ANY_TYPE   IP_ADDR_ANY


      

Marco LWIP_HDR_MEM_H

#define LWIP_HDR_MEM_H


      

Marco LWIP_HDR_MEMP_H

#define LWIP_HDR_MEMP_H


      

Marco LWIP_MEMPOOL

#define LWIP_MEMPOOL(name,num,size,desc)
/* run once with empty definition to handle all custom includes in lwippools.h */

Marco LWIP_MEMPOOL_PROTOTYPE(name)

#define LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name
/**
 * @ingroup mempool
 * Declare prototype for private memory pool if it is used in multiple files
 */

Marco LWIP_MEMPOOL_DECLARE(name,num,size,desc)

#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \
 LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \
 const struct memp_desc memp_ ## name = { \
   DECLARE_LWIP_MEMPOOL_DESC(desc) \
   LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \
   LWIP_MEM_ALIGN_SIZE(size) \
 };


      

Marco LWIP_MEMPOOL_DECLARE(name,num,size,desc)

#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) \
 LWIP_DECLARE_MEMORY_ALIGNED(memp_memory_ ## name ## _base, ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))); \
   \
 LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \
   \
 static struct memp *memp_tab_ ## name; \
   \
 const struct memp_desc memp_ ## name = { \
   DECLARE_LWIP_MEMPOOL_DESC(desc) \
   LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \
   LWIP_MEM_ALIGN_SIZE(size), \
   (num), \
   memp_memory_ ## name ## _base, \
   &memp_tab_ ## name \
 };
/**
 * @ingroup mempool
 * Declare a private memory pool
 * Private mempools example:
 * .h: only when pool is used in multiple .c files: LWIP_MEMPOOL_PROTOTYPE(my_private_pool);
 * .c:
 *   - in global variables section: LWIP_MEMPOOL_DECLARE(my_private_pool, 10, sizeof(foo), "Some description")
 *   - call ONCE before using pool (e.g. in some init() function): LWIP_MEMPOOL_INIT(my_private_pool);
 *   - allocate: void* my_new_mem = LWIP_MEMPOOL_ALLOC(my_private_pool);
 *   - free: LWIP_MEMPOOL_FREE(my_private_pool, my_new_mem);
 *
 * To relocate a pool, declare it as extern in cc.h. Example for GCC:
 *   extern u8_t \_\_attribute\_\_((section(".onchip_mem"))) memp_memory_my_private_pool_base[];
 */

Marco LWIP_MEMPOOL_INIT(name)

#define LWIP_MEMPOOL_INIT(name)   memp_init_pool(&memp_ ## name)
/**
 * @ingroup mempool
 * Initialize a private memory pool
 */

Marco LWIP_MEMPOOL_ALLOC(name)

#define LWIP_MEMPOOL_ALLOC(name)  memp_malloc_pool(&memp_ ## name)
/**
 * @ingroup mempool
 * Allocate from a private memory pool
 */

Marco LWIP_MEMPOOL_FREE(name, x)

#define LWIP_MEMPOOL_FREE(name, x) memp_free_pool(&memp_ ## name, (x))
/**
 * @ingroup mempool
 * Free element from a private memory pool
 */

Marco memp_malloc(t)

#define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__)


      

Marco LWIP_HDR_MLD6_H

#define LWIP_HDR_MLD6_H


      

Marco MLD6_TMR_INTERVAL

#define MLD6_TMR_INTERVAL             100 /* Milliseconds */


      

Marco netif_mld6_data(netif)

#define netif_mld6_data(netif) ((struct mld_group *)netif_get_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_MLD6))
/** @ingroup mld6
 * Get list head of MLD6 groups for netif.
 * Note: The allnodes group IP is NOT in the list, since it must always 
 * be received for correct IPv6 operation.
 * @see @ref netif_set_mld_mac_filter()
 */

Marco LWIP_HDR_ND6_H

#define LWIP_HDR_ND6_H


      

Marco ND6_TMR_INTERVAL

#define ND6_TMR_INTERVAL 1000
/** 1 second period */

Marco ND6_RTR_SOLICITATION_INTERVAL

#define ND6_RTR_SOLICITATION_INTERVAL 4000


      

Marco LWIP_HDR_NETBUF_H

#define LWIP_HDR_NETBUF_H


      

Marco NETBUF_FLAG_DESTADDR

#define NETBUF_FLAG_DESTADDR   1
/** This netbuf has dest-addr/port set */

Marco NETBUF_FLAG_CHKSUM

#define NETBUF_FLAG_CHKSUM     2
/** This netbuf includes a checksum */

Marco netbuf_copy_partial(buf, dataptr, len, offset)

#define netbuf_copy_partial(buf, dataptr, len, offset) \
 pbuf_copy_partial((buf)->p, (dataptr), (len), (offset))


      

Marco netbuf_copy(buf,dataptr,len)

#define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0)


      

Marco netbuf_take(buf, dataptr, len)

#define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len)


      

Marco netbuf_len(buf)

#define netbuf_len(buf)             ((buf)->p->tot_len)


      

Marco netbuf_fromaddr(buf)

#define netbuf_fromaddr(buf)        (&((buf)->addr))


      

Marco netbuf_set_fromaddr(buf, fromaddr)

#define netbuf_set_fromaddr(buf, fromaddr) ip_addr_set(&((buf)->addr), fromaddr)


      

Marco netbuf_fromport(buf)

#define netbuf_fromport(buf)        ((buf)->port)


      

Marco netbuf_destaddr(buf)

#define netbuf_destaddr(buf)        (&((buf)->toaddr))


      

Marco netbuf_set_destaddr(buf, destaddr)

#define netbuf_set_destaddr(buf, destaddr) ip_addr_set(&((buf)->toaddr), destaddr)


      

Marco netbuf_destport(buf)

#define netbuf_destport(buf)        (((buf)->flags & NETBUF_FLAG_DESTADDR) ? (buf)->toport_chksum : 0)


      

Marco netbuf_destport(buf)

#define netbuf_destport(buf)        ((buf)->toport_chksum)


      

Marco netbuf_set_chksum(buf, chksum)

#define netbuf_set_chksum(buf, chksum) do { (buf)->flags = NETBUF_FLAG_CHKSUM; \
                                           (buf)->toport_chksum = chksum; } while(0)


      

Marco LWIP_HDR_NETDB_H

#define LWIP_HDR_NETDB_H


      

Marco LWIP_DNS_API_DECLARE_H_ERRNO

#define LWIP_DNS_API_DECLARE_H_ERRNO 1


      

Marco LWIP_DNS_API_DEFINE_ERRORS

#define LWIP_DNS_API_DEFINE_ERRORS   1


      

Marco LWIP_DNS_API_DEFINE_FLAGS

#define LWIP_DNS_API_DEFINE_FLAGS    1


      

Marco LWIP_DNS_API_DECLARE_STRUCTS

#define LWIP_DNS_API_DECLARE_STRUCTS 1


      

Marco EAI_NONAME

#define EAI_NONAME     200
/** Errors used by the DNS API functions, h_errno can be one of them */

Marco EAI_SERVICE

#define EAI_SERVICE    201


      

Marco EAI_FAIL

#define EAI_FAIL       202


      

Marco EAI_MEMORY

#define EAI_MEMORY     203


      

Marco EAI_FAMILY

#define EAI_FAMILY     204


      

Marco HOST_NOT_FOUND

#define HOST_NOT_FOUND 210


      

Marco NO_DATA

#define NO_DATA        211


      

Marco NO_RECOVERY

#define NO_RECOVERY    212


      

Marco TRY_AGAIN

#define TRY_AGAIN      213


      

Marco AI_PASSIVE

#define AI_PASSIVE     1
/* input flags for struct addrinfo */

Marco AI_CANONNAME

#define AI_CANONNAME   2


      

Marco AI_NUMERICHOST

#define AI_NUMERICHOST 4


      

Marco AI_NUMERICSERV

#define AI_NUMERICSERV 8


      

Marco AI_V4MAPPED

#define AI_V4MAPPED    16


      

Marco AI_ALL

#define AI_ALL         32


      

Marco AI_ADDRCONFIG

#define AI_ADDRCONFIG  64


      

Marco NETDB_ELEM_SIZE

#define NETDB_ELEM_SIZE          (sizeof(struct addrinfo) + sizeof(struct sockaddr_storage) + DNS_MAX_NAME_LENGTH + 1)


      

Marco gethostbyname(name)

#define gethostbyname(name) lwip_gethostbyname(name)
/** @ingroup netdbapi */

Marco gethostbyname_r(name, ret, buf, buflen, result, h_errnop)

#define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \
      lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop)
/** @ingroup netdbapi */

Marco freeaddrinfo(addrinfo)

#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo)
/** @ingroup netdbapi */

Marco getaddrinfo(nodname, servname, hints, res)

#define getaddrinfo(nodname, servname, hints, res) \
      lwip_getaddrinfo(nodname, servname, hints, res)
/** @ingroup netdbapi */

Marco LWIP_HDR_NETIF_H

#define LWIP_HDR_NETIF_H


      

Marco ENABLE_LOOPBACK

#define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF)


      

Marco NETIF_MAX_HWADDR_LEN

#define NETIF_MAX_HWADDR_LEN 6U


      

Marco NETIF_NAMESIZE

#define NETIF_NAMESIZE 6
/** The size of a fully constructed netif name which the
 * netif can be identified by in APIs. Composed of
 * 2 chars, 3 (max) digits, and 1 \0
 */

Marco NETIF_FLAG_UP

#define NETIF_FLAG_UP          0x01U
/** Whether the network interface is 'up'. This is
 * a software flag used to control whether this network
 * interface is enabled and processes traffic.
 * It must be set by the startup code before this netif can be used
 * (also for dhcp/autoip).
 */

Marco NETIF_FLAG_BROADCAST

#define NETIF_FLAG_BROADCAST   0x02U
/** If set, the netif has broadcast capability.
 * Set by the netif driver in its init function. */
#define NETIF_FLAG_LINK_UP     0x04U
/** If set, the interface has an active link
 *  (set by the network interface driver).
 * Either set by the netif driver in its init function (if the link
 * is up at that time) or at a later point once the link comes up
 * (if link detection is supported by the hardware). */

Marco NETIF_FLAG_ETHARP

#define NETIF_FLAG_ETHARP      0x08U
/** If set, the netif is an ethernet device using ARP.
 * Set by the netif driver in its init function.
 * Used to check input packet types and use of DHCP. */

Marco NETIF_FLAG_ETHERNET

#define NETIF_FLAG_ETHERNET    0x10U
/** If set, the netif is an ethernet device. It might not use
 * ARP or TCP/IP if it is used for PPPoE only.
 */

Marco NETIF_FLAG_IGMP

#define NETIF_FLAG_IGMP        0x20U
/** If set, the netif has IGMP capability.
 * Set by the netif driver in its init function. */

Marco NETIF_FLAG_MLD6

#define NETIF_FLAG_MLD6        0x40U
/** If set, the netif has MLD6 capability.
 * Set by the netif driver in its init function. */

Marco NETIF_CHECKSUM_GEN_IP

#define NETIF_CHECKSUM_GEN_IP      1


      

Marco NETIF_CHECKSUM_GEN_UDP

#define NETIF_CHECKSUM_GEN_UDP     2


      

Marco NETIF_CHECKSUM_GEN_TCP

#define NETIF_CHECKSUM_GEN_TCP     4


      

Marco NETIF_CHECKSUM_GEN_ICMP

#define NETIF_CHECKSUM_GEN_ICMP    8


      

Marco NETIF_CHECKSUM_GEN_ICMP6

#define NETIF_CHECKSUM_GEN_ICMP6   16


      

Marco NETIF_CHECKSUM_CHECK_IP

#define NETIF_CHECKSUM_CHECK_IP    256


      

Marco NETIF_CHECKSUM_CHECK_UDP

#define NETIF_CHECKSUM_CHECK_UDP   512


      

Marco NETIF_CHECKSUM_CHECK_TCP

#define NETIF_CHECKSUM_CHECK_TCP   1024


      

Marco NETIF_CHECKSUM_CHECK_ICMP

#define NETIF_CHECKSUM_CHECK_ICMP  2048


      

Marco NETIF_CHECKSUM_CHECK_ICMP6

#define NETIF_CHECKSUM_CHECK_ICMP6 4096


      

Marco NETIF_CHECKSUM_ENABLE_ALL

#define NETIF_CHECKSUM_ENABLE_ALL  65535


      

Marco NETIF_CHECKSUM_DISABLE_ALL

#define NETIF_CHECKSUM_DISABLE_ALL 0


      

Marco netif_set_client_data(netif, id, data)

#define netif_set_client_data(netif, id, data) netif_get_client_data(netif, id) = (data)
/** @ingroup netif_cd
 * Set client data. Obtain ID from netif_alloc_client_data_id().
 */

Marco netif_get_client_data(netif, id)

#define netif_get_client_data(netif, id)      (netif)->client_data[(id)]
/** @ingroup netif_cd
 * Get client data. Obtain ID from netif_alloc_client_data_id().
 */

Marco LWIP_NETIF_USE_HINTS

#define LWIP_NETIF_USE_HINTS             1


      

Marco LWIP_NETIF_USE_HINTS

#define LWIP_NETIF_USE_HINTS             0


      

Marco NETIF_SET_CHECKSUM_CTRL(netif, chksumflags)

#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags) do { \
 (netif)->chksum_flags = chksumflags; } while(0)


      

Marco IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag)

#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag) if (((netif) == NULL) || (((netif)->chksum_flags & (chksumflag)) != 0))


      

Marco NETIF_SET_CHECKSUM_CTRL

#define NETIF_SET_CHECKSUM_CTRL(netif, chksumflags)


      

Marco IF__NETIF_CHECKSUM_ENABLED

#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag)


      

Marco NETIF_FOREACH(netif)

#define NETIF_FOREACH(netif) if (((netif) = netif_default) != NULL)


      

Marco NETIF_FOREACH(netif)

#define NETIF_FOREACH(netif) for ((netif) = netif_list; (netif) != NULL; (netif) = (netif)->next)


      

Marco netif_ip4_addr(netif)

#define netif_ip4_addr(netif)   ((const ip4_addr_t*)ip_2_ip4(&((netif)->ip_addr)))
/** @ingroup netif_ip4 */

Marco netif_ip4_netmask(netif)

#define netif_ip4_netmask(netif) ((const ip4_addr_t*)ip_2_ip4(&((netif)->netmask)))
/** @ingroup netif_ip4 */

Marco netif_ip4_gw(netif)

#define netif_ip4_gw(netif)     ((const ip4_addr_t*)ip_2_ip4(&((netif)->gw)))
/** @ingroup netif_ip4 */

Marco netif_ip_addr4(netif)

#define netif_ip_addr4(netif)   ((const ip_addr_t*)&((netif)->ip_addr))
/** @ingroup netif_ip4 */

Marco netif_ip_netmask4(netif)

#define netif_ip_netmask4(netif) ((const ip_addr_t*)&((netif)->netmask))
/** @ingroup netif_ip4 */

Marco netif_ip_gw4(netif)

#define netif_ip_gw4(netif)     ((const ip_addr_t*)&((netif)->gw))
/** @ingroup netif_ip4 */

Marco netif_set_flags(netif, set_flags)

#define netif_set_flags(netif, set_flags)    do { (netif)->flags = (u8_t)((netif)->flags | (set_flags)); } while(0)


      

Marco netif_clear_flags(netif, clr_flags)

#define netif_clear_flags(netif, clr_flags)  do { (netif)->flags = (u8_t)((netif)->flags & (u8_t)(~(clr_flags) & 255)); } while(0)


      

Marco netif_is_flag_set(nefif, flag)

#define netif_is_flag_set(nefif, flag)       (((netif)->flags & (flag)) != 0)


      

Marco netif_is_up(netif)

#define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0)
/** @ingroup netif
 * Ask if an interface is up
 */
#define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0)
/** Ask if a link is up */

Marco netif_set_hostname(netif, name)

#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0)
/** @ingroup netif */

Marco netif_get_hostname(netif)

#define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL)
/** @ingroup netif */

Marco netif_set_igmp_mac_filter(netif, function)

#define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0)
/** @ingroup netif */

Marco netif_get_igmp_mac_filter(netif)

#define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL)


      

Marco netif_set_mld_mac_filter(netif, function)

#define netif_set_mld_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->mld_mac_filter = function; }}while(0)
/** @ingroup netif */

Marco netif_get_mld_mac_filter(netif)

#define netif_get_mld_mac_filter(netif) (((netif) != NULL) ? ((netif)->mld_mac_filter) : NULL)


      

Marco netif_mld_mac_filter(netif, addr, action)

#define netif_mld_mac_filter(netif, addr, action) do { if((netif) && (netif)->mld_mac_filter) { (netif)->mld_mac_filter((netif), (addr), (action)); }}while(0)


      

Marco netif_ip_addr6(netif, i)

#define netif_ip_addr6(netif, i) ((const ip_addr_t*)(&((netif)->ip6_addr[i])))
/** @ingroup netif_ip6 */

Marco netif_ip6_addr(netif, i)

#define netif_ip6_addr(netif, i) ((const ip6_addr_t*)ip_2_ip6(&((netif)->ip6_addr[i])))
/** @ingroup netif_ip6 */

Marco netif_ip6_addr_state(netif, i)

#define netif_ip6_addr_state(netif, i) ((netif)->ip6_addr_state[i])


      

Marco netif_set_ip6_autoconfig_enabled(netif, action)

#define netif_set_ip6_autoconfig_enabled(netif, action) do { if(netif) { (netif)->ip6_autoconfig_enabled = (action); }}while(0)


      

Marco netif_ip6_addr_valid_life(netif, i)

#define netif_ip6_addr_valid_life(netif, i) \
   (((netif) != NULL) ? ((netif)->ip6_addr_valid_life[i]) : IP6_ADDR_LIFE_STATIC)


      

Marco netif_ip6_addr_set_valid_life(netif, i, secs)

#define netif_ip6_addr_set_valid_life(netif, i, secs) \
   do { if (netif != NULL) { (netif)->ip6_addr_valid_life[i] = (secs); }} while (0)


      

Marco netif_ip6_addr_pref_life(netif, i)

#define netif_ip6_addr_pref_life(netif, i) \
   (((netif) != NULL) ? ((netif)->ip6_addr_pref_life[i]) : IP6_ADDR_LIFE_STATIC)


      

Marco netif_ip6_addr_set_pref_life(netif, i, secs)

#define netif_ip6_addr_set_pref_life(netif, i, secs) \
   do { if (netif != NULL) { (netif)->ip6_addr_pref_life[i] = (secs); }} while (0)


      

Marco netif_ip6_addr_isstatic(netif, i)

#define netif_ip6_addr_isstatic(netif, i) \
   (netif_ip6_addr_valid_life((netif), (i)) == IP6_ADDR_LIFE_STATIC)


      

Marco netif_ip6_addr_isstatic(netif, i)

#define netif_ip6_addr_isstatic(netif, i) (1) /* all addresses are static */


      

Marco netif_mtu6(netif)

#define netif_mtu6(netif) ((netif)->mtu6)


      

Marco netif_mtu6(netif)

#define netif_mtu6(netif) ((netif)->mtu)


      

Marco NETIF_SET_HINTS(netif, netifhint)

#define NETIF_SET_HINTS(netif, netifhint) (netif)->hints = (netifhint)


      

Marco NETIF_RESET_HINTS(netif)

#define NETIF_RESET_HINTS(netif)     (netif)->hints = NULL


      

Marco NETIF_SET_HINTS

#define NETIF_SET_HINTS(netif, netifhint)


      

Marco NETIF_RESET_HINTS

#define NETIF_RESET_HINTS(netif)


      

Marco netif_get_index(netif)

#define netif_get_index(netif)     ((u8_t)((netif)->num + 1))
/* Interface indexes always start at 1 per RFC 3493, section 4, num starts at 0 (internal index is 0..254)*/

Marco NETIF_NO_INDEX

#define NETIF_NO_INDEX             (0)


      

Marco LWIP_NSC_NONE

#define LWIP_NSC_NONE                    0
/* used for initialization only */

Marco LWIP_NSC_NETIF_ADDED

#define LWIP_NSC_NETIF_ADDED             1
/** netif was added. arg: NULL. Called AFTER netif was added. */

Marco LWIP_NSC_NETIF_REMOVED

#define LWIP_NSC_NETIF_REMOVED           2
/** netif was removed. arg: NULL. Called BEFORE netif is removed. */
#define LWIP_NSC_LINK_CHANGED            4
/** link changed */

Marco LWIP_NSC_STATUS_CHANGED

#define LWIP_NSC_STATUS_CHANGED          8
/** netif administrative status changed.\n
  * up is called AFTER netif is set up.\n
  * down is called BEFORE the netif is actually set down. */

Marco LWIP_NSC_IPV4_ADDRESS_CHANGED

#define LWIP_NSC_IPV4_ADDRESS_CHANGED    16
/** IPv4 address has changed */

Marco LWIP_NSC_IPV4_GATEWAY_CHANGED

#define LWIP_NSC_IPV4_GATEWAY_CHANGED    32
/** IPv4 gateway has changed */

Marco LWIP_NSC_IPV4_NETMASK_CHANGED

#define LWIP_NSC_IPV4_NETMASK_CHANGED    64
/** IPv4 netmask has changed */

Marco LWIP_NSC_IPV4_SETTINGS_CHANGED

#define LWIP_NSC_IPV4_SETTINGS_CHANGED   128
/** called AFTER IPv4 address/gateway/netmask changes have been applied */

Marco LWIP_NSC_IPV6_SET

#define LWIP_NSC_IPV6_SET                256
/** IPv6 address was added */

Marco LWIP_NSC_IPV6_ADDR_STATE_CHANGED

#define LWIP_NSC_IPV6_ADDR_STATE_CHANGED 512
/** IPv6 address state has changed */

Marco NETIF_DECLARE_EXT_CALLBACK(name)

#define NETIF_DECLARE_EXT_CALLBACK(name) static netif_ext_callback_t name;


      

Marco NETIF_DECLARE_EXT_CALLBACK

#define NETIF_DECLARE_EXT_CALLBACK(name)


      

Marco netif_add_ext_callback

#define netif_add_ext_callback(callback, fn)


      

Marco netif_remove_ext_callback

#define netif_remove_ext_callback(callback)


      

Marco netif_invoke_ext_callback

#define netif_invoke_ext_callback(netif, reason, args)


      

Marco LWIP_HDR_NETIFAPI_H

#define LWIP_HDR_NETIFAPI_H


      

Marco netifapi_netif_remove(n)

#define netifapi_netif_remove(n)       netifapi_netif_common(n, netif_remove, NULL)
/** @ingroup netifapi_netif
  * @see netif_remove()
  */

Marco netifapi_netif_set_up(n)

#define netifapi_netif_set_up(n)       netifapi_netif_common(n, netif_set_up, NULL)
/** @ingroup netifapi_netif
  * @see netif_set_up()
  */

Marco netifapi_netif_set_down(n)

#define netifapi_netif_set_down(n)     netifapi_netif_common(n, netif_set_down, NULL)
/** @ingroup netifapi_netif
  * @see netif_set_down()
  */

Marco netifapi_netif_set_default(n)

#define netifapi_netif_set_default(n)  netifapi_netif_common(n, netif_set_default, NULL)
/** @ingroup netifapi_netif
  * @see netif_set_default()
  */
#define netifapi_netif_set_link_up(n)  netifapi_netif_common(n, netif_set_link_up, NULL)
/** @ingroup netifapi_netif
  * @see netif_set_link_up()
  */
#define netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL)
/** @ingroup netifapi_netif
  * @see netif_set_link_down()
  */

Marco netifapi_dhcp_start(n)

#define netifapi_dhcp_start(n)           netifapi_netif_common(n, NULL, dhcp_start)
/** @ingroup netifapi_dhcp4
  * @see dhcp_start()
  */

Marco netifapi_dhcp_stop(n)

#define netifapi_dhcp_stop(n)            netifapi_netif_common(n, dhcp_stop, NULL)
/**
 * @ingroup netifapi_dhcp4
 * @deprecated Use netifapi_dhcp_release_and_stop() instead.
 */

Marco netifapi_dhcp_inform(n)

#define netifapi_dhcp_inform(n)          netifapi_netif_common(n, dhcp_inform, NULL)
/** @ingroup netifapi_dhcp4
  * @see dhcp_inform()
  */

Marco netifapi_dhcp_renew(n)

#define netifapi_dhcp_renew(n)           netifapi_netif_common(n, NULL, dhcp_renew)
/** @ingroup netifapi_dhcp4
  * @see dhcp_renew()
  */

Marco netifapi_dhcp_release(n)

#define netifapi_dhcp_release(n)         netifapi_netif_common(n, NULL, dhcp_release)
/**
 * @ingroup netifapi_dhcp4
 * @deprecated Use netifapi_dhcp_release_and_stop() instead.
 */

Marco netifapi_dhcp_release_and_stop(n)

#define netifapi_dhcp_release_and_stop(n) netifapi_netif_common(n, dhcp_release_and_stop, NULL)
/** @ingroup netifapi_dhcp4
  * @see dhcp_release_and_stop()
  */

Marco netifapi_autoip_start(n)

#define netifapi_autoip_start(n)     netifapi_netif_common(n, NULL, autoip_start)
/** @ingroup netifapi_autoip
  * @see autoip_start()
  */

Marco netifapi_autoip_stop(n)

#define netifapi_autoip_stop(n)      netifapi_netif_common(n, NULL, autoip_stop)
/** @ingroup netifapi_autoip
  * @see autoip_stop()
  */

Marco LWIP_HDR_OPT_H

#define LWIP_HDR_OPT_H


      

Marco NO_SYS

#define NO_SYS                         0


      

Marco LWIP_TIMERS

#define LWIP_TIMERS                    (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS))


      

Marco LWIP_TIMERS

#define LWIP_TIMERS                    1


      

Marco LWIP_TIMERS_CUSTOM

#define LWIP_TIMERS_CUSTOM             0


      

Marco MEMCPY(dst,src,len)

#define MEMCPY(dst,src,len)            memcpy(dst,src,len)


      

Marco SMEMCPY(dst,src,len)

#define SMEMCPY(dst,src,len)           memcpy(dst,src,len)


      

Marco MEMMOVE(dst,src,len)

#define MEMMOVE(dst,src,len)           memmove(dst,src,len)


      

Marco LWIP_MPU_COMPATIBLE

#define LWIP_MPU_COMPATIBLE            0


      

Marco LWIP_TCPIP_CORE_LOCKING

#define LWIP_TCPIP_CORE_LOCKING        1


      

Marco LWIP_TCPIP_CORE_LOCKING_INPUT

#define LWIP_TCPIP_CORE_LOCKING_INPUT  0


      

Marco SYS_LIGHTWEIGHT_PROT

#define SYS_LIGHTWEIGHT_PROT           1


      

Marco LWIP_ASSERT_CORE_LOCKED

#define LWIP_ASSERT_CORE_LOCKED()


      

Marco LWIP_MARK_TCPIP_THREAD

#define LWIP_MARK_TCPIP_THREAD()


      

Marco MEM_LIBC_MALLOC

#define MEM_LIBC_MALLOC                0


      

Marco MEMP_MEM_MALLOC

#define MEMP_MEM_MALLOC                0


      

Marco MEMP_MEM_INIT

#define MEMP_MEM_INIT                  0


      

Marco MEM_ALIGNMENT

#define MEM_ALIGNMENT                  1


      

Marco MEM_SIZE

#define MEM_SIZE                       1600


      

Marco MEMP_OVERFLOW_CHECK

#define MEMP_OVERFLOW_CHECK            0


      

Marco MEMP_SANITY_CHECK

#define MEMP_SANITY_CHECK              0


      

Marco MEM_OVERFLOW_CHECK

#define MEM_OVERFLOW_CHECK             0


      

Marco MEM_SANITY_CHECK

#define MEM_SANITY_CHECK               0


      

Marco MEM_USE_POOLS

#define MEM_USE_POOLS                  0


      

Marco MEM_USE_POOLS_TRY_BIGGER_POOL

#define MEM_USE_POOLS_TRY_BIGGER_POOL  0


      

Marco MEMP_USE_CUSTOM_POOLS

#define MEMP_USE_CUSTOM_POOLS          0


      

Marco LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT

#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0


      

Marco MEMP_NUM_PBUF

#define MEMP_NUM_PBUF                  16


      

Marco MEMP_NUM_RAW_PCB

#define MEMP_NUM_RAW_PCB               4


      

Marco MEMP_NUM_UDP_PCB

#define MEMP_NUM_UDP_PCB               4


      

Marco MEMP_NUM_TCP_PCB

#define MEMP_NUM_TCP_PCB               5


      

Marco MEMP_NUM_TCP_PCB_LISTEN

#define MEMP_NUM_TCP_PCB_LISTEN        8


      

Marco MEMP_NUM_TCP_SEG

#define MEMP_NUM_TCP_SEG               16


      

Marco MEMP_NUM_ALTCP_PCB

#define MEMP_NUM_ALTCP_PCB             MEMP_NUM_TCP_PCB


      

Marco MEMP_NUM_REASSDATA

#define MEMP_NUM_REASSDATA             5


      

Marco MEMP_NUM_FRAG_PBUF

#define MEMP_NUM_FRAG_PBUF             15


      

Marco MEMP_NUM_ARP_QUEUE

#define MEMP_NUM_ARP_QUEUE             30


      

Marco MEMP_NUM_IGMP_GROUP

#define MEMP_NUM_IGMP_GROUP            8


      

Marco LWIP_NUM_SYS_TIMEOUT_INTERNAL

#define LWIP_NUM_SYS_TIMEOUT_INTERNAL  (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_AUTOIP + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD)))
/**
 * The number of sys timeouts used by the core stack (not apps)
 * The default number of timeouts is calculated here for all enabled modules.
 */

Marco MEMP_NUM_SYS_TIMEOUT

#define MEMP_NUM_SYS_TIMEOUT           LWIP_NUM_SYS_TIMEOUT_INTERNAL


      

Marco MEMP_NUM_NETBUF

#define MEMP_NUM_NETBUF                2


      

Marco MEMP_NUM_NETCONN

#define MEMP_NUM_NETCONN               4


      

Marco MEMP_NUM_SELECT_CB

#define MEMP_NUM_SELECT_CB             4


      

Marco MEMP_NUM_TCPIP_MSG_API

#define MEMP_NUM_TCPIP_MSG_API         8


      

Marco MEMP_NUM_TCPIP_MSG_INPKT

#define MEMP_NUM_TCPIP_MSG_INPKT       8


      

Marco MEMP_NUM_NETDB

#define MEMP_NUM_NETDB                 1


      

Marco MEMP_NUM_LOCALHOSTLIST

#define MEMP_NUM_LOCALHOSTLIST         1


      

Marco PBUF_POOL_SIZE

#define PBUF_POOL_SIZE                 16


      

Marco MEMP_NUM_API_MSG

#define MEMP_NUM_API_MSG               MEMP_NUM_TCPIP_MSG_API


      

Marco MEMP_NUM_DNS_API_MSG

#define MEMP_NUM_DNS_API_MSG           MEMP_NUM_TCPIP_MSG_API


      

Marco MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA

#define MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA MEMP_NUM_TCPIP_MSG_API


      

Marco MEMP_NUM_NETIFAPI_MSG

#define MEMP_NUM_NETIFAPI_MSG          MEMP_NUM_TCPIP_MSG_API


      

Marco LWIP_ARP

#define LWIP_ARP                       1


      

Marco ARP_TABLE_SIZE

#define ARP_TABLE_SIZE                 10


      

Marco ARP_MAXAGE

#define ARP_MAXAGE                     300


      

Marco ARP_QUEUEING

#define ARP_QUEUEING                   0


      

Marco ARP_QUEUE_LEN

#define ARP_QUEUE_LEN                  3


      

Marco ETHARP_SUPPORT_VLAN

#define ETHARP_SUPPORT_VLAN            0


      

Marco LWIP_ETHERNET

#define LWIP_ETHERNET                  LWIP_ARP


      

Marco ETH_PAD_SIZE

#define ETH_PAD_SIZE                   0


      

Marco ETHARP_SUPPORT_STATIC_ENTRIES

#define ETHARP_SUPPORT_STATIC_ENTRIES  0


      

Marco ETHARP_TABLE_MATCH_NETIF

#define ETHARP_TABLE_MATCH_NETIF       !LWIP_SINGLE_NETIF


      

Marco LWIP_IPV4

#define LWIP_IPV4                      1


      

Marco IP_FORWARD

#define IP_FORWARD                     0


      

Marco IP_REASSEMBLY

#define IP_REASSEMBLY                  1


      

Marco IP_FRAG

#define IP_FRAG                        1


      

Marco IP_FORWARD

#define IP_FORWARD                     0


      

Marco IP_REASSEMBLY

#define IP_REASSEMBLY                  0


      

Marco IP_FRAG

#define IP_FRAG                        0


      

Marco IP_OPTIONS_ALLOWED

#define IP_OPTIONS_ALLOWED             1


      

Marco IP_REASS_MAXAGE

#define IP_REASS_MAXAGE                15


      

Marco IP_REASS_MAX_PBUFS

#define IP_REASS_MAX_PBUFS             10


      

Marco IP_DEFAULT_TTL

#define IP_DEFAULT_TTL                 255


      

Marco IP_SOF_BROADCAST

#define IP_SOF_BROADCAST               0


      

Marco IP_SOF_BROADCAST_RECV

#define IP_SOF_BROADCAST_RECV          0


      

Marco IP_FORWARD_ALLOW_TX_ON_RX_NETIF

#define IP_FORWARD_ALLOW_TX_ON_RX_NETIF 0


      

Marco LWIP_ICMP

#define LWIP_ICMP                      1


      

Marco ICMP_TTL

#define ICMP_TTL                       IP_DEFAULT_TTL


      

Marco LWIP_BROADCAST_PING

#define LWIP_BROADCAST_PING            0


      

Marco LWIP_MULTICAST_PING

#define LWIP_MULTICAST_PING            0


      

Marco LWIP_RAW

#define LWIP_RAW                       0


      

Marco RAW_TTL

#define RAW_TTL                        IP_DEFAULT_TTL


      

Marco LWIP_DHCP

#define LWIP_DHCP                      0


      

Marco LWIP_DHCP

#define LWIP_DHCP                      0


      

Marco DHCP_DOES_ARP_CHECK

#define DHCP_DOES_ARP_CHECK            (LWIP_DHCP && LWIP_ARP)


      

Marco LWIP_DHCP_BOOTP_FILE

#define LWIP_DHCP_BOOTP_FILE           0


      

Marco LWIP_DHCP_GET_NTP_SRV

#define LWIP_DHCP_GET_NTP_SRV          0


      

Marco LWIP_DHCP_MAX_NTP_SERVERS

#define LWIP_DHCP_MAX_NTP_SERVERS      1


      

Marco LWIP_DHCP_MAX_DNS_SERVERS

#define LWIP_DHCP_MAX_DNS_SERVERS      DNS_MAX_SERVERS


      

Marco LWIP_AUTOIP

#define LWIP_AUTOIP                    0


      

Marco LWIP_AUTOIP

#define LWIP_AUTOIP                    0


      

Marco LWIP_DHCP_AUTOIP_COOP

#define LWIP_DHCP_AUTOIP_COOP          0


      

Marco LWIP_DHCP_AUTOIP_COOP_TRIES

#define LWIP_DHCP_AUTOIP_COOP_TRIES    9


      

Marco LWIP_MIB2_CALLBACKS

#define LWIP_MIB2_CALLBACKS            0


      

Marco LWIP_MULTICAST_TX_OPTIONS

#define LWIP_MULTICAST_TX_OPTIONS      ((LWIP_IGMP || LWIP_IPV6_MLD) && (LWIP_UDP || LWIP_RAW))


      

Marco LWIP_IGMP

#define LWIP_IGMP                      0


      

Marco LWIP_IGMP

#define LWIP_IGMP                      0


      

Marco LWIP_DNS

#define LWIP_DNS                       0


      

Marco DNS_TABLE_SIZE

#define DNS_TABLE_SIZE                 4


      

Marco DNS_MAX_NAME_LENGTH

#define DNS_MAX_NAME_LENGTH            256


      

Marco DNS_MAX_SERVERS

#define DNS_MAX_SERVERS                2


      

Marco DNS_MAX_RETRIES

#define DNS_MAX_RETRIES                4


      

Marco DNS_DOES_NAME_CHECK

#define DNS_DOES_NAME_CHECK            1


      

Marco LWIP_DNS_SECURE

#define LWIP_DNS_SECURE (LWIP_DNS_SECURE_RAND_XID | LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING | LWIP_DNS_SECURE_RAND_SRC_PORT)


      

Marco LWIP_DNS_SECURE_RAND_XID

#define LWIP_DNS_SECURE_RAND_XID               1
/* A list of DNS security features follows */

Marco LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING

#define LWIP_DNS_SECURE_NO_MULTIPLE_OUTSTANDING 2


      

Marco LWIP_DNS_SECURE_RAND_SRC_PORT

#define LWIP_DNS_SECURE_RAND_SRC_PORT          4


      

Marco DNS_LOCAL_HOSTLIST

#define DNS_LOCAL_HOSTLIST             0


      

Marco DNS_LOCAL_HOSTLIST_IS_DYNAMIC

#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC  0


      

Marco LWIP_DNS_SUPPORT_MDNS_QUERIES

#define LWIP_DNS_SUPPORT_MDNS_QUERIES  0


      

Marco LWIP_UDP

#define LWIP_UDP                       1


      

Marco LWIP_UDPLITE

#define LWIP_UDPLITE                   0


      

Marco UDP_TTL

#define UDP_TTL                        IP_DEFAULT_TTL


      

Marco LWIP_NETBUF_RECVINFO

#define LWIP_NETBUF_RECVINFO           0


      

Marco LWIP_TCP

#define LWIP_TCP                       1


      

Marco TCP_TTL

#define TCP_TTL                        IP_DEFAULT_TTL


      

Marco TCP_WND

#define TCP_WND                        (4 * TCP_MSS)


      

Marco TCP_MAXRTX

#define TCP_MAXRTX                     12


      

Marco TCP_SYNMAXRTX

#define TCP_SYNMAXRTX                  6


      

Marco TCP_QUEUE_OOSEQ

#define TCP_QUEUE_OOSEQ                LWIP_TCP


      

Marco LWIP_TCP_SACK_OUT

#define LWIP_TCP_SACK_OUT              0


      

Marco LWIP_TCP_MAX_SACK_NUM

#define LWIP_TCP_MAX_SACK_NUM          4


      

Marco TCP_MSS

#define TCP_MSS                        536


      

Marco TCP_CALCULATE_EFF_SEND_MSS

#define TCP_CALCULATE_EFF_SEND_MSS     1


      

Marco TCP_SND_BUF

#define TCP_SND_BUF                    (2 * TCP_MSS)


      

Marco TCP_SND_QUEUELEN

#define TCP_SND_QUEUELEN               ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS))


      

Marco TCP_SNDLOWAT

#define TCP_SNDLOWAT                   LWIP_MIN(LWIP_MAX(((TCP_SND_BUF)/2), (2 * TCP_MSS) + 1), (TCP_SND_BUF) - 1)


      

Marco TCP_SNDQUEUELOWAT

#define TCP_SNDQUEUELOWAT              LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5)


      

Marco TCP_OOSEQ_MAX_BYTES

#define TCP_OOSEQ_MAX_BYTES            0


      

Marco TCP_OOSEQ_BYTES_LIMIT(pcb)

#define TCP_OOSEQ_BYTES_LIMIT(pcb)     TCP_OOSEQ_MAX_BYTES


      

Marco TCP_OOSEQ_BYTES_LIMIT

#define TCP_OOSEQ_BYTES_LIMIT(pcb)


      

Marco TCP_OOSEQ_MAX_PBUFS

#define TCP_OOSEQ_MAX_PBUFS            0


      

Marco TCP_OOSEQ_PBUFS_LIMIT(pcb)

#define TCP_OOSEQ_PBUFS_LIMIT(pcb)     TCP_OOSEQ_MAX_PBUFS


      

Marco TCP_OOSEQ_PBUFS_LIMIT

#define TCP_OOSEQ_PBUFS_LIMIT(pcb)


      

Marco TCP_LISTEN_BACKLOG

#define TCP_LISTEN_BACKLOG             0


      

Marco TCP_DEFAULT_LISTEN_BACKLOG

#define TCP_DEFAULT_LISTEN_BACKLOG     255


      

Marco TCP_OVERSIZE

#define TCP_OVERSIZE                   TCP_MSS


      

Marco LWIP_TCP_TIMESTAMPS

#define LWIP_TCP_TIMESTAMPS            0


      

Marco TCP_WND_UPDATE_THRESHOLD

#define TCP_WND_UPDATE_THRESHOLD       LWIP_MIN((TCP_WND / 4), (TCP_MSS * 4))


      

Marco LWIP_EVENT_API

#define LWIP_EVENT_API                 0


      

Marco LWIP_CALLBACK_API

#define LWIP_CALLBACK_API              1


      

Marco LWIP_EVENT_API

#define LWIP_EVENT_API                 0


      

Marco LWIP_CALLBACK_API

#define LWIP_CALLBACK_API              0


      

Marco LWIP_WND_SCALE

#define LWIP_WND_SCALE                 0


      

Marco TCP_RCV_SCALE

#define TCP_RCV_SCALE                  0


      

Marco LWIP_TCP_PCB_NUM_EXT_ARGS

#define LWIP_TCP_PCB_NUM_EXT_ARGS      0


      

Marco LWIP_ALTCP

#define LWIP_ALTCP                     0


      

Marco LWIP_ALTCP_TLS

#define LWIP_ALTCP_TLS                 0


      
      
#define PBUF_LINK_HLEN                 (18 + ETH_PAD_SIZE)


      
      
#define PBUF_LINK_HLEN                 (14 + ETH_PAD_SIZE)


      
      
#define PBUF_LINK_ENCAPSULATION_HLEN   0


      

Marco PBUF_POOL_BUFSIZE

#define PBUF_POOL_BUFSIZE              LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)


      

Marco LWIP_PBUF_REF_T

#define LWIP_PBUF_REF_T                u8_t


      

Marco LWIP_SINGLE_NETIF

#define LWIP_SINGLE_NETIF              0


      

Marco LWIP_NETIF_HOSTNAME

#define LWIP_NETIF_HOSTNAME            0


      

Marco LWIP_NETIF_API

#define LWIP_NETIF_API                 0


      

Marco LWIP_NETIF_STATUS_CALLBACK

#define LWIP_NETIF_STATUS_CALLBACK     0


      

Marco LWIP_NETIF_EXT_STATUS_CALLBACK

#define LWIP_NETIF_EXT_STATUS_CALLBACK 0


      
      
#define LWIP_NETIF_LINK_CALLBACK       0


      

Marco LWIP_NETIF_REMOVE_CALLBACK

#define LWIP_NETIF_REMOVE_CALLBACK     0


      

Marco LWIP_NETIF_HWADDRHINT

#define LWIP_NETIF_HWADDRHINT          0


      

Marco LWIP_NETIF_TX_SINGLE_PBUF

#define LWIP_NETIF_TX_SINGLE_PBUF      0


      

Marco LWIP_NUM_NETIF_CLIENT_DATA

#define LWIP_NUM_NETIF_CLIENT_DATA     0


      

Marco LWIP_HAVE_LOOPIF

#define LWIP_HAVE_LOOPIF               (LWIP_NETIF_LOOPBACK && !LWIP_SINGLE_NETIF)


      

Marco LWIP_LOOPIF_MULTICAST

#define LWIP_LOOPIF_MULTICAST          0


      

Marco LWIP_NETIF_LOOPBACK

#define LWIP_NETIF_LOOPBACK            0


      

Marco LWIP_LOOPBACK_MAX_PBUFS

#define LWIP_LOOPBACK_MAX_PBUFS        0


      

Marco LWIP_NETIF_LOOPBACK_MULTITHREADING

#define LWIP_NETIF_LOOPBACK_MULTITHREADING   (!NO_SYS)


      

Marco TCPIP_THREAD_NAME

#define TCPIP_THREAD_NAME              "tcpip_thread"


      

Marco TCPIP_THREAD_STACKSIZE

#define TCPIP_THREAD_STACKSIZE         0


      

Marco TCPIP_THREAD_PRIO

#define TCPIP_THREAD_PRIO              1


      

Marco TCPIP_MBOX_SIZE

#define TCPIP_MBOX_SIZE                0


      

Marco LWIP_TCPIP_THREAD_ALIVE

#define LWIP_TCPIP_THREAD_ALIVE()


      

Marco SLIPIF_THREAD_NAME

#define SLIPIF_THREAD_NAME             "slipif_loop"


      

Marco SLIPIF_THREAD_STACKSIZE

#define SLIPIF_THREAD_STACKSIZE        0


      

Marco SLIPIF_THREAD_PRIO

#define SLIPIF_THREAD_PRIO             1


      

Marco DEFAULT_THREAD_NAME

#define DEFAULT_THREAD_NAME            "lwIP"


      

Marco DEFAULT_THREAD_STACKSIZE

#define DEFAULT_THREAD_STACKSIZE       0


      

Marco DEFAULT_THREAD_PRIO

#define DEFAULT_THREAD_PRIO            1


      

Marco DEFAULT_RAW_RECVMBOX_SIZE

#define DEFAULT_RAW_RECVMBOX_SIZE      0


      

Marco DEFAULT_UDP_RECVMBOX_SIZE

#define DEFAULT_UDP_RECVMBOX_SIZE      0


      

Marco DEFAULT_TCP_RECVMBOX_SIZE

#define DEFAULT_TCP_RECVMBOX_SIZE      0


      

Marco DEFAULT_ACCEPTMBOX_SIZE

#define DEFAULT_ACCEPTMBOX_SIZE        0


      

Marco LWIP_NETCONN

#define LWIP_NETCONN                   1


      

Marco LWIP_TCPIP_TIMEOUT

#define LWIP_TCPIP_TIMEOUT             0


      

Marco LWIP_NETCONN_SEM_PER_THREAD

#define LWIP_NETCONN_SEM_PER_THREAD    0


      

Marco LWIP_NETCONN_FULLDUPLEX

#define LWIP_NETCONN_FULLDUPLEX        0


      

Marco LWIP_SOCKET

#define LWIP_SOCKET                    1


      

Marco LWIP_COMPAT_SOCKETS

#define LWIP_COMPAT_SOCKETS            1


      

Marco LWIP_POSIX_SOCKETS_IO_NAMES

#define LWIP_POSIX_SOCKETS_IO_NAMES    1


      

Marco LWIP_SOCKET_OFFSET

#define LWIP_SOCKET_OFFSET             0


      

Marco LWIP_TCP_KEEPALIVE

#define LWIP_TCP_KEEPALIVE             0


      

Marco LWIP_SO_SNDTIMEO

#define LWIP_SO_SNDTIMEO               0


      

Marco LWIP_SO_RCVTIMEO

#define LWIP_SO_RCVTIMEO               0


      

Marco LWIP_SO_SNDRCVTIMEO_NONSTANDARD

#define LWIP_SO_SNDRCVTIMEO_NONSTANDARD 0


      

Marco LWIP_SO_RCVBUF

#define LWIP_SO_RCVBUF                 0


      

Marco LWIP_SO_LINGER

#define LWIP_SO_LINGER                 0


      

Marco RECV_BUFSIZE_DEFAULT

#define RECV_BUFSIZE_DEFAULT           INT_MAX


      

Marco LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT

#define LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT 20000


      

Marco SO_REUSE

#define SO_REUSE                       0


      

Marco SO_REUSE_RXTOALL

#define SO_REUSE_RXTOALL               0


      

Marco LWIP_FIONREAD_LINUXMODE

#define LWIP_FIONREAD_LINUXMODE        0


      

Marco LWIP_SOCKET_SELECT

#define LWIP_SOCKET_SELECT             1


      

Marco LWIP_SOCKET_POLL

#define LWIP_SOCKET_POLL               1


      

Marco LWIP_STATS

#define LWIP_STATS                     1


      

Marco LWIP_STATS_DISPLAY

#define LWIP_STATS_DISPLAY             0


      
      
#define LINK_STATS                     1


      

Marco ETHARP_STATS

#define ETHARP_STATS                   (LWIP_ARP)


      

Marco IP_STATS

#define IP_STATS                       1


      

Marco IPFRAG_STATS

#define IPFRAG_STATS                   (IP_REASSEMBLY || IP_FRAG)


      

Marco ICMP_STATS

#define ICMP_STATS                     1


      

Marco IGMP_STATS

#define IGMP_STATS                     (LWIP_IGMP)


      

Marco UDP_STATS

#define UDP_STATS                      (LWIP_UDP)


      

Marco TCP_STATS

#define TCP_STATS                      (LWIP_TCP)


      

Marco MEM_STATS

#define MEM_STATS                      ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0))


      

Marco MEMP_STATS

#define MEMP_STATS                     (MEMP_MEM_MALLOC == 0)


      

Marco SYS_STATS

#define SYS_STATS                      (NO_SYS == 0)


      

Marco IP6_STATS

#define IP6_STATS                      (LWIP_IPV6)


      

Marco ICMP6_STATS

#define ICMP6_STATS                    (LWIP_IPV6 && LWIP_ICMP6)


      

Marco IP6_FRAG_STATS

#define IP6_FRAG_STATS                 (LWIP_IPV6 && (LWIP_IPV6_FRAG || LWIP_IPV6_REASS))


      

Marco MLD6_STATS

#define MLD6_STATS                     (LWIP_IPV6 && LWIP_IPV6_MLD)


      

Marco ND6_STATS

#define ND6_STATS                      (LWIP_IPV6)


      

Marco MIB2_STATS

#define MIB2_STATS                     0


      
      
#define LINK_STATS                     0


      

Marco ETHARP_STATS

#define ETHARP_STATS                   0


      

Marco IP_STATS

#define IP_STATS                       0


      

Marco IPFRAG_STATS

#define IPFRAG_STATS                   0


      

Marco ICMP_STATS

#define ICMP_STATS                     0


      

Marco IGMP_STATS

#define IGMP_STATS                     0


      

Marco UDP_STATS

#define UDP_STATS                      0


      

Marco TCP_STATS

#define TCP_STATS                      0


      

Marco MEM_STATS

#define MEM_STATS                      0


      

Marco MEMP_STATS

#define MEMP_STATS                     0


      

Marco SYS_STATS

#define SYS_STATS                      0


      

Marco LWIP_STATS_DISPLAY

#define LWIP_STATS_DISPLAY             0


      

Marco IP6_STATS

#define IP6_STATS                      0


      

Marco ICMP6_STATS

#define ICMP6_STATS                    0


      

Marco IP6_FRAG_STATS

#define IP6_FRAG_STATS                 0


      

Marco MLD6_STATS

#define MLD6_STATS                     0


      

Marco ND6_STATS

#define ND6_STATS                      0


      

Marco MIB2_STATS

#define MIB2_STATS                     0


      

Marco LWIP_CHECKSUM_CTRL_PER_NETIF

#define LWIP_CHECKSUM_CTRL_PER_NETIF   0


      

Marco CHECKSUM_GEN_IP

#define CHECKSUM_GEN_IP                1


      

Marco CHECKSUM_GEN_UDP

#define CHECKSUM_GEN_UDP               1


      

Marco CHECKSUM_GEN_TCP

#define CHECKSUM_GEN_TCP               1


      

Marco CHECKSUM_GEN_ICMP

#define CHECKSUM_GEN_ICMP              1


      

Marco CHECKSUM_GEN_ICMP6

#define CHECKSUM_GEN_ICMP6             1


      

Marco CHECKSUM_CHECK_IP

#define CHECKSUM_CHECK_IP              1


      

Marco CHECKSUM_CHECK_UDP

#define CHECKSUM_CHECK_UDP             1


      

Marco CHECKSUM_CHECK_TCP

#define CHECKSUM_CHECK_TCP             1


      

Marco CHECKSUM_CHECK_ICMP

#define CHECKSUM_CHECK_ICMP            1


      

Marco CHECKSUM_CHECK_ICMP6

#define CHECKSUM_CHECK_ICMP6           1


      

Marco LWIP_CHECKSUM_ON_COPY

#define LWIP_CHECKSUM_ON_COPY          0


      

Marco LWIP_IPV6

#define LWIP_IPV6                      0


      

Marco IPV6_REASS_MAXAGE

#define IPV6_REASS_MAXAGE              60


      

Marco LWIP_IPV6_SCOPES

#define LWIP_IPV6_SCOPES               (LWIP_IPV6 && !LWIP_SINGLE_NETIF)


      

Marco LWIP_IPV6_SCOPES_DEBUG

#define LWIP_IPV6_SCOPES_DEBUG         0


      

Marco LWIP_IPV6_NUM_ADDRESSES

#define LWIP_IPV6_NUM_ADDRESSES        3


      

Marco LWIP_IPV6_FORWARD

#define LWIP_IPV6_FORWARD              0


      

Marco LWIP_IPV6_FRAG

#define LWIP_IPV6_FRAG                 1


      

Marco LWIP_IPV6_REASS

#define LWIP_IPV6_REASS                LWIP_IPV6


      

Marco LWIP_IPV6_SEND_ROUTER_SOLICIT

#define LWIP_IPV6_SEND_ROUTER_SOLICIT  1


      

Marco LWIP_IPV6_AUTOCONFIG

#define LWIP_IPV6_AUTOCONFIG           LWIP_IPV6


      

Marco LWIP_IPV6_ADDRESS_LIFETIMES

#define LWIP_IPV6_ADDRESS_LIFETIMES    LWIP_IPV6_AUTOCONFIG


      

Marco LWIP_IPV6_DUP_DETECT_ATTEMPTS

#define LWIP_IPV6_DUP_DETECT_ATTEMPTS  1


      

Marco LWIP_ICMP6

#define LWIP_ICMP6                     LWIP_IPV6


      

Marco LWIP_ICMP6_DATASIZE

#define LWIP_ICMP6_DATASIZE            8


      

Marco LWIP_ICMP6_HL

#define LWIP_ICMP6_HL                  255


      

Marco LWIP_IPV6_MLD

#define LWIP_IPV6_MLD                  LWIP_IPV6


      

Marco MEMP_NUM_MLD6_GROUP

#define MEMP_NUM_MLD6_GROUP            4


      

Marco LWIP_ND6_QUEUEING

#define LWIP_ND6_QUEUEING              LWIP_IPV6


      

Marco MEMP_NUM_ND6_QUEUE

#define MEMP_NUM_ND6_QUEUE             20


      

Marco LWIP_ND6_NUM_NEIGHBORS

#define LWIP_ND6_NUM_NEIGHBORS         10


      

Marco LWIP_ND6_NUM_DESTINATIONS

#define LWIP_ND6_NUM_DESTINATIONS      10


      

Marco LWIP_ND6_NUM_PREFIXES

#define LWIP_ND6_NUM_PREFIXES          5


      

Marco LWIP_ND6_NUM_ROUTERS

#define LWIP_ND6_NUM_ROUTERS           3


      

Marco LWIP_ND6_MAX_MULTICAST_SOLICIT

#define LWIP_ND6_MAX_MULTICAST_SOLICIT 3


      

Marco LWIP_ND6_MAX_UNICAST_SOLICIT

#define LWIP_ND6_MAX_UNICAST_SOLICIT   3


      

Marco LWIP_ND6_MAX_ANYCAST_DELAY_TIME

#define LWIP_ND6_MAX_ANYCAST_DELAY_TIME 1000


      

Marco LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT

#define LWIP_ND6_MAX_NEIGHBOR_ADVERTISEMENT 3


      

Marco LWIP_ND6_REACHABLE_TIME

#define LWIP_ND6_REACHABLE_TIME        30000


      

Marco LWIP_ND6_RETRANS_TIMER

#define LWIP_ND6_RETRANS_TIMER         1000


      

Marco LWIP_ND6_DELAY_FIRST_PROBE_TIME

#define LWIP_ND6_DELAY_FIRST_PROBE_TIME 5000


      

Marco LWIP_ND6_ALLOW_RA_UPDATES

#define LWIP_ND6_ALLOW_RA_UPDATES      1


      

Marco LWIP_ND6_TCP_REACHABILITY_HINTS

#define LWIP_ND6_TCP_REACHABILITY_HINTS 1


      

Marco LWIP_ND6_RDNSS_MAX_DNS_SERVERS

#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0


      

Marco LWIP_IPV6_DHCP6

#define LWIP_IPV6_DHCP6                0


      

Marco LWIP_IPV6_DHCP6_STATEFUL

#define LWIP_IPV6_DHCP6_STATEFUL       0


      

Marco LWIP_IPV6_DHCP6_STATELESS

#define LWIP_IPV6_DHCP6_STATELESS      LWIP_IPV6_DHCP6


      

Marco LWIP_DHCP6_GET_NTP_SRV

#define LWIP_DHCP6_GET_NTP_SRV         0


      

Marco LWIP_DHCP6_MAX_NTP_SERVERS

#define LWIP_DHCP6_MAX_NTP_SERVERS     1


      

Marco LWIP_DHCP6_MAX_DNS_SERVERS

#define LWIP_DHCP6_MAX_DNS_SERVERS     DNS_MAX_SERVERS


      

Marco LWIP_HOOK_FILENAME

#define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h"


      

Marco LWIP_HOOK_TCP_ISN

#define LWIP_HOOK_TCP_ISN(local_ip, local_port, remote_ip, remote_port)


      

Marco LWIP_HOOK_TCP_INPACKET_PCB

#define LWIP_HOOK_TCP_INPACKET_PCB(pcb, hdr, optlen, opt1len, opt2, p)


      

Marco LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH

#define LWIP_HOOK_TCP_OUT_TCPOPT_LENGTH(pcb, internal_len)


      

Marco LWIP_HOOK_TCP_OUT_ADD_TCPOPTS

#define LWIP_HOOK_TCP_OUT_ADD_TCPOPTS(p, hdr, pcb, opts)


      

Marco LWIP_HOOK_IP4_INPUT

#define LWIP_HOOK_IP4_INPUT(pbuf, input_netif)


      

Marco LWIP_HOOK_IP4_ROUTE

#define LWIP_HOOK_IP4_ROUTE()


      

Marco LWIP_HOOK_IP4_ROUTE_SRC

#define LWIP_HOOK_IP4_ROUTE_SRC(src, dest)


      

Marco LWIP_HOOK_IP4_CANFORWARD

#define LWIP_HOOK_IP4_CANFORWARD(src, dest)


      

Marco LWIP_HOOK_ETHARP_GET_GW

#define LWIP_HOOK_ETHARP_GET_GW(netif, dest)


      

Marco LWIP_HOOK_IP6_INPUT

#define LWIP_HOOK_IP6_INPUT(pbuf, input_netif)


      

Marco LWIP_HOOK_IP6_ROUTE

#define LWIP_HOOK_IP6_ROUTE(src, dest)


      

Marco LWIP_HOOK_ND6_GET_GW

#define LWIP_HOOK_ND6_GET_GW(netif, dest)


      

Marco LWIP_HOOK_VLAN_CHECK

#define LWIP_HOOK_VLAN_CHECK(netif, eth_hdr, vlan_hdr)


      

Marco LWIP_HOOK_VLAN_SET

#define LWIP_HOOK_VLAN_SET(netif, p, src, dst, eth_type)


      

Marco LWIP_HOOK_MEMP_AVAILABLE

#define LWIP_HOOK_MEMP_AVAILABLE(memp_t_type)


      

Marco LWIP_HOOK_UNKNOWN_ETH_PROTOCOL

#define LWIP_HOOK_UNKNOWN_ETH_PROTOCOL(pbuf, netif)


      

Marco LWIP_HOOK_DHCP_APPEND_OPTIONS

#define LWIP_HOOK_DHCP_APPEND_OPTIONS(netif, dhcp, state, msg, msg_type, options_len_ptr)


      

Marco LWIP_HOOK_DHCP_PARSE_OPTION

#define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset)


      

Marco LWIP_HOOK_DHCP6_APPEND_OPTIONS

#define LWIP_HOOK_DHCP6_APPEND_OPTIONS(netif, dhcp6, state, msg, msg_type, options_len_ptr, max_len)


      

Marco LWIP_HOOK_SOCKETS_SETSOCKOPT

#define LWIP_HOOK_SOCKETS_SETSOCKOPT(s, sock, level, optname, optval, optlen, err)


      

Marco LWIP_HOOK_SOCKETS_GETSOCKOPT

#define LWIP_HOOK_SOCKETS_GETSOCKOPT(s, sock, level, optname, optval, optlen, err)


      

Marco LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE

#define LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE(name, addr, addrtype, err)


      

Marco LWIP_DBG_MIN_LEVEL

#define LWIP_DBG_MIN_LEVEL             LWIP_DBG_LEVEL_ALL


      

Marco LWIP_DBG_TYPES_ON

#define LWIP_DBG_TYPES_ON              LWIP_DBG_ON


      

Marco ETHARP_DEBUG

#define ETHARP_DEBUG                   LWIP_DBG_OFF


      

Marco NETIF_DEBUG

#define NETIF_DEBUG                    LWIP_DBG_OFF


      

Marco PBUF_DEBUG

#define PBUF_DEBUG                     LWIP_DBG_OFF


      

Marco API_LIB_DEBUG

#define API_LIB_DEBUG                  LWIP_DBG_OFF


      

Marco API_MSG_DEBUG

#define API_MSG_DEBUG                  LWIP_DBG_OFF


      

Marco SOCKETS_DEBUG

#define SOCKETS_DEBUG                  LWIP_DBG_OFF


      

Marco ICMP_DEBUG

#define ICMP_DEBUG                     LWIP_DBG_OFF


      

Marco IGMP_DEBUG

#define IGMP_DEBUG                     LWIP_DBG_OFF


      

Marco INET_DEBUG

#define INET_DEBUG                     LWIP_DBG_OFF


      

Marco IP_DEBUG

#define IP_DEBUG                       LWIP_DBG_OFF


      

Marco IP_REASS_DEBUG

#define IP_REASS_DEBUG                 LWIP_DBG_OFF


      

Marco RAW_DEBUG

#define RAW_DEBUG                      LWIP_DBG_OFF


      

Marco MEM_DEBUG

#define MEM_DEBUG                      LWIP_DBG_OFF


      

Marco MEMP_DEBUG

#define MEMP_DEBUG                     LWIP_DBG_OFF


      

Marco SYS_DEBUG

#define SYS_DEBUG                      LWIP_DBG_OFF


      

Marco TIMERS_DEBUG

#define TIMERS_DEBUG                   LWIP_DBG_OFF


      

Marco TCP_DEBUG

#define TCP_DEBUG                      LWIP_DBG_OFF


      

Marco TCP_INPUT_DEBUG

#define TCP_INPUT_DEBUG                LWIP_DBG_OFF


      

Marco TCP_FR_DEBUG

#define TCP_FR_DEBUG                   LWIP_DBG_OFF


      

Marco TCP_RTO_DEBUG

#define TCP_RTO_DEBUG                  LWIP_DBG_OFF


      

Marco TCP_CWND_DEBUG

#define TCP_CWND_DEBUG                 LWIP_DBG_OFF


      

Marco TCP_WND_DEBUG

#define TCP_WND_DEBUG                  LWIP_DBG_OFF


      

Marco TCP_OUTPUT_DEBUG

#define TCP_OUTPUT_DEBUG               LWIP_DBG_OFF


      

Marco TCP_RST_DEBUG

#define TCP_RST_DEBUG                  LWIP_DBG_OFF


      

Marco TCP_QLEN_DEBUG

#define TCP_QLEN_DEBUG                 LWIP_DBG_OFF


      

Marco UDP_DEBUG

#define UDP_DEBUG                      LWIP_DBG_OFF


      

Marco TCPIP_DEBUG

#define TCPIP_DEBUG                    LWIP_DBG_OFF


      

Marco SLIP_DEBUG

#define SLIP_DEBUG                     LWIP_DBG_OFF


      

Marco DHCP_DEBUG

#define DHCP_DEBUG                     LWIP_DBG_OFF


      

Marco AUTOIP_DEBUG

#define AUTOIP_DEBUG                   LWIP_DBG_OFF


      

Marco DNS_DEBUG

#define DNS_DEBUG                      LWIP_DBG_OFF


      

Marco IP6_DEBUG

#define IP6_DEBUG                      LWIP_DBG_OFF


      

Marco DHCP6_DEBUG

#define DHCP6_DEBUG                    LWIP_DBG_OFF


      

Marco LWIP_TESTMODE

#define LWIP_TESTMODE                  0


      

Marco LWIP_PERF

#define LWIP_PERF                      0


      

Marco LWIP_HDR_PBUF_H

#define LWIP_HDR_PBUF_H


      

Marco LWIP_SUPPORT_CUSTOM_PBUF

#define LWIP_SUPPORT_CUSTOM_PBUF ((IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG))


      

Marco PBUF_NEEDS_COPY(p)

#define PBUF_NEEDS_COPY(p) ((p)->type_internal & PBUF_TYPE_FLAG_DATA_VOLATILE)


      

Marco PBUF_TRANSPORT_HLEN

#define PBUF_TRANSPORT_HLEN 20


      

Marco PBUF_IP_HLEN

#define PBUF_IP_HLEN       40


      

Marco PBUF_IP_HLEN

#define PBUF_IP_HLEN       20


      

Marco PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS

#define PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS      128
/** Indicates that the payload directly follows the struct pbuf.
 *  This makes @ref pbuf_header work in both directions. */

Marco PBUF_TYPE_FLAG_DATA_VOLATILE

#define PBUF_TYPE_FLAG_DATA_VOLATILE               64
/** Indicates the data stored in this pbuf can change. If this pbuf needs
 * to be queued, it must be copied/duplicated. */

Marco PBUF_TYPE_ALLOC_SRC_MASK

#define PBUF_TYPE_ALLOC_SRC_MASK                   15
/** 4 bits are reserved for 16 allocation sources (e.g. heap, pool1, pool2, etc)
 * Internally, we use: 0=heap, 1=MEMP_PBUF, 2=MEMP_PBUF_POOL -> 13 types free*/

Marco PBUF_ALLOC_FLAG_RX

#define PBUF_ALLOC_FLAG_RX                         256
/** Indicates this pbuf is used for RX (if not set, indicates use for TX).
 * This information can be used to keep some spare RX buffers e.g. for
 * receiving TCP ACKs to unblock a connection) */

Marco PBUF_ALLOC_FLAG_DATA_CONTIGUOUS

#define PBUF_ALLOC_FLAG_DATA_CONTIGUOUS            512
/** Indicates the application needs the pbuf payload to be in one piece */

Marco PBUF_TYPE_ALLOC_SRC_MASK_STD_HEAP

#define PBUF_TYPE_ALLOC_SRC_MASK_STD_HEAP          0


      

Marco PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF

#define PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF     1


      

Marco PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF_POOL

#define PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF_POOL 2


      

Marco PBUF_TYPE_ALLOC_SRC_MASK_APP_MIN

#define PBUF_TYPE_ALLOC_SRC_MASK_APP_MIN           3
/** First pbuf allocation type for applications */

Marco PBUF_TYPE_ALLOC_SRC_MASK_APP_MAX

#define PBUF_TYPE_ALLOC_SRC_MASK_APP_MAX           PBUF_TYPE_ALLOC_SRC_MASK
/** Last pbuf allocation type for applications */

Marco PBUF_FLAG_PUSH

#define PBUF_FLAG_PUSH     0x01U
/** indicates this packet's data should be immediately passed to the application */

Marco PBUF_FLAG_IS_CUSTOM

#define PBUF_FLAG_IS_CUSTOM 0x02U
/** indicates this is a custom pbuf: pbuf_free calls pbuf_custom->custom_free_function()
    when the last reference is released (plus custom PBUF_RAM cannot be trimmed) */

Marco PBUF_FLAG_MCASTLOOP

#define PBUF_FLAG_MCASTLOOP 0x04U
/** indicates this pbuf is UDP multicast to be looped back */

Marco PBUF_FLAG_LLBCAST

#define PBUF_FLAG_LLBCAST  0x08U
/** indicates this pbuf was received as link-level broadcast */

Marco PBUF_FLAG_LLMCAST

#define PBUF_FLAG_LLMCAST  0x10U
/** indicates this pbuf was received as link-level multicast */

Marco PBUF_FLAG_TCP_FIN

#define PBUF_FLAG_TCP_FIN  0x20U
/** indicates this pbuf includes a TCP FIN flag */

Marco PBUF_POOL_FREE_OOSEQ

#define PBUF_POOL_FREE_OOSEQ 1


      

Marco PBUF_CHECK_FREE_OOSEQ()

#define PBUF_CHECK_FREE_OOSEQ() do { if(pbuf_free_ooseq_pending) { \
 /* pbuf_alloc() reported PBUF_POOL to be empty -> try to free some \
     ooseq queued pbufs now */ \
 pbuf_free_ooseq(); }}while(0)
/** When not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ()
    at regular intervals from main level to check if ooseq pbufs need to be
    freed! */

Marco PBUF_CHECK_FREE_OOSEQ

#define PBUF_CHECK_FREE_OOSEQ()
/* Otherwise declare an empty PBUF_CHECK_FREE_OOSEQ */

Marco pbuf_init

#define pbuf_init()
/* Initializes the pbuf module. This call is empty for now, but may not be in future. */

Marco pbuf_get_allocsrc(p)

#define pbuf_get_allocsrc(p)         ((p)->type_internal & PBUF_TYPE_ALLOC_SRC_MASK)


      

Marco pbuf_match_allocsrc(p, type)

#define pbuf_match_allocsrc(p, type) (pbuf_get_allocsrc(p) == ((type) & PBUF_TYPE_ALLOC_SRC_MASK))


      

Marco pbuf_match_type(p, type)

#define pbuf_match_type(p, type)     pbuf_match_allocsrc(p, type)


      

Marco LWIP_HDR_ALTCP_PRIV_H

#define LWIP_HDR_ALTCP_PRIV_H


      

Marco LWIP_HDR_API_MSG_H

#define LWIP_HDR_API_MSG_H


      

Marco API_MSG_M_DEF_SEM(m)

#define API_MSG_M_DEF_SEM(m) *m


      

Marco API_MSG_M_DEF_SEM(m)

#define API_MSG_M_DEF_SEM(m) API_MSG_M_DEF(m)


      

Marco API_MSG_M_DEF_SEM(m)

#define API_MSG_M_DEF_SEM(m) API_MSG_M_DEF(m)


      

Marco NETCONN_SHUT_RD

#define NETCONN_SHUT_RD  1
/* For the netconn API, these values are use as a bitmask! */

Marco NETCONN_SHUT_WR

#define NETCONN_SHUT_WR  2


      

Marco NETCONN_SHUT_RDWR

#define NETCONN_SHUT_RDWR (NETCONN_SHUT_RD | NETCONN_SHUT_WR)


      

Marco LWIP_API_MSG_SEM(msg)

#define LWIP_API_MSG_SEM(msg)         ((msg)->op_completed_sem)


      

Marco LWIP_API_MSG_SEM(msg)

#define LWIP_API_MSG_SEM(msg)         (&(msg)->conn->op_completed)


      

Marco NETIFAPI_IPADDR_DEF(type, m)

#define NETIFAPI_IPADDR_DEF(type, m) type m


      

Marco NETIFAPI_IPADDR_DEF(type, m)

#define NETIFAPI_IPADDR_DEF(type, m) const type * m


      

Marco LWIP_HDR_MEM_PRIV_H

#define LWIP_HDR_MEM_PRIV_H


      

Marco MEM_SANITY_REGION_BEFORE

#define MEM_SANITY_REGION_BEFORE 16


      

Marco MEM_SANITY_REGION_BEFORE_ALIGNED

#define MEM_SANITY_REGION_BEFORE_ALIGNED   LWIP_MEM_ALIGN_SIZE(MEM_SANITY_REGION_BEFORE)


      

Marco MEM_SANITY_REGION_BEFORE_ALIGNED

#define MEM_SANITY_REGION_BEFORE_ALIGNED   0


      

Marco MEM_SANITY_REGION_AFTER

#define MEM_SANITY_REGION_AFTER  16


      

Marco MEM_SANITY_REGION_AFTER_ALIGNED

#define MEM_SANITY_REGION_AFTER_ALIGNED    LWIP_MEM_ALIGN_SIZE(MEM_SANITY_REGION_AFTER)


      

Marco MEM_SANITY_REGION_AFTER_ALIGNED

#define MEM_SANITY_REGION_AFTER_ALIGNED    0


      

Marco LWIP_HDR_MEMP_PRIV_H

#define LWIP_HDR_MEMP_PRIV_H


      

Marco MEMP_SIZE

#define MEMP_SIZE         (LWIP_MEM_ALIGN_SIZE(sizeof(struct memp)) + MEM_SANITY_REGION_BEFORE_ALIGNED)
/* MEMP_SIZE: save space for struct memp and for sanity check */

Marco MEMP_ALIGN_SIZE(x)

#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x) + MEM_SANITY_REGION_AFTER_ALIGNED)


      

Marco MEMP_SIZE

#define MEMP_SIZE          0
/* No sanity checks
 * We don't need to preserve the struct memp while not allocated, so we
 * can save a little space and set MEMP_SIZE to 0.
 */

Marco MEMP_ALIGN_SIZE(x)

#define MEMP_ALIGN_SIZE(x) (LWIP_MEM_ALIGN_SIZE(x))


      

Marco MEMP_POOL_FIRST

#define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST)
/* The actual start and stop values are here (cast them over)
   We use this helper type and these defines so we can avoid using const memp_t values */

Marco MEMP_POOL_LAST

#define MEMP_POOL_LAST  ((memp_t) MEMP_POOL_HELPER_LAST)


      

Marco DECLARE_LWIP_MEMPOOL_DESC(desc)

#define DECLARE_LWIP_MEMPOOL_DESC(desc) (desc),


      

Marco DECLARE_LWIP_MEMPOOL_DESC

#define DECLARE_LWIP_MEMPOOL_DESC(desc)


      

Marco LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name)

#define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name) static struct stats_mem name;


      

Marco LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name)

#define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name) &name,


      

Marco LWIP_MEMPOOL_DECLARE_STATS_INSTANCE

#define LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(name)


      

Marco LWIP_MEMPOOL_DECLARE_STATS_REFERENCE

#define LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(name)


      

Marco memp_malloc_pool(d)

#define memp_malloc_pool(d) memp_malloc_pool_fn((d), __FILE__, __LINE__)


      

Marco LWIP_MALLOC_MEMPOOL(num, size)

#define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + LWIP_MEM_ALIGN_SIZE(sizeof(struct memp_malloc_helper))), "MALLOC_"#size)
/* This treats "malloc pools" just like any other pool.
   The pools are a little bigger to provide 'size' as the amount of user data. */

Marco LWIP_MALLOC_MEMPOOL_START

#define LWIP_MALLOC_MEMPOOL_START


      

Marco LWIP_MALLOC_MEMPOOL_END

#define LWIP_MALLOC_MEMPOOL_END


      

Marco LWIP_PBUF_MEMPOOL(name, num, payload, desc)

#define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf)) + LWIP_MEM_ALIGN_SIZE(payload)), desc)
/* This treats "pbuf pools" just like any other pool.
 * Allocates buffers for a pbuf struct AND a payload size */

Marco LWIP_HDR_ND6_PRIV_H

#define LWIP_HDR_ND6_PRIV_H


      

Marco ND6_HOPLIM

#define ND6_HOPLIM 255 /* maximum hop limit, required in all ND packets */


      

Marco ND6_2HRS

#define ND6_2HRS 7200 /* two hours, expressed in number of seconds */


      

Marco LWIP_HDR_RAW_PRIV_H

#define LWIP_HDR_RAW_PRIV_H


      

Marco LWIP_HDR_SOCKETS_PRIV_H

#define LWIP_HDR_SOCKETS_PRIV_H


      

Marco NUM_SOCKETS

#define NUM_SOCKETS MEMP_NUM_NETCONN


      

Marco SELWAIT_T

#define SELWAIT_T u8_t


      

Marco set_errno(err)

#define set_errno(err) do { if (err) { errno = (err); } } while(0)


      

Marco LWIP_SETGETSOCKOPT_MAXOPTLEN

#define LWIP_SETGETSOCKOPT_MAXOPTLEN LWIP_MAX(16, sizeof(struct ifreq))
/** Maximum optlen used by setsockopt/getsockopt */

Marco SELECT_SEM_T

#define SELECT_SEM_T       sys_sem_t*


      

Marco SELECT_SEM_PTR(sem)

#define SELECT_SEM_PTR(sem) (sem)


      

Marco SELECT_SEM_T

#define SELECT_SEM_T       sys_sem_t


      

Marco SELECT_SEM_PTR(sem)

#define SELECT_SEM_PTR(sem) (&(sem))


      

Marco LWIP_HDR_TCP_PRIV_H

#define LWIP_HDR_TCP_PRIV_H


      

Marco tcp_do_output_nagle(tpcb)

#define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \
                           ((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \
                           (((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \
                             ((tpcb)->unsent->len >= (tpcb)->mss))) || \
                           ((tcp_sndbuf(tpcb) == 0) || (tcp_sndqueuelen(tpcb) >= TCP_SND_QUEUELEN)) \
                           ) ? 1 : 0)
/**
 * This is the Nagle algorithm: try to combine user data to send as few TCP
 * segments as possible. Only send if
 * - no previously transmitted data on the connection remains unacknowledged or
 * - the TF_NODELAY flag is set (nagle algorithm turned off for this pcb) or
 * - the only unsent segment is at least pcb->mss bytes long (or there is more
 *   than one unsent segment - with lwIP, this can happen although unsent->len < mss)
 * - or if we are in fast-retransmit (TF_INFR)
 */

Marco tcp_output_nagle(tpcb)

#define tcp_output_nagle(tpcb) (tcp_do_output_nagle(tpcb) ? tcp_output(tpcb) : ERR_OK)


      

Marco TCP_SEQ_LT(a,b)

#define TCP_SEQ_LT(a,b)    ((s32_t)((u32_t)(a) - (u32_t)(b)) < 0)


      

Marco TCP_SEQ_LEQ(a,b)

#define TCP_SEQ_LEQ(a,b)   ((s32_t)((u32_t)(a) - (u32_t)(b)) <= 0)


      

Marco TCP_SEQ_GT(a,b)

#define TCP_SEQ_GT(a,b)    ((s32_t)((u32_t)(a) - (u32_t)(b)) > 0)


      

Marco TCP_SEQ_GEQ(a,b)

#define TCP_SEQ_GEQ(a,b)   ((s32_t)((u32_t)(a) - (u32_t)(b)) >= 0)


      

Marco TCP_SEQ_BETWEEN(a,b,c)

#define TCP_SEQ_BETWEEN(a,b,c) ((c)-(b) >= (a)-(b))


      

Marco TCP_SEQ_BETWEEN(a,b,c)

#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c))


      

Marco TCP_TMR_INTERVAL

#define TCP_TMR_INTERVAL      250 /* The TCP timer interval in milliseconds. */


      

Marco TCP_FAST_INTERVAL

#define TCP_FAST_INTERVAL     TCP_TMR_INTERVAL /* the fine grained timeout in milliseconds */


      

Marco TCP_SLOW_INTERVAL

#define TCP_SLOW_INTERVAL     (2*TCP_TMR_INTERVAL) /* the coarse grained timeout in milliseconds */


      

Marco TCP_FIN_WAIT_TIMEOUT

#define TCP_FIN_WAIT_TIMEOUT 20000 /* milliseconds */


      

Marco TCP_SYN_RCVD_TIMEOUT

#define TCP_SYN_RCVD_TIMEOUT 20000 /* milliseconds */


      

Marco TCP_OOSEQ_TIMEOUT

#define TCP_OOSEQ_TIMEOUT       6U /* x RTO */


      

Marco TCP_MSL

#define TCP_MSL 60000UL /* The maximum segment lifetime in milliseconds */


      

Marco TCP_KEEPIDLE_DEFAULT

#define TCP_KEEPIDLE_DEFAULT    7200000UL /* Default KEEPALIVE timer in milliseconds */


      

Marco TCP_KEEPINTVL_DEFAULT

#define TCP_KEEPINTVL_DEFAULT   75000UL  /* Default Time between KEEPALIVE probes in milliseconds */


      

Marco TCP_KEEPCNT_DEFAULT

#define TCP_KEEPCNT_DEFAULT     9U       /* Default Counter for KEEPALIVE probes */


      

Marco TCP_MAXIDLE

#define TCP_MAXIDLE             TCP_KEEPCNT_DEFAULT * TCP_KEEPINTVL_DEFAULT /* Maximum KEEPALIVE probe time */


      

Marco TCP_TCPLEN(seg)

#define TCP_TCPLEN(seg) ((seg)->len + (((TCPH_FLAGS((seg)->tcphdr) & (TCP_FIN | TCP_SYN)) != 0) ? 1U : 0U))


      

Marco TF_RESET

#define TF_RESET    (u8_t)0x08U  /* Connection was reset. */
/** Flags used on input processing, not on pcb->flags
*/

Marco TF_CLOSED

#define TF_CLOSED   (u8_t)0x10U  /* Connection was successfully closed. */


      

Marco TF_GOT_FIN

#define TF_GOT_FIN  (u8_t)0x20U  /* Connection was closed by the remote end. */


      

Marco TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret)

#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret) ret = lwip_tcp_event(arg, (pcb),\
               LWIP_EVENT_ACCEPT, NULL, 0, err)


      

Marco TCP_EVENT_SENT(pcb,space,ret)

#define TCP_EVENT_SENT(pcb,space,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
                  LWIP_EVENT_SENT, NULL, space, ERR_OK)


      

Marco TCP_EVENT_RECV(pcb,p,err,ret)

#define TCP_EVENT_RECV(pcb,p,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
               LWIP_EVENT_RECV, (p), 0, (err))


      

Marco TCP_EVENT_CLOSED(pcb,ret)

#define TCP_EVENT_CLOSED(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
               LWIP_EVENT_RECV, NULL, 0, ERR_OK)


      

Marco TCP_EVENT_CONNECTED(pcb,err,ret)

#define TCP_EVENT_CONNECTED(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\
               LWIP_EVENT_CONNECTED, NULL, 0, (err))


      

Marco TCP_EVENT_POLL(pcb,ret)

#define TCP_EVENT_POLL(pcb,ret)      do { if ((pcb)->state != SYN_RCVD) {                         \
               ret = lwip_tcp_event((pcb)->callback_arg, (pcb), LWIP_EVENT_POLL, NULL, 0, ERR_OK); \
               } else {                                                                           \
               ret = ERR_ARG; } } while(0)


      

Marco TCP_EVENT_ERR(last_state,errf,arg,err)

#define TCP_EVENT_ERR(last_state,errf,arg,err) do { if (last_state != SYN_RCVD) {               \
               lwip_tcp_event((arg), NULL, LWIP_EVENT_ERR, NULL, 0, (err)); } } while(0)
/* For event API, last state SYN_RCVD must be excluded here: the application
   has not seen this pcb, yet! */

Marco TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret)

#define TCP_EVENT_ACCEPT(lpcb,pcb,arg,err,ret)                \
 do {                                                        \
   if((lpcb)->accept != NULL)                                \
     (ret) = (lpcb)->accept((arg),(pcb),(err));              \
   else (ret) = ERR_ARG;                                     \
 } while (0)


      

Marco TCP_EVENT_SENT(pcb,space,ret)

#define TCP_EVENT_SENT(pcb,space,ret)                         \
 do {                                                        \
   if((pcb)->sent != NULL)                                   \
     (ret) = (pcb)->sent((pcb)->callback_arg,(pcb),(space)); \
   else (ret) = ERR_OK;                                      \
 } while (0)


      

Marco TCP_EVENT_RECV(pcb,p,err,ret)

#define TCP_EVENT_RECV(pcb,p,err,ret)                         \
 do {                                                        \
   if((pcb)->recv != NULL) {                                 \
     (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),(p),(err));\
   } else {                                                  \
     (ret) = tcp_recv_null(NULL, (pcb), (p), (err));         \
   }                                                         \
 } while (0)


      

Marco TCP_EVENT_CLOSED(pcb,ret)

#define TCP_EVENT_CLOSED(pcb,ret)                               \
 do {                                                          \
   if(((pcb)->recv != NULL)) {                                 \
     (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),NULL,ERR_OK);\
   } else {                                                    \
     (ret) = ERR_OK;                                           \
   }                                                           \
 } while (0)


      

Marco TCP_EVENT_CONNECTED(pcb,err,ret)

#define TCP_EVENT_CONNECTED(pcb,err,ret)                        \
 do {                                                          \
   if((pcb)->connected != NULL)                                \
     (ret) = (pcb)->connected((pcb)->callback_arg,(pcb),(err)); \
   else (ret) = ERR_OK;                                        \
 } while (0)


      

Marco TCP_EVENT_POLL(pcb,ret)

#define TCP_EVENT_POLL(pcb,ret)                               \
 do {                                                        \
   if((pcb)->poll != NULL)                                   \
     (ret) = (pcb)->poll((pcb)->callback_arg,(pcb));         \
   else (ret) = ERR_OK;                                      \
 } while (0)


      

Marco TCP_EVENT_ERR(last_state,errf,arg,err)

#define TCP_EVENT_ERR(last_state,errf,arg,err)                \
 do {                                                        \
   LWIP_UNUSED_ARG(last_state);                              \
   if((errf) != NULL)                                        \
     (errf)((arg),(err));                                    \
 } while (0)


      

Marco TCP_OVERSIZE_DBGCHECK

#define TCP_OVERSIZE_DBGCHECK 1


      

Marco TCP_OVERSIZE_DBGCHECK

#define TCP_OVERSIZE_DBGCHECK 0


      

Marco TCP_CHECKSUM_ON_COPY

#define TCP_CHECKSUM_ON_COPY (LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_TCP)
/** Don't generate checksum on copy if CHECKSUM_GEN_TCP is disabled */

Marco LWIP_TCP_OPT_EOL

#define LWIP_TCP_OPT_EOL       0


      

Marco LWIP_TCP_OPT_NOP

#define LWIP_TCP_OPT_NOP       1


      

Marco LWIP_TCP_OPT_MSS

#define LWIP_TCP_OPT_MSS       2


      

Marco LWIP_TCP_OPT_WS

#define LWIP_TCP_OPT_WS        3


      

Marco LWIP_TCP_OPT_SACK_PERM

#define LWIP_TCP_OPT_SACK_PERM 4


      

Marco LWIP_TCP_OPT_TS

#define LWIP_TCP_OPT_TS        8


      

Marco LWIP_TCP_OPT_LEN_MSS

#define LWIP_TCP_OPT_LEN_MSS   4


      

Marco LWIP_TCP_OPT_LEN_TS

#define LWIP_TCP_OPT_LEN_TS    10


      

Marco LWIP_TCP_OPT_LEN_TS_OUT

#define LWIP_TCP_OPT_LEN_TS_OUT 12 /* aligned for output (includes NOP padding) */


      

Marco LWIP_TCP_OPT_LEN_TS_OUT

#define LWIP_TCP_OPT_LEN_TS_OUT 0


      

Marco LWIP_TCP_OPT_LEN_WS

#define LWIP_TCP_OPT_LEN_WS    3


      

Marco LWIP_TCP_OPT_LEN_WS_OUT

#define LWIP_TCP_OPT_LEN_WS_OUT 4 /* aligned for output (includes NOP padding) */


      

Marco LWIP_TCP_OPT_LEN_WS_OUT

#define LWIP_TCP_OPT_LEN_WS_OUT 0


      

Marco LWIP_TCP_OPT_LEN_SACK_PERM

#define LWIP_TCP_OPT_LEN_SACK_PERM    2


      

Marco LWIP_TCP_OPT_LEN_SACK_PERM_OUT

#define LWIP_TCP_OPT_LEN_SACK_PERM_OUT 4 /* aligned for output (includes NOP padding) */


      

Marco LWIP_TCP_OPT_LEN_SACK_PERM_OUT

#define LWIP_TCP_OPT_LEN_SACK_PERM_OUT 0


      

Marco LWIP_TCP_OPT_LENGTH(flags)

#define LWIP_TCP_OPT_LENGTH(flags) \
 ((flags) & TF_SEG_OPTS_MSS      ? LWIP_TCP_OPT_LEN_MSS          : 0) + \
 ((flags) & TF_SEG_OPTS_TS       ? LWIP_TCP_OPT_LEN_TS_OUT       : 0) + \
 ((flags) & TF_SEG_OPTS_WND_SCALE ? LWIP_TCP_OPT_LEN_WS_OUT       : 0) + \
 ((flags) & TF_SEG_OPTS_SACK_PERM ? LWIP_TCP_OPT_LEN_SACK_PERM_OUT : 0)


      

Marco TCP_BUILD_MSS_OPTION(mss)

#define TCP_BUILD_MSS_OPTION(mss) lwip_htonl(33816576 | ((mss) & 65535))
/** This returns a TCP header option for MSS in an u32_t */

Marco TCPWNDSIZE_F

#define TCPWNDSIZE_F      U32_F


      

Marco TCPWND_MAX

#define TCPWND_MAX        0xFFFFFFFFU


      

Marco TCPWND_CHECK16(x)

#define TCPWND_CHECK16(x) LWIP_ASSERT("window size > 0xFFFF", (x) <= 65535)


      

Marco TCPWND_MIN16(x)

#define TCPWND_MIN16(x)   ((u16_t)LWIP_MIN((x), 65535))


      

Marco TCPWNDSIZE_F

#define TCPWNDSIZE_F      U16_F


      

Marco TCPWND_MAX

#define TCPWND_MAX        0xFFFFU


      

Marco TCPWND_CHECK16

#define TCPWND_CHECK16(x)


      

Marco TCPWND_MIN16(x)

#define TCPWND_MIN16(x)   x


      

Marco NUM_TCP_PCB_LISTS_NO_TIME_WAIT

#define NUM_TCP_PCB_LISTS_NO_TIME_WAIT 3


      

Marco NUM_TCP_PCB_LISTS

#define NUM_TCP_PCB_LISTS              4


      

Marco TCP_DEBUG_PCB_LISTS

#define TCP_DEBUG_PCB_LISTS 0


      

Marco TCP_REG(pcbs, npcb)

#define TCP_REG(pcbs, npcb) do {\
                           struct tcp_pcb *tcp_tmp_pcb; \
                           LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %"U16_F"\n", (void *)(npcb), (npcb)->local_port)); \
                           for (tcp_tmp_pcb = *(pcbs); \
         tcp_tmp_pcb != NULL; \
       tcp_tmp_pcb = tcp_tmp_pcb->next) { \
                               LWIP_ASSERT("TCP_REG: already registered\n", tcp_tmp_pcb != (npcb)); \
                           } \
                           LWIP_ASSERT("TCP_REG: pcb->state != CLOSED", ((pcbs) == &tcp_bound_pcbs) || ((npcb)->state != CLOSED)); \
                           (npcb)->next = *(pcbs); \
                           LWIP_ASSERT("TCP_REG: npcb->next != npcb", (npcb)->next != (npcb)); \
                           *(pcbs) = (npcb); \
                           LWIP_ASSERT("TCP_REG: tcp_pcbs sane", tcp_pcbs_sane()); \
             tcp_timer_needed(); \
                           } while(0)


      

Marco TCP_RMV(pcbs, npcb)

#define TCP_RMV(pcbs, npcb) do { \
                           struct tcp_pcb *tcp_tmp_pcb; \
                           LWIP_ASSERT("TCP_RMV: pcbs != NULL", *(pcbs) != NULL); \
                           LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", (void *)(npcb), (void *)(*(pcbs)))); \
                           if(*(pcbs) == (npcb)) { \
                              *(pcbs) = (*pcbs)->next; \
                           } else for (tcp_tmp_pcb = *(pcbs); tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \
                              if(tcp_tmp_pcb->next == (npcb)) { \
                                 tcp_tmp_pcb->next = (npcb)->next; \
                                 break; \
                              } \
                           } \
                           (npcb)->next = NULL; \
                           LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \
                           LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removed %p from %p\n", (void *)(npcb), (void *)(*(pcbs)))); \
                           } while(0)


      

Marco TCP_REG(pcbs, npcb)

#define TCP_REG(pcbs, npcb)                       \
 do {                                            \
   (npcb)->next = *pcbs;                         \
   *(pcbs) = (npcb);                             \
   tcp_timer_needed();                           \
 } while (0)


      

Marco TCP_RMV(pcbs, npcb)

#define TCP_RMV(pcbs, npcb)                       \
 do {                                            \
   if(*(pcbs) == (npcb)) {                       \
     (*(pcbs)) = (*pcbs)->next;                  \
   }                                             \
   else {                                        \
     struct tcp_pcb *tcp_tmp_pcb;                \
     for (tcp_tmp_pcb = *pcbs;                   \
         tcp_tmp_pcb != NULL;                    \
         tcp_tmp_pcb = tcp_tmp_pcb->next) {      \
       if(tcp_tmp_pcb->next == (npcb)) {         \
         tcp_tmp_pcb->next = (npcb)->next;       \
         break;                                  \
       }                                         \
     }                                           \
   }                                             \
   (npcb)->next = NULL;                          \
 } while(0)


      

Marco TCP_REG_ACTIVE(npcb)

#define TCP_REG_ACTIVE(npcb)                      \
 do {                                            \
   TCP_REG(&tcp_active_pcbs, npcb);              \
   tcp_active_pcbs_changed = 1;                  \
 } while (0)


      

Marco TCP_RMV_ACTIVE(npcb)

#define TCP_RMV_ACTIVE(npcb)                      \
 do {                                            \
   TCP_RMV(&tcp_active_pcbs, npcb);              \
   tcp_active_pcbs_changed = 1;                  \
 } while (0)


      

Marco TCP_PCB_REMOVE_ACTIVE(pcb)

#define TCP_PCB_REMOVE_ACTIVE(pcb)                \
 do {                                            \
   tcp_pcb_remove(&tcp_active_pcbs, pcb);        \
   tcp_active_pcbs_changed = 1;                  \
 } while (0)


      

Marco tcp_ack(pcb)

#define tcp_ack(pcb)                              \
 do {                                            \
   if((pcb)->flags & TF_ACK_DELAY) {             \
     tcp_clear_flags(pcb, TF_ACK_DELAY);         \
     tcp_ack_now(pcb);                           \
   }                                             \
   else {                                        \
     tcp_set_flags(pcb, TF_ACK_DELAY);           \
   }                                             \
 } while (0)


      

Marco tcp_ack_now(pcb)

#define tcp_ack_now(pcb)                          \
 tcp_set_flags(pcb, TF_ACK_NOW)


      

Marco tcp_eff_send_mss(sendmss, src, dest)

#define tcp_eff_send_mss(sendmss, src, dest) \
   tcp_eff_send_mss_netif(sendmss, ip_route(src, dest), dest)


      

Marco LWIP_HDR_TCPIP_PRIV_H

#define LWIP_HDR_TCPIP_PRIV_H


      

Marco API_VAR_REF(name)

#define API_VAR_REF(name)              (*(name))


      

Marco API_VAR_DECLARE(type, name)

#define API_VAR_DECLARE(type, name)    type * name


      

Marco API_VAR_ALLOC_EXT(type, pool, name, errorblock)

#define API_VAR_ALLOC_EXT(type, pool, name, errorblock) do { \
                                         name = (type *)memp_malloc(pool); \
                                         if (name == NULL) { \
                                           errorblock; \
                                         } \
                                       } while(0)


      

Marco API_VAR_ALLOC(type, pool, name, errorval)

#define API_VAR_ALLOC(type, pool, name, errorval) API_VAR_ALLOC_EXT(type, pool, name, return errorval)


      

Marco API_VAR_ALLOC_POOL(type, pool, name, errorval)

#define API_VAR_ALLOC_POOL(type, pool, name, errorval) do { \
                                         name = (type *)LWIP_MEMPOOL_ALLOC(pool); \
                                         if (name == NULL) { \
                                           return errorval; \
                                         } \
                                       } while(0)


      

Marco API_VAR_FREE(pool, name)

#define API_VAR_FREE(pool, name)       memp_free(pool, name)


      

Marco API_VAR_FREE_POOL(pool, name)

#define API_VAR_FREE_POOL(pool, name)  LWIP_MEMPOOL_FREE(pool, name)


      

Marco API_EXPR_REF(expr)

#define API_EXPR_REF(expr)             (&(expr))


      

Marco API_EXPR_REF_SEM(expr)

#define API_EXPR_REF_SEM(expr)         (expr)


      

Marco API_EXPR_REF_SEM(expr)

#define API_EXPR_REF_SEM(expr)         API_EXPR_REF(expr)


      

Marco API_EXPR_DEREF(expr)

#define API_EXPR_DEREF(expr)           expr


      

Marco API_MSG_M_DEF(m)

#define API_MSG_M_DEF(m)               m


      

Marco API_MSG_M_DEF_C(t, m)

#define API_MSG_M_DEF_C(t, m)          t m


      

Marco API_VAR_REF(name)

#define API_VAR_REF(name)              name


      

Marco API_VAR_DECLARE(type, name)

#define API_VAR_DECLARE(type, name)    type name


      

Marco API_VAR_ALLOC_EXT

#define API_VAR_ALLOC_EXT(type, pool, name, errorblock)


      

Marco API_VAR_ALLOC

#define API_VAR_ALLOC(type, pool, name, errorval)


      

Marco API_VAR_ALLOC_POOL

#define API_VAR_ALLOC_POOL(type, pool, name, errorval)


      

Marco API_VAR_FREE

#define API_VAR_FREE(pool, name)


      

Marco API_VAR_FREE_POOL

#define API_VAR_FREE_POOL(pool, name)


      

Marco API_EXPR_REF(expr)

#define API_EXPR_REF(expr)             expr


      

Marco API_EXPR_REF_SEM(expr)

#define API_EXPR_REF_SEM(expr)         API_EXPR_REF(expr)


      

Marco API_EXPR_DEREF(expr)

#define API_EXPR_DEREF(expr)           (*(expr))


      

Marco API_MSG_M_DEF(m)

#define API_MSG_M_DEF(m)               *m


      

Marco API_MSG_M_DEF_C(t, m)

#define API_MSG_M_DEF_C(t, m)          const t * m


      

Marco LWIP_HDR_PROT_AUTOIP_H

#define LWIP_HDR_PROT_AUTOIP_H


      

Marco AUTOIP_NET

#define AUTOIP_NET             0xA9FE0000
/* 169.254.0.0 */

Marco AUTOIP_RANGE_START

#define AUTOIP_RANGE_START     (AUTOIP_NET | 256)
/* 169.254.1.0 */

Marco AUTOIP_RANGE_END

#define AUTOIP_RANGE_END       (AUTOIP_NET | 15EFF)
/* 169.254.254.255 */

Marco PROBE_WAIT

#define PROBE_WAIT             1  /* second   (initial random delay)                 */
/* RFC 3927 Constants */

Marco PROBE_MIN

#define PROBE_MIN              1  /* second   (minimum delay till repeated probe)    */


      

Marco PROBE_MAX

#define PROBE_MAX              2  /* seconds  (maximum delay till repeated probe)    */


      

Marco PROBE_NUM

#define PROBE_NUM              3  /*          (number of probe packets)              */


      

Marco ANNOUNCE_NUM

#define ANNOUNCE_NUM           2  /*          (number of announcement packets)       */


      

Marco ANNOUNCE_INTERVAL

#define ANNOUNCE_INTERVAL      2  /* seconds  (time between announcement packets)    */


      

Marco ANNOUNCE_WAIT

#define ANNOUNCE_WAIT          2  /* seconds  (delay before announcing)              */


      

Marco MAX_CONFLICTS

#define MAX_CONFLICTS          10 /*          (max conflicts before rate limiting)   */


      

Marco RATE_LIMIT_INTERVAL

#define RATE_LIMIT_INTERVAL    60 /* seconds  (delay between successive attempts)    */


      

Marco DEFEND_INTERVAL

#define DEFEND_INTERVAL        10 /* seconds  (min. wait between defensive ARPs)     */


      

Marco LWIP_HDR_PROT_DHCP_H

#define LWIP_HDR_PROT_DHCP_H


      

Marco DHCP_CHADDR_LEN

#define DHCP_CHADDR_LEN  16U
/* DHCP message item offsets and length */

Marco DHCP_SNAME_OFS

#define DHCP_SNAME_OFS   44U


      

Marco DHCP_SNAME_LEN

#define DHCP_SNAME_LEN   64U


      

Marco DHCP_FILE_OFS

#define DHCP_FILE_OFS    108U


      

Marco DHCP_FILE_LEN

#define DHCP_FILE_LEN    128U


      

Marco DHCP_MSG_LEN

#define DHCP_MSG_LEN     236U


      

Marco DHCP_OPTIONS_OFS

#define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4U) /* 4 byte: cookie */


      

Marco DHCP_BOOTREQUEST

#define DHCP_BOOTREQUEST           1
/* DHCP op codes */

Marco DHCP_BOOTREPLY

#define DHCP_BOOTREPLY             2


      

Marco DHCP_DISCOVER

#define DHCP_DISCOVER              1
/* DHCP message types */

Marco DHCP_OFFER

#define DHCP_OFFER                 2


      

Marco DHCP_REQUEST

#define DHCP_REQUEST               3


      

Marco DHCP_DECLINE

#define DHCP_DECLINE               4


      

Marco DHCP_ACK

#define DHCP_ACK                   5


      

Marco DHCP_NAK

#define DHCP_NAK                   6


      

Marco DHCP_RELEASE

#define DHCP_RELEASE               7


      

Marco DHCP_INFORM

#define DHCP_INFORM                8


      
      
#define DHCP_MAGIC_COOKIE          0x63825363UL


      

Marco DHCP_OPTION_PAD

#define DHCP_OPTION_PAD            0
/* BootP options */

Marco DHCP_OPTION_SUBNET_MASK

#define DHCP_OPTION_SUBNET_MASK    1 /* RFC 2132 3.3 */


      

Marco DHCP_OPTION_ROUTER

#define DHCP_OPTION_ROUTER         3


      

Marco DHCP_OPTION_DNS_SERVER

#define DHCP_OPTION_DNS_SERVER     6


      

Marco DHCP_OPTION_HOSTNAME

#define DHCP_OPTION_HOSTNAME       12


      

Marco DHCP_OPTION_IP_TTL

#define DHCP_OPTION_IP_TTL         23


      

Marco DHCP_OPTION_MTU

#define DHCP_OPTION_MTU            26


      

Marco DHCP_OPTION_BROADCAST

#define DHCP_OPTION_BROADCAST      28


      

Marco DHCP_OPTION_TCP_TTL

#define DHCP_OPTION_TCP_TTL        37


      

Marco DHCP_OPTION_NTP

#define DHCP_OPTION_NTP            42


      

Marco DHCP_OPTION_END

#define DHCP_OPTION_END            255


      

Marco DHCP_OPTION_REQUESTED_IP

#define DHCP_OPTION_REQUESTED_IP   50 /* RFC 2132 9.1, requested IP address */
/* DHCP options */

Marco DHCP_OPTION_LEASE_TIME

#define DHCP_OPTION_LEASE_TIME     51 /* RFC 2132 9.2, time in seconds, in 4 bytes */


      

Marco DHCP_OPTION_OVERLOAD

#define DHCP_OPTION_OVERLOAD       52 /* RFC2132 9.3, use file and/or sname field for options */


      

Marco DHCP_OPTION_MESSAGE_TYPE

#define DHCP_OPTION_MESSAGE_TYPE   53 /* RFC 2132 9.6, important for DHCP */


      

Marco DHCP_OPTION_MESSAGE_TYPE_LEN

#define DHCP_OPTION_MESSAGE_TYPE_LEN 1


      

Marco DHCP_OPTION_SERVER_ID

#define DHCP_OPTION_SERVER_ID      54 /* RFC 2132 9.7, server IP address */


      

Marco DHCP_OPTION_PARAMETER_REQUEST_LIST

#define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 /* RFC 2132 9.8, requested option types */


      

Marco DHCP_OPTION_MAX_MSG_SIZE

#define DHCP_OPTION_MAX_MSG_SIZE   57 /* RFC 2132 9.10, message size accepted >= 576 */


      

Marco DHCP_OPTION_MAX_MSG_SIZE_LEN

#define DHCP_OPTION_MAX_MSG_SIZE_LEN 2


      

Marco DHCP_OPTION_T1

#define DHCP_OPTION_T1             58 /* T1 renewal time */


      

Marco DHCP_OPTION_T2

#define DHCP_OPTION_T2             59 /* T2 rebinding time */


      

Marco DHCP_OPTION_US

#define DHCP_OPTION_US             60


      

Marco DHCP_OPTION_CLIENT_ID

#define DHCP_OPTION_CLIENT_ID      61


      

Marco DHCP_OPTION_TFTP_SERVERNAME

#define DHCP_OPTION_TFTP_SERVERNAME 66


      

Marco DHCP_OPTION_BOOTFILE

#define DHCP_OPTION_BOOTFILE       67


      

Marco DHCP_OVERLOAD_NONE

#define DHCP_OVERLOAD_NONE         0
/* possible combinations of overloading the file and sname fields with options */

Marco DHCP_OVERLOAD_FILE

#define DHCP_OVERLOAD_FILE         1


      

Marco DHCP_OVERLOAD_SNAME

#define DHCP_OVERLOAD_SNAME        2


      

Marco DHCP_OVERLOAD_SNAME_FILE

#define DHCP_OVERLOAD_SNAME_FILE   3


      

Marco LWIP_HDR_PROT_DHCP6_H

#define LWIP_HDR_PROT_DHCP6_H


      

Marco DHCP6_CLIENT_PORT

#define DHCP6_CLIENT_PORT 546


      

Marco DHCP6_SERVER_PORT

#define DHCP6_SERVER_PORT 547


      

Marco DHCP6_TRANSACTION_ID_LEN

#define DHCP6_TRANSACTION_ID_LEN  3
/* DHCPv6 message item offsets and length */

Marco DHCP6_SOLICIT

#define DHCP6_SOLICIT              1
/* DHCPv6 message types */

Marco DHCP6_ADVERTISE

#define DHCP6_ADVERTISE            2


      

Marco DHCP6_REQUEST

#define DHCP6_REQUEST              3


      

Marco DHCP6_CONFIRM

#define DHCP6_CONFIRM              4


      

Marco DHCP6_RENEW

#define DHCP6_RENEW                5


      

Marco DHCP6_REBIND

#define DHCP6_REBIND               6


      

Marco DHCP6_REPLY

#define DHCP6_REPLY                7


      

Marco DHCP6_RELEASE

#define DHCP6_RELEASE              8


      

Marco DHCP6_DECLINE

#define DHCP6_DECLINE              9


      

Marco DHCP6_RECONFIGURE

#define DHCP6_RECONFIGURE          10


      

Marco DHCP6_INFOREQUEST

#define DHCP6_INFOREQUEST          11


      

Marco DHCP6_RELAYFORW

#define DHCP6_RELAYFORW            12


      

Marco DHCP6_RELAYREPL

#define DHCP6_RELAYREPL            13


      

Marco DHCP6_STATUS_SUCCESS

#define DHCP6_STATUS_SUCCESS       0 /* Success. */
/** DHCPv6 status codes */

Marco DHCP6_STATUS_UNSPECFAIL

#define DHCP6_STATUS_UNSPECFAIL    1 /* Failure, reason unspecified; this status code is sent by either a client or a server to indicate a failure not explicitly specified in this document. */


      

Marco DHCP6_STATUS_NOADDRSAVAIL

#define DHCP6_STATUS_NOADDRSAVAIL  2 /* Server has no addresses available to assign to the IA(s). */


      

Marco DHCP6_STATUS_NOBINDING

#define DHCP6_STATUS_NOBINDING     3 /* Client record (binding) unavailable. */


      
      
#define DHCP6_STATUS_NOTONLINK     4 /* The prefix for the address is not appropriate for the link to which the client is attached. */


      

Marco DHCP6_STATUS_USEMULTICAST

#define DHCP6_STATUS_USEMULTICAST  5 /* Sent by a server to a client to force the client to send messages to the server using the All_DHCP_Relay_Agents_and_Servers address. */


      

Marco DHCP6_DUID_LLT

#define DHCP6_DUID_LLT             1 /* LLT: Link-layer Address Plus Time */
/** DHCPv6 DUID types */

Marco DHCP6_DUID_EN

#define DHCP6_DUID_EN              2 /* EN: Enterprise number */


      

Marco DHCP6_DUID_LL

#define DHCP6_DUID_LL              3 /* LL: Link-layer Address */


      

Marco DHCP6_DUID_UUID

#define DHCP6_DUID_UUID            4 /* UUID (RFC 6355) */


      

Marco DHCP6_OPTION_CLIENTID

#define DHCP6_OPTION_CLIENTID      1
/* DHCPv6 options */

Marco DHCP6_OPTION_SERVERID

#define DHCP6_OPTION_SERVERID      2


      

Marco DHCP6_OPTION_IA_NA

#define DHCP6_OPTION_IA_NA         3


      

Marco DHCP6_OPTION_IA_TA

#define DHCP6_OPTION_IA_TA         4


      

Marco DHCP6_OPTION_IAADDR

#define DHCP6_OPTION_IAADDR        5


      

Marco DHCP6_OPTION_ORO

#define DHCP6_OPTION_ORO           6


      

Marco DHCP6_OPTION_PREFERENCE

#define DHCP6_OPTION_PREFERENCE    7


      

Marco DHCP6_OPTION_ELAPSED_TIME

#define DHCP6_OPTION_ELAPSED_TIME  8


      

Marco DHCP6_OPTION_RELAY_MSG

#define DHCP6_OPTION_RELAY_MSG     9


      

Marco DHCP6_OPTION_AUTH

#define DHCP6_OPTION_AUTH          11


      

Marco DHCP6_OPTION_UNICAST

#define DHCP6_OPTION_UNICAST       12


      

Marco DHCP6_OPTION_STATUS_CODE

#define DHCP6_OPTION_STATUS_CODE   13


      

Marco DHCP6_OPTION_RAPID_COMMIT

#define DHCP6_OPTION_RAPID_COMMIT  14


      

Marco DHCP6_OPTION_USER_CLASS

#define DHCP6_OPTION_USER_CLASS    15


      

Marco DHCP6_OPTION_VENDOR_CLASS

#define DHCP6_OPTION_VENDOR_CLASS  16


      

Marco DHCP6_OPTION_VENDOR_OPTS

#define DHCP6_OPTION_VENDOR_OPTS   17


      

Marco DHCP6_OPTION_INTERFACE_ID

#define DHCP6_OPTION_INTERFACE_ID  18


      

Marco DHCP6_OPTION_RECONF_MSG

#define DHCP6_OPTION_RECONF_MSG    19


      

Marco DHCP6_OPTION_RECONF_ACCEPT

#define DHCP6_OPTION_RECONF_ACCEPT 20


      

Marco DHCP6_OPTION_DNS_SERVERS

#define DHCP6_OPTION_DNS_SERVERS   23 /* RFC 3646 */
/* More options see https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml */

Marco DHCP6_OPTION_DOMAIN_LIST

#define DHCP6_OPTION_DOMAIN_LIST   24 /* RFC 3646 */


      

Marco DHCP6_OPTION_SNTP_SERVERS

#define DHCP6_OPTION_SNTP_SERVERS  31 /* RFC 4075 */


      

Marco LWIP_HDR_PROT_DNS_H

#define LWIP_HDR_PROT_DNS_H


      

Marco DNS_SERVER_PORT

#define DNS_SERVER_PORT          53


      

Marco DNS_RRTYPE_A

#define DNS_RRTYPE_A             1    /* a host address */
/* DNS field TYPE used for "Resource Records" */

Marco DNS_RRTYPE_NS

#define DNS_RRTYPE_NS            2    /* an authoritative name server */


      

Marco DNS_RRTYPE_MD

#define DNS_RRTYPE_MD            3    /* a mail destination (Obsolete - use MX) */


      

Marco DNS_RRTYPE_MF

#define DNS_RRTYPE_MF            4    /* a mail forwarder (Obsolete - use MX) */


      

Marco DNS_RRTYPE_CNAME

#define DNS_RRTYPE_CNAME         5    /* the canonical name for an alias */


      

Marco DNS_RRTYPE_SOA

#define DNS_RRTYPE_SOA           6    /* marks the start of a zone of authority */


      

Marco DNS_RRTYPE_MB

#define DNS_RRTYPE_MB            7    /* a mailbox domain name (EXPERIMENTAL) */


      

Marco DNS_RRTYPE_MG

#define DNS_RRTYPE_MG            8    /* a mail group member (EXPERIMENTAL) */


      

Marco DNS_RRTYPE_MR

#define DNS_RRTYPE_MR            9    /* a mail rename domain name (EXPERIMENTAL) */


      

Marco DNS_RRTYPE_NULL

#define DNS_RRTYPE_NULL          10   /* a null RR (EXPERIMENTAL) */


      

Marco DNS_RRTYPE_WKS

#define DNS_RRTYPE_WKS           11   /* a well known service description */


      

Marco DNS_RRTYPE_PTR

#define DNS_RRTYPE_PTR           12   /* a domain name pointer */


      

Marco DNS_RRTYPE_HINFO

#define DNS_RRTYPE_HINFO         13   /* host information */


      

Marco DNS_RRTYPE_MINFO

#define DNS_RRTYPE_MINFO         14   /* mailbox or mail list information */


      

Marco DNS_RRTYPE_MX

#define DNS_RRTYPE_MX            15   /* mail exchange */


      

Marco DNS_RRTYPE_TXT

#define DNS_RRTYPE_TXT           16   /* text strings */


      

Marco DNS_RRTYPE_AAAA

#define DNS_RRTYPE_AAAA          28   /* IPv6 address */


      

Marco DNS_RRTYPE_SRV

#define DNS_RRTYPE_SRV           33   /* service location */


      

Marco DNS_RRTYPE_ANY

#define DNS_RRTYPE_ANY           255  /* any type */


      

Marco DNS_RRCLASS_IN

#define DNS_RRCLASS_IN           1    /* the Internet */
/* DNS field CLASS used for "Resource Records" */

Marco DNS_RRCLASS_CS

#define DNS_RRCLASS_CS           2    /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */


      

Marco DNS_RRCLASS_CH

#define DNS_RRCLASS_CH           3    /* the CHAOS class */


      

Marco DNS_RRCLASS_HS

#define DNS_RRCLASS_HS           4    /* Hesiod [Dyer 87] */


      

Marco DNS_RRCLASS_ANY

#define DNS_RRCLASS_ANY          255  /* any class */


      

Marco DNS_RRCLASS_FLUSH

#define DNS_RRCLASS_FLUSH        2048 /* Flush bit */


      

Marco DNS_FLAG1_RESPONSE

#define DNS_FLAG1_RESPONSE       128
/* DNS protocol flags */

Marco DNS_FLAG1_OPCODE_STATUS

#define DNS_FLAG1_OPCODE_STATUS  16


      

Marco DNS_FLAG1_OPCODE_INVERSE

#define DNS_FLAG1_OPCODE_INVERSE 8


      

Marco DNS_FLAG1_OPCODE_STANDARD

#define DNS_FLAG1_OPCODE_STANDARD 0


      

Marco DNS_FLAG1_AUTHORATIVE

#define DNS_FLAG1_AUTHORATIVE    4


      

Marco DNS_FLAG1_TRUNC

#define DNS_FLAG1_TRUNC          2


      

Marco DNS_FLAG1_RD

#define DNS_FLAG1_RD             1


      

Marco DNS_FLAG2_RA

#define DNS_FLAG2_RA             128


      

Marco DNS_FLAG2_ERR_MASK

#define DNS_FLAG2_ERR_MASK       15


      

Marco DNS_FLAG2_ERR_NONE

#define DNS_FLAG2_ERR_NONE       0


      

Marco DNS_FLAG2_ERR_NAME

#define DNS_FLAG2_ERR_NAME       3


      

Marco DNS_HDR_GET_OPCODE(hdr)

#define DNS_HDR_GET_OPCODE(hdr) ((((hdr)->flags1) >> 3) & 15)


      

Marco LWIP_HDR_PROT_ETHARP_H

#define LWIP_HDR_PROT_ETHARP_H


      

Marco ETHARP_HWADDR_LEN

#define ETHARP_HWADDR_LEN    ETH_HWADDR_LEN


      

Marco LWIP_HDR_PROT_ETHERNET_H

#define LWIP_HDR_PROT_ETHERNET_H


      

Marco ETH_HWADDR_LEN

#define ETH_HWADDR_LEN   ETHARP_HWADDR_LEN /* compatibility mode */


      

Marco ETH_HWADDR_LEN

#define ETH_HWADDR_LEN   6


      

Marco LWIP_HDR_PROT_IANA_H

#define LWIP_HDR_PROT_IANA_H


      

Marco LWIP_HDR_PROT_ICMP_H

#define LWIP_HDR_PROT_ICMP_H


      

Marco ICMP_ER

#define ICMP_ER  0   /* echo reply */


      

Marco ICMP_DUR

#define ICMP_DUR 3   /* destination unreachable */


      

Marco ICMP_SQ

#define ICMP_SQ  4   /* source quench */


      

Marco ICMP_RD

#define ICMP_RD  5   /* redirect */


      

Marco ICMP_ECHO

#define ICMP_ECHO 8   /* echo */


      

Marco ICMP_TE

#define ICMP_TE 11   /* time exceeded */


      

Marco ICMP_PP

#define ICMP_PP 12   /* parameter problem */


      

Marco ICMP_TS

#define ICMP_TS 13   /* timestamp */


      

Marco ICMP_TSR

#define ICMP_TSR 14   /* timestamp reply */


      

Marco ICMP_IRQ

#define ICMP_IRQ 15   /* information request */


      

Marco ICMP_IR

#define ICMP_IR 16   /* information reply */


      

Marco ICMP_AM

#define ICMP_AM 17   /* address mask request */


      

Marco ICMP_AMR

#define ICMP_AMR 18   /* address mask reply */


      

Marco LWIP_HDR_PROT_ICMP6_H

#define LWIP_HDR_PROT_ICMP6_H


      

Marco LWIP_HDR_PROT_IEEE_H

#define LWIP_HDR_PROT_IEEE_H


      

Marco LWIP_HDR_PROT_IGMP_H

#define LWIP_HDR_PROT_IGMP_H


      

Marco IGMP_TTL

#define IGMP_TTL                      1
/*
 * IGMP constants
 */

Marco IGMP_MINLEN

#define IGMP_MINLEN                   8


      

Marco ROUTER_ALERT

#define ROUTER_ALERT                  0x9404U


      

Marco ROUTER_ALERTLEN

#define ROUTER_ALERTLEN               4


      

Marco IGMP_MEMB_QUERY

#define IGMP_MEMB_QUERY               17 /* Membership query         */
/*
 * IGMP message types, including version number.
 */

Marco IGMP_V1_MEMB_REPORT

#define IGMP_V1_MEMB_REPORT           18 /* Ver. 1 membership report */


      

Marco IGMP_V2_MEMB_REPORT

#define IGMP_V2_MEMB_REPORT           22 /* Ver. 2 membership report */


      

Marco IGMP_LEAVE_GROUP

#define IGMP_LEAVE_GROUP              23 /* Leave-group message      */


      

Marco IGMP_GROUP_NON_MEMBER

#define IGMP_GROUP_NON_MEMBER         0
/* Group  membership states */

Marco IGMP_GROUP_DELAYING_MEMBER

#define IGMP_GROUP_DELAYING_MEMBER    1


      

Marco IGMP_GROUP_IDLE_MEMBER

#define IGMP_GROUP_IDLE_MEMBER        2


      

Marco LWIP_HDR_PROT_IP_H

#define LWIP_HDR_PROT_IP_H


      

Marco IP_PROTO_ICMP

#define IP_PROTO_ICMP   1


      

Marco IP_PROTO_IGMP

#define IP_PROTO_IGMP   2


      

Marco IP_PROTO_UDP

#define IP_PROTO_UDP    17


      

Marco IP_PROTO_UDPLITE

#define IP_PROTO_UDPLITE 136


      

Marco IP_PROTO_TCP

#define IP_PROTO_TCP    6


      

Marco IP_HDR_GET_VERSION(ptr)

#define IP_HDR_GET_VERSION(ptr)  ((*(u8_t*)(ptr)) >> 4)
/** This operates on a void* by loading the first byte */

Marco LWIP_HDR_PROT_IP4_H

#define LWIP_HDR_PROT_IP4_H


      

Marco IP_HLEN

#define IP_HLEN 20
/* Size of the IPv4 header. Same as 'sizeof(struct ip_hdr)'. */

Marco IP_HLEN_MAX

#define IP_HLEN_MAX 60
/* Maximum size of the IPv4 header with options. */

Marco LWIP_HDR_PROT_IP6_H

#define LWIP_HDR_PROT_IP6_H


      

Marco IP6_HLEN

#define IP6_HLEN 40


      

Marco IP6_NEXTH_HOPBYHOP

#define IP6_NEXTH_HOPBYHOP 0


      

Marco IP6_NEXTH_TCP

#define IP6_NEXTH_TCP      6


      

Marco IP6_NEXTH_UDP

#define IP6_NEXTH_UDP      17


      

Marco IP6_NEXTH_ENCAPS

#define IP6_NEXTH_ENCAPS   41


      

Marco IP6_NEXTH_ROUTING

#define IP6_NEXTH_ROUTING  43


      

Marco IP6_NEXTH_FRAGMENT

#define IP6_NEXTH_FRAGMENT 44


      

Marco IP6_NEXTH_ICMP6

#define IP6_NEXTH_ICMP6    58


      

Marco IP6_NEXTH_NONE

#define IP6_NEXTH_NONE     59


      

Marco IP6_NEXTH_DESTOPTS

#define IP6_NEXTH_DESTOPTS 60


      

Marco IP6_NEXTH_UDPLITE

#define IP6_NEXTH_UDPLITE  136


      

Marco LWIP_HDR_PROT_MLD6_H

#define LWIP_HDR_PROT_MLD6_H


      

Marco MLD6_HBH_HLEN

#define MLD6_HBH_HLEN 8


      

Marco LWIP_HDR_PROT_ND6_H

#define LWIP_HDR_PROT_ND6_H


      

Marco LWIP_HDR_PROT_TCP_H

#define LWIP_HDR_PROT_TCP_H


      

Marco TCP_HLEN

#define TCP_HLEN 20
/* Length of the TCP header, excluding options. */

Marco LWIP_HDR_PROT_UDP_H

#define LWIP_HDR_PROT_UDP_H


      

Marco UDP_HLEN

#define UDP_HLEN 8


      

Marco LWIP_HDR_RAW_H

#define LWIP_HDR_RAW_H


      

Marco RAW_FLAGS_CONNECTED

#define RAW_FLAGS_CONNECTED     0x01U


      

Marco RAW_FLAGS_HDRINCL

#define RAW_FLAGS_HDRINCL       0x02U


      

Marco RAW_FLAGS_MULTICAST_LOOP

#define RAW_FLAGS_MULTICAST_LOOP 0x04U


      

Marco raw_flags(pcb)

#define         raw_flags(pcb) ((pcb)->flags)


      

Marco raw_setflags(pcb,f)

#define         raw_setflags(pcb,f) ((pcb)->flags = (f))


      

Marco raw_set_flags(pcb, set_flags)

#define         raw_set_flags(pcb, set_flags)    do { (pcb)->flags = (u8_t)((pcb)->flags | (set_flags)); } while(0)


      

Marco raw_clear_flags(pcb, clr_flags)

#define         raw_clear_flags(pcb, clr_flags)  do { (pcb)->flags = (u8_t)((pcb)->flags & (u8_t)(~(clr_flags) & 255)); } while(0)


      

Marco raw_is_flag_set(pcb, flag)

#define         raw_is_flag_set(pcb, flag)       (((pcb)->flags & (flag)) != 0)


      

Marco raw_init()

#define raw_init() /* Compatibility define, no init needed. */


      

Marco raw_new_ip6(proto)

#define raw_new_ip6(proto) raw_new_ip_type(IPADDR_TYPE_V6, proto)
/* for compatibility with older implementation */

Marco raw_set_multicast_netif_index(pcb, idx)

#define raw_set_multicast_netif_index(pcb, idx) ((pcb)->mcast_ifindex = (idx))


      

Marco raw_get_multicast_netif_index(pcb)

#define raw_get_multicast_netif_index(pcb)     ((pcb)->mcast_ifindex)


      

Marco raw_set_multicast_ttl(pcb, value)

#define raw_set_multicast_ttl(pcb, value)      ((pcb)->mcast_ttl = (value))


      

Marco raw_get_multicast_ttl(pcb)

#define raw_get_multicast_ttl(pcb)             ((pcb)->mcast_ttl)


      

Marco SIO_H

#define SIO_H


      

Marco LWIP_HDR_SNMP_H

#define LWIP_HDR_SNMP_H


      

Marco MIB2_COPY_SYSUPTIME_TO(ptrToVal)

#define MIB2_COPY_SYSUPTIME_TO(ptrToVal) (*(ptrToVal) = (sys_now() / 10))


      

Marco MIB2_STATS_NETIF_INC(n, x)

#define MIB2_STATS_NETIF_INC(n, x)     do { ++(n)->mib2_counters.x; } while(0)
/**
 * @ingroup netif_mib2
 * Increment stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs)
 */

Marco MIB2_STATS_NETIF_ADD(n, x, val)

#define MIB2_STATS_NETIF_ADD(n, x, val) do { (n)->mib2_counters.x += (val); } while(0)
/**
 * @ingroup netif_mib2
 * Add value to stats member for SNMP MIB2 stats (struct stats_mib2_netif_ctrs)
 */

Marco MIB2_INIT_NETIF(netif, type, speed)

#define MIB2_INIT_NETIF(netif, type, speed) do { \
 (netif)->link_type = (type); \
 (netif)->link_speed = (speed);\
 (netif)->ts = 0;             \
 (netif)->mib2_counters.ifinoctets = 0;     \
 (netif)->mib2_counters.ifinucastpkts = 0;  \
 (netif)->mib2_counters.ifinnucastpkts = 0; \
 (netif)->mib2_counters.ifindiscards = 0;   \
 (netif)->mib2_counters.ifinerrors = 0;   \
 (netif)->mib2_counters.ifinunknownprotos = 0;   \
 (netif)->mib2_counters.ifoutoctets = 0;    \
 (netif)->mib2_counters.ifoutucastpkts = 0; \
 (netif)->mib2_counters.ifoutnucastpkts = 0; \
 (netif)->mib2_counters.ifoutdiscards = 0; \
 (netif)->mib2_counters.ifouterrors = 0; } while(0)
/**
 * @ingroup netif_mib2
 * Init MIB2 statistic counters in netif
 * @param netif Netif to init
 * @param type one of enum @ref snmp_ifType
 * @param speed your link speed here (units: bits per second)
 */

Marco MIB2_COPY_SYSUPTIME_TO

#define MIB2_COPY_SYSUPTIME_TO(ptrToVal)


      

Marco MIB2_INIT_NETIF

#define MIB2_INIT_NETIF(netif, type, speed)


      

Marco MIB2_STATS_NETIF_INC

#define MIB2_STATS_NETIF_INC(n, x)


      

Marco MIB2_STATS_NETIF_ADD

#define MIB2_STATS_NETIF_ADD(n, x, val)


      

Marco mib2_add_arp_entry

#define mib2_add_arp_entry(ni,ip)


      

Marco mib2_remove_arp_entry

#define mib2_remove_arp_entry(ni,ip)


      

Marco mib2_netif_added

#define mib2_netif_added(ni)
/* network interface */

Marco mib2_netif_removed

#define mib2_netif_removed(ni)


      

Marco mib2_add_arp_entry

#define mib2_add_arp_entry(ni,ip)
/* ARP */

Marco mib2_remove_arp_entry

#define mib2_remove_arp_entry(ni,ip)


      

Marco mib2_add_ip4

#define mib2_add_ip4(ni)
/* IP */

Marco mib2_remove_ip4

#define mib2_remove_ip4(ni)


      

Marco mib2_add_route_ip4

#define mib2_add_route_ip4(dflt, ni)


      

Marco mib2_remove_route_ip4

#define mib2_remove_route_ip4(dflt, ni)


      

Marco mib2_udp_bind

#define mib2_udp_bind(pcb)
/* UDP */

Marco mib2_udp_unbind

#define mib2_udp_unbind(pcb)


      

Marco NETIF_INIT_SNMP

#define NETIF_INIT_SNMP               MIB2_INIT_NETIF
/* for source-code compatibility reasons only, can be removed (not used internally) */

Marco snmp_add_ifinoctets(ni,value)

#define snmp_add_ifinoctets(ni,value) MIB2_STATS_NETIF_ADD(ni, ifinoctets, value)


      

Marco snmp_inc_ifinucastpkts(ni)

#define snmp_inc_ifinucastpkts(ni)    MIB2_STATS_NETIF_INC(ni, ifinucastpkts)


      

Marco snmp_inc_ifinnucastpkts(ni)

#define snmp_inc_ifinnucastpkts(ni)   MIB2_STATS_NETIF_INC(ni, ifinnucastpkts)


      

Marco snmp_inc_ifindiscards(ni)

#define snmp_inc_ifindiscards(ni)     MIB2_STATS_NETIF_INC(ni, ifindiscards)


      

Marco snmp_inc_ifinerrors(ni)

#define snmp_inc_ifinerrors(ni)       MIB2_STATS_NETIF_INC(ni, ifinerrors)


      

Marco snmp_inc_ifinunknownprotos(ni)

#define snmp_inc_ifinunknownprotos(ni) MIB2_STATS_NETIF_INC(ni, ifinunknownprotos)


      

Marco snmp_add_ifoutoctets(ni,value)

#define snmp_add_ifoutoctets(ni,value) MIB2_STATS_NETIF_ADD(ni, ifoutoctets, value)


      

Marco snmp_inc_ifoutucastpkts(ni)

#define snmp_inc_ifoutucastpkts(ni)   MIB2_STATS_NETIF_INC(ni, ifoutucastpkts)


      

Marco snmp_inc_ifoutnucastpkts(ni)

#define snmp_inc_ifoutnucastpkts(ni)  MIB2_STATS_NETIF_INC(ni, ifoutnucastpkts)


      

Marco snmp_inc_ifoutdiscards(ni)

#define snmp_inc_ifoutdiscards(ni)    MIB2_STATS_NETIF_INC(ni, ifoutdiscards)


      

Marco snmp_inc_ifouterrors(ni)

#define snmp_inc_ifouterrors(ni)      MIB2_STATS_NETIF_INC(ni, ifouterrors)


      

Marco LWIP_HDR_SOCKETS_H

#define LWIP_HDR_SOCKETS_H


      

Marco IOV_MAX

#define IOV_MAX 65535


      

Marco MSG_TRUNC

#define MSG_TRUNC  4
/* struct msghdr->msg_flags bit field values */

Marco MSG_CTRUNC

#define MSG_CTRUNC 8


      

Marco ALIGN_H(size)

#define ALIGN_H(size) (((size) + sizeof(long) - 1U) & ~(sizeof(long)-1U))
/* cmsg header/data alignment. NOTE: we align to native word size (double word
size on 16-bit arch) so structures are not placed at an unaligned address.
16-bit arch needs double word to ensure 32-bit alignment because socklen_t
could be 32 bits. If we ever have cmsg data with a 64-bit variable, alignment
will need to increase long long */

Marco ALIGN_D(size)

#define ALIGN_D(size) ALIGN_H(size)


      

Marco CMSG_FIRSTHDR(mhdr)

#define CMSG_FIRSTHDR(mhdr) \
         ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
          (struct cmsghdr *)(mhdr)->msg_control : \
          (struct cmsghdr *)NULL)


      

Marco CMSG_NXTHDR(mhdr, cmsg)

#define CMSG_NXTHDR(mhdr, cmsg) \
       (((cmsg) == NULL) ? CMSG_FIRSTHDR(mhdr) : \
        (((u8_t *)(cmsg) + ALIGN_H((cmsg)->cmsg_len) \
                           + ALIGN_D(sizeof(struct cmsghdr)) > \
          (u8_t *)((mhdr)->msg_control) + (mhdr)->msg_controllen) ? \
         (struct cmsghdr *)NULL : \
         (struct cmsghdr *)((void*)((u8_t *)(cmsg) + \
                                     ALIGN_H((cmsg)->cmsg_len)))))


      

Marco CMSG_DATA(cmsg)

#define CMSG_DATA(cmsg) ((void*)((u8_t *)(cmsg) + \
                        ALIGN_D(sizeof(struct cmsghdr))))


      

Marco CMSG_SPACE(length)

#define CMSG_SPACE(length) (ALIGN_D(sizeof(struct cmsghdr)) + \
                           ALIGN_H(length))


      

Marco CMSG_LEN(length)

#define CMSG_LEN(length) (ALIGN_D(sizeof(struct cmsghdr)) + \
                          length)


      

Marco IFNAMSIZ

#define IFNAMSIZ NETIF_NAMESIZE
/* Set socket options argument */

Marco SOCK_STREAM

#define SOCK_STREAM    1
/* Socket protocol types (TCP/UDP/RAW) */

Marco SOCK_DGRAM

#define SOCK_DGRAM     2


      

Marco SOCK_RAW

#define SOCK_RAW       3


      

Marco SO_REUSEADDR

#define SO_REUSEADDR  4 /* Allow local address reuse */
/*
 * Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c)
 */

Marco SO_KEEPALIVE

#define SO_KEEPALIVE  8 /* keep connections alive */


      

Marco SO_BROADCAST

#define SO_BROADCAST  32 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */


      

Marco SO_DEBUG

#define SO_DEBUG       1 /* Unimplemented: turn on debugging info recording */
/*
 * Additional options, not kept in so_options.
 */

Marco SO_ACCEPTCONN

#define SO_ACCEPTCONN  2 /* socket has had listen() */


      

Marco SO_DONTROUTE

#define SO_DONTROUTE   16 /* Unimplemented: just use interface addresses */


      

Marco SO_USELOOPBACK

#define SO_USELOOPBACK 64 /* Unimplemented: bypass hardware when possible */


      

Marco SO_LINGER

#define SO_LINGER      128 /* linger on close if data present */


      

Marco SO_DONTLINGER

#define SO_DONTLINGER  ((int)(~SO_LINGER))


      

Marco SO_OOBINLINE

#define SO_OOBINLINE   256 /* Unimplemented: leave received OOB data in line */


      

Marco SO_REUSEPORT

#define SO_REUSEPORT   512 /* Unimplemented: allow local address & port reuse */


      

Marco SO_SNDBUF

#define SO_SNDBUF      4097 /* Unimplemented: send buffer size */


      

Marco SO_RCVBUF

#define SO_RCVBUF      4098 /* receive buffer size */


      

Marco SO_SNDLOWAT

#define SO_SNDLOWAT    4099 /* Unimplemented: send low-water mark */


      

Marco SO_RCVLOWAT

#define SO_RCVLOWAT    4100 /* Unimplemented: receive low-water mark */


      

Marco SO_SNDTIMEO

#define SO_SNDTIMEO    4101 /* send timeout */


      

Marco SO_RCVTIMEO

#define SO_RCVTIMEO    4102 /* receive timeout */


      

Marco SO_ERROR

#define SO_ERROR       4103 /* get error status and clear */


      

Marco SO_TYPE

#define SO_TYPE        4104 /* get socket type */


      

Marco SO_CONTIMEO

#define SO_CONTIMEO    4105 /* Unimplemented: connect timeout */


      

Marco SO_NO_CHECK

#define SO_NO_CHECK    256a /* don't create UDP checksum */


      

Marco SO_BINDTODEVICE

#define SO_BINDTODEVICE 256b /* bind to device */


      

Marco SOL_SOCKET

#define SOL_SOCKET 4095   /* options for socket level */
/*
 * Level number for (get/set)sockopt() to apply to socket itself.
 */

Marco AF_UNSPEC

#define AF_UNSPEC      0


      

Marco AF_INET

#define AF_INET        2


      

Marco AF_INET6

#define AF_INET6       10


      

Marco AF_INET6

#define AF_INET6       AF_UNSPEC


      

Marco PF_INET

#define PF_INET        AF_INET


      

Marco PF_INET6

#define PF_INET6       AF_INET6


      

Marco PF_UNSPEC

#define PF_UNSPEC      AF_UNSPEC


      

Marco IPPROTO_IP

#define IPPROTO_IP     0


      

Marco IPPROTO_ICMP

#define IPPROTO_ICMP   1


      

Marco IPPROTO_TCP

#define IPPROTO_TCP    6


      

Marco IPPROTO_UDP

#define IPPROTO_UDP    17


      

Marco IPPROTO_IPV6

#define IPPROTO_IPV6   41


      

Marco IPPROTO_ICMPV6

#define IPPROTO_ICMPV6 58


      

Marco IPPROTO_UDPLITE

#define IPPROTO_UDPLITE 136


      

Marco IPPROTO_RAW

#define IPPROTO_RAW    255


      

Marco MSG_PEEK

#define MSG_PEEK      1   /* Peeks at an incoming message */
/* Flags we can use with send and recv. */

Marco MSG_WAITALL

#define MSG_WAITALL   2   /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */


      

Marco MSG_OOB

#define MSG_OOB       4   /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */


      

Marco MSG_DONTWAIT

#define MSG_DONTWAIT  8   /* Nonblocking i/o for this operation only */


      

Marco MSG_MORE

#define MSG_MORE      16   /* Sender will send more */


      

Marco MSG_NOSIGNAL

#define MSG_NOSIGNAL  32   /* Uninmplemented: Requests not to send the SIGPIPE signal if an attempt to send is made on a stream-oriented socket that is no longer connected. */


      

Marco IP_TOS

#define IP_TOS            1
/*
 * Options for level IPPROTO_IP
 */

Marco IP_TTL

#define IP_TTL            2


      

Marco IP_PKTINFO

#define IP_PKTINFO        8


      

Marco TCP_NODELAY

#define TCP_NODELAY   1   /* don't delay send to coalesce packets */
/*
 * Options for level IPPROTO_TCP
 */

Marco TCP_KEEPALIVE

#define TCP_KEEPALIVE 2   /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */


      

Marco TCP_KEEPIDLE

#define TCP_KEEPIDLE  3   /* set pcb->keep_idle  - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */


      

Marco TCP_KEEPINTVL

#define TCP_KEEPINTVL 4   /* set pcb->keep_intvl - Use seconds for get/setsockopt */


      

Marco TCP_KEEPCNT

#define TCP_KEEPCNT   5   /* set pcb->keep_cnt   - Use number of probes sent for get/setsockopt */


      

Marco IPV6_CHECKSUM

#define IPV6_CHECKSUM      7 /* RFC3542: calculate and insert the ICMPv6 checksum for raw sockets. */
/*
 * Options for level IPPROTO_IPV6
 */

Marco IPV6_V6ONLY

#define IPV6_V6ONLY        27 /* RFC3493: boolean control to restrict AF_INET6 sockets to IPv6 communications only. */


      

Marco UDPLITE_SEND_CSCOV

#define UDPLITE_SEND_CSCOV 1 /* sender checksum coverage */
/*
 * Options for level IPPROTO_UDPLITE
 */

Marco UDPLITE_RECV_CSCOV

#define UDPLITE_RECV_CSCOV 2 /* minimal receiver checksum coverage */


      

Marco IP_MULTICAST_TTL

#define IP_MULTICAST_TTL  5
/*
 * Options and types for UDP multicast traffic handling
 */

Marco IP_MULTICAST_IF

#define IP_MULTICAST_IF   6


      

Marco IP_MULTICAST_LOOP

#define IP_MULTICAST_LOOP 7


      

Marco IP_ADD_MEMBERSHIP

#define IP_ADD_MEMBERSHIP 3
/*
 * Options and types related to multicast membership
 */

Marco IP_DROP_MEMBERSHIP

#define IP_DROP_MEMBERSHIP 4


      

Marco IPV6_JOIN_GROUP

#define IPV6_JOIN_GROUP     12
/*
 * Options and types related to IPv6 multicast membership
 */

Marco IPV6_ADD_MEMBERSHIP

#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP


      

Marco IPV6_LEAVE_GROUP

#define IPV6_LEAVE_GROUP    13


      

Marco IPV6_DROP_MEMBERSHIP

#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP


      

Marco IPTOS_TOS_MASK

#define IPTOS_TOS_MASK         1E
/*
 * The Type of Service provides an indication of the abstract
 * parameters of the quality of service desired.  These parameters are
 * to be used to guide the selection of the actual service parameters
 * when transmitting a datagram through a particular network.  Several
 * networks offer service precedence, which somehow treats high
 * precedence traffic as more important than other traffic (generally
 * by accepting only traffic above a certain precedence at time of high
 * load).  The major choice is a three way tradeoff between low-delay,
 * high-reliability, and high-throughput.
 * The use of the Delay, Throughput, and Reliability indications may
 * increase the cost (in some sense) of the service.  In many networks
 * better performance for one of these parameters is coupled with worse
 * performance on another.  Except for very unusual cases at most two
 * of these three indications should be set.
 */

Marco IPTOS_TOS(tos)

#define IPTOS_TOS(tos)         ((tos) & IPTOS_TOS_MASK)


      

Marco IPTOS_LOWDELAY

#define IPTOS_LOWDELAY         16


      

Marco IPTOS_THROUGHPUT

#define IPTOS_THROUGHPUT       8


      

Marco IPTOS_RELIABILITY

#define IPTOS_RELIABILITY      4


      

Marco IPTOS_LOWCOST

#define IPTOS_LOWCOST          2


      

Marco IPTOS_MINCOST

#define IPTOS_MINCOST          IPTOS_LOWCOST


      

Marco IPTOS_PREC_MASK

#define IPTOS_PREC_MASK                0xe0
/*
 * The Network Control precedence designation is intended to be used
 * within a network only.  The actual use and control of that
 * designation is up to each network. The Internetwork Control
 * designation is intended for use by gateway control originators only.
 * If the actual use of these precedence designations is of concern to
 * a particular network, it is the responsibility of that network to
 * control the access to, and use of, those precedence designations.
 */

Marco IPTOS_PREC(tos)

#define IPTOS_PREC(tos)               ((tos) & IPTOS_PREC_MASK)


      

Marco IPTOS_PREC_NETCONTROL

#define IPTOS_PREC_NETCONTROL          0xe0


      

Marco IPTOS_PREC_INTERNETCONTROL

#define IPTOS_PREC_INTERNETCONTROL     0xc0


      

Marco IPTOS_PREC_CRITIC_ECP

#define IPTOS_PREC_CRITIC_ECP          0xa0


      

Marco IPTOS_PREC_FLASHOVERRIDE

#define IPTOS_PREC_FLASHOVERRIDE       128


      

Marco IPTOS_PREC_FLASH

#define IPTOS_PREC_FLASH               96


      

Marco IPTOS_PREC_IMMEDIATE

#define IPTOS_PREC_IMMEDIATE           64


      

Marco IPTOS_PREC_PRIORITY

#define IPTOS_PREC_PRIORITY            32


      

Marco IPTOS_PREC_ROUTINE

#define IPTOS_PREC_ROUTINE             0


      

Marco IOCPARM_MASK

#define IOCPARM_MASK   0x7fU          /* parameters must be < 128 bytes */


      

Marco IOC_VOID

#define IOC_VOID       0x20000000UL   /* no parameters */


      

Marco IOC_OUT

#define IOC_OUT        0x40000000UL   /* copy out parameters */


      

Marco IOC_IN

#define IOC_IN         0x80000000UL   /* copy in parameters */


      

Marco IOC_INOUT

#define IOC_INOUT      (IOC_IN|IOC_OUT)


      

Marco _IO(x,y)

#define _IO(x,y)       ((long)(IOC_VOID|((x)<<8)|(y)))


      

Marco _IOR(x,y,t)

#define _IOR(x,y,t)    ((long)(IOC_OUT|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)))


      

Marco _IOW(x,y,t)

#define _IOW(x,y,t)    ((long)(IOC_IN|((sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)))


      

Marco FIONREAD

#define FIONREAD   _IOR('f', 127, unsigned long) /* get # bytes to read */


      

Marco FIONBIO

#define FIONBIO    _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */


      

Marco SIOCSHIWAT

#define SIOCSHIWAT _IOW('s', 0, unsigned long) /* set high watermark */


      

Marco SIOCGHIWAT

#define SIOCGHIWAT _IOR('s', 1, unsigned long) /* get high watermark */


      

Marco SIOCSLOWAT

#define SIOCSLOWAT _IOW('s', 2, unsigned long) /* set low watermark */


      

Marco SIOCGLOWAT

#define SIOCGLOWAT _IOR('s', 3, unsigned long) /* get low watermark */


      

Marco SIOCATMARK

#define SIOCATMARK _IOR('s', 7, unsigned long) /* at oob mark? */


      

Marco F_GETFL

#define F_GETFL 3


      

Marco F_SETFL

#define F_SETFL 4


      

Marco O_NONBLOCK

#define O_NONBLOCK 1 /* nonblocking I/O */


      

Marco O_NDELAY

#define O_NDELAY   O_NONBLOCK /* same as O_NONBLOCK, for compatibility */


      

Marco O_RDONLY

#define O_RDONLY   2


      

Marco O_WRONLY

#define O_WRONLY   4


      

Marco O_RDWR

#define O_RDWR     (O_RDONLY|O_WRONLY)


      

Marco SHUT_RD

#define SHUT_RD  0


      

Marco SHUT_WR

#define SHUT_WR  1


      

Marco SHUT_RDWR

#define SHUT_RDWR 2


      

Marco FD_SETSIZE

#define FD_SETSIZE   MEMP_NUM_NETCONN
/* Make FD_SETSIZE match NUM_SOCKETS in socket.c */

Marco LWIP_SELECT_MAXNFDS

#define LWIP_SELECT_MAXNFDS (FD_SETSIZE + LWIP_SOCKET_OFFSET)


      

Marco FDSETSAFESET(n, code)

#define FDSETSAFESET(n, code) do { \
 if (((n) - LWIP_SOCKET_OFFSET < MEMP_NUM_NETCONN) && (((int)(n) - LWIP_SOCKET_OFFSET) >= 0)) { \
 code; }} while(0)


      

Marco FDSETSAFEGET(n, code)

#define FDSETSAFEGET(n, code) (((n) - LWIP_SOCKET_OFFSET < MEMP_NUM_NETCONN) && (((int)(n) - LWIP_SOCKET_OFFSET) >= 0) ?\
 (code) : 0)


      

Marco FD_SET(n, p)

#define FD_SET(n, p) FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] = (u8_t)((p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] | (1 << (((n)-LWIP_SOCKET_OFFSET) & 7))))


      

Marco FD_CLR(n, p)

#define FD_CLR(n, p) FDSETSAFESET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] = (u8_t)((p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] & ~(1 << (((n)-LWIP_SOCKET_OFFSET) & 7))))


      

Marco FD_ISSET(n,p)

#define FD_ISSET(n,p) FDSETSAFEGET(n, (p)->fd_bits[((n)-LWIP_SOCKET_OFFSET)/8] &  (1 << (((n)-LWIP_SOCKET_OFFSET) & 7)))


      

Marco FD_ZERO(p)

#define FD_ZERO(p)   memset((void*)(p), 0, sizeof(*(p)))


      

Marco LWIP_SELECT_MAXNFDS

#define LWIP_SELECT_MAXNFDS FD_SETSIZE


      

Marco POLLIN

#define POLLIN    1


      

Marco POLLOUT

#define POLLOUT   2


      

Marco POLLERR

#define POLLERR   4


      

Marco POLLNVAL

#define POLLNVAL  8


      

Marco POLLRDNORM

#define POLLRDNORM 16
/* Below values are unimplemented */

Marco POLLRDBAND

#define POLLRDBAND 32


      

Marco POLLPRI

#define POLLPRI   64


      

Marco POLLWRNORM

#define POLLWRNORM 128


      

Marco POLLWRBAND

#define POLLWRBAND 256


      

Marco POLLHUP

#define POLLHUP   512


      

Marco LWIP_TIMEVAL_PRIVATE

#define LWIP_TIMEVAL_PRIVATE 1


      

Marco lwip_socket_init()

#define lwip_socket_init() /* Compatibility define, no init needed. */


      

Marco lwip_accept

#define lwip_accept      accept
/* This helps code parsers/code completion by not having the COMPAT functions as defines */

Marco lwip_bind

#define lwip_bind        bind


      

Marco lwip_shutdown

#define lwip_shutdown    shutdown


      

Marco lwip_getpeername

#define lwip_getpeername getpeername


      

Marco lwip_getsockname

#define lwip_getsockname getsockname


      

Marco lwip_setsockopt

#define lwip_setsockopt  setsockopt


      

Marco lwip_getsockopt

#define lwip_getsockopt  getsockopt


      

Marco lwip_close

#define lwip_close       closesocket


      

Marco lwip_connect

#define lwip_connect     connect


      

Marco lwip_listen

#define lwip_listen      listen


      

Marco lwip_recv

#define lwip_recv        recv


      

Marco lwip_recvmsg

#define lwip_recvmsg     recvmsg


      

Marco lwip_recvfrom

#define lwip_recvfrom    recvfrom


      

Marco lwip_send

#define lwip_send        send


      

Marco lwip_sendmsg

#define lwip_sendmsg     sendmsg


      

Marco lwip_sendto

#define lwip_sendto      sendto


      

Marco lwip_socket

#define lwip_socket      socket


      

Marco lwip_select

#define lwip_select      select


      

Marco lwip_poll

#define lwip_poll        poll


      

Marco lwip_ioctl

#define lwip_ioctl       ioctlsocket


      

Marco lwip_inet_ntop

#define lwip_inet_ntop   inet_ntop


      

Marco lwip_inet_pton

#define lwip_inet_pton   inet_pton


      

Marco lwip_read

#define lwip_read        read


      

Marco lwip_readv

#define lwip_readv       readv


      

Marco lwip_write

#define lwip_write       write


      

Marco lwip_writev

#define lwip_writev      writev


      

Marco lwip_close

#define lwip_close       close


      

Marco closesocket(s)

#define closesocket(s)   close(s)


      

Marco lwip_ioctl

#define lwip_ioctl       ioctl


      

Marco ioctlsocket

#define ioctlsocket      ioctl


      

Marco accept(s,addr,addrlen)

#define accept(s,addr,addrlen)                   lwip_accept(s,addr,addrlen)
/** @ingroup socket */

Marco bind(s,name,namelen)

#define bind(s,name,namelen)                     lwip_bind(s,name,namelen)
/** @ingroup socket */

Marco shutdown(s,how)

#define shutdown(s,how)                          lwip_shutdown(s,how)
/** @ingroup socket */

Marco getpeername(s,name,namelen)

#define getpeername(s,name,namelen)              lwip_getpeername(s,name,namelen)
/** @ingroup socket */

Marco getsockname(s,name,namelen)

#define getsockname(s,name,namelen)              lwip_getsockname(s,name,namelen)
/** @ingroup socket */

Marco setsockopt(s,level,optname,opval,optlen)

#define setsockopt(s,level,optname,opval,optlen) lwip_setsockopt(s,level,optname,opval,optlen)
/** @ingroup socket */

Marco getsockopt(s,level,optname,opval,optlen)

#define getsockopt(s,level,optname,opval,optlen) lwip_getsockopt(s,level,optname,opval,optlen)
/** @ingroup socket */

Marco closesocket(s)

#define closesocket(s)                           lwip_close(s)
/** @ingroup socket */

Marco connect(s,name,namelen)

#define connect(s,name,namelen)                  lwip_connect(s,name,namelen)
/** @ingroup socket */

Marco listen(s,backlog)

#define listen(s,backlog)                        lwip_listen(s,backlog)
/** @ingroup socket */

Marco recv(s,mem,len,flags)

#define recv(s,mem,len,flags)                    lwip_recv(s,mem,len,flags)
/** @ingroup socket */

Marco recvmsg(s,message,flags)

#define recvmsg(s,message,flags)                 lwip_recvmsg(s,message,flags)
/** @ingroup socket */

Marco recvfrom(s,mem,len,flags,from,fromlen)

#define recvfrom(s,mem,len,flags,from,fromlen)   lwip_recvfrom(s,mem,len,flags,from,fromlen)
/** @ingroup socket */

Marco send(s,dataptr,size,flags)

#define send(s,dataptr,size,flags)               lwip_send(s,dataptr,size,flags)
/** @ingroup socket */

Marco sendmsg(s,message,flags)

#define sendmsg(s,message,flags)                 lwip_sendmsg(s,message,flags)
/** @ingroup socket */

Marco sendto(s,dataptr,size,flags,to,tolen)

#define sendto(s,dataptr,size,flags,to,tolen)    lwip_sendto(s,dataptr,size,flags,to,tolen)
/** @ingroup socket */

Marco socket(domain,type,protocol)

#define socket(domain,type,protocol)             lwip_socket(domain,type,protocol)
/** @ingroup socket */

Marco select(maxfdp1,readset,writeset,exceptset,timeout)

#define select(maxfdp1,readset,writeset,exceptset,timeout)    lwip_select(maxfdp1,readset,writeset,exceptset,timeout)
/** @ingroup socket */

Marco poll(fds,nfds,timeout)

#define poll(fds,nfds,timeout)                   lwip_poll(fds,nfds,timeout)
/** @ingroup socket */

Marco ioctlsocket(s,cmd,argp)

#define ioctlsocket(s,cmd,argp)                  lwip_ioctl(s,cmd,argp)
/** @ingroup socket */

Marco inet_ntop(af,src,dst,size)

#define inet_ntop(af,src,dst,size)               lwip_inet_ntop(af,src,dst,size)
/** @ingroup socket */

Marco inet_pton(af,src,dst)

#define inet_pton(af,src,dst)                    lwip_inet_pton(af,src,dst)
/** @ingroup socket */

Marco read(s,mem,len)

#define read(s,mem,len)                          lwip_read(s,mem,len)
/** @ingroup socket */

Marco readv(s,iov,iovcnt)

#define readv(s,iov,iovcnt)                      lwip_readv(s,iov,iovcnt)
/** @ingroup socket */

Marco write(s,dataptr,len)

#define write(s,dataptr,len)                     lwip_write(s,dataptr,len)
/** @ingroup socket */

Marco writev(s,iov,iovcnt)

#define writev(s,iov,iovcnt)                     lwip_writev(s,iov,iovcnt)
/** @ingroup socket */

Marco close(s)

#define close(s)                                 lwip_close(s)
/** @ingroup socket */

Marco fcntl(s,cmd,val)

#define fcntl(s,cmd,val)                         lwip_fcntl(s,cmd,val)
/** @ingroup socket */

Marco ioctl(s,cmd,argp)

#define ioctl(s,cmd,argp)                        lwip_ioctl(s,cmd,argp)
/** @ingroup socket */

Marco LWIP_HDR_STATS_H

#define LWIP_HDR_STATS_H


      

Marco LWIP_STATS_LARGE

#define LWIP_STATS_LARGE 0


      

Marco STAT_COUNTER

#define STAT_COUNTER    u32_t


      

Marco STAT_COUNTER_F

#define STAT_COUNTER_F  U32_F


      

Marco STAT_COUNTER

#define STAT_COUNTER    u16_t


      

Marco STAT_COUNTER_F

#define STAT_COUNTER_F  U16_F


      

Marco STATS_INC(x)

#define STATS_INC(x) ++lwip_stats.x


      

Marco STATS_DEC(x)

#define STATS_DEC(x) --lwip_stats.x


      

Marco STATS_INC_USED(x, y, type)

#define STATS_INC_USED(x, y, type) do { lwip_stats.x.used = (type)(lwip_stats.x.used + y); \
                               if (lwip_stats.x.max < lwip_stats.x.used) { \
                                   lwip_stats.x.max = lwip_stats.x.used; \
                               } \
                            } while(0)


      

Marco STATS_GET(x)

#define STATS_GET(x) lwip_stats.x


      

Marco stats_init

#define stats_init()


      

Marco STATS_INC

#define STATS_INC(x)


      

Marco STATS_DEC

#define STATS_DEC(x)


      

Marco STATS_INC_USED

#define STATS_INC_USED(x, y, type)


      

Marco TCP_STATS_INC(x)

#define TCP_STATS_INC(x) STATS_INC(x)


      

Marco TCP_STATS_DISPLAY()

#define TCP_STATS_DISPLAY() stats_display_proto(&lwip_stats.tcp, "TCP")


      

Marco TCP_STATS_INC

#define TCP_STATS_INC(x)


      

Marco TCP_STATS_DISPLAY

#define TCP_STATS_DISPLAY()


      

Marco UDP_STATS_INC(x)

#define UDP_STATS_INC(x) STATS_INC(x)


      

Marco UDP_STATS_DISPLAY()

#define UDP_STATS_DISPLAY() stats_display_proto(&lwip_stats.udp, "UDP")


      

Marco UDP_STATS_INC

#define UDP_STATS_INC(x)


      

Marco UDP_STATS_DISPLAY

#define UDP_STATS_DISPLAY()


      

Marco ICMP_STATS_INC(x)

#define ICMP_STATS_INC(x) STATS_INC(x)


      

Marco ICMP_STATS_DISPLAY()

#define ICMP_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp, "ICMP")


      

Marco ICMP_STATS_INC

#define ICMP_STATS_INC(x)


      

Marco ICMP_STATS_DISPLAY

#define ICMP_STATS_DISPLAY()


      

Marco IGMP_STATS_INC(x)

#define IGMP_STATS_INC(x) STATS_INC(x)


      

Marco IGMP_STATS_DISPLAY()

#define IGMP_STATS_DISPLAY() stats_display_igmp(&lwip_stats.igmp, "IGMP")


      

Marco IGMP_STATS_INC

#define IGMP_STATS_INC(x)


      

Marco IGMP_STATS_DISPLAY

#define IGMP_STATS_DISPLAY()


      

Marco IP_STATS_INC(x)

#define IP_STATS_INC(x) STATS_INC(x)


      

Marco IP_STATS_DISPLAY()

#define IP_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip, "IP")


      

Marco IP_STATS_INC

#define IP_STATS_INC(x)


      

Marco IP_STATS_DISPLAY

#define IP_STATS_DISPLAY()


      

Marco IPFRAG_STATS_INC(x)

#define IPFRAG_STATS_INC(x) STATS_INC(x)


      

Marco IPFRAG_STATS_DISPLAY()

#define IPFRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG")


      

Marco IPFRAG_STATS_INC

#define IPFRAG_STATS_INC(x)


      

Marco IPFRAG_STATS_DISPLAY

#define IPFRAG_STATS_DISPLAY()


      

Marco ETHARP_STATS_INC(x)

#define ETHARP_STATS_INC(x) STATS_INC(x)


      

Marco ETHARP_STATS_DISPLAY()

#define ETHARP_STATS_DISPLAY() stats_display_proto(&lwip_stats.etharp, "ETHARP")


      

Marco ETHARP_STATS_INC

#define ETHARP_STATS_INC(x)


      

Marco ETHARP_STATS_DISPLAY

#define ETHARP_STATS_DISPLAY()


      
      
#define LINK_STATS_INC(x) STATS_INC(x)


      
      
#define LINK_STATS_DISPLAY() stats_display_proto(&lwip_stats.link, "LINK")


      
      
#define LINK_STATS_INC(x)


      
      
#define LINK_STATS_DISPLAY()


      

Marco MEM_STATS_AVAIL(x, y)

#define MEM_STATS_AVAIL(x, y) lwip_stats.mem.x = y


      

Marco MEM_STATS_INC(x)

#define MEM_STATS_INC(x) STATS_INC(mem.x)


      

Marco MEM_STATS_INC_USED(x, y)

#define MEM_STATS_INC_USED(x, y) STATS_INC_USED(mem, y, mem_size_t)


      

Marco MEM_STATS_DEC_USED(x, y)

#define MEM_STATS_DEC_USED(x, y) lwip_stats.mem.x = (mem_size_t)((lwip_stats.mem.x) - (y))


      

Marco MEM_STATS_DISPLAY()

#define MEM_STATS_DISPLAY() stats_display_mem(&lwip_stats.mem, "HEAP")


      

Marco MEM_STATS_AVAIL

#define MEM_STATS_AVAIL(x, y)


      

Marco MEM_STATS_INC

#define MEM_STATS_INC(x)


      

Marco MEM_STATS_INC_USED

#define MEM_STATS_INC_USED(x, y)


      

Marco MEM_STATS_DEC_USED

#define MEM_STATS_DEC_USED(x, y)


      

Marco MEM_STATS_DISPLAY

#define MEM_STATS_DISPLAY()


      

Marco MEMP_STATS_DEC(x, i)

#define MEMP_STATS_DEC(x, i) STATS_DEC(memp[i]->x)


      

Marco MEMP_STATS_DISPLAY(i)

#define MEMP_STATS_DISPLAY(i) stats_display_memp(lwip_stats.memp[i], i)


      

Marco MEMP_STATS_GET(x, i)

#define MEMP_STATS_GET(x, i) STATS_GET(memp[i]->x)


      

Marco MEMP_STATS_DEC

#define MEMP_STATS_DEC(x, i)


      

Marco MEMP_STATS_DISPLAY

#define MEMP_STATS_DISPLAY(i)


      

Marco MEMP_STATS_GET(x, i)

#define MEMP_STATS_GET(x, i) 0


      

Marco SYS_STATS_INC(x)

#define SYS_STATS_INC(x) STATS_INC(sys.x)


      

Marco SYS_STATS_DEC(x)

#define SYS_STATS_DEC(x) STATS_DEC(sys.x)


      

Marco SYS_STATS_INC_USED(x)

#define SYS_STATS_INC_USED(x) STATS_INC_USED(sys.x, 1, STAT_COUNTER)


      

Marco SYS_STATS_DISPLAY()

#define SYS_STATS_DISPLAY() stats_display_sys(&lwip_stats.sys)


      

Marco SYS_STATS_INC

#define SYS_STATS_INC(x)


      

Marco SYS_STATS_DEC

#define SYS_STATS_DEC(x)


      

Marco SYS_STATS_INC_USED

#define SYS_STATS_INC_USED(x)


      

Marco SYS_STATS_DISPLAY

#define SYS_STATS_DISPLAY()


      

Marco IP6_STATS_INC(x)

#define IP6_STATS_INC(x) STATS_INC(x)


      

Marco IP6_STATS_DISPLAY()

#define IP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6, "IPv6")


      

Marco IP6_STATS_INC

#define IP6_STATS_INC(x)


      

Marco IP6_STATS_DISPLAY

#define IP6_STATS_DISPLAY()


      

Marco ICMP6_STATS_INC(x)

#define ICMP6_STATS_INC(x) STATS_INC(x)


      

Marco ICMP6_STATS_DISPLAY()

#define ICMP6_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp6, "ICMPv6")


      

Marco ICMP6_STATS_INC

#define ICMP6_STATS_INC(x)


      

Marco ICMP6_STATS_DISPLAY

#define ICMP6_STATS_DISPLAY()


      

Marco IP6_FRAG_STATS_INC(x)

#define IP6_FRAG_STATS_INC(x) STATS_INC(x)


      

Marco IP6_FRAG_STATS_DISPLAY()

#define IP6_FRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip6_frag, "IPv6 FRAG")


      

Marco IP6_FRAG_STATS_INC

#define IP6_FRAG_STATS_INC(x)


      

Marco IP6_FRAG_STATS_DISPLAY

#define IP6_FRAG_STATS_DISPLAY()


      

Marco MLD6_STATS_INC(x)

#define MLD6_STATS_INC(x) STATS_INC(x)


      

Marco MLD6_STATS_DISPLAY()

#define MLD6_STATS_DISPLAY() stats_display_igmp(&lwip_stats.mld6, "MLDv1")


      

Marco MLD6_STATS_INC

#define MLD6_STATS_INC(x)


      

Marco MLD6_STATS_DISPLAY

#define MLD6_STATS_DISPLAY()


      

Marco ND6_STATS_INC(x)

#define ND6_STATS_INC(x) STATS_INC(x)


      

Marco ND6_STATS_DISPLAY()

#define ND6_STATS_DISPLAY() stats_display_proto(&lwip_stats.nd6, "ND")


      

Marco ND6_STATS_INC

#define ND6_STATS_INC(x)


      

Marco ND6_STATS_DISPLAY

#define ND6_STATS_DISPLAY()


      

Marco MIB2_STATS_INC(x)

#define MIB2_STATS_INC(x) STATS_INC(x)


      

Marco MIB2_STATS_INC

#define MIB2_STATS_INC(x)


      

Marco stats_display

#define stats_display()


      

Marco stats_display_proto

#define stats_display_proto(proto, name)


      

Marco stats_display_igmp

#define stats_display_igmp(igmp, name)


      

Marco stats_display_mem

#define stats_display_mem(mem, name)


      

Marco stats_display_memp

#define stats_display_memp(mem, index)


      

Marco stats_display_sys

#define stats_display_sys(sys)


      

Marco LWIP_HDR_SYS_H

#define LWIP_HDR_SYS_H


      

Marco sys_sem_new(s, c)

#define sys_sem_new(s, c) ERR_OK


      

Marco sys_sem_signal

#define sys_sem_signal(s)


      

Marco sys_sem_wait

#define sys_sem_wait(s)


      

Marco sys_arch_sem_wait

#define sys_arch_sem_wait(s,t)


      

Marco sys_sem_free

#define sys_sem_free(s)


      

Marco sys_sem_valid(s)

#define sys_sem_valid(s) 0


      

Marco sys_sem_valid_val(s)

#define sys_sem_valid_val(s) 0


      

Marco sys_sem_set_invalid

#define sys_sem_set_invalid(s)


      

Marco sys_sem_set_invalid_val

#define sys_sem_set_invalid_val(s)


      

Marco sys_mutex_new(mu)

#define sys_mutex_new(mu) ERR_OK


      

Marco sys_mutex_lock

#define sys_mutex_lock(mu)


      

Marco sys_mutex_unlock

#define sys_mutex_unlock(mu)


      

Marco sys_mutex_free

#define sys_mutex_free(mu)


      

Marco sys_mutex_valid(mu)

#define sys_mutex_valid(mu) 0


      

Marco sys_mutex_set_invalid

#define sys_mutex_set_invalid(mu)


      

Marco sys_mbox_new(m, s)

#define sys_mbox_new(m, s) ERR_OK


      

Marco sys_mbox_fetch

#define sys_mbox_fetch(m,d)


      

Marco sys_mbox_tryfetch

#define sys_mbox_tryfetch(m,d)


      

Marco sys_mbox_post

#define sys_mbox_post(m,d)


      

Marco sys_mbox_trypost

#define sys_mbox_trypost(m,d)


      

Marco sys_mbox_free

#define sys_mbox_free(m)


      

Marco sys_mbox_valid

#define sys_mbox_valid(m)


      

Marco sys_mbox_valid_val

#define sys_mbox_valid_val(m)


      

Marco sys_mbox_set_invalid

#define sys_mbox_set_invalid(m)


      

Marco sys_mbox_set_invalid_val

#define sys_mbox_set_invalid_val(m)


      

Marco sys_thread_new

#define sys_thread_new(n,t,a,s,p)


      

Marco sys_msleep

#define sys_msleep(t)


      

Marco SYS_ARCH_TIMEOUT

#define SYS_ARCH_TIMEOUT 0xffffffffUL
/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */

Marco SYS_MBOX_EMPTY

#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT
/** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate.
 * For now we use the same magic value, but we allow this to change in future.
 */

Marco LWIP_COMPAT_MUTEX

#define LWIP_COMPAT_MUTEX 0


      

Marco sys_mutex_t

#define sys_mutex_t                  sys_sem_t
/* for old ports that don't have mutexes: define them to binary semaphores */

Marco sys_mutex_new(mutex)

#define sys_mutex_new(mutex)         sys_sem_new(mutex, 1)


      

Marco sys_mutex_lock(mutex)

#define sys_mutex_lock(mutex)        sys_sem_wait(mutex)


      

Marco sys_mutex_unlock(mutex)

#define sys_mutex_unlock(mutex)      sys_sem_signal(mutex)


      

Marco sys_mutex_free(mutex)

#define sys_mutex_free(mutex)        sys_sem_free(mutex)


      

Marco sys_mutex_valid(mutex)

#define sys_mutex_valid(mutex)       sys_sem_valid(mutex)


      

Marco sys_mutex_set_invalid(mutex)

#define sys_mutex_set_invalid(mutex) sys_sem_set_invalid(mutex)


      

Marco sys_sem_wait(sem)

#define sys_sem_wait(sem)                 sys_arch_sem_wait(sem, 0)
/** Wait for a semaphore - forever/no timeout */

Marco sys_sem_valid_val(sem)

#define sys_sem_valid_val(sem)      sys_sem_valid(&(sem))
/**
 * Same as sys_sem_valid() but taking a value, not a pointer
 */

Marco sys_sem_set_invalid_val(sem)

#define sys_sem_set_invalid_val(sem) sys_sem_set_invalid(&(sem))
/**
 * Same as sys_sem_set_invalid() but taking a value, not a pointer
 */

Marco sys_mbox_tryfetch(mbox, msg)

#define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg)
/**
 * For now, we map straight to sys_arch implementation.
 */

Marco sys_mbox_fetch(mbox, msg)

#define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0)


      

Marco sys_mbox_valid_val(mbox)

#define sys_mbox_valid_val(mbox)      sys_mbox_valid(&(mbox))
/**
 * Same as sys_mbox_valid() but taking a value, not a pointer
 */

Marco sys_mbox_set_invalid_val(mbox)

#define sys_mbox_set_invalid_val(mbox) sys_mbox_set_invalid(&(mbox))
/**
 * Same as sys_mbox_set_invalid() but taking a value, not a pointer
 */

Marco SYS_ARCH_DECL_PROTECT(lev)

#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev
/**
 * @ingroup sys_prot
 * SYS_ARCH_DECL_PROTECT
 * declare a protection variable. This macro will default to defining a variable of
 * type sys_prot_t. If a particular port needs a different implementation, then
 * this macro may be defined in sys_arch.h.
 */

Marco SYS_ARCH_PROTECT(lev)

#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect()
/**
 * @ingroup sys_prot
 * SYS_ARCH_PROTECT
 * Perform a "fast" protect. This could be implemented by
 * disabling interrupts for an embedded system or by using a semaphore or
 * mutex. The implementation should allow calling SYS_ARCH_PROTECT when
 * already protected. The old protection level is returned in the variable
 * "lev". This macro will default to calling the sys_arch_protect() function
 * which should be implemented in sys_arch.c. If a particular port needs a
 * different implementation, then this macro may be defined in sys_arch.h
 */

Marco SYS_ARCH_UNPROTECT(lev)

#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev)
/**
 * @ingroup sys_prot
 * SYS_ARCH_UNPROTECT
 * Perform a "fast" set of the protection level to "lev". This could be
 * implemented by setting the interrupt level to "lev" within the MACRO or by
 * using a semaphore or mutex.  This macro will default to calling the
 * sys_arch_unprotect() function which should be implemented in
 * sys_arch.c. If a particular port needs a different implementation, then
 * this macro may be defined in sys_arch.h
 */

Marco SYS_ARCH_DECL_PROTECT

#define SYS_ARCH_DECL_PROTECT(lev)


      

Marco SYS_ARCH_PROTECT

#define SYS_ARCH_PROTECT(lev)


      

Marco SYS_ARCH_UNPROTECT

#define SYS_ARCH_UNPROTECT(lev)


      

Marco SYS_ARCH_INC(var, val)

#define SYS_ARCH_INC(var, val) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               var += val; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)


      

Marco SYS_ARCH_DEC(var, val)

#define SYS_ARCH_DEC(var, val) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               var -= val; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)


      

Marco SYS_ARCH_GET(var, ret)

#define SYS_ARCH_GET(var, ret) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               ret = var; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)


      

Marco SYS_ARCH_SET(var, val)

#define SYS_ARCH_SET(var, val) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               var = val; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)


      

Marco SYS_ARCH_LOCKED(code)

#define SYS_ARCH_LOCKED(code) do { \
                               SYS_ARCH_DECL_PROTECT(old_level); \
                               SYS_ARCH_PROTECT(old_level); \
                               code; \
                               SYS_ARCH_UNPROTECT(old_level); \
                             } while(0)


      

Marco TUYA_APP_TCPIP_THREAD_PRIO_UP(prio)

#define TUYA_APP_TCPIP_THREAD_PRIO_UP(prio) tuya_app_tcpip_thread_prio_up(prio)


      

Marco TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio)

#define TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio) tuya_app_tcpip_thread_prio_back(prio)


      

Marco TUYA_APP_TCPIP_THREAD_PRIO_UP

#define TUYA_APP_TCPIP_THREAD_PRIO_UP(prio)


      

Marco TUYA_APP_TCPIP_THREAD_PRIO_BACK

#define TUYA_APP_TCPIP_THREAD_PRIO_BACK(prio)


      

Marco LWIP_HDR_TCP_H

#define LWIP_HDR_TCP_H


      

Marco RCV_WND_SCALE(pcb, wnd)

#define RCV_WND_SCALE(pcb, wnd) (((wnd) >> (pcb)->rcv_scale))


      

Marco SND_WND_SCALE(pcb, wnd)

#define SND_WND_SCALE(pcb, wnd) (((wnd) << (pcb)->snd_scale))


      

Marco TCPWND16(x)

#define TCPWND16(x)            ((u16_t)LWIP_MIN((x), 65535))


      

Marco TCP_WND_MAX(pcb)

#define TCP_WND_MAX(pcb)       ((tcpwnd_size_t)(((pcb)->flags & TF_WND_SCALE) ? TCP_WND : TCPWND16(TCP_WND)))


      

Marco RCV_WND_SCALE(pcb, wnd)

#define RCV_WND_SCALE(pcb, wnd) (wnd)


      

Marco SND_WND_SCALE(pcb, wnd)

#define SND_WND_SCALE(pcb, wnd) (wnd)


      

Marco TCPWND16(x)

#define TCPWND16(x)            (x)


      

Marco TCP_WND_MAX(pcb)

#define TCP_WND_MAX(pcb)       TCP_WND


      

Marco TCP_WND_INC(wnd, inc)

#define TCP_WND_INC(wnd, inc)  do { \
                                 if ((tcpwnd_size_t)(wnd + inc) >= wnd) { \
                                   wnd = (tcpwnd_size_t)(wnd + inc); \
                                 } else { \
                                   wnd = (tcpwnd_size_t)-1; \
                                 } \
                               } while(0)
/* Increments a tcpwnd_size_t and holds at max value rather than rollover */

Marco LWIP_TCP_PCB_NUM_EXT_ARG_ID_INVALID

#define LWIP_TCP_PCB_NUM_EXT_ARG_ID_INVALID 255


      

Marco TCP_PCB_EXTARGS

#define TCP_PCB_EXTARGS struct tcp_pcb_ext_args ext_args[LWIP_TCP_PCB_NUM_EXT_ARGS];
/* This is a helper define to prevent zero size arrays if disabled */

Marco TCP_PCB_EXTARGS

#define TCP_PCB_EXTARGS


      

Marco TCP_PCB_COMMON(type)

#define TCP_PCB_COMMON(type) \
 type *next; /* for the linked list */ \
 void *callback_arg; \
 TCP_PCB_EXTARGS \
 enum tcp_state state; /* TCP state */ \
 u8_t prio; \
 /* ports are in host byte order */ \
 u16_t local_port
/**
 * members common to struct tcp_pcb and struct tcp_listen_pcb
 */

Marco tcp_set_flags(pcb, set_flags)

#define         tcp_set_flags(pcb, set_flags)    do { (pcb)->flags = (tcpflags_t)((pcb)->flags | (set_flags)); } while(0)


      

Marco tcp_clear_flags(pcb, clr_flags)

#define         tcp_clear_flags(pcb, clr_flags)  do { (pcb)->flags = (tcpflags_t)((pcb)->flags & (tcpflags_t)(~(clr_flags) & TCP_ALLFLAGS)); } while(0)


      

Marco tcp_is_flag_set(pcb, flag)

#define         tcp_is_flag_set(pcb, flag)       (((pcb)->flags & (flag)) != 0)


      

Marco tcp_mss(pcb)

#define         tcp_mss(pcb)            (((pcb)->flags & TF_TIMESTAMP) ? ((pcb)->mss - 12) : (pcb)->mss)


      

Marco tcp_mss(pcb)

#define         tcp_mss(pcb)            ((pcb)->mss)
/** @ingroup tcp_raw */

Marco tcp_sndbuf(pcb)

#define         tcp_sndbuf(pcb)         (TCPWND16((pcb)->snd_buf))
/** @ingroup tcp_raw */

Marco tcp_sndqueuelen(pcb)

#define         tcp_sndqueuelen(pcb)    ((pcb)->snd_queuelen)
/** @ingroup tcp_raw */

Marco tcp_nagle_disable(pcb)

#define         tcp_nagle_disable(pcb)  tcp_set_flags(pcb, TF_NODELAY)
/** @ingroup tcp_raw */

Marco tcp_nagle_enable(pcb)

#define         tcp_nagle_enable(pcb)   tcp_clear_flags(pcb, TF_NODELAY)
/** @ingroup tcp_raw */

Marco tcp_nagle_disabled(pcb)

#define         tcp_nagle_disabled(pcb) tcp_is_flag_set(pcb, TF_NODELAY)
/** @ingroup tcp_raw */

Marco tcp_backlog_set(pcb, new_backlog)

#define         tcp_backlog_set(pcb, new_backlog) do { \
 LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", (pcb)->state == LISTEN); \
 ((struct tcp_pcb_listen *)(pcb))->backlog = ((new_backlog) ? (new_backlog) : 1); } while(0)


      

Marco tcp_backlog_set

#define         tcp_backlog_set(pcb, new_backlog)


      

Marco tcp_backlog_delayed

#define         tcp_backlog_delayed(pcb)


      

Marco tcp_backlog_accepted

#define         tcp_backlog_accepted(pcb)


      

Marco tcp_accepted(pcb)

#define         tcp_accepted(pcb) do { LWIP_UNUSED_ARG(pcb); } while(0) /* compatibility define, not needed any more */


      

Marco tcp_listen(pcb)

#define         tcp_listen(pcb) tcp_listen_with_backlog(pcb, TCP_DEFAULT_LISTEN_BACKLOG)
/** @ingroup tcp_raw */

Marco tcp_dbg_get_tcp_state(pcb)

#define tcp_dbg_get_tcp_state(pcb) ((pcb)->state)


      

Marco tcp_new_ip6()

#define tcp_new_ip6() tcp_new_ip_type(IPADDR_TYPE_V6)
/* for compatibility with older implementation */

Marco LWIP_HDR_TCPBASE_H

#define LWIP_HDR_TCPBASE_H


      

Marco TCP_STATE_IS_CLOSING(state)

#define TCP_STATE_IS_CLOSING(state) ((state) >= FIN_WAIT_1)
/* ATTENTION: this depends on state number ordering! */

Marco TCP_WRITE_FLAG_COPY

#define TCP_WRITE_FLAG_COPY 1
/* Flags for "apiflags" parameter in tcp_write */

Marco TCP_WRITE_FLAG_MORE

#define TCP_WRITE_FLAG_MORE 2


      

Marco TCP_PRIO_MIN

#define TCP_PRIO_MIN   1


      

Marco TCP_PRIO_NORMAL

#define TCP_PRIO_NORMAL 64


      

Marco TCP_PRIO_MAX

#define TCP_PRIO_MAX   127


      

Marco LWIP_HDR_TCPIP_H

#define LWIP_HDR_TCPIP_H


      

Marco LOCK_TCPIP_CORE()

#define LOCK_TCPIP_CORE()    sys_mutex_lock(&lock_tcpip_core)
/** Lock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */

Marco UNLOCK_TCPIP_CORE()

#define UNLOCK_TCPIP_CORE()  sys_mutex_unlock(&lock_tcpip_core)
/** Unlock lwIP core mutex (needs @ref LWIP_TCPIP_CORE_LOCKING 1) */

Marco LOCK_TCPIP_CORE

#define LOCK_TCPIP_CORE()


      

Marco UNLOCK_TCPIP_CORE

#define UNLOCK_TCPIP_CORE()


      

Marco tcpip_callback_with_block(function, ctx, block)

#define tcpip_callback_with_block(function, ctx, block) ((block != 0)? tcpip_callback(function, ctx) : tcpip_try_callback(function, ctx))
/**  @ingroup lwip_os
 * @deprecated use tcpip_try_callback() or tcpip_callback() instead
 */

Marco LWIP_HDR_TIMEOUTS_H

#define LWIP_HDR_TIMEOUTS_H


      

Marco LWIP_DEBUG_TIMERNAMES

#define LWIP_DEBUG_TIMERNAMES SYS_DEBUG


      

Marco LWIP_DEBUG_TIMERNAMES

#define LWIP_DEBUG_TIMERNAMES 0


      

Marco SYS_TIMEOUTS_SLEEPTIME_INFINITE

#define SYS_TIMEOUTS_SLEEPTIME_INFINITE 4294967295
/** Returned by sys_timeouts_sleeptime() to indicate there is no timer, so we
 * can sleep forever.
 */

Marco sys_timeout(msecs, handler, arg)

#define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler)


      

Marco LWIP_HDR_UDP_H

#define LWIP_HDR_UDP_H


      

Marco UDP_FLAGS_NOCHKSUM

#define UDP_FLAGS_NOCHKSUM      0x01U


      

Marco UDP_FLAGS_UDPLITE

#define UDP_FLAGS_UDPLITE       0x02U


      

Marco UDP_FLAGS_CONNECTED

#define UDP_FLAGS_CONNECTED     0x04U


      

Marco UDP_FLAGS_MULTICAST_LOOP

#define UDP_FLAGS_MULTICAST_LOOP 0x08U


      

Marco udp_flags(pcb)

#define         udp_flags(pcb) ((pcb)->flags)


      

Marco udp_setflags(pcb, f)

#define         udp_setflags(pcb, f) ((pcb)->flags = (f))


      

Marco udp_set_flags(pcb, set_flags)

#define         udp_set_flags(pcb, set_flags)    do { (pcb)->flags = (u8_t)((pcb)->flags | (set_flags)); } while(0)


      

Marco udp_clear_flags(pcb, clr_flags)

#define         udp_clear_flags(pcb, clr_flags)  do { (pcb)->flags = (u8_t)((pcb)->flags & (u8_t)(~(clr_flags) & 255)); } while(0)


      

Marco udp_is_flag_set(pcb, flag)

#define         udp_is_flag_set(pcb, flag)       (((pcb)->flags & (flag)) != 0)


      

Marco udp_new_ip6()

#define udp_new_ip6() udp_new_ip_type(IPADDR_TYPE_V6)
/* for compatibility with older implementation */

Marco udp_set_multicast_netif_addr(pcb, ip4addr)

#define udp_set_multicast_netif_addr(pcb, ip4addr) ip4_addr_copy((pcb)->mcast_ip4, *(ip4addr))


      

Marco udp_get_multicast_netif_addr(pcb)

#define udp_get_multicast_netif_addr(pcb)         (&(pcb)->mcast_ip4)


      

Marco udp_set_multicast_netif_index(pcb, idx)

#define udp_set_multicast_netif_index(pcb, idx)   ((pcb)->mcast_ifindex = (idx))


      

Marco udp_get_multicast_netif_index(pcb)

#define udp_get_multicast_netif_index(pcb)        ((pcb)->mcast_ifindex)


      

Marco udp_set_multicast_ttl(pcb, value)

#define udp_set_multicast_ttl(pcb, value)         ((pcb)->mcast_ttl = (value))


      

Marco udp_get_multicast_ttl(pcb)

#define udp_get_multicast_ttl(pcb)                ((pcb)->mcast_ttl)


      

Marco udp_debug_print

#define udp_debug_print(udphdr)


      

Marco LWIP_HDR_NETIF_BRIDGEIF_H

#define LWIP_HDR_NETIF_BRIDGEIF_H


      

Marco BR_FLOOD

#define BR_FLOOD ((bridgeif_portmask_t)-1)


      

Marco BRIDGEIF_INITDATA1(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, ethaddr)

#define BRIDGEIF_INITDATA1(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, ethaddr) {ethaddr, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries}
/** @ingroup bridgeif
 * Use this for constant initialization of a bridgeif_initdat_t
 * (ethaddr must be passed as ETH_ADDR())
 */

Marco BRIDGEIF_INITDATA2(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, e0, e1, e2, e3, e4, e5)

#define BRIDGEIF_INITDATA2(max_ports, max_fdb_dynamic_entries, max_fdb_static_entries, e0, e1, e2, e3, e4, e5) {{e0, e1, e2, e3, e4, e5}, max_ports, max_fdb_dynamic_entries, max_fdb_static_entries}
/** @ingroup bridgeif
 * Use this for constant initialization of a bridgeif_initdat_t
 * (each byte of ethaddr must be passed)
 */

Marco BRIDGEIF_DECL_PROTECT(lev)

#define BRIDGEIF_DECL_PROTECT(lev)   SYS_ARCH_DECL_PROTECT(lev)


      

Marco BRIDGEIF_READ_PROTECT(lev)

#define BRIDGEIF_READ_PROTECT(lev)   SYS_ARCH_PROTECT(lev)


      

Marco BRIDGEIF_READ_UNPROTECT(lev)

#define BRIDGEIF_READ_UNPROTECT(lev) SYS_ARCH_UNPROTECT(lev)


      

Marco BRIDGEIF_WRITE_PROTECT

#define BRIDGEIF_WRITE_PROTECT(lev)


      

Marco BRIDGEIF_WRITE_UNPROTECT

#define BRIDGEIF_WRITE_UNPROTECT(lev)


      

Marco BRIDGEIF_DECL_PROTECT

#define BRIDGEIF_DECL_PROTECT(lev)


      

Marco BRIDGEIF_READ_PROTECT

#define BRIDGEIF_READ_PROTECT(lev)


      

Marco BRIDGEIF_READ_UNPROTECT

#define BRIDGEIF_READ_UNPROTECT(lev)


      

Marco BRIDGEIF_WRITE_PROTECT

#define BRIDGEIF_WRITE_PROTECT(lev)


      

Marco BRIDGEIF_WRITE_UNPROTECT

#define BRIDGEIF_WRITE_UNPROTECT(lev)


      

Marco LWIP_HDR_NETIF_BRIDGEIF_OPTS_H

#define LWIP_HDR_NETIF_BRIDGEIF_OPTS_H


      

Marco BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT

#define BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT NO_SYS


      

Marco BRIDGEIF_MAX_PORTS

#define BRIDGEIF_MAX_PORTS                 7


      

Marco BRIDGEIF_DEBUG

#define BRIDGEIF_DEBUG                     LWIP_DBG_OFF


      

Marco BRIDGEIF_FDB_DEBUG

#define BRIDGEIF_FDB_DEBUG                 LWIP_DBG_OFF


      

Marco BRIDGEIF_FW_DEBUG

#define BRIDGEIF_FW_DEBUG                  LWIP_DBG_OFF


      

Marco LWIP_HDR_NETIF_ETHERNET_H

#define LWIP_HDR_NETIF_ETHERNET_H


      

Marco LWIP_ARP_FILTER_NETIF

#define LWIP_ARP_FILTER_NETIF 0


      

Marco LWIP_HDR_NETIF_IEEE802154_H

#define LWIP_HDR_NETIF_IEEE802154_H


      

Marco LWIP_HDR_LOWPAN6_H

#define LWIP_HDR_LOWPAN6_H


      

Marco LOWPAN6_TMR_INTERVAL

#define LOWPAN6_TMR_INTERVAL 1000
/** 1 second period for reassembly */

Marco LWIP_HDR_LOWPAN6_BLE_H

#define LWIP_HDR_LOWPAN6_BLE_H


      

Marco LWIP_HDR_LOWPAN6_COMMON_H

#define LWIP_HDR_LOWPAN6_COMMON_H


      

Marco LWIP_HDR_LOWPAN6_OPTS_H

#define LWIP_HDR_LOWPAN6_OPTS_H


      

Marco LWIP_6LOWPAN_NUM_CONTEXTS

#define LWIP_6LOWPAN_NUM_CONTEXTS       10


      

Marco LWIP_6LOWPAN_INFER_SHORT_ADDRESS

#define LWIP_6LOWPAN_INFER_SHORT_ADDRESS 1


      

Marco LWIP_6LOWPAN_IPHC

#define LWIP_6LOWPAN_IPHC               1


      

Marco LWIP_6LOWPAN_802154_HW_CRC

#define LWIP_6LOWPAN_802154_HW_CRC      0


      

Marco LWIP_6LOWPAN_CALC_CRC(buf, len)

#define LWIP_6LOWPAN_CALC_CRC(buf, len) lowpan6_calc_crc(buf, len)


      

Marco LWIP_LOWPAN6_DEBUG

#define LWIP_LOWPAN6_DEBUG              LWIP_DBG_OFF


      

Marco LWIP_LOWPAN6_802154_DEBUG

#define LWIP_LOWPAN6_802154_DEBUG       LWIP_DBG_OFF


      

Marco LWIP_LOWPAN6_IP_COMPRESSED_DEBUG

#define LWIP_LOWPAN6_IP_COMPRESSED_DEBUG     LWIP_DBG_OFF


      

Marco LWIP_LOWPAN6_DECOMPRESSION_DEBUG

#define LWIP_LOWPAN6_DECOMPRESSION_DEBUG     LWIP_DBG_OFF


      

Marco LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG

#define LWIP_RFC7668_IP_UNCOMPRESSED_DEBUG   LWIP_DBG_OFF


      

Marco LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS

#define LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS 1


      

Marco CCP_H

#define CCP_H


      

Marco CCP_CONFREQ

#define CCP_CONFREQ 1


      

Marco CCP_CONFACK

#define CCP_CONFACK 2


      

Marco CCP_TERMREQ

#define CCP_TERMREQ 5


      

Marco CCP_TERMACK

#define CCP_TERMACK 6


      

Marco CCP_RESETREQ

#define CCP_RESETREQ 14


      

Marco CCP_RESETACK

#define CCP_RESETACK 15


      

Marco CCP_MAX_OPTION_LENGTH

#define CCP_MAX_OPTION_LENGTH 32


      

Marco CCP_CODE(dp)

#define CCP_CODE(dp)	((dp)[0])


      

Marco CCP_ID(dp)

#define CCP_ID(dp)	((dp)[1])


      

Marco CCP_LENGTH(dp)

#define CCP_LENGTH(dp)	(((dp)[2] << 8) + (dp)[3])


      

Marco CCP_HDRLEN

#define CCP_HDRLEN	4


      

Marco CCP_OPT_CODE(dp)

#define CCP_OPT_CODE(dp) ((dp)[0])


      

Marco CCP_OPT_LENGTH(dp)

#define CCP_OPT_LENGTH(dp) ((dp)[1])


      

Marco CCP_OPT_MINLEN

#define CCP_OPT_MINLEN	2


      

Marco CI_BSD_COMPRESS

#define CI_BSD_COMPRESS	21 /* config. option for BSD-Compress */


      

Marco CILEN_BSD_COMPRESS

#define CILEN_BSD_COMPRESS 3 /* length of config. option */


      

Marco BSD_NBITS(x)

#define BSD_NBITS(x)	((x) & 31) /* number of bits requested */
/* Macros for handling the 3rd byte of the BSD-Compress config option. */

Marco BSD_VERSION(x)

#define BSD_VERSION(x)	((x) >> 5) /* version of option format */


      

Marco BSD_CURRENT_VERSION

#define BSD_CURRENT_VERSION 1	/* current version number */


      

Marco BSD_MAKE_OPT(v, n)

#define BSD_MAKE_OPT(v, n) (((v) << 5) | (n))


      

Marco BSD_MIN_BITS

#define BSD_MIN_BITS	9 /* smallest code size supported */


      

Marco BSD_MAX_BITS

#define BSD_MAX_BITS	15 /* largest code size supported */


      

Marco CI_DEFLATE

#define CI_DEFLATE	26 /* config option for Deflate */


      

Marco CI_DEFLATE_DRAFT

#define CI_DEFLATE_DRAFT 24 /* value used in original draft RFC */


      

Marco CILEN_DEFLATE

#define CILEN_DEFLATE	4 /* length of its config option */


      

Marco DEFLATE_MIN_SIZE

#define DEFLATE_MIN_SIZE 9


      

Marco DEFLATE_MAX_SIZE

#define DEFLATE_MAX_SIZE 15


      

Marco DEFLATE_METHOD_VAL

#define DEFLATE_METHOD_VAL 8


      

Marco DEFLATE_SIZE(x)

#define DEFLATE_SIZE(x)	(((x) >> 4) + 8)


      

Marco DEFLATE_METHOD(x)

#define DEFLATE_METHOD(x) ((x) & 15)


      

Marco DEFLATE_MAKE_OPT(w)

#define DEFLATE_MAKE_OPT(w) ((((w) - 8) << 4) + DEFLATE_METHOD_VAL)


      

Marco DEFLATE_CHK_SEQUENCE

#define DEFLATE_CHK_SEQUENCE 0


      

Marco CI_MPPE

#define CI_MPPE               18     /* config option for MPPE */


      

Marco CILEN_MPPE

#define CILEN_MPPE             6     /* length of config option */


      

Marco CI_PREDICTOR_1

#define CI_PREDICTOR_1	1 /* config option for Predictor-1 */


      

Marco CILEN_PREDICTOR_1

#define CILEN_PREDICTOR_1 2 /* length of its config option */


      

Marco CI_PREDICTOR_2

#define CI_PREDICTOR_2	2 /* config option for Predictor-2 */


      

Marco CILEN_PREDICTOR_2

#define CILEN_PREDICTOR_2 2 /* length of its config option */


      

Marco CHAP_H

#define CHAP_H


      

Marco CHAP_HDRLEN

#define CHAP_HDRLEN 4
/*
 * CHAP packets begin with a standard header with code, id, len (2 bytes).
 */

Marco CHAP_CHALLENGE

#define CHAP_CHALLENGE 1
/*
 * Values for the code field.
 */

Marco CHAP_RESPONSE

#define CHAP_RESPONSE 2


      

Marco CHAP_SUCCESS

#define CHAP_SUCCESS 3


      

Marco CHAP_FAILURE

#define CHAP_FAILURE 4


      

Marco CHAP_MD5

#define CHAP_MD5	5
/*
 * CHAP digest codes.
 */

Marco CHAP_MICROSOFT

#define CHAP_MICROSOFT	128


      

Marco CHAP_MICROSOFT_V2

#define CHAP_MICROSOFT_V2 129


      

Marco MAX_CHALLENGE_LEN

#define MAX_CHALLENGE_LEN 64
/*
 * Semi-arbitrary limits on challenge and response fields.
 */

Marco MAX_RESPONSE_LEN

#define MAX_RESPONSE_LEN 64


      

Marco CHAL_MAX_PKTLEN

#define CHAL_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_CHALLENGE_LEN + MAXNAMELEN)
/*
 * These limits apply to challenge and response packets we send.
 * The +4 is the +1 that we actually need rounded up.
 */

Marco RESP_MAX_PKTLEN

#define RESP_MAX_PKTLEN (PPP_HDRLEN + CHAP_HDRLEN + 4 + MAX_RESPONSE_LEN + MAXNAMELEN)


      

Marco MDTYPE_MICROSOFT_V2

#define MDTYPE_MICROSOFT_V2 1


      

Marco MDTYPE_MICROSOFT

#define MDTYPE_MICROSOFT 2


      

Marco MDTYPE_MD5

#define MDTYPE_MD5	4


      

Marco MDTYPE_NONE

#define MDTYPE_NONE	0


      

Marco CHAP_DIGEST(mdtype)

#define CHAP_DIGEST(mdtype) \
   ((mdtype) & MDTYPE_MD5)? CHAP_MD5: \
   ((mdtype) & MDTYPE_MICROSOFT_V2)? CHAP_MICROSOFT_V2: \
   ((mdtype) & MDTYPE_MICROSOFT)? CHAP_MICROSOFT: \
   0
/* Return the digest alg. ID for the most preferred digest type. */

Marco CHAP_DIGEST(mdtype)

#define CHAP_DIGEST(mdtype) \
   ((mdtype) & MDTYPE_MD5)? CHAP_MD5: \
   0


      

Marco CHAP_MDTYPE(mdtype)

#define CHAP_MDTYPE(mdtype) ((mdtype) ^ ((mdtype) - 1)) & (mdtype)
/* Return the bit flag (lsb set) for our most preferred digest type. */

Marco CHAP_MDTYPE_D(digest)

#define CHAP_MDTYPE_D(digest) \
   ((digest) == CHAP_MICROSOFT_V2)? MDTYPE_MICROSOFT_V2: \
   ((digest) == CHAP_MICROSOFT)? MDTYPE_MICROSOFT: \
   ((digest) == CHAP_MD5)? MDTYPE_MD5: \
   0


      

Marco CHAP_MDTYPE_D(digest)

#define CHAP_MDTYPE_D(digest) \
   ((digest) == CHAP_MD5)? MDTYPE_MD5: \
   0


      

Marco CHAP_CANDIGEST(mdtype, digest)

#define CHAP_CANDIGEST(mdtype, digest) \
   ((digest) == CHAP_MICROSOFT_V2)? (mdtype) & MDTYPE_MICROSOFT_V2: \
   ((digest) == CHAP_MICROSOFT)? (mdtype) & MDTYPE_MICROSOFT: \
   ((digest) == CHAP_MD5)? (mdtype) & MDTYPE_MD5: \
   0


      

Marco CHAP_CANDIGEST(mdtype, digest)

#define CHAP_CANDIGEST(mdtype, digest) \
   ((digest) == CHAP_MD5)? (mdtype) & MDTYPE_MD5: \
   0


      

Marco CHAPMS_INCLUDE

#define CHAPMS_INCLUDE


      

Marco PPP_EAP_H

#define PPP_EAP_H


      

Marco EAP_HEADERLEN

#define EAP_HEADERLEN 4
/*
 * Packet header = Code, id, length.
 */

Marco EAP_REQUEST

#define EAP_REQUEST 1
/* EAP message codes. */

Marco EAP_RESPONSE

#define EAP_RESPONSE 2


      

Marco EAP_SUCCESS

#define EAP_SUCCESS 3


      

Marco EAP_FAILURE

#define EAP_FAILURE 4


      

Marco EAPT_IDENTITY

#define EAPT_IDENTITY	1
/* EAP types */

Marco EAPT_NOTIFICATION

#define EAPT_NOTIFICATION 2


      

Marco EAPT_NAK

#define EAPT_NAK	3 /* (response only) */


      

Marco EAPT_MD5CHAP

#define EAPT_MD5CHAP	4


      

Marco EAPT_OTP

#define EAPT_OTP	5 /* One-Time Password; RFC 1938 */


      

Marco EAPT_TOKEN

#define EAPT_TOKEN	6 /* Generic Token Card */


      

Marco EAPT_RSA

#define EAPT_RSA	9 /* RSA Public Key Authentication */
/* 7 and 8 are unassigned. */

Marco EAPT_DSS

#define EAPT_DSS	10 /* DSS Unilateral */


      

Marco EAPT_KEA

#define EAPT_KEA	11 /* KEA */


      

Marco EAPT_KEA_VALIDATE

#define EAPT_KEA_VALIDATE 12 /* KEA-VALIDATE	*/


      

Marco EAPT_TLS

#define EAPT_TLS	13 /* EAP-TLS */


      

Marco EAPT_DEFENDER

#define EAPT_DEFENDER	14 /* Defender Token (AXENT) */


      

Marco EAPT_W2K

#define EAPT_W2K	15 /* Windows 2000 EAP */


      

Marco EAPT_ARCOT

#define EAPT_ARCOT	16 /* Arcot Systems */


      

Marco EAPT_CISCOWIRELESS

#define EAPT_CISCOWIRELESS 17 /* Cisco Wireless */


      

Marco EAPT_NOKIACARD

#define EAPT_NOKIACARD	18 /* Nokia IP smart card */


      

Marco EAPT_SRP

#define EAPT_SRP	19 /* Secure Remote Password */


      

Marco EAPSRP_CHALLENGE

#define EAPSRP_CHALLENGE 1 /* Request 1 - Challenge */
/* EAP SRP-SHA1 Subtypes */

Marco EAPSRP_CKEY

#define EAPSRP_CKEY	1 /* Response 1 - Client Key */


      

Marco EAPSRP_SKEY

#define EAPSRP_SKEY	2 /* Request 2 - Server Key */


      

Marco EAPSRP_CVALIDATOR

#define EAPSRP_CVALIDATOR 2 /* Response 2 - Client Validator */


      

Marco EAPSRP_SVALIDATOR

#define EAPSRP_SVALIDATOR 3 /* Request 3 - Server Validator */


      

Marco EAPSRP_ACK

#define EAPSRP_ACK	3 /* Response 3 - final ack */


      

Marco EAPSRP_LWRECHALLENGE

#define EAPSRP_LWRECHALLENGE 4 /* Req/resp 4 - Lightweight rechal */


      

Marco SRPVAL_EBIT

#define SRPVAL_EBIT 1 /* Use shared key for ECP */


      

Marco SRP_PSEUDO_ID

#define SRP_PSEUDO_ID "pseudo_"


      

Marco SRP_PSEUDO_LEN

#define SRP_PSEUDO_LEN 7


      

Marco MD5_SIGNATURE_SIZE

#define MD5_SIGNATURE_SIZE 16


      

Marco EAP_MIN_CHALLENGE_LENGTH

#define EAP_MIN_CHALLENGE_LENGTH 17


      

Marco EAP_MAX_CHALLENGE_LENGTH

#define EAP_MAX_CHALLENGE_LENGTH 24


      

Marco EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH

#define EAP_MIN_MAX_POWER_OF_TWO_CHALLENGE_LENGTH    3  /* 2^3-1 = 7, 17+7 = 24 */


      

Marco EAP_STATES

#define EAP_STATES \
 "Initial", "Pending", "Closed", "Listen", "Identify", \
 "SRP1", "SRP2", "SRP3", "MD5Chall", "Open", "SRP4", "BadAuth"


      

Marco eap_client_active(pcb)

#define eap_client_active(pcb) ((pcb)->eap.es_client.ea_state == eapListen)


      

Marco eap_server_active(pcb)

#define eap_server_active(pcb) \
 ((pcb)->eap.es_server.ea_state >= eapIdentify && \
 (pcb)->eap.es_server.ea_state <= eapMD5Chall)


      

Marco EAP_MAX_CHALLENGE_LENGTH

#define EAP_MAX_CHALLENGE_LENGTH 24


      

Marco EAP_DEFTIMEOUT

#define EAP_DEFTIMEOUT	3 /* Timeout (seconds) for rexmit */


      

Marco EAP_DEFTRANSMITS

#define EAP_DEFTRANSMITS 10 /* max # times to transmit */


      

Marco EAP_DEFREQTIME

#define EAP_DEFREQTIME	20 /* Time to wait for peer request */


      

Marco EAP_DEFALLOWREQ

#define EAP_DEFALLOWREQ	20 /* max # times to accept requests */


      

Marco ECP_H

#define ECP_H


      

Marco EUI64_H

#define EUI64_H


      

Marco eui64_iszero(e)

#define eui64_iszero(e)	(((e).e32[0] | (e).e32[1]) == 0)


      

Marco eui64_equals(e, o)

#define eui64_equals(e, o) (((e).e32[0] == (o).e32[0]) && \
			((e).e32[1] == (o).e32[1]))


      

Marco eui64_zero(e)

#define eui64_zero(e)	(e).e32[0] = (e).e32[1] = 0;


      

Marco eui64_copy(s, d)

#define eui64_copy(s, d) memcpy(&(d), &(s), sizeof(eui64_t))


      

Marco eui64_magic(e)

#define eui64_magic(e)	do {		\
			(e).e32[0] = magic(); \
			(e).e32[1] = magic(); \
			(e).e8[0] &= ~2; \
			} while (0)


      

Marco eui64_magic_nz(x)

#define eui64_magic_nz(x) do {			\
			eui64_magic(x);		\
			} while (eui64_iszero(x))


      

Marco eui64_magic_ne(x, y)

#define eui64_magic_ne(x, y) do {			\
			eui64_magic(x);		\
			} while (eui64_equals(x, y))


      

Marco eui64_get(ll, cp)

#define eui64_get(ll, cp) do {			\
			eui64_copy((*cp), (ll)); \
			(cp) += sizeof(eui64_t); \
			} while (0)


      

Marco eui64_put(ll, cp)

#define eui64_put(ll, cp) do {			\
			eui64_copy((ll), (*cp)); \
			(cp) += sizeof(eui64_t); \
			} while (0)


      

Marco eui64_set32(e, l)

#define eui64_set32(e, l) do {		\
			(e).e32[0] = 0;	\
			(e).e32[1] = lwip_htonl(l); \
			} while (0)


      

Marco eui64_setlo32(e, l)

#define eui64_setlo32(e, l) eui64_set32(e, l)


      

Marco FSM_H

#define FSM_H


      

Marco HEADERLEN

#define HEADERLEN 4
/*
 * Packet header = Code, id, length.
 */

Marco CONFREQ

#define CONFREQ	1 /* Configuration Request */
/*
 *  CP (LCP, IPCP, etc.) codes.
 */

Marco CONFACK

#define CONFACK	2 /* Configuration Ack */


      

Marco CONFNAK

#define CONFNAK	3 /* Configuration Nak */


      

Marco CONFREJ

#define CONFREJ	4 /* Configuration Reject */


      

Marco TERMREQ

#define TERMREQ	5 /* Termination Request */


      

Marco TERMACK

#define TERMACK	6 /* Termination Ack */


      

Marco CODEREJ

#define CODEREJ	7 /* Code Reject */


      

Marco PPP_FSM_INITIAL

#define PPP_FSM_INITIAL	0 /* Down, hasn't been opened */
/*
 * Link states.
 */

Marco PPP_FSM_STARTING

#define PPP_FSM_STARTING 1 /* Down, been opened */


      

Marco PPP_FSM_CLOSED

#define PPP_FSM_CLOSED	2 /* Up, hasn't been opened */


      

Marco PPP_FSM_STOPPED

#define PPP_FSM_STOPPED	3 /* Open, waiting for down event */


      

Marco PPP_FSM_CLOSING

#define PPP_FSM_CLOSING	4 /* Terminating the connection, not open */


      

Marco PPP_FSM_STOPPING

#define PPP_FSM_STOPPING 5 /* Terminating, but open */


      

Marco PPP_FSM_REQSENT

#define PPP_FSM_REQSENT	6 /* We've sent a Config Request */


      

Marco PPP_FSM_ACKRCVD

#define PPP_FSM_ACKRCVD	7 /* We've received a Config Ack */


      

Marco PPP_FSM_ACKSENT

#define PPP_FSM_ACKSENT	8 /* We've sent a Config Ack */


      

Marco PPP_FSM_OPENED

#define PPP_FSM_OPENED	9 /* Connection available */


      

Marco OPT_PASSIVE

#define OPT_PASSIVE 1 /* Don't die if we don't get a response */
/*
 * Flags - indicate options controlling FSM operation
 */

Marco OPT_RESTART

#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */


      

Marco OPT_SILENT

#define OPT_SILENT 4 /* Wait for peer to speak first */


      

Marco DEFTIMEOUT

#define DEFTIMEOUT 3 /* Timeout time in seconds */


      

Marco DEFMAXTERMREQS

#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */


      

Marco DEFMAXCONFREQS

#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */


      

Marco DEFMAXNAKLOOPS

#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */


      

Marco IPCP_H

#define IPCP_H


      

Marco CI_ADDRS

#define CI_ADDRS 1 /* IP Addresses */
/*
 * Options.
 */

Marco CI_COMPRESSTYPE

#define CI_COMPRESSTYPE 2 /* Compression Type */


      

Marco CI_ADDR

#define CI_ADDR	3


      

Marco CI_MS_DNS1

#define CI_MS_DNS1     129 /* Primary DNS value */


      

Marco CI_MS_DNS2

#define CI_MS_DNS2     131    /* Secondary DNS value */


      

Marco CI_MS_WINS1

#define CI_MS_WINS1    130    /* Primary WINS value */


      

Marco CI_MS_WINS2

#define CI_MS_WINS2    132 /* Secondary WINS value */


      

Marco MAX_STATES

#define MAX_STATES 16	/* from slcompress.h */


      

Marco IPCP_VJMODE_OLD

#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */


      

Marco IPCP_VJMODE_RFC1172

#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */


      

Marco IPCP_VJMODE_RFC1332

#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */


      

Marco IPCP_VJ_COMP

#define IPCP_VJ_COMP 2d /* current value for VJ compression option*/


      

Marco IPCP_VJ_COMP_OLD

#define IPCP_VJ_COMP_OLD 55 /* "old" (i.e, broken) value for VJ */


      

Marco IPV6CP_H

#define IPV6CP_H


      

Marco CI_IFACEID

#define CI_IFACEID 1 /* Interface Identifier */
/*
 * Options.
 */

Marco CI_COMPRESSTYPE

#define CI_COMPRESSTYPE 2 /* Compression Type     */


      

Marco LCP_H

#define LCP_H


      

Marco CI_VENDOR

#define CI_VENDOR 0 /* Vendor Specific */
/*
 * Options.
 */

Marco CI_MRU

#define CI_MRU	1 /* Maximum Receive Unit */


      

Marco CI_ASYNCMAP

#define CI_ASYNCMAP 2 /* Async Control Character Map */


      

Marco CI_AUTHTYPE

#define CI_AUTHTYPE 3 /* Authentication Type */


      

Marco CI_QUALITY

#define CI_QUALITY 4 /* Quality Protocol */


      

Marco CI_MAGICNUMBER

#define CI_MAGICNUMBER 5 /* Magic Number */


      

Marco CI_PCOMPRESSION

#define CI_PCOMPRESSION 7 /* Protocol Field Compression */


      

Marco CI_ACCOMPRESSION

#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */


      

Marco CI_FCSALTERN

#define CI_FCSALTERN 9 /* FCS-Alternatives */


      

Marco CI_SDP

#define CI_SDP	10 /* Self-Describing-Pad */


      

Marco CI_NUMBERED

#define CI_NUMBERED 11 /* Numbered-Mode */


      

Marco CI_CALLBACK

#define CI_CALLBACK 13 /* callback */


      

Marco CI_MRRU

#define CI_MRRU	17 /* max reconstructed receive unit; multilink */


      

Marco CI_SSNHF

#define CI_SSNHF 18 /* short sequence numbers for multilink */


      

Marco CI_EPDISC

#define CI_EPDISC 19 /* endpoint discriminator */


      

Marco CI_MPPLUS

#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */


      

Marco CI_LDISC

#define CI_LDISC 23 /* Link-Discriminator */


      

Marco CI_LCPAUTH

#define CI_LCPAUTH 24 /* LCP Authentication */


      

Marco CI_COBS

#define CI_COBS	25 /* Consistent Overhead Byte Stuffing */


      

Marco CI_PREFELIS

#define CI_PREFELIS 26 /* Prefix Elision */


      

Marco CI_MPHDRFMT

#define CI_MPHDRFMT 27 /* MP Header Format */


      

Marco CI_I18N

#define CI_I18N	28 /* Internationalization */


      

Marco CI_SDL

#define CI_SDL	29 /* Simple Data Link */


      

Marco PROTREJ

#define PROTREJ	8 /* Protocol Reject */
/*
 * LCP-specific packet types (code numbers).
 */

Marco ECHOREQ

#define ECHOREQ	9 /* Echo Request */


      

Marco ECHOREP

#define ECHOREP	10 /* Echo Reply */


      

Marco DISCREQ

#define DISCREQ	11 /* Discard Request */


      

Marco IDENTIF

#define IDENTIF	12 /* Identification */


      

Marco TIMEREM

#define TIMEREM	13 /* Time Remaining */


      

Marco CBCP_OPT

#define CBCP_OPT 6 /* Use callback control protocol */
/* Value used as data for CI_CALLBACK option */

Marco DEFMRU

#define DEFMRU 1500	/* Try for this */


      

Marco MINMRU

#define MINMRU 128	/* No MRUs below this */


      

Marco MAXMRU

#define MAXMRU 16384	/* Normally limit MRU to this */


      

Marco MAX_ENDP_LEN

#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */
/* An endpoint discriminator, used with multilink. */

Marco DEFLOOPBACKFAIL

#define DEFLOOPBACKFAIL 10
/* Default number of times we receive our magic number from the peer
   before deciding the link is looped-back. */

Marco MAGIC_H

#define MAGIC_H


      

Marco MPPE_H

#define MPPE_H


      

Marco MPPE_PAD

#define MPPE_PAD	4 /* MPPE growth per frame */


      

Marco MPPE_MAX_KEY_LEN

#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */


      

Marco MPPE_OPT_40

#define MPPE_OPT_40	1 /* 40 bit */
/* option bits for ccp_options.mppe */

Marco MPPE_OPT_128

#define MPPE_OPT_128	2 /* 128 bit */


      

Marco MPPE_OPT_STATEFUL

#define MPPE_OPT_STATEFUL 4 /* stateful mode */


      

Marco MPPE_OPT_56

#define MPPE_OPT_56	8 /* 56 bit */
/* unsupported opts */

Marco MPPE_OPT_MPPC

#define MPPE_OPT_MPPC	16 /* MPPC compression */


      

Marco MPPE_OPT_D

#define MPPE_OPT_D	32 /* Unknown */


      

Marco MPPE_OPT_UNSUPPORTED

#define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D)


      

Marco MPPE_OPT_UNKNOWN

#define MPPE_OPT_UNKNOWN 64 /* Bits !defined in RFC 3078 were set */


      

Marco MPPE_C_BIT

#define MPPE_C_BIT	1 /* MPPC */
/*
 * This is not nice ... the alternative is a bitfield struct though.
 * And unfortunately, we cannot share the same bits for the option
 * names above since C and H are the same bit.  We could do a u_int32
 * but then we have to do a lwip_htonl() all the time and/or we still need
 * to know which octet is which.
 */

Marco MPPE_D_BIT

#define MPPE_D_BIT	16 /* Obsolete, usage unknown */


      

Marco MPPE_L_BIT

#define MPPE_L_BIT	32 /* 40-bit */


      

Marco MPPE_S_BIT

#define MPPE_S_BIT	64 /* 128-bit */


      

Marco MPPE_M_BIT

#define MPPE_M_BIT	128 /* 56-bit, not supported */


      

Marco MPPE_H_BIT

#define MPPE_H_BIT	1 /* Stateless (in a different byte) */


      

Marco MPPE_ALL_BITS

#define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT)
/* Does not include H bit; used for least significant octet only. */

Marco MPPE_OPTS_TO_CI(opts, ci)

#define MPPE_OPTS_TO_CI(opts, ci)	\
   do {				\
 u_char *ptr = ci; /* u_char[4] */ \
					\
 /* H bit */			\
 if (opts & MPPE_OPT_STATEFUL)	\
    *ptr++ = 0;		\
 else				\
    *ptr++ = MPPE_H_BIT;	\
 *ptr++ = 0;			\
 *ptr++ = 0;			\
					\
 /* S,L bits */			\
 *ptr = 0;			\
 if (opts & MPPE_OPT_128)	\
    *ptr |= MPPE_S_BIT;		\
 if (opts & MPPE_OPT_40)		\
    *ptr |= MPPE_L_BIT;		\
 /* M,D,C bits not supported */	\
   } while (/* CONSTCOND */ 0)
/* Build a CI from mppe opts (see RFC 3078) */

Marco MPPE_CI_TO_OPTS(ci, opts)

#define MPPE_CI_TO_OPTS(ci, opts)	\
   do {				\
 const u_char *ptr = ci; /* u_char[4] */ \
					\
 opts = 0;			\
					\
 /* H bit */			\
 if (!(ptr[0] & MPPE_H_BIT))	\
    opts |= MPPE_OPT_STATEFUL;	\
					\
 /* S,L bits */			\
 if (ptr[3] & MPPE_S_BIT)	\
    opts |= MPPE_OPT_128;	\
 if (ptr[3] & MPPE_L_BIT)	\
    opts |= MPPE_OPT_40;	\
					\
 /* M,D,C bits */		\
 if (ptr[3] & MPPE_M_BIT)	\
    opts |= MPPE_OPT_56;	\
 if (ptr[3] & MPPE_D_BIT)	\
    opts |= MPPE_OPT_D;		\
 if (ptr[3] & MPPE_C_BIT)	\
    opts |= MPPE_OPT_MPPC;	\
					\
 /* Other bits */		\
 if (ptr[0] & ~MPPE_H_BIT)	\
    opts |= MPPE_OPT_UNKNOWN;	\
 if (ptr[1] || ptr[2])		\
    opts |= MPPE_OPT_UNKNOWN;	\
 if (ptr[3] & ~MPPE_ALL_BITS)	\
    opts |= MPPE_OPT_UNKNOWN;	\
   } while (/* CONSTCOND */ 0)
/* The reverse of the above */

Marco SHA1_PAD_SIZE

#define SHA1_PAD_SIZE 40
/* Shared MPPE padding between MSCHAP and MPPE */

Marco LWIP_INCLUDED_POLARSSL_ARC4_H

#define LWIP_INCLUDED_POLARSSL_ARC4_H


      

Marco LWIP_INCLUDED_POLARSSL_DES_H

#define LWIP_INCLUDED_POLARSSL_DES_H


      

Marco DES_ENCRYPT

#define DES_ENCRYPT    1


      

Marco DES_DECRYPT

#define DES_DECRYPT    0


      

Marco LWIP_INCLUDED_POLARSSL_MD4_H

#define LWIP_INCLUDED_POLARSSL_MD4_H


      

Marco LWIP_INCLUDED_POLARSSL_MD5_H

#define LWIP_INCLUDED_POLARSSL_MD5_H


      

Marco LWIP_INCLUDED_POLARSSL_SHA1_H

#define LWIP_INCLUDED_POLARSSL_SHA1_H


      

Marco PPP_H

#define PPP_H


      

Marco PPP_OPTIONS

#define PPP_OPTIONS        0


      

Marco PPP_NOTIFY

#define PPP_NOTIFY         0


      

Marco PPP_REMOTENAME

#define PPP_REMOTENAME     0


      

Marco PPP_IDLETIMELIMIT

#define PPP_IDLETIMELIMIT  0


      

Marco PPP_LCP_ADAPTIVE

#define PPP_LCP_ADAPTIVE   0


      

Marco PPP_MAXCONNECT

#define PPP_MAXCONNECT     0


      

Marco PPP_ALLOWED_ADDRS

#define PPP_ALLOWED_ADDRS  0


      

Marco PPP_PROTOCOLNAME

#define PPP_PROTOCOLNAME   0


      

Marco PPP_STATS_SUPPORT

#define PPP_STATS_SUPPORT  0


      

Marco DEFLATE_SUPPORT

#define DEFLATE_SUPPORT    0


      

Marco BSDCOMPRESS_SUPPORT

#define BSDCOMPRESS_SUPPORT 0


      

Marco PREDICTOR_SUPPORT

#define PREDICTOR_SUPPORT  0


      

Marco PPP_HDRLEN

#define PPP_HDRLEN 4 /* octets for standard ppp header */
/*
 * The basic PPP frame.
 */

Marco PPP_FCSLEN

#define PPP_FCSLEN 2 /* octets for FCS */


      

Marco PPP_PHASE_DEAD

#define PPP_PHASE_DEAD         0
/*
 * Values for phase.
 */

Marco PPP_PHASE_MASTER

#define PPP_PHASE_MASTER       1


      

Marco PPP_PHASE_HOLDOFF

#define PPP_PHASE_HOLDOFF      2


      

Marco PPP_PHASE_INITIALIZE

#define PPP_PHASE_INITIALIZE   3


      

Marco PPP_PHASE_SERIALCONN

#define PPP_PHASE_SERIALCONN   4


      

Marco PPP_PHASE_DORMANT

#define PPP_PHASE_DORMANT      5


      

Marco PPP_PHASE_ESTABLISH

#define PPP_PHASE_ESTABLISH    6


      

Marco PPP_PHASE_AUTHENTICATE

#define PPP_PHASE_AUTHENTICATE 7


      

Marco PPP_PHASE_CALLBACK

#define PPP_PHASE_CALLBACK     8


      

Marco PPP_PHASE_NETWORK

#define PPP_PHASE_NETWORK      9


      

Marco PPP_PHASE_RUNNING

#define PPP_PHASE_RUNNING      10


      

Marco PPP_PHASE_TERMINATE

#define PPP_PHASE_TERMINATE    11


      

Marco PPP_PHASE_DISCONNECT

#define PPP_PHASE_DISCONNECT   12


      

Marco PPPERR_NONE

#define PPPERR_NONE        0 /* No error. */
/* Error codes. */

Marco PPPERR_PARAM

#define PPPERR_PARAM       1 /* Invalid parameter. */


      

Marco PPPERR_OPEN

#define PPPERR_OPEN        2 /* Unable to open PPP session. */


      

Marco PPPERR_DEVICE

#define PPPERR_DEVICE      3 /* Invalid I/O device for PPP. */


      

Marco PPPERR_ALLOC

#define PPPERR_ALLOC       4 /* Unable to allocate resources. */


      

Marco PPPERR_USER

#define PPPERR_USER        5 /* User interrupt. */


      

Marco PPPERR_CONNECT

#define PPPERR_CONNECT     6 /* Connection lost. */


      

Marco PPPERR_AUTHFAIL

#define PPPERR_AUTHFAIL    7 /* Failed authentication challenge. */


      

Marco PPPERR_PROTOCOL

#define PPPERR_PROTOCOL    8 /* Failed to meet protocol. */


      

Marco PPPERR_PEERDEAD

#define PPPERR_PEERDEAD    9 /* Connection timeout */


      

Marco PPPERR_IDLETIMEOUT

#define PPPERR_IDLETIMEOUT 10 /* Idle Timeout */


      

Marco PPPERR_CONNECTTIME

#define PPPERR_CONNECTTIME 11 /* Max connect time reached */


      

Marco PPPERR_LOOPBACK

#define PPPERR_LOOPBACK    12 /* Loopback detected */


      

Marco PPP_AUTH_SUPPORT

#define PPP_AUTH_SUPPORT (PAP_SUPPORT || CHAP_SUPPORT || EAP_SUPPORT)
/* Whether auth support is enabled at all */

Marco PPPAUTHTYPE_NONE

#define PPPAUTHTYPE_NONE     0
/*
 * Set PPP authentication.
 *
 * Warning: Using PPPAUTHTYPE_ANY might have security consequences.
 * RFC 1994 says:
 *
 * In practice, within or associated with each PPP server, there is a
 * database which associates "user" names with authentication
 * information ("secrets").  It is not anticipated that a particular
 * named user would be authenticated by multiple methods.  This would
 * make the user vulnerable to attacks which negotiate the least secure
 * method from among a set (such as PAP rather than CHAP).  If the same
 * secret was used, PAP would reveal the secret to be used later with
 * CHAP.
 *
 * Instead, for each user name there should be an indication of exactly
 * one method used to authenticate that user name.  If a user needs to
 * make use of different authentication methods under different
 * circumstances, then distinct user names SHOULD be employed, each of
 * which identifies exactly one authentication method.
 *
 * Default is none auth type, unset (NULL) user and passwd.
 */

Marco PPPAUTHTYPE_PAP

#define PPPAUTHTYPE_PAP      1


      

Marco PPPAUTHTYPE_CHAP

#define PPPAUTHTYPE_CHAP     2


      

Marco PPPAUTHTYPE_MSCHAP

#define PPPAUTHTYPE_MSCHAP   4


      

Marco PPPAUTHTYPE_MSCHAP_V2

#define PPPAUTHTYPE_MSCHAP_V2 8


      

Marco PPPAUTHTYPE_EAP

#define PPPAUTHTYPE_EAP      16


      

Marco PPPAUTHTYPE_ANY

#define PPPAUTHTYPE_ANY      255


      

Marco ppp_set_auth_required(ppp, boolval)

#define ppp_set_auth_required(ppp, boolval) (ppp->settings.auth_required = boolval)
/*
 * If set, peer is required to authenticate. This is mostly necessary for PPP server support.
 *
 * Default is false.
 */

Marco ppp_set_ipcp_ouraddr(ppp, addr)

#define ppp_set_ipcp_ouraddr(ppp, addr) do { ppp->ipcp_wantoptions.ouraddr = ip4_addr_get_u32(addr); \
                                            ppp->ask_for_local = ppp->ipcp_wantoptions.ouraddr != 0; } while(0)
/*
 * Set PPP interface "our" and "his" IPv4 addresses. This is mostly necessary for PPP server
 * support but it can also be used on a PPP link where each side choose its own IP address.
 *
 * Default is unset (0.0.0.0).
 */

Marco ppp_set_ipcp_hisaddr(ppp, addr)

#define ppp_set_ipcp_hisaddr(ppp, addr) (ppp->ipcp_wantoptions.hisaddr = ip4_addr_get_u32(addr))


      

Marco ppp_set_ipcp_dnsaddr(ppp, index, addr)

#define ppp_set_ipcp_dnsaddr(ppp, index, addr) (ppp->ipcp_allowoptions.dnsaddr[index] = ip4_addr_get_u32(addr))
/*
 * Set DNS server addresses that are sent if the peer asks for them. This is mostly necessary
 * for PPP server support.
 *
 * Default is unset (0.0.0.0).
 */

Marco ppp_set_usepeerdns(ppp, boolval)

#define ppp_set_usepeerdns(ppp, boolval) (ppp->settings.usepeerdns = boolval)
/*
 * If set, we ask the peer for up to 2 DNS server addresses. Received DNS server addresses are
 * registered using the dns_setserver() function.
 *
 * Default is false.
 */

Marco PPP_MPPE_DISABLE

#define PPP_MPPE_DISABLE          0
/* Disable MPPE (Microsoft Point to Point Encryption). This parameter is exclusive. */

Marco PPP_MPPE_ENABLE

#define PPP_MPPE_ENABLE           1
/* Require the use of MPPE (Microsoft Point to Point Encryption). */

Marco PPP_MPPE_ALLOW_STATEFUL

#define PPP_MPPE_ALLOW_STATEFUL   2
/* Allow MPPE to use stateful mode. Stateless mode is still attempted first. */

Marco PPP_MPPE_REFUSE_40

#define PPP_MPPE_REFUSE_40        4
/* Refuse the use of MPPE with 40-bit encryption. Conflict with PPP_MPPE_REFUSE_128. */

Marco PPP_MPPE_REFUSE_128

#define PPP_MPPE_REFUSE_128       8
/* Refuse the use of MPPE with 128-bit encryption. Conflict with PPP_MPPE_REFUSE_40. */

Marco ppp_set_listen_time(ppp, intval)

#define ppp_set_listen_time(ppp, intval) (ppp->settings.listen_time = intval)
/*
 * Wait for up to intval milliseconds for a valid PPP packet from the peer.
 * At the end of this  time, or when a valid PPP packet is received from the
 * peer, we commence negotiation by sending our first LCP packet.
 *
 * Default is 0.
 */

Marco ppp_set_passive(ppp, boolval)

#define ppp_set_passive(ppp, boolval) (ppp->lcp_wantoptions.passive = boolval)
/*
 * If set, we will attempt to initiate a connection but if no reply is received from
 * the peer, we will then just wait passively for a valid LCP packet from the peer.
 *
 * Default is false.
 */

Marco ppp_set_silent(ppp, boolval)

#define ppp_set_silent(ppp, boolval) (ppp->lcp_wantoptions.silent = boolval)
/*
 * If set, we will not transmit LCP packets to initiate a connection until a valid
 * LCP packet is received from the peer. This is what we usually call the server mode.
 *
 * Default is false.
 */

Marco ppp_set_neg_pcomp(ppp, boolval)

#define ppp_set_neg_pcomp(ppp, boolval) (ppp->lcp_wantoptions.neg_pcompression = \
                                        ppp->lcp_allowoptions.neg_pcompression = boolval)
/*
 * If set, enable protocol field compression negotiation in both the receive and
 * the transmit direction.
 *
 * Default is true.
 */

Marco ppp_set_neg_accomp(ppp, boolval)

#define ppp_set_neg_accomp(ppp, boolval) (ppp->lcp_wantoptions.neg_accompression = \
                                         ppp->lcp_allowoptions.neg_accompression = boolval)
/*
 * If set, enable Address/Control compression in both the receive and the transmit
 * direction.
 *
 * Default is true.
 */

Marco ppp_set_neg_asyncmap(ppp, boolval)

#define ppp_set_neg_asyncmap(ppp, boolval) (ppp->lcp_wantoptions.neg_asyncmap = \
                                           ppp->lcp_allowoptions.neg_asyncmap = boolval)
/*
 * If set, enable asyncmap negotiation. Otherwise forcing all control characters to
 * be escaped for both the transmit and the receive direction.
 *
 * Default is true.
 */

Marco ppp_set_asyncmap(ppp, intval)

#define ppp_set_asyncmap(ppp, intval) (ppp->lcp_wantoptions.asyncmap = intval)
/*
 * This option sets the Async-Control-Character-Map (ACCM) for this end of the link.
 * The ACCM is a set of 32 bits, one for each of the ASCII control characters with
 * values from 0 to 31, where a 1 bit  indicates that the corresponding control
 * character should not be used in PPP packets sent to this system. The map is
 * an unsigned 32 bits integer where the least significant bit (00000001) represents
 * character 0 and the most significant bit (80000000) represents character 31.
 * We will then ask the peer to send these characters as a 2-byte escape sequence.
 *
 * Default is 0.
 */

Marco ppp_set_default(ppp)

#define ppp_set_default(ppp)        netif_set_default(ppp->netif)
/*
 * Set a PPP interface as the default network interface
 * (used to output all packets for which no specific route is found).
 */

Marco PPPCTLG_UPSTATUS

#define PPPCTLG_UPSTATUS 0
/*
 * PPP IOCTL commands.
 *
 * Get the up status - 0 for down, non-zero for up.  The argument must
 * point to an int.
 */

Marco PPPCTLG_ERRCODE

#define PPPCTLG_ERRCODE 1
/*
 * Get the PPP error code.  The argument must point to an int.
 * Returns a PPPERR_* value.
 */

Marco PPPCTLG_FD

#define PPPCTLG_FD      2
/*
 * Get the fd associated with a PPP over serial
 */

Marco ppp_netif(ppp)

#define ppp_netif(ppp)              (ppp->netif)
/* Get the PPP netif interface */

Marco ppp_set_netif_statuscallback(ppp, status_cb)

#define ppp_set_netif_statuscallback(ppp, status_cb)      \
       netif_set_status_callback(ppp->netif, status_cb);
/* Set an lwIP-style status-callback for the selected PPP device */
#define ppp_set_netif_linkcallback(ppp, link_cb)          \
       netif_set_link_callback(ppp->netif, link_cb);
/* Set an lwIP-style link-callback for the selected PPP device */

Marco LWIP_HDR_PPP_IMPL_H

#define LWIP_HDR_PPP_IMPL_H


      

Marco PPP_CTRL_PBUF_TYPE

#define PPP_CTRL_PBUF_TYPE      PBUF_RAM


      

Marco PPP_CTRL_PBUF_MAX_SIZE

#define PPP_CTRL_PBUF_MAX_SIZE  512


      

Marco PPP_CTRL_PBUF_TYPE

#define PPP_CTRL_PBUF_TYPE      PBUF_POOL


      

Marco PPP_CTRL_PBUF_MAX_SIZE

#define PPP_CTRL_PBUF_MAX_SIZE  PBUF_POOL_BUFSIZE


      

Marco PPP_ADDRESS(p)

#define PPP_ADDRESS(p) (((u_char *)(p))[0])
/*
 * The basic PPP frame.
 */

Marco PPP_CONTROL(p)

#define PPP_CONTROL(p) (((u_char *)(p))[1])


      

Marco PPP_PROTOCOL(p)

#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3])


      

Marco PPP_ALLSTATIONS

#define PPP_ALLSTATIONS 255 /* All-Stations broadcast address */
/*
 * Significant octet values.
 */

Marco PPP_UI

#define PPP_UI	3 /* Unnumbered Information */


      

Marco PPP_FLAG

#define PPP_FLAG 7e /* Flag Sequence */


      

Marco PPP_ESCAPE

#define PPP_ESCAPE 7d /* Asynchronous Control Escape */


      

Marco PPP_TRANS

#define PPP_TRANS 32 /* Asynchronous transparency modifier */


      

Marco PPP_IP

#define PPP_IP	33 /* Internet Protocol */
/*
 * Protocol field values.
 */

Marco PPP_AT

#define PPP_AT	41 /* AppleTalk Protocol */


      

Marco PPP_IPX

#define PPP_IPX	2b /* IPX protocol */


      

Marco PPP_VJC_COMP

#define PPP_VJC_COMP 2d /* VJ compressed TCP */


      

Marco PPP_VJC_UNCOMP

#define PPP_VJC_UNCOMP 47 /* VJ uncompressed TCP */


      

Marco PPP_IPV6

#define PPP_IPV6 87 /* Internet Protocol Version 6 */


      

Marco PPP_COMP

#define PPP_COMP 15d /* compressed packet */


      

Marco PPP_IPCP

#define PPP_IPCP 32801 /* IP Control Protocol */


      

Marco PPP_ATCP

#define PPP_ATCP 32809 /* AppleTalk Control Protocol */


      

Marco PPP_IPXCP

#define PPP_IPXCP 2050b /* IPX Control Protocol */


      

Marco PPP_IPV6CP

#define PPP_IPV6CP 32855 /* IPv6 Control Protocol */


      

Marco PPP_CCP

#define PPP_CCP	2063d /* Compression Control Protocol */


      

Marco PPP_ECP

#define PPP_ECP	32851 /* Encryption Control Protocol */


      

Marco PPP_LCP

#define PPP_LCP	0xc021 /* Link Control Protocol */


      

Marco PPP_PAP

#define PPP_PAP	0xc023 /* Password Authentication Protocol */


      

Marco PPP_LQR

#define PPP_LQR	0xc025 /* Link Quality Report protocol */


      

Marco PPP_CHAP

#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */


      

Marco PPP_CBCP

#define PPP_CBCP 0xc029 /* Callback Control Protocol */


      

Marco PPP_EAP

#define PPP_EAP	0xc227 /* Extensible Authentication Protocol */


      

Marco EPD_NULL

#define EPD_NULL 0 /* null discriminator, no data */
/* values for epdisc.class */

Marco EPD_LOCAL

#define EPD_LOCAL 1


      

Marco EPD_IP

#define EPD_IP	2


      

Marco EPD_MAC

#define EPD_MAC	3


      

Marco EPD_MAGIC

#define EPD_MAGIC 4


      

Marco EPD_PHONENUM

#define EPD_PHONENUM 5


      

Marco PPP_OCTETS_DIRECTION_SUM

#define PPP_OCTETS_DIRECTION_SUM       0


      

Marco PPP_OCTETS_DIRECTION_IN

#define PPP_OCTETS_DIRECTION_IN        1


      

Marco PPP_OCTETS_DIRECTION_OUT

#define PPP_OCTETS_DIRECTION_OUT       2


      

Marco PPP_OCTETS_DIRECTION_MAXOVERAL

#define PPP_OCTETS_DIRECTION_MAXOVERAL 3


      

Marco PPP_OCTETS_DIRECTION_MAXSESSION

#define PPP_OCTETS_DIRECTION_MAXSESSION 4
/* same as previos, but little different on RADIUS side */

Marco PPP_DATAINPUT

#define PPP_DATAINPUT 0
/* Data input may be used by CCP and ECP, remove this entry
 * from struct protent to save some flash
 */

Marco PAP_WITHPEER

#define PAP_WITHPEER 1


      

Marco PAP_PEER

#define PAP_PEER 2


      

Marco CHAP_WITHPEER

#define CHAP_WITHPEER 4


      

Marco CHAP_PEER

#define CHAP_PEER 8


      

Marco EAP_WITHPEER

#define EAP_WITHPEER 16


      

Marco EAP_PEER

#define EAP_PEER 32


      

Marco CHAP_MD5_WITHPEER

#define CHAP_MD5_WITHPEER 64


      

Marco CHAP_MD5_PEER

#define CHAP_MD5_PEER	128


      

Marco CHAP_MS_SHIFT

#define CHAP_MS_SHIFT	8 /* LSB position for MS auths */


      

Marco CHAP_MS_WITHPEER

#define CHAP_MS_WITHPEER 256


      

Marco CHAP_MS_PEER

#define CHAP_MS_PEER	512


      

Marco CHAP_MS2_WITHPEER

#define CHAP_MS2_WITHPEER 1024


      

Marco CHAP_MS2_PEER

#define CHAP_MS2_PEER	2048


      

Marco CHAP_MDTYPE_SUPPORTED

#define CHAP_MDTYPE_SUPPORTED (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5)


      

Marco CHAP_MDTYPE_SUPPORTED

#define CHAP_MDTYPE_SUPPORTED (MDTYPE_MD5)


      

Marco CHAP_MDTYPE_SUPPORTED

#define CHAP_MDTYPE_SUPPORTED (MDTYPE_NONE)


      

Marco GETCHAR(c, cp)

#define GETCHAR(c, cp) { \
 (c) = *(cp)++; \
}
/*
 * Inline versions of get/put char/short/long.
 * Pointer is advanced; we assume that both arguments
 * are lvalues and will already be in registers.
 * cp MUST be u_char *.
 */

Marco PUTCHAR(c, cp)

#define PUTCHAR(c, cp) { \
 *(cp)++ = (u_char) (c); \
}


      

Marco GETSHORT(s, cp)

#define GETSHORT(s, cp) { \
 (s) = *(cp)++ << 8; \
 (s) |= *(cp)++; \
}


      

Marco PUTSHORT(s, cp)

#define PUTSHORT(s, cp) { \
 *(cp)++ = (u_char) ((s) >> 8); \
 *(cp)++ = (u_char) (s); \
}


      

Marco GETLONG(l, cp)

#define GETLONG(l, cp) { \
 (l) = *(cp)++ << 8; \
 (l) |= *(cp)++; (l) <<= 8; \
 (l) |= *(cp)++; (l) <<= 8; \
 (l) |= *(cp)++; \
}


      

Marco PUTLONG(l, cp)

#define PUTLONG(l, cp) { \
 *(cp)++ = (u_char) ((l) >> 24); \
 *(cp)++ = (u_char) ((l) >> 16); \
 *(cp)++ = (u_char) ((l) >> 8); \
 *(cp)++ = (u_char) (l); \
}


      

Marco INCPTR(n, cp)

#define INCPTR(n, cp) ((cp) += (n))


      

Marco DECPTR(n, cp)

#define DECPTR(n, cp) ((cp) -= (n))


      

Marco TIMEOUT(f, a, t)

#define TIMEOUT(f, a, t)       do { sys_untimeout((f), (a)); sys_timeout((t)*1000, (f), (a)); } while(0)
/*
 * System dependent definitions for user-level 4.3BSD UNIX implementation.
 */

Marco TIMEOUTMS(f, a, t)

#define TIMEOUTMS(f, a, t)     do { sys_untimeout((f), (a)); sys_timeout((t), (f), (a)); } while(0)


      

Marco UNTIMEOUT(f, a)

#define UNTIMEOUT(f, a)        sys_untimeout((f), (a))


      

Marco BZERO(s, n)

#define BZERO(s, n)	memset(s, 0, n)


      

Marco BCMP(s1, s2, l)

#define BCMP(s1, s2, l)	memcmp(s1, s2, l)


      

Marco PRINTMSG(m, l)

#define PRINTMSG(m, l)	{ ppp_info("Remote message: %0.*v", l, m); }


      

Marco MAKEHEADER(p, t)

#define MAKEHEADER(p, t) { \
   PUTCHAR(PPP_ALLSTATIONS, p); \
   PUTCHAR(PPP_UI, p); \
   PUTSHORT(t, p); }
/*
 * MAKEHEADER - Add Header fields to a packet.
 */

Marco mp_bundle_terminated()

#define mp_bundle_terminated() /* nothing */


      

Marco mp_exit_bundle()

#define mp_exit_bundle() /* nothing */


      
      
#define doing_multilink	0


      
      
#define multilink_master 0


      

Marco LWIP_PPP_OPTS_H

#define LWIP_PPP_OPTS_H


      

Marco PPP_SUPPORT

#define PPP_SUPPORT                    0


      

Marco PPPOE_SUPPORT

#define PPPOE_SUPPORT                  0


      

Marco PPPOL2TP_SUPPORT

#define PPPOL2TP_SUPPORT               0


      

Marco PPPOL2TP_AUTH_SUPPORT

#define PPPOL2TP_AUTH_SUPPORT          PPPOL2TP_SUPPORT


      

Marco PPPOS_SUPPORT

#define PPPOS_SUPPORT                  PPP_SUPPORT


      

Marco LWIP_PPP_API

#define LWIP_PPP_API                   (PPP_SUPPORT && (NO_SYS == 0))


      

Marco MEMP_NUM_PPP_PCB

#define MEMP_NUM_PPP_PCB               1


      

Marco PPP_NUM_TIMEOUTS_PER_PCB

#define PPP_NUM_TIMEOUTS_PER_PCB       (1 + PPP_IPV4_SUPPORT + PPP_IPV6_SUPPORT + CCP_SUPPORT)


      

Marco PPP_NUM_TIMEOUTS

#define PPP_NUM_TIMEOUTS               (PPP_SUPPORT * PPP_NUM_TIMEOUTS_PER_PCB * MEMP_NUM_PPP_PCB)
/* The number of sys_timeouts required for the PPP module */

Marco MEMP_NUM_PPPOS_INTERFACES

#define MEMP_NUM_PPPOS_INTERFACES      MEMP_NUM_PPP_PCB


      

Marco MEMP_NUM_PPPOE_INTERFACES

#define MEMP_NUM_PPPOE_INTERFACES      1


      

Marco MEMP_NUM_PPPOL2TP_INTERFACES

#define MEMP_NUM_PPPOL2TP_INTERFACES      1


      

Marco MEMP_NUM_PPP_API_MSG

#define MEMP_NUM_PPP_API_MSG 5


      

Marco PPP_DEBUG

#define PPP_DEBUG                      LWIP_DBG_OFF


      

Marco PPP_INPROC_IRQ_SAFE

#define PPP_INPROC_IRQ_SAFE            0


      

Marco PRINTPKT_SUPPORT

#define PRINTPKT_SUPPORT               0


      

Marco PPP_IPV4_SUPPORT

#define PPP_IPV4_SUPPORT               (LWIP_IPV4)


      

Marco PPP_IPV6_SUPPORT

#define PPP_IPV6_SUPPORT               (LWIP_IPV6)


      

Marco PPP_NOTIFY_PHASE

#define PPP_NOTIFY_PHASE               0


      

Marco PPP_USE_PBUF_RAM

#define PPP_USE_PBUF_RAM               0


      

Marco PPP_FCS_TABLE

#define PPP_FCS_TABLE                  1


      

Marco PAP_SUPPORT

#define PAP_SUPPORT                    0


      

Marco CHAP_SUPPORT

#define CHAP_SUPPORT                   0


      

Marco MSCHAP_SUPPORT

#define MSCHAP_SUPPORT                 0


      

Marco CHAP_SUPPORT

#define CHAP_SUPPORT                   1


      

Marco EAP_SUPPORT

#define EAP_SUPPORT                    0


      

Marco CCP_SUPPORT

#define CCP_SUPPORT                    0


      

Marco MPPE_SUPPORT

#define MPPE_SUPPORT                   0


      

Marco CCP_SUPPORT

#define CCP_SUPPORT                    1


      

Marco MSCHAP_SUPPORT

#define MSCHAP_SUPPORT                 1


      

Marco CHAP_SUPPORT

#define CHAP_SUPPORT                   1


      

Marco CBCP_SUPPORT

#define CBCP_SUPPORT                   0


      

Marco ECP_SUPPORT

#define ECP_SUPPORT                    0


      

Marco DEMAND_SUPPORT

#define DEMAND_SUPPORT                 0


      

Marco LQR_SUPPORT

#define LQR_SUPPORT                    0


      

Marco PPP_SERVER

#define PPP_SERVER                     0


      

Marco PPP_OUR_NAME

#define PPP_OUR_NAME                   "lwIP"


      

Marco VJ_SUPPORT

#define VJ_SUPPORT                     1


      

Marco VJ_SUPPORT

#define VJ_SUPPORT                     0


      

Marco PPP_MD5_RANDM

#define PPP_MD5_RANDM                  (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT)


      

Marco LWIP_USE_EXTERNAL_POLARSSL

#define LWIP_USE_EXTERNAL_POLARSSL     0


      

Marco LWIP_USE_EXTERNAL_MBEDTLS

#define LWIP_USE_EXTERNAL_MBEDTLS      0


      

Marco FSM_DEFTIMEOUT

#define FSM_DEFTIMEOUT                 6


      

Marco FSM_DEFMAXTERMREQS

#define FSM_DEFMAXTERMREQS             2


      

Marco FSM_DEFMAXCONFREQS

#define FSM_DEFMAXCONFREQS             10


      

Marco FSM_DEFMAXNAKLOOPS

#define FSM_DEFMAXNAKLOOPS             5


      

Marco UPAP_DEFTIMEOUT

#define UPAP_DEFTIMEOUT                6


      

Marco UPAP_DEFTRANSMITS

#define UPAP_DEFTRANSMITS              10


      

Marco UPAP_DEFREQTIME

#define UPAP_DEFREQTIME                30


      

Marco CHAP_DEFTIMEOUT

#define CHAP_DEFTIMEOUT                6


      

Marco CHAP_DEFTRANSMITS

#define CHAP_DEFTRANSMITS              10


      

Marco CHAP_DEFRECHALLENGETIME

#define CHAP_DEFRECHALLENGETIME        0


      

Marco EAP_DEFREQTIME

#define EAP_DEFREQTIME                 6


      

Marco EAP_DEFALLOWREQ

#define EAP_DEFALLOWREQ                10


      

Marco EAP_DEFTIMEOUT

#define EAP_DEFTIMEOUT                 6


      

Marco EAP_DEFTRANSMITS

#define EAP_DEFTRANSMITS               10


      

Marco LCP_DEFLOOPBACKFAIL

#define LCP_DEFLOOPBACKFAIL            10


      

Marco LCP_ECHOINTERVAL

#define LCP_ECHOINTERVAL               0


      

Marco LCP_MAXECHOFAILS

#define LCP_MAXECHOFAILS               3


      

Marco PPP_MAXIDLEFLAG

#define PPP_MAXIDLEFLAG                100


      

Marco PPP_MRU

#define PPP_MRU                        1500


      

Marco PPP_DEFMRU

#define PPP_DEFMRU                     1500


      

Marco PPP_MAXMRU

#define PPP_MAXMRU                     1500


      

Marco PPP_MINMRU

#define PPP_MINMRU                     128


      

Marco PPPOL2TP_DEFMRU

#define PPPOL2TP_DEFMRU                1450


      

Marco MAXNAMELEN

#define MAXNAMELEN                     256


      

Marco MAXSECRETLEN

#define MAXSECRETLEN                   256


      

Marco LWIP_INCLUDED_POLARSSL_MD5

#define LWIP_INCLUDED_POLARSSL_MD5     1


      

Marco LWIP_INCLUDED_POLARSSL_MD4

#define LWIP_INCLUDED_POLARSSL_MD4     1
/* MSCHAP require MD4 support */

Marco LWIP_INCLUDED_POLARSSL_SHA1

#define LWIP_INCLUDED_POLARSSL_SHA1    1
/* MSCHAP require SHA1 support */

Marco LWIP_INCLUDED_POLARSSL_DES

#define LWIP_INCLUDED_POLARSSL_DES     1
/* MSCHAP require DES support */

Marco LWIP_INCLUDED_POLARSSL_ARC4

#define LWIP_INCLUDED_POLARSSL_ARC4    1
/* MPPE require ARC4 support */

Marco LWIP_INCLUDED_POLARSSL_MD4

#define LWIP_INCLUDED_POLARSSL_MD4     0


      

Marco LWIP_INCLUDED_POLARSSL_MD5

#define LWIP_INCLUDED_POLARSSL_MD5     0


      

Marco LWIP_INCLUDED_POLARSSL_SHA1

#define LWIP_INCLUDED_POLARSSL_SHA1    0


      

Marco LWIP_INCLUDED_POLARSSL_DES

#define LWIP_INCLUDED_POLARSSL_DES     0


      

Marco LWIP_INCLUDED_POLARSSL_ARC4

#define LWIP_INCLUDED_POLARSSL_ARC4    0


      

Marco PPP_NUM_TIMEOUTS

#define PPP_NUM_TIMEOUTS               0


      

Marco LWIP_PPPAPI_H

#define LWIP_PPPAPI_H


      

Marco PPPCRYPT_H

#define PPPCRYPT_H


      

Marco lwip_md4_context

#define lwip_md4_context md4_context


      

Marco lwip_md4_init

#define lwip_md4_init(context)


      

Marco lwip_md4_starts

#define lwip_md4_starts md4_starts


      

Marco lwip_md4_update

#define lwip_md4_update md4_update


      

Marco lwip_md4_finish

#define lwip_md4_finish md4_finish


      

Marco lwip_md4_free

#define lwip_md4_free(context)


      

Marco lwip_md5_context

#define lwip_md5_context md5_context


      

Marco lwip_md5_init

#define lwip_md5_init(context)


      

Marco lwip_md5_starts

#define lwip_md5_starts md5_starts


      

Marco lwip_md5_update

#define lwip_md5_update md5_update


      

Marco lwip_md5_finish

#define lwip_md5_finish md5_finish


      

Marco lwip_md5_free

#define lwip_md5_free(context)


      

Marco lwip_sha1_context

#define lwip_sha1_context sha1_context


      

Marco lwip_sha1_init

#define lwip_sha1_init(context)


      

Marco lwip_sha1_starts

#define lwip_sha1_starts sha1_starts


      

Marco lwip_sha1_update

#define lwip_sha1_update sha1_update


      

Marco lwip_sha1_finish

#define lwip_sha1_finish sha1_finish


      

Marco lwip_sha1_free

#define lwip_sha1_free(context)


      

Marco lwip_des_context

#define lwip_des_context des_context


      

Marco lwip_des_init

#define lwip_des_init(context)


      

Marco lwip_des_setkey_enc

#define lwip_des_setkey_enc des_setkey_enc


      

Marco lwip_des_crypt_ecb

#define lwip_des_crypt_ecb des_crypt_ecb


      

Marco lwip_des_free

#define lwip_des_free(context)


      

Marco lwip_arc4_context

#define lwip_arc4_context arc4_context


      

Marco lwip_arc4_init

#define lwip_arc4_init(context)


      

Marco lwip_arc4_setup

#define lwip_arc4_setup arc4_setup


      

Marco lwip_arc4_crypt

#define lwip_arc4_crypt arc4_crypt


      

Marco lwip_arc4_free

#define lwip_arc4_free(context)


      

Marco lwip_md4_context

#define lwip_md4_context mbedtls_md4_context


      

Marco lwip_md4_init

#define lwip_md4_init mbedtls_md4_init


      

Marco lwip_md4_starts

#define lwip_md4_starts mbedtls_md4_starts


      

Marco lwip_md4_update

#define lwip_md4_update mbedtls_md4_update


      

Marco lwip_md4_finish

#define lwip_md4_finish mbedtls_md4_finish


      

Marco lwip_md4_free

#define lwip_md4_free mbedtls_md4_free


      

Marco lwip_md5_context

#define lwip_md5_context mbedtls_md5_context


      

Marco lwip_md5_init

#define lwip_md5_init mbedtls_md5_init


      

Marco lwip_md5_starts

#define lwip_md5_starts mbedtls_md5_starts


      

Marco lwip_md5_update

#define lwip_md5_update mbedtls_md5_update


      

Marco lwip_md5_finish

#define lwip_md5_finish mbedtls_md5_finish


      

Marco lwip_md5_free

#define lwip_md5_free mbedtls_md5_free


      

Marco lwip_sha1_context

#define lwip_sha1_context mbedtls_sha1_context


      

Marco lwip_sha1_init

#define lwip_sha1_init mbedtls_sha1_init


      

Marco lwip_sha1_starts

#define lwip_sha1_starts mbedtls_sha1_starts


      

Marco lwip_sha1_update

#define lwip_sha1_update mbedtls_sha1_update


      

Marco lwip_sha1_finish

#define lwip_sha1_finish mbedtls_sha1_finish


      

Marco lwip_sha1_free

#define lwip_sha1_free mbedtls_sha1_free


      

Marco lwip_des_context

#define lwip_des_context mbedtls_des_context


      

Marco lwip_des_init

#define lwip_des_init mbedtls_des_init


      

Marco lwip_des_setkey_enc

#define lwip_des_setkey_enc mbedtls_des_setkey_enc


      

Marco lwip_des_crypt_ecb

#define lwip_des_crypt_ecb mbedtls_des_crypt_ecb


      

Marco lwip_des_free

#define lwip_des_free mbedtls_des_free


      

Marco lwip_arc4_context

#define lwip_arc4_context mbedtls_arc4_context


      

Marco lwip_arc4_init

#define lwip_arc4_init mbedtls_arc4_init


      

Marco lwip_arc4_setup

#define lwip_arc4_setup mbedtls_arc4_setup


      

Marco lwip_arc4_crypt(context, buffer, length)

#define lwip_arc4_crypt(context, buffer, length) mbedtls_arc4_crypt(context, length, buffer, buffer)


      

Marco lwip_arc4_free

#define lwip_arc4_free mbedtls_arc4_free


      

Marco PPPDEBUG_H

#define PPPDEBUG_H


      

Marco LOG_CRITICAL

#define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE)
/* Trace levels. */

Marco LOG_ERR

#define LOG_ERR      (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE)


      

Marco LOG_NOTICE

#define LOG_NOTICE   (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING)


      

Marco LOG_WARNING

#define LOG_WARNING  (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING)


      

Marco LOG_INFO

#define LOG_INFO     (PPP_DEBUG)


      

Marco LOG_DETAIL

#define LOG_DETAIL   (PPP_DEBUG)


      

Marco LOG_DEBUG

#define LOG_DEBUG    (PPP_DEBUG)


      

Marco MAINDEBUG(a)

#define MAINDEBUG(a)   LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a)


      

Marco SYSDEBUG(a)

#define SYSDEBUG(a)    LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a)


      

Marco FSMDEBUG(a)

#define FSMDEBUG(a)    LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a)


      

Marco LCPDEBUG(a)

#define LCPDEBUG(a)    LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a)


      

Marco IPCPDEBUG(a)

#define IPCPDEBUG(a)   LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a)


      

Marco IPV6CPDEBUG(a)

#define IPV6CPDEBUG(a) LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a)


      

Marco UPAPDEBUG(a)

#define UPAPDEBUG(a)   LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a)


      

Marco CHAPDEBUG(a)

#define CHAPDEBUG(a)   LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, a)


      

Marco PPPDEBUG(a, b)

#define PPPDEBUG(a, b) LWIP_DEBUGF(a, b)


      

Marco MAINDEBUG

#define MAINDEBUG(a)


      

Marco SYSDEBUG

#define SYSDEBUG(a)


      

Marco FSMDEBUG

#define FSMDEBUG(a)


      

Marco LCPDEBUG

#define LCPDEBUG(a)


      

Marco IPCPDEBUG

#define IPCPDEBUG(a)


      

Marco IPV6CPDEBUG

#define IPV6CPDEBUG(a)


      

Marco UPAPDEBUG

#define UPAPDEBUG(a)


      

Marco CHAPDEBUG

#define CHAPDEBUG(a)


      

Marco PPPDEBUG

#define PPPDEBUG(a, b)


      

Marco PPP_OE_H

#define PPP_OE_H


      

Marco pppoe_init()

#define pppoe_init() /* compatibility define, no initialization needed */


      

Marco PPPOL2TP_H

#define PPPOL2TP_H


      

Marco PPPOL2TP_CONTROL_TIMEOUT

#define PPPOL2TP_CONTROL_TIMEOUT        (5*1000) /* base for quick timeout calculation */
/* Timeout */

Marco PPPOL2TP_SLOW_RETRY

#define PPPOL2TP_SLOW_RETRY             (60*1000) /* persistent retry interval */


      

Marco PPPOL2TP_MAXSCCRQ

#define PPPOL2TP_MAXSCCRQ               4        /* retry SCCRQ four times (quickly) */


      

Marco PPPOL2TP_MAXICRQ

#define PPPOL2TP_MAXICRQ                4        /* retry IRCQ four times */


      

Marco PPPOL2TP_MAXICCN

#define PPPOL2TP_MAXICCN                4        /* retry ICCN four times */


      

Marco PPPOL2TP_HEADERFLAG_CONTROL

#define PPPOL2TP_HEADERFLAG_CONTROL     32768
/* L2TP header flags */

Marco PPPOL2TP_HEADERFLAG_LENGTH

#define PPPOL2TP_HEADERFLAG_LENGTH      16384


      

Marco PPPOL2TP_HEADERFLAG_SEQUENCE

#define PPPOL2TP_HEADERFLAG_SEQUENCE    2048


      

Marco PPPOL2TP_HEADERFLAG_OFFSET

#define PPPOL2TP_HEADERFLAG_OFFSET      512


      

Marco PPPOL2TP_HEADERFLAG_PRIORITY

#define PPPOL2TP_HEADERFLAG_PRIORITY    256


      

Marco PPPOL2TP_HEADERFLAG_VERSION

#define PPPOL2TP_HEADERFLAG_VERSION     2


      

Marco PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY

#define PPPOL2TP_HEADERFLAG_CONTROL_MANDATORY    (PPPOL2TP_HEADERFLAG_CONTROL|PPPOL2TP_HEADERFLAG_LENGTH|PPPOL2TP_HEADERFLAG_SEQUENCE|PPPOL2TP_HEADERFLAG_VERSION)
/* Mandatory bits for control: Control, Length, Sequence, Version 2 */

Marco PPPOL2TP_HEADERFLAG_CONTROL_FORBIDDEN

#define PPPOL2TP_HEADERFLAG_CONTROL_FORBIDDEN    (PPPOL2TP_HEADERFLAG_OFFSET|PPPOL2TP_HEADERFLAG_PRIORITY)
/* Forbidden bits for control: Offset, Priority */

Marco PPPOL2TP_HEADERFLAG_DATA_MANDATORY

#define PPPOL2TP_HEADERFLAG_DATA_MANDATORY       (PPPOL2TP_HEADERFLAG_VERSION)
/* Mandatory bits for data: Version 2 */

Marco PPPOL2TP_AVPHEADERFLAG_MANDATORY

#define PPPOL2TP_AVPHEADERFLAG_MANDATORY 32768
/* AVP (Attribute Value Pair) header */

Marco PPPOL2TP_AVPHEADERFLAG_HIDDEN

#define PPPOL2TP_AVPHEADERFLAG_HIDDEN    16384


      

Marco PPPOL2TP_AVPHEADERFLAG_LENGTHMASK

#define PPPOL2TP_AVPHEADERFLAG_LENGTHMASK 1023


      

Marco PPPOL2TP_AVPTYPE_MESSAGE

#define PPPOL2TP_AVPTYPE_MESSAGE     0 /* Message type */
/* -- AVP - Message type */

Marco PPPOL2TP_MESSAGETYPE_SCCRQ

#define PPPOL2TP_MESSAGETYPE_SCCRQ   1 /* Start Control Connection Request */
/* Control Connection Management */

Marco PPPOL2TP_MESSAGETYPE_SCCRP

#define PPPOL2TP_MESSAGETYPE_SCCRP   2 /* Start Control Connection Reply */


      

Marco PPPOL2TP_MESSAGETYPE_SCCCN

#define PPPOL2TP_MESSAGETYPE_SCCCN   3 /* Start Control Connection Connected */


      

Marco PPPOL2TP_MESSAGETYPE_STOPCCN

#define PPPOL2TP_MESSAGETYPE_STOPCCN 4 /* Stop Control Connection Notification */


      

Marco PPPOL2TP_MESSAGETYPE_HELLO

#define PPPOL2TP_MESSAGETYPE_HELLO   6 /* Hello */


      

Marco PPPOL2TP_MESSAGETYPE_OCRQ

#define PPPOL2TP_MESSAGETYPE_OCRQ    7 /* Outgoing Call Request */
/* Call Management */

Marco PPPOL2TP_MESSAGETYPE_OCRP

#define PPPOL2TP_MESSAGETYPE_OCRP    8 /* Outgoing Call Reply */


      

Marco PPPOL2TP_MESSAGETYPE_OCCN

#define PPPOL2TP_MESSAGETYPE_OCCN    9 /* Outgoing Call Connected */


      

Marco PPPOL2TP_MESSAGETYPE_ICRQ

#define PPPOL2TP_MESSAGETYPE_ICRQ   10 /* Incoming Call Request */


      

Marco PPPOL2TP_MESSAGETYPE_ICRP

#define PPPOL2TP_MESSAGETYPE_ICRP   11 /* Incoming Call Reply */


      

Marco PPPOL2TP_MESSAGETYPE_ICCN

#define PPPOL2TP_MESSAGETYPE_ICCN   12 /* Incoming Call Connected */


      

Marco PPPOL2TP_MESSAGETYPE_CDN

#define PPPOL2TP_MESSAGETYPE_CDN    14 /* Call Disconnect Notify */


      

Marco PPPOL2TP_MESSAGETYPE_WEN

#define PPPOL2TP_MESSAGETYPE_WEN    15 /* WAN Error Notify */
/* Error reporting */

Marco PPPOL2TP_MESSAGETYPE_SLI

#define PPPOL2TP_MESSAGETYPE_SLI    16 /* Set Link Info */
/* PPP Session Control */

Marco PPPOL2TP_AVPTYPE_RESULTCODE

#define PPPOL2TP_AVPTYPE_RESULTCODE  1 /* Result code */
/* -- AVP - Result code */

Marco PPPOL2TP_RESULTCODE

#define PPPOL2TP_RESULTCODE          1 /* General request to clear control connection */


      

Marco PPPOL2TP_AVPTYPE_VERSION

#define PPPOL2TP_AVPTYPE_VERSION     2
/* -- AVP - Protocol version (!= L2TP Header version) */

Marco PPPOL2TP_VERSION

#define PPPOL2TP_VERSION        256 /* L2TP Protocol version 1, revision 0 */


      

Marco PPPOL2TP_AVPTYPE_FRAMINGCAPABILITIES

#define PPPOL2TP_AVPTYPE_FRAMINGCAPABILITIES          3 /* Bearer capabilities */
/* -- AVP - Framing capabilities */

Marco PPPOL2TP_FRAMINGCAPABILITIES

#define PPPOL2TP_FRAMINGCAPABILITIES         3 /* Async + Sync framing */


      

Marco PPPOL2TP_AVPTYPE_BEARERCAPABILITIES

#define PPPOL2TP_AVPTYPE_BEARERCAPABILITIES          4 /* Bearer capabilities */
/* -- AVP - Bearer capabilities */

Marco PPPOL2TP_BEARERCAPABILITIES

#define PPPOL2TP_BEARERCAPABILITIES         3 /* Analog + Digital Access */


      

Marco PPPOL2TP_AVPTYPE_TIEBREAKER

#define PPPOL2TP_AVPTYPE_TIEBREAKER  5
/* -- AVP - Tie breaker */

Marco PPPOL2TP_AVPTYPE_HOSTNAME

#define PPPOL2TP_AVPTYPE_HOSTNAME    7 /* Host name */
/* -- AVP - Host name */

Marco PPPOL2TP_HOSTNAME

#define PPPOL2TP_HOSTNAME       "lwIP" /* FIXME: make it configurable */


      

Marco PPPOL2TP_AVPTYPE_VENDORNAME

#define PPPOL2TP_AVPTYPE_VENDORNAME  8 /* Vendor name */
/* -- AVP - Vendor name */

Marco PPPOL2TP_VENDORNAME

#define PPPOL2TP_VENDORNAME     "lwIP" /* FIXME: make it configurable */


      

Marco PPPOL2TP_AVPTYPE_TUNNELID

#define PPPOL2TP_AVPTYPE_TUNNELID    9 /* Assign Tunnel ID */
/* -- AVP - Assign tunnel ID */

Marco PPPOL2TP_AVPTYPE_RECEIVEWINDOWSIZE

#define PPPOL2TP_AVPTYPE_RECEIVEWINDOWSIZE 10 /* Receive window size */
/* -- AVP - Receive window size */

Marco PPPOL2TP_RECEIVEWINDOWSIZE

#define PPPOL2TP_RECEIVEWINDOWSIZE          8 /* FIXME: make it configurable */


      

Marco PPPOL2TP_AVPTYPE_CHALLENGE

#define PPPOL2TP_AVPTYPE_CHALLENGE  11 /* Challenge */
/* -- AVP - Challenge */

Marco PPPOL2TP_AVPTYPE_CAUSECODE

#define PPPOL2TP_AVPTYPE_CAUSECODE  12 /* Cause code*/
/* -- AVP - Cause code */

Marco PPPOL2TP_AVPTYPE_CHALLENGERESPONSE

#define PPPOL2TP_AVPTYPE_CHALLENGERESPONSE  13 /* Challenge response */
/* -- AVP - Challenge response */

Marco PPPOL2TP_AVPTYPE_CHALLENGERESPONSE_SIZE

#define PPPOL2TP_AVPTYPE_CHALLENGERESPONSE_SIZE 16


      

Marco PPPOL2TP_AVPTYPE_SESSIONID

#define PPPOL2TP_AVPTYPE_SESSIONID  14 /* Assign Session ID */
/* -- AVP - Assign session ID */

Marco PPPOL2TP_AVPTYPE_CALLSERIALNUMBER

#define PPPOL2TP_AVPTYPE_CALLSERIALNUMBER  15 /* Call Serial Number */
/* -- AVP - Call serial number */

Marco PPPOL2TP_AVPTYPE_FRAMINGTYPE

#define PPPOL2TP_AVPTYPE_FRAMINGTYPE        19 /* Framing Type */
/* -- AVP - Framing type */

Marco PPPOL2TP_FRAMINGTYPE

#define PPPOL2TP_FRAMINGTYPE        1 /* Sync framing */


      

Marco PPPOL2TP_AVPTYPE_TXCONNECTSPEED

#define PPPOL2TP_AVPTYPE_TXCONNECTSPEED     24 /* TX Connect Speed */
/* -- AVP - TX Connect Speed */

Marco PPPOL2TP_TXCONNECTSPEED

#define PPPOL2TP_TXCONNECTSPEED      100000000 /* Connect speed: 100 Mbits/s */


      

Marco PPPOL2TP_STATE_INITIAL

#define PPPOL2TP_STATE_INITIAL    0
/* L2TP Session state */

Marco PPPOL2TP_STATE_SCCRQ_SENT

#define PPPOL2TP_STATE_SCCRQ_SENT 1


      

Marco PPPOL2TP_STATE_ICRQ_SENT

#define PPPOL2TP_STATE_ICRQ_SENT  2


      

Marco PPPOL2TP_STATE_ICCN_SENT

#define PPPOL2TP_STATE_ICCN_SENT  3


      

Marco PPPOL2TP_STATE_DATA

#define PPPOL2TP_STATE_DATA       4


      

Marco PPPOL2TP_OUTPUT_DATA_HEADER_LEN

#define PPPOL2TP_OUTPUT_DATA_HEADER_LEN  6 /* Our data header len */


      

Marco PPPOS_H

#define PPPOS_H


      

Marco UPAP_H

#define UPAP_H


      

Marco UPAP_HEADERLEN

#define UPAP_HEADERLEN 4
/*
 * Packet header = Code, id, length.
 */

Marco UPAP_AUTHREQ

#define UPAP_AUTHREQ 1 /* Authenticate-Request */
/*
 * UPAP codes.
 */

Marco UPAP_AUTHACK

#define UPAP_AUTHACK 2 /* Authenticate-Ack */


      

Marco UPAP_AUTHNAK

#define UPAP_AUTHNAK 3 /* Authenticate-Nak */


      

Marco UPAPCS_INITIAL

#define UPAPCS_INITIAL 0 /* Connection down */
/*
 * Client states.
 */

Marco UPAPCS_CLOSED

#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */


      

Marco UPAPCS_PENDING

#define UPAPCS_PENDING 2 /* Connection down, have requested auth */


      

Marco UPAPCS_AUTHREQ

#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */


      

Marco UPAPCS_OPEN

#define UPAPCS_OPEN 4 /* We've received an Ack */


      

Marco UPAPCS_BADAUTH

#define UPAPCS_BADAUTH 5 /* We've received a Nak */


      

Marco UPAPSS_INITIAL

#define UPAPSS_INITIAL 0 /* Connection down */
/*
 * Server states.
 */

Marco UPAPSS_CLOSED

#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */


      

Marco UPAPSS_PENDING

#define UPAPSS_PENDING 2 /* Connection down, have requested auth */


      

Marco UPAPSS_LISTEN

#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */


      

Marco UPAPSS_OPEN

#define UPAPSS_OPEN 4 /* We've sent an Ack */


      

Marco UPAPSS_BADAUTH

#define UPAPSS_BADAUTH 5 /* We've sent a Nak */


      

Marco UPAP_DEFTIMEOUT

#define UPAP_DEFTIMEOUT 3 /* Timeout (seconds) for retransmitting req */


      

Marco UPAP_DEFREQTIME

#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */


      

Marco VJ_H

#define VJ_H


      

Marco MAX_SLOTS

#define MAX_SLOTS 16 /* must be > 2 and < 256 */


      

Marco MAX_HDR

#define MAX_HDR  128


      

Marco TYPE_IP

#define TYPE_IP              64
/* packet types */

Marco TYPE_UNCOMPRESSED_TCP

#define TYPE_UNCOMPRESSED_TCP 112


      

Marco TYPE_COMPRESSED_TCP

#define TYPE_COMPRESSED_TCP  128


      

Marco TYPE_ERROR

#define TYPE_ERROR           0


      

Marco NEW_C

#define NEW_C 64 /* flag bits for what changed in a packet */
/* Bits in first octet of compressed packet */

Marco NEW_I

#define NEW_I 32


      

Marco NEW_S

#define NEW_S 8


      

Marco NEW_A

#define NEW_A 4


      

Marco NEW_W

#define NEW_W 2


      

Marco NEW_U

#define NEW_U 1


      

Marco SPECIAL_I

#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */
/* reserved, special-case values of above */

Marco SPECIAL_D

#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */


      

Marco SPECIALS_MASK

#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U)


      

Marco TCP_PUSH_BIT

#define TCP_PUSH_BIT 16


      

Marco cs_ip

#define cs_ip vjcs_u.csu_ip


      

Marco cs_hdr

#define cs_hdr vjcs_u.csu_hdr


      

Marco VJF_TOSS

#define VJF_TOSS 1U /* tossing rcvd frames because of input err */
/* flag values */

Marco LWIP_HDR_NETIF_SLIPIF_H

#define LWIP_HDR_NETIF_SLIPIF_H


      

Marco SLIP_USE_RX_THREAD

#define SLIP_USE_RX_THREAD !NO_SYS


      

Marco SLIP_RX_FROM_ISR

#define SLIP_RX_FROM_ISR 0


      

Marco SLIP_RX_QUEUE

#define SLIP_RX_QUEUE SLIP_RX_FROM_ISR


      

Marco LWIP_HDR_ZEPIF_H

#define LWIP_HDR_ZEPIF_H


      

Marco ZEPIF_DEFAULT_UDP_PORT

#define ZEPIF_DEFAULT_UDP_PORT 17754


      

Marco __TUYA_ADC_H__

#define __TUYA_ADC_H__


      

Marco TUYA_ADC_CFG(__ADC, __PIN, __FLAG)

#define TUYA_ADC_CFG(__ADC, __PIN, __FLAG)                                   \
   (__ADC)->cfg.pin = __PIN;                                               \
   (__ADC)->cfg.flag = __FLAG


      

Marco __TUYA_DRV_H__

#define __TUYA_DRV_H__


      

Marco TUYA_DRV_ASSRET(__EXPRESS)

#define TUYA_DRV_ASSRET(__EXPRESS)                     \
   if (!(__EXPRESS)) {                               \
       PR_ERR("TUYA DRV ASSERT "#__EXPRESS"");        \
       return OPRT_INVALID_PARM;                         \
   }


      

Marco __TUYA_GPIO_H__

#define __TUYA_GPIO_H__


      

Marco __TUYA_I2C_H__

#define __TUYA_I2C_H__


      

Marco TUYA_I2C_WR

#define TUYA_I2C_WR               0


      

Marco TUYA_I2C_RD

#define TUYA_I2C_RD              (1 << 0)


      

Marco TUYA_I2C_ADDR_10BIT

#define TUYA_I2C_ADDR_10BIT      (1 << 2) // this is a ten bit chip address


      

Marco TUYA_I2C_NO_START

#define TUYA_I2C_NO_START        (1 << 4)


      

Marco TUYA_I2C_IGNORE_NACK

#define TUYA_I2C_IGNORE_NACK     (1 << 5)


      

Marco TUYA_I2C_NO_READ_ACK

#define TUYA_I2C_NO_READ_ACK     (1 << 6) // when I2C reading, we do not ACK


      

Marco TUYA_I2C_NO_WRITE_ACK

#define TUYA_I2C_NO_WRITE_ACK    (1 << 7) // when I2C writing, we do not ACK


      

Marco TUYA_I2C_MASTER_CFG(__I2C, __ADDR)

#define TUYA_I2C_MASTER_CFG(__I2C, __ADDR)                                 \
   (__I2C)->cfg.dev_addr  = __ADDR;                                      \
   (__I2C)->cfg.mode      = TUYA_I2C_MODE_MASTER                         \



      

Marco TUYA_I2C_SW_CFG_INIT(__CFG, __SCL, __SDA, __DELAY)

#define TUYA_I2C_SW_CFG_INIT(__CFG, __SCL, __SDA, __DELAY)                 \
   (__CFG)->scl_pin       = __SCL;                                       \
   (__CFG)->sda_pin       = __SDA;                                       \
   (__CFG)->delay_count   = __DELAY;                                     \
   (__CFG)->timeout       = 100


      

Marco __TUYA_I2S_H__

#define __TUYA_I2S_H__


      

Marco TUYA_I2S_CFG(__I2S, __MODE, __FREQ, __DATABIT, __CHANNEL, __STANDARD)

#define TUYA_I2S_CFG(__I2S, __MODE, __FREQ, __DATABIT, __CHANNEL, __STANDARD)  \
   (__I2S)->cfg.mode     = __MODE;                                           \
   (__I2S)->cfg.freq     = __FREQ;                                           \
   (__I2S)->cfg.cahnnel  = __DATABIT;                                        \
   (__I2S)->cfg.standard = __CHANNEL;                                        \
   (__I2S)->cfg.databits = __STANDARD                                        


      

Marco __TUYA_PIN_H__

#define __TUYA_PIN_H__


      

Marco TUYA_PINS_NAME(PORT)

#define TUYA_PINS_NAME(PORT)                           \
   PORT##0, PORT##1, PORT##2, PORT##3, PORT##4,   \
   PORT##5, PORT##6, PORT##7, PORT##8, PORT##9,   \
   PORT##10, PORT##11, PORT##12, PORT##13, PORT##14,  \
   PORT##15, PORT##16, PORT##17, PORT##18, PORT##19,  \
   PORT##20, PORT##21, PORT##22, PORT##23, PORT##24,  \
   PORT##25, PORT##26, PORT##27, PORT##28, PORT##29,  \
   PORT##30, PORT##31 


      

Marco TUYA_PIN_INIT_LOW

#define TUYA_PIN_INIT_LOW              ((uint16_t)(1 << 0))
// 2bit

Marco TUYA_PIN_INIT_HIGH

#define TUYA_PIN_INIT_HIGH             ((uint16_t)(2 << 0))


      

Marco TUYA_PIN_INIT_MASK

#define TUYA_PIN_INIT_MASK             ((uint16_t)(3 << 0))


      

Marco TUYA_PIN_IN

#define TUYA_PIN_IN                    ((uint16_t)(1 << 2))
// 3bit

Marco TUYA_PIN_IN_FL

#define TUYA_PIN_IN_FL                 ((uint16_t)(2 << 2))


      

Marco TUYA_PIN_IN_IRQ

#define TUYA_PIN_IN_IRQ                ((uint16_t)(3 << 2))


      

Marco TUYA_PIN_OUT_PP

#define TUYA_PIN_OUT_PP                ((uint16_t)(4 << 2))


      

Marco TUYA_PIN_OUT_OD

#define TUYA_PIN_OUT_OD                ((uint16_t)(5 << 2))


      

Marco TUYA_PIN_INOUT_MASK

#define TUYA_PIN_INOUT_MASK            ((uint16_t)(7 << 2))


      

Marco TUYA_PIN_IRQ_RISE

#define TUYA_PIN_IRQ_RISE              ((uint16_t)(1 << 5))
// 3bit

Marco TUYA_PIN_IRQ_FALL

#define TUYA_PIN_IRQ_FALL              ((uint16_t)(2 << 5))


      

Marco TUYA_PIN_IRQ_RISE_FALL

#define TUYA_PIN_IRQ_RISE_FALL         ((uint16_t)(3 << 5))


      

Marco TUYA_PIN_IRQ_LOW

#define TUYA_PIN_IRQ_LOW               ((uint16_t)(4 << 5))


      

Marco TUYA_PIN_IRQ_HIGH

#define TUYA_PIN_IRQ_HIGH              ((uint16_t)(5 << 5))


      

Marco TUYA_PIN_IRQ_MASK

#define TUYA_PIN_IRQ_MASK              ((uint16_t)(7 << 5))


      

Marco TUYA_PIN_PULL_UP

#define TUYA_PIN_PULL_UP               ((uint16_t)(1 << 9))
// 4bit 

Marco TUYA_PIN_PULL_DOWN

#define TUYA_PIN_PULL_DOWN             ((uint16_t)(2 << 9))


      

Marco TUYA_PIN_PULL_NONE

#define TUYA_PIN_PULL_NONE             ((uint16_t)(3 << 9))


      

Marco TUYA_PIN_MODE_MASK

#define TUYA_PIN_MODE_MASK             ((uint16_t)(15 << 9))


      

Marco TUYA_PIN_NUM(__PINNAME)

#define TUYA_PIN_NUM(__PINNAME)        (__PINNAME & 31)


      

Marco TUYA_PIN_PORT(__PINNAME)

#define TUYA_PIN_PORT(__PINNAME)       (__PINNAME >> 5)


      

Marco __TUYA_PWM_H__

#define __TUYA_PWM_H__


      

Marco TUYA_PWM_FREQUENCY(__PWM)

#define TUYA_PWM_FREQUENCY(__PWM)  ((uint32_t)(1000000000 / (__PWM)->cfg.period_ns))


      

Marco TUYA_PWM_PERCENT(__PWM)

#define TUYA_PWM_PERCENT(__PWM)    ((__PWM)->cfg.percent)


      

Marco TUYA_PWM_CFG(__PWM, __PIN, __FREQUENCY, __PERCENT)

#define TUYA_PWM_CFG(__PWM, __PIN, __FREQUENCY, __PERCENT)                     \
   (__PWM)->cfg.pin      = __PIN;                                            \
   (__PWM)->cfg.period_ns = (uint32_t)1000000000 / (__FREQUENCY);             \
   (__PWM)->cfg.percent  = __PERCENT;                                        \
   (__PWM)->cfg.pulse_ns = (uint32_t)((__PWM)->cfg.period_ns * (__PERCENT)); \
   (__PWM)->cfg.polarity = TUYA_PWM_POSITIVE


      

Marco __TUYA_RTC_H__

#define __TUYA_RTC_H__


      

Marco __TUYA_SPI_H__

#define __TUYA_SPI_H__


      

Marco TUYA_SPI_CPHA

#define TUYA_SPI_CPHA            (1 << 0)


      

Marco TUYA_SPI_CPOL

#define TUYA_SPI_CPOL            (1 << 1)


      

Marco TUYA_SPI_MODE_MASK

#define TUYA_SPI_MODE_MASK       (TUYA_SPI_CPHA | TUYA_SPI_CPOL)


      

Marco tuya_spi_send_then_send(spi, send1, len1, send2, len2)

#define tuya_spi_send_then_send(spi, send1, len1, send2, len2)             \
   do {                                                                   \
       tuya_spi_msg_t   msg[2];                                          \
       msg[0].send_buf = send1;                                           \
       msg[0].recv_buf = NULL;                                            \
       msg[0].length  = len1;                                            \
       msg[1].send_buf = send2;                                           \
       msg[1].recv_buf = NULL;                                            \
       msg[1].length  = len2;                                            \
       tuya_spi_xfer_msg(spi, msg, 2);                                    \
   } while (0)


      

Marco tuya_spi_send_then_recv(spi, send, len1, recv, len2)

#define tuya_spi_send_then_recv(spi, send, len1, recv, len2)               \
   do {                                                                   \
       tuya_spi_msg_t   msg[2];                                          \
       msg[0].send_buf = send;                                            \
       msg[0].recv_buf = NULL;                                            \
       msg[0].length  = len1;                                            \
       msg[1].send_buf = NULL;                                            \
       msg[1].recv_buf = recv;                                            \
       msg[1].length  = len2;                                            \
       tuya_spi_xfer_msg(spi, msg, 2);                                    \
   } while (0)


      

Marco tuya_spi_send(spi, buf, len)

#define tuya_spi_send(spi, buf, len)                                       \
   tuya_spi_xfer(spi, buf, NULL, len)


      

Marco tuya_spi_recv(spi, buf, len)

#define tuya_spi_recv(spi, buf, len)                                       \
   tuya_spi_xfer(spi, NULL, buf, len)


      

Marco __TUYA_TIMER_H__

#define __TUYA_TIMER_H__


      

Marco TUYA_TIMER_CFG(__TIMER, __MODE, __CB, __ARG)

#define TUYA_TIMER_CFG(__TIMER, __MODE, __CB, __ARG)                         \
   (__TIMER)->cfg.mode = __MODE;                                            \
   (__TIMER)->cfg.cb  = __CB;                                              \
   (__TIMER)->cfg.arg = __ARG


      

Marco __TUYA_UART_H__

#define __TUYA_UART_H__


      

Marco TUYA_UART_8N1_CFG(__UART, __BAUDRATE, __BUFSZ, __FLAG)

#define TUYA_UART_8N1_CFG(__UART, __BAUDRATE, __BUFSZ, __FLAG)               \
       (__UART)->cfg.baudrate = __BAUDRATE;                                \
       (__UART)->cfg.flag     = TUYA_DRV_INT_RX_FLAG | __FLAG;             \
       (__UART)->cfg.bufsz    = __BUFSZ;                                   \
       (__UART)->cfg.databits = TUYA_UART_DATA_BIT8;                       \
       (__UART)->cfg.stopbits = TUYA_UART_STOP_BIT1;                       \
       (__UART)->cfg.parity   = TUYA_UART_PARITY_NONE


      

Marco TUYA_UART_8N1_CFG_INIT(__CFG, __BAUDRATE, __BUFSZ, __FLAG)

#define TUYA_UART_8N1_CFG_INIT(__CFG, __BAUDRATE, __BUFSZ, __FLAG)           \
       (__CFG)->baudrate      = __BAUDRATE;                                \
       (__CFG)->flag          = TUYA_DRV_INT_RX_FLAG | __FLAG;             \
       (__CFG)->bufsz         = __BUFSZ;                                   \
       (__CFG)->databits      = TUYA_UART_DATA_BIT8;                       \
       (__CFG)->stopbits      = TUYA_UART_STOP_BIT1;                       \
       (__CFG)->parity        = TUYA_UART_PARITY_NONE


      

Marco __TUYA_UART_LEGACY_H__

#define __TUYA_UART_LEGACY_H__


      

Marco __DIRECT_CONNECT_TUYA_H__

#define __DIRECT_CONNECT_TUYA_H__


      

Marco __TUYA_IOT_API_PRE_HANDLE_H

#define __TUYA_IOT_API_PRE_HANDLE_H


      

Marco __TUYA_IOT_COM_API_H

#define __TUYA_IOT_COM_API_H


      

Marco tuya_iot_init(fs_storge_path)

#define tuya_iot_init(fs_storge_path) \
   tuya_iot_init_params(fs_storge_path, NULL)


      

Marco tuya_iot_kv_flash_init

#define tuya_iot_kv_flash_init    tuya_iot_kv_flash_init_param


      

Marco tuya_iot_upgrade_gw(fw, get_file_cb, upgrd_nofity_cb, pri_data)

#define tuya_iot_upgrade_gw(fw, get_file_cb, upgrd_nofity_cb, pri_data) \
   tuya_iot_upgrade_gw_notify(fw, get_file_cb, upgrd_nofity_cb, pri_data, TRUE, 0)


      

Marco tuya_iot_upgrade_dev(devid, fw, get_file_cb, upgrd_nofity_cb, pri_data)

#define tuya_iot_upgrade_dev(devid, fw, get_file_cb, upgrd_nofity_cb, pri_data) \
   tuya_iot_upgrade_dev_notify(devid, fw, get_file_cb, upgrd_nofity_cb, pri_data, TRUE, 0)


      

Marco dev_report_dp_raw_sync(dev_id, dpid, data, len, timeout)

#define dev_report_dp_raw_sync(dev_id, dpid, data, len, timeout) \
   dev_report_dp_raw_sync_extend(dev_id, dpid, data, len, timeout, TRUE)


      

Marco dev_report_dp_raw_sync_with_time(dev_id, dpid, data, len, timeout, time_str)

#define dev_report_dp_raw_sync_with_time(dev_id, dpid, data, len, timeout, time_str) \
   dev_report_dp_raw_sync_extend_with_time(dev_id, dpid, data, len, timeout, TRUE, time_str)


      

Marco dev_report_dp_stat_sync(dev_id, dp_data, cnt, timeout)

#define dev_report_dp_stat_sync(dev_id, dp_data, cnt, timeout) \
   dev_report_dp_stat_sync_extend(dev_id, dp_data, cnt, timeout, TRUE)


      

Marco tuya_iot_upload_layout_buffer(map_id, buffer, len)

#define tuya_iot_upload_layout_buffer(map_id, buffer, len) \
   tuya_iot_map_cleaner_upload_buffer(map_id, buffer, len, "layout/lay.bin", UP_CLEANER_MAP)


      

Marco tuya_iot_upload_route_buffer(map_id, buffer, len)

#define tuya_iot_upload_route_buffer(map_id, buffer, len) \
   tuya_iot_map_cleaner_upload_buffer(map_id, buffer, len, "route/rou.bin", UP_CLEANER_PATH)


      

Marco tuya_iot_upload_layout_file(map_id, local_file_name)

#define tuya_iot_upload_layout_file(map_id, local_file_name) \
   tuya_iot_map_cleaner_upload_file(map_id, local_file_name, "layout/lay.bin", UP_CLEANER_MAP)


      

Marco tuya_iot_upload_route_file(map_id, local_file_name)

#define tuya_iot_upload_route_file(map_id, local_file_name) \
   tuya_iot_map_cleaner_upload_file(map_id, local_file_name, "route/rou.bin", UP_CLEANER_PATH)


      

Marco __TUYA_IOT_DEV_CHECK__

#define __TUYA_IOT_DEV_CHECK__


      

Marco TY_DEV_RANDOM_LENGTH

#define TY_DEV_RANDOM_LENGTH 16


      

Marco TY_DEV_KEY_LENGTH

#define TY_DEV_KEY_LENGTH 16 //取authkey前16字节


      

Marco TY_DEV_SHA256_DIGEST_SIZE

#define TY_DEV_SHA256_DIGEST_SIZE 32 //uint8 type 512 = 32*8


      

Marco TY_DEV_RANDOM_AES_LEN

#define TY_DEV_RANDOM_AES_LEN 32 //16 byte->aes128ecb->32 byte


      

Marco TY_DEV_SESSION_KEY_LEN

#define TY_DEV_SESSION_KEY_LEN 16


      

Marco ENCRYPT_AUTHKEY_HMACRA_NAME

#define ENCRYPT_AUTHKEY_HMACRA_NAME "hmacRandomA"


      

Marco ENCRYPT_AUTHKEY_HMACRB_NAME

#define ENCRYPT_AUTHKEY_HMACRB_NAME "hmacRandomB"


      

Marco ENCRYPT_AUTHKEY_AESRB_NAME

#define ENCRYPT_AUTHKEY_AESRB_NAME "aesRandomB"


      

Marco ENCRYPT_AUTHKEY_SESSIONKEY_NAME

#define ENCRYPT_AUTHKEY_SESSIONKEY_NAME "sessionKey"


      

Marco TY_DEV_IS_INDEPENDENT_NAME

#define TY_DEV_IS_INDEPENDENT_NAME "isIndependent"


      

Marco TY_DEV_IS_SUB_NAME

#define TY_DEV_IS_SUB_NAME "isSub"


      

Marco TY_DEV_IS_FAMILY_NAME

#define TY_DEV_IS_FAMILY_NAME "isFamily"


      

Marco _TUYA_IOT_INTERNAL_API_H

#define _TUYA_IOT_INTERNAL_API_H


      

Marco _TUYA_IOT_WIFI_API_H

#define _TUYA_IOT_WIFI_API_H


      

Marco tuya_iot_wf_soc_dev_init(cfg, start_mode,cbs,product_key,wf_sw_ver)

#define tuya_iot_wf_soc_dev_init(cfg, start_mode,cbs,product_key,wf_sw_ver) \
       tuya_iot_wf_soc_dev_init_param(cfg, start_mode,cbs,NULL,product_key,wf_sw_ver)


      

Marco tuya_iot_reg_get_wf_nw_stat_cb(wf_nw_stat_cb)

#define tuya_iot_reg_get_wf_nw_stat_cb(wf_nw_stat_cb) \
   tuya_iot_reg_get_wf_nw_stat_cb_params(wf_nw_stat_cb, 1)


      

Marco __TUYA_IOT_BASE_API_H

#define __TUYA_IOT_BASE_API_H


      

Marco tuya_iot_soc_init(cbs, product_key, sw_ver)

#define tuya_iot_soc_init(cbs, product_key, sw_ver) \
       tuya_iot_soc_init_param(cbs, product_key, NULL, sw_ver)


      

Marco tuya_iot_reg_get_nw_stat_cb(nw_stat_cb)

#define tuya_iot_reg_get_nw_stat_cb(nw_stat_cb) \
   tuya_iot_reg_get_nw_stat_cb_params(nw_stat_cb, 1);


      

Marco __SVC_ASTRO_TIMER__

#define __SVC_ASTRO_TIMER__


      

Marco GW_AUDIO_SCENE_H

#define GW_AUDIO_SCENE_H


      

Marco TUYA_BT_H__

#define TUYA_BT_H__


      

Marco _GW_INTF_H

#define _GW_INTF_H


      

Marco SERIAL_NO_STR_LEN

#define SERIAL_NO_STR_LEN 32   // max string length of sn


      

Marco GET_ACCESS_TOKEN_INTERVAL

#define GET_ACCESS_TOKEN_INTERVAL (300 * 1000) //5min


      

Marco CLOUD_CAPABILITY_WIFI

#define CLOUD_CAPABILITY_WIFI        0    // wifi
/**
 * @brief Denifition of capability in cloud
*/

Marco CLOUD_CAPABILITY_CABLE

#define CLOUD_CAPABILITY_CABLE       1    // cable


      

Marco CLOUD_CAPABILITY_GPRS

#define CLOUD_CAPABILITY_GPRS        2    // gprs


      

Marco CLOUD_CAPABILITY_NBIOT

#define CLOUD_CAPABILITY_NBIOT       3    // nb-iot


      

Marco CLOUD_CAPABILITY_BLUETOOTH

#define CLOUD_CAPABILITY_BLUETOOTH   10   // bt


      

Marco CLOUD_CAPABILITY_BLEMESH

#define CLOUD_CAPABILITY_BLEMESH     11   // blemesh


      

Marco CLOUD_CAPABILITY_ZIGBEE

#define CLOUD_CAPABILITY_ZIGBEE      12   // zigbee


      

Marco CLOUD_CAPABILITY_INFRARED

#define CLOUD_CAPABILITY_INFRARED    13   // infrared


      

Marco CLOUD_CAPABILITY_SUBPIECES

#define CLOUD_CAPABILITY_SUBPIECES   14   // subpieces


      

Marco CLOUD_CAPABILITY_SIGMESH

#define CLOUD_CAPABILITY_SIGMESH     15   // sigmesh


      

Marco CLOUD_CAPABILITY_MCU

#define CLOUD_CAPABILITY_MCU         16   // mcu


      

Marco GRP_LMT

#define GRP_LMT 64 // group limit


      

Marco SCENE_LMT

#define SCENE_LMT 64 // scene limit


      

Marco LOG_PHAT_MAX_LEN

#define LOG_PHAT_MAX_LEN 64


      

Marco IS_STRIDE_PID_KEY

#define IS_STRIDE_PID_KEY "is_stride" // kv for stride


      

Marco TUYA_CLOUD_BASE_DEFS_H

#define TUYA_CLOUD_BASE_DEFS_H


      

Marco GB_STAT_LAN_UNCONN

#define GB_STAT_LAN_UNCONN 0
/* offline in LAN.  user wired callback  return  */

Marco GB_STAT_LAN_CONN

#define GB_STAT_LAN_CONN 1
/* online in LAN, offline in WAN.
   user wired callback  return  but mqtt is offline
*/

Marco GB_STAT_CLOUD_CONN

#define GB_STAT_CLOUD_CONN 2
/* online in WAN.
   user wired callback  return  and mqtt is online
*/

Marco GB_STAT_GPRS_SIM_DISC

#define GB_STAT_GPRS_SIM_DISC 3
/* GPRS: SIM is not ready. */

Marco GB_STAT_GPRS_SEARCH_NETWORK

#define GB_STAT_GPRS_SEARCH_NETWORK 4
/* GPRS: search network. */

Marco GB_STAT_GPRS_REG_NETWORK

#define GB_STAT_GPRS_REG_NETWORK 5
/* GPRS: regist network. */

Marco GB_STAT_GPRS_GOT_IP

#define GB_STAT_GPRS_GOT_IP 6
/* GPRS: got ip address. */

Marco TUYA_CLOUD_COM_DEFS_H

#define TUYA_CLOUD_COM_DEFS_H


      

Marco ENCRYPT_KEY_LEN

#define ENCRYPT_KEY_LEN        16     // max string length of storage encrypt
// tuya sdk constants definitions

Marco GW_UUID_LEN

#define GW_UUID_LEN            25     // max string length of UUID


      

Marco AUTH_KEY_LEN

#define AUTH_KEY_LEN           32     // max string length of AUTH_KEY


      

Marco PSK_KEY_LEN

#define PSK_KEY_LEN            64     // max string length of PSK_KEY


      

Marco PRODUCT_KEY_LEN

#define PRODUCT_KEY_LEN        16     // max string length of PRODUCT_KEY


      

Marco SW_VER_LEN

#define SW_VER_LEN             10     // max string length of VERSION


      

Marco SW_MD5_LEN

#define SW_MD5_LEN             32     // max string length of attatch MD5


      

Marco BT_HID_LEN

#define BT_HID_LEN             19     // max string length of HID


      

Marco BT_MAC_LEN

#define BT_MAC_LEN             12     // max string length of MAC


      

Marco TUYA_PSK_LEN

#define TUYA_PSK_LEN           32     // max string length of PSK


      

Marco TUYA_PSK21_LEN

#define TUYA_PSK21_LEN         44     // max string length of PSK21


      

Marco TUYA_IMEI_LEN

#define TUYA_IMEI_LEN          18     // max string length of IMEI


      

Marco TUYA_SN_LEN

#define TUYA_SN_LEN            20     // max string length of SN


      

Marco SYS_ENV_LEN

#define SYS_ENV_LEN            20     // max string length of ENV


      

Marco LOG_SEQ_PATH_LEN

#define LOG_SEQ_PATH_LEN       128    // max string length of LOG SEQ PATH


      

Marco GW_ID_LEN

#define GW_ID_LEN              25     // max string length of GW_ID


      

Marco DEV_UUID_LEN

#define DEV_UUID_LEN           25     // max string length of DEV UUID


      

Marco DEV_ID_LEN

#define DEV_ID_LEN             25     // max string length of DEV_ID


      

Marco SCHEMA_ID_LEN

#define SCHEMA_ID_LEN          16     // max string length of SCHEMA


      

Marco SCHEMA_VER_LEN

#define SCHEMA_VER_LEN         16     // max string length of SCHEMA VERSION


      

Marco BIND_TOKEN_LEN

#define BIND_TOKEN_LEN         16     // max string length of BIND_TOKEN


      

Marco TOKEN_LEN

#define TOKEN_LEN              8      // max string length of TOKEN


      

Marco REGION_LEN

#define REGION_LEN             2      // max string length of REGIN IN TOKEN


      

Marco REGIST_KEY_LEN

#define REGIST_KEY_LEN         4      // max string length of REGIST_KEY IN TOKEN


      

Marco HTTP_URL_LMT

#define HTTP_URL_LMT           128    // max string length of URL


      

Marco MQ_URL_LMT

#define MQ_URL_LMT             128    // max string length of MQTT_URL


      

Marco TIME_ZONE_LEN

#define TIME_ZONE_LEN          10     // max string length of TIME_ZONE


      

Marco SUMMER_TM_ZONE_LEN

#define SUMMER_TM_ZONE_LEN     256    // max string length of SUMMER_TIME_ZONE


      

Marco COUNTRY_CODE_LEN

#define COUNTRY_CODE_LEN       8      // max string length of COUNTRY_CODE


      

Marco COUNTRY_CODE_LEN

#define COUNTRY_CODE_LEN       8      // max string length of COUNTRY_CODE


      

Marco IPV4_LEN

#define IPV4_LEN               15     // max string length of IPV4_LEN 255.255.255.255


      

Marco SEC_KEY_LEN

#define SEC_KEY_LEN            16     // max string length of SECURITY_KEY


      

Marco LOCAL_KEY_LEN

#define LOCAL_KEY_LEN          16     // max string length of LOCAL_KEY


      

Marco WXAPPID_LEN

#define WXAPPID_LEN            32     // max string length of wechat_appid


      

Marco WXUUID_LEN

#define WXUUID_LEN             32     // max string length of wechat_uuid


      

Marco GRP_ID_LEN

#define GRP_ID_LEN             5      // max string length of group id range:1-65535


      

Marco SCENE_ID_LEN

#define SCENE_ID_LEN           3      // max string length of scene id range:1-255


      

Marco NET_MODE_LEN

#define NET_MODE_LEN           32     // max string length of NET MODE


      

Marco LC_GW_SLEEP_HB_LMT_S

#define LC_GW_SLEEP_HB_LMT_S 12*3600 // 12h


      

Marco M_SCE_SUCCESS

#define M_SCE_SUCCESS 0       // success
//group and scene error code

Marco M_SCE_ERR_EXCEED

#define M_SCE_ERR_EXCEED 1    // space not enough


      

Marco M_SCE_ERR_TIMEOUT

#define M_SCE_ERR_TIMEOUT 2   // timeout


      

Marco M_SCE_ERR_PARAM

#define M_SCE_ERR_PARAM 3     // param not in range


      

Marco M_SCE_WRITE_FILE

#define M_SCE_WRITE_FILE 4    // failed to write db


      

Marco M_SCE_ERR_OTHER

#define M_SCE_ERR_OTHER 5     // other failure


      

Marco GP_DEV_SUPPORT_MAX

#define GP_DEV_SUPPORT_MAX GP_DEV_ATH_10 // max attach id


      

Marco CH_NAME_LMT

#define CH_NAME_LMT 15         // max string length of operator name


      

Marco CH_CODE_LMT

#define CH_CODE_LMT 20         // max string length of operator code


      

Marco CH_SN_LMT

#define CH_SN_LMT 20           // max string length of device sn


      

Marco CH_REPORT_CODE_LMT

#define CH_REPORT_CODE_LMT 20  // max string length of report code


      

Marco CH_MANU_ID_LMT

#define CH_MANU_ID_LMT 10      // max string length of manufacture id


      

Marco CH_VERSION_LMT

#define CH_VERSION_LMT 10      // max string length of sw version


      

Marco CH_ENCRYPT_KEY_LMT

#define CH_ENCRYPT_KEY_LMT 20  // max string length of encrypt key


      

Marco GW_ATTACH_ATTR_LMT

#define GW_ATTACH_ATTR_LMT 4


      

Marco DP_REPT_USER_REG_MAX_NUM

#define DP_REPT_USER_REG_MAX_NUM 5
//add by sunkz

Marco FW_URL_LEN

#define FW_URL_LEN     255      // max length of firmware download url


      

Marco FW_MD5_LEN

#define FW_MD5_LEN     32       // max length of firmware md5


      

Marco FW_HMAC_LEN

#define FW_HMAC_LEN    64       // max length of firmware hmac


      

Marco TUYA_CLOUD_WIFI_DEFS_H

#define TUYA_CLOUD_WIFI_DEFS_H


      

Marco __TUYA_DEV_H__

#define __TUYA_DEV_H__


      

Marco TUYA_DEVOS_ACTIVATE_H

#define TUYA_DEVOS_ACTIVATE_H


      

Marco __TUYA_DEVOS_ENTRY_H__

#define __TUYA_DEVOS_ENTRY_H__


      

Marco TUYA_DEVOS_NETCFG_H

#define TUYA_DEVOS_NETCFG_H


      

Marco EVT_NETCFG_DONE

#define EVT_NETCFG_DONE     "netcfg.done"


      
      
#define TUYA_DEVOS_NETLINK_H


      
      
#define EVT_NETLINK_UP     "netlink.up" // network linkage up


      
      
#define EVT_NETLINK_DOWN   "netlink.down" // network linkage down


      

Marco TUYA_DEVOS_RESET_H

#define TUYA_DEVOS_RESET_H


      

Marco TUYA_DEVOS_UTILS_H

#define TUYA_DEVOS_UTILS_H


      

Marco __TUYA_WS_DB_GW_H__

#define __TUYA_WS_DB_GW_H__


      

Marco _SMART_FRAME_H

#define _SMART_FRAME_H


      

Marco _TUYA_SYSTEM_DP_H

#define _TUYA_SYSTEM_DP_H


      

Marco TY_SYSTEM_DP_MIN

#define TY_SYSTEM_DP_MIN           200


      

Marco TY_SYSTEM_DP_IR_CTL

#define TY_SYSTEM_DP_IR_CTL        201


      

Marco TY_SYSTEM_DP_STUDY_REPORT

#define TY_SYSTEM_DP_STUDY_REPORT  202


      

Marco _IOT_HTTPC_H

#define _IOT_HTTPC_H


      

Marco httpc_raw_get(p_url, pp_raw_http, offset, total_len)

#define httpc_raw_get(p_url, pp_raw_http, offset, total_len) \
   httpc_raw_get_with_head(p_url, pp_raw_http, offset, total_len, NULL, NULL) \

/**
 * @brief Raw HTTP GET request
 * 
 * @param[in] p_url URL to request
 * @param[in,out] pp_raw_http Pointer to RAW_HTTP_S
 * @param[in] offset Offset of buffer
 * @param[in] total_len Total length of buffer
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Marco __TUYA_IR_CODE_H__

#define __TUYA_IR_CODE_H__


      

Marco _TUYA_IR_CONTROL_H

#define _TUYA_IR_CONTROL_H


      

Marco TUYA_IR_ATTRIBUTE_REPORT_URL

#define TUYA_IR_ATTRIBUTE_REPORT_URL      "tuya.device.infrared.attribute.batch.save"


      

Marco TUYA_IR_ATTRIBUTE_REPORT_URL_VER

#define TUYA_IR_ATTRIBUTE_REPORT_URL_VER  "1.0"


      

Marco TY_CODE_FASTLZ_VER

#define TY_CODE_FASTLZ_VER                3


      

Marco IR_MQTT_UP_VER

#define IR_MQTT_UP_VER                    3


      

Marco IR_KEY_MAX_NUM_FASTLZ

#define IR_KEY_MAX_NUM_FASTLZ             10


      

Marco IR_MQTT_UP_CYCLE_TIME

#define IR_MQTT_UP_CYCLE_TIME             2000       //ms


      

Marco IR_MQTT_UP_CYCLE_TYPE

#define IR_MQTT_UP_CYCLE_TYPE             TIMER_ONCE //ms


      

Marco IR_MQTT_PUSH_TYPE_BUF_MAX_LEN

#define IR_MQTT_PUSH_TYPE_BUF_MAX_LEN     128


      

Marco TUYA_IR_WS_DB_

#define TUYA_IR_WS_DB_


      

Marco IR_TYPE_FLASH_KEY

#define IR_TYPE_FLASH_KEY  "ir_type_flg"


      

Marco IR_GW_ID

#define IR_GW_ID           "ir_recode_gwid"


      

Marco IR_INIT_MODE

#define IR_INIT_MODE       "ir_init_mode"


      

Marco _AK_LAN_PROTOCOL_H

#define _AK_LAN_PROTOCOL_H


      

Marco _APP_AGENT_H

#define _APP_AGENT_H


      

Marco FRM_GRP_OPER_ENGR

#define FRM_GRP_OPER_ENGR 0xd0
//group test

Marco FRM_GRP_CMD

#define FRM_GRP_CMD 0xd1


      

Marco lan_pro_cntl_init(wechat)

#define lan_pro_cntl_init(wechat) tuya_svc_lan_init()


      

Marco lan_pro_cntl_exit()

#define lan_pro_cntl_exit() tuya_svc_lan_exit()


      

Marco lan_pro_cntl_disable()

#define lan_pro_cntl_disable() tuya_svc_lan_disable()


      

Marco lan_pro_cntl_enable()

#define lan_pro_cntl_enable() tuya_svc_lan_enable()


      

Marco lan_dp_sata_report(data,len)

#define lan_dp_sata_report(data,len) tuya_svc_lan_dp_report(data,len)


      

Marco lan_data_report_cb(fr_type,ret_code,data,len)

#define lan_data_report_cb(fr_type,ret_code,data,len) tuya_svc_lan_data_report(fr_type,ret_code,data,len)


      

Marco lan_disconnect_all_sockets()

#define lan_disconnect_all_sockets() tuya_svc_lan_disconnect_all()


      

Marco lan_pro_cntl_get_valid_connect_cnt()

#define lan_pro_cntl_get_valid_connect_cnt() tuya_svc_lan_get_valid_connections()


      

Marco lan_pro_cntl_cfg(cfg,data)

#define lan_pro_cntl_cfg(cfg,data) tuya_svc_lan_cfg(cfg,data)


      

Marco lan_pro_cntl_unregister_cb(frame_type)

#define lan_pro_cntl_unregister_cb(frame_type) tuya_svc_lan_unregister_cb(frame_type)


      

Marco is_lan_connected()

#define is_lan_connected() (tuya_svc_lan_get_valid_connections() != 0)


      

Marco lan_pro_cntl_register_cb(frame_type,handler)

#define lan_pro_cntl_register_cb(frame_type,handler) tuya_svc_lan_register_cb(frame_type,handler)


      

Marco __LAN_PROTOCOL__

#define __LAN_PROTOCOL__


      

Marco FRM_TP_CFG_WF

#define FRM_TP_CFG_WF 1 // only used for ap 3.0 network config
// lan protocol

Marco FRM_TP_CMD

#define FRM_TP_CMD 7
// #define FRM_TP_UNBIND_DEV 6

Marco FRM_TP_STAT_REPORT

#define FRM_TP_STAT_REPORT 8


      

Marco FRM_TP_HB

#define FRM_TP_HB 9


      

Marco FRM_QUERY_STAT

#define FRM_QUERY_STAT 0a


      

Marco FRM_USER_BIND_REQ

#define FRM_USER_BIND_REQ 0c
// #define FRM_SSID_QUERY 0x0b // discard

Marco FRM_TP_NEW_CMD

#define FRM_TP_NEW_CMD 0d


      

Marco FRM_ADD_SUB_DEV_CMD

#define FRM_ADD_SUB_DEV_CMD 0e


      

Marco FRM_CFG_WIFI_INFO

#define FRM_CFG_WIFI_INFO 15


      

Marco FRM_QUERY_STAT_NEW

#define FRM_QUERY_STAT_NEW 16


      

Marco FRM_SCENE_EXEC

#define FRM_SCENE_EXEC 17


      

Marco FRM_LAN_QUERY_DP

#define FRM_LAN_QUERY_DP 18


      

Marco FRM_SECURITY_TYPE3

#define FRM_SECURITY_TYPE3 3


      

Marco FRM_SECURITY_TYPE4

#define FRM_SECURITY_TYPE4 4


      

Marco FRM_SECURITY_TYPE5

#define FRM_SECURITY_TYPE5 5


      

Marco FRM_LAN_EXT_STREAM

#define FRM_LAN_EXT_STREAM 64


      

Marco FR_TYPE_ENCRYPTION

#define FR_TYPE_ENCRYPTION 19


      

Marco FRM_AP_CFG_WF_V40

#define FRM_AP_CFG_WF_V40 20


      

Marco FR_TYPE_BOARDCAST_LPV34

#define FR_TYPE_BOARDCAST_LPV34 35


      

Marco __LAN_CLUSTER_API_H

#define __LAN_CLUSTER_API_H


      

Marco __LAN_CLUSTER_BASE_H

#define __LAN_CLUSTER_BASE_H


      

Marco CLS_CAP_MASTER_MIN

#define CLS_CAP_MASTER_MIN  1000 //能变成master节点的最低能力值
//对外的能力判断

Marco CLS_CAP_NODE_MIN

#define CLS_CAP_NODE_MIN 	 100  //能变成普通节点的最低能力值


      

Marco MASTER_CONFIRM_MSG_TIME

#define MASTER_CONFIRM_MSG_TIME 		5 		//master广播周期,秒为单位


      

Marco MASTER_CONFIRM_MSG_WAIT_NUM

#define MASTER_CONFIRM_MSG_WAIT_NUM	4	//master连续广播之后能成为master的广播次数


      

Marco MASTER_KEEPALIVE_CHECK_NUM

#define MASTER_KEEPALIVE_CHECK_NUM  	3 		//普通节点判断master离线的 周期个数


      

Marco MASTER_KEEPALIVE_CHECK_TIME

#define MASTER_KEEPALIVE_CHECK_TIME 	MASTER_CONFIRM_MSG_TIME 	//普通节点保活检测定时器周期


      

Marco MST_CFM_MSG_MAX_LEN

#define MST_CFM_MSG_MAX_LEN 128


      

Marco __LAN_CLUSTER_MASTER_API_H

#define __LAN_CLUSTER_MASTER_API_H


      

Marco __LAN_DEV_BASE_H

#define __LAN_DEV_BASE_H


      

Marco __LAN_DEV_BASE_API_H

#define __LAN_DEV_BASE_API_H


      

Marco __LAN_DEV_BASE_MASTER_H

#define __LAN_DEV_BASE_MASTER_H


      

Marco __LAN_DP_REPORT_CNTL_API_H

#define __LAN_DP_REPORT_CNTL_API_H


      

Marco __LAN_DP_REPORT_CNTL_MASTER_API_H

#define __LAN_DP_REPORT_CNTL_MASTER_API_H


      

Marco __LAN_MSG_RELIABLE_TRANS_H

#define __LAN_MSG_RELIABLE_TRANS_H


      

Marco MAX_MERGE_NUM_IN_MSG

#define MAX_MERGE_NUM_IN_MSG 3 //一个RPC消息中包含最大的命令个数


      

Marco PEER_NODE_ALLOW_CB_MAX

#define PEER_NODE_ALLOW_CB_MAX 4


      

Marco __LAN_PUB_SUB_MQ_API_H

#define __LAN_PUB_SUB_MQ_API_H


      

Marco LAN_TOPIC_NAME_LEN_MAX

#define LAN_TOPIC_NAME_LEN_MAX 32
/***********************************************************
*************************micro define***********************
***********************************************************/

Marco __LAN_SIMPLE_MQ_API_H

#define __LAN_SIMPLE_MQ_API_H


      

Marco LAN_SVC_NAME_MAX

#define LAN_SVC_NAME_MAX 32


      

Marco __SCENE_LINKAGE_LAN_H

#define __SCENE_LINKAGE_LAN_H


      

Marco __ACTION_H

#define __ACTION_H


      

Marco __ACTION_EXT

#define __ACTION_EXT


      

Marco __ACTION_EXT

#define __ACTION_EXT extern


      

Marco RULE_ID_LEN

#define RULE_ID_LEN 20
/***********************************************************
*************************micro define***********************
***********************************************************/

Marco __SCENE_LINKAGE_H

#define __SCENE_LINKAGE_H


      

Marco __SCENE_LINKAGE_EXT

#define __SCENE_LINKAGE_EXT


      

Marco __SCENE_LINKAGE_EXT

#define __SCENE_LINKAGE_EXT extern


      

Marco LINKAGE_RULE_LOCAL

#define LINKAGE_RULE_LOCAL    		0 
//��https://wiki.tuya-inc.com:7799/pages/viewpage.action?pageId=22086410

Marco LINKAGE_RULE_LAN

#define LINKAGE_RULE_LAN    		1 


      

Marco RULE_TYPE_LOCAL_2_PROTOCOL(local)

#define RULE_TYPE_LOCAL_2_PROTOCOL(local) ((local) + 1)


      

Marco RULE_TYPE_PROTOCOL_2_LOCAL(pro)

#define RULE_TYPE_PROTOCOL_2_LOCAL(pro) ((pro) - 1) 


      

Marco LINKAGE_RULE_NUM

#define LINKAGE_RULE_NUM    		2 


      

Marco LINKAGE_RULE_NUM

#define LINKAGE_RULE_NUM    		1 


      

Marco __SCENE_LINKAGE_ENGR_H

#define __SCENE_LINKAGE_ENGR_H


      

Marco __SCENE_LINKAGE_ENGR_EXT

#define __SCENE_LINKAGE_ENGR_EXT


      

Marco __SCENE_LINKAGE_ENGR_EXT

#define __SCENE_LINKAGE_ENGR_EXT extern


      

Marco _GPIO_TEST_H

#define _GPIO_TEST_H


      

Marco __MF_TEST_H

#define __MF_TEST_H


      

Marco ___PROD_TEST_H__

#define ___PROD_TEST_H__


      

Marco _MQC_APP_H

#define _MQC_APP_H


      

Marco PRO_DATA_PUSH

#define PRO_DATA_PUSH              4  /* dev -> cloud push dp data */
// mqtt protocol

Marco PRO_CMD

#define PRO_CMD                    5  /* cloud -> dev send dp data */


      

Marco PRO_DEV_UNBIND

#define PRO_DEV_UNBIND             8  /* cloud -> dev */


      

Marco PRO_GW_RESET

#define PRO_GW_RESET               11 /* cloud -> dev reset dev */


      

Marco PRO_TIMER_UG_INF

#define PRO_TIMER_UG_INF           13 /* cloud -> dev update timer */


      

Marco PRO_UPGD_REQ

#define PRO_UPGD_REQ               15 /* cloud -> dev update dev/gw */


      

Marco PRO_UPGE_PUSH

#define PRO_UPGE_PUSH              16 /* dev -> cloud update upgrade percent */


      

Marco PRO_IOT_DA_REQ

#define PRO_IOT_DA_REQ             22 /* cloud -> dev send data req */


      

Marco PRO_IOT_DA_RESP

#define PRO_IOT_DA_RESP            23 /* dev -> cloud send data resp */


      

Marco PRO_DEV_LINE_STAT_UPDATE

#define PRO_DEV_LINE_STAT_UPDATE   25 /* dev -> sub device online status update */


      

Marco PRO_CMD_ACK

#define PRO_CMD_ACK                26 /* dev -> cloud  dev send ackId to cloud */


      

Marco PRO_MQ_EXT_CFG_INF

#define PRO_MQ_EXT_CFG_INF         27 /* cloud -> dev runtime cfg update */


      

Marco PRO_MQ_BLE_RAW_CMD

#define PRO_MQ_BLE_RAW_CMD         28 /* cloud -> ble dev RAW data */


      

Marco PRO_MQ_QUERY_DP

#define PRO_MQ_QUERY_DP            31 /* cloud -> dev query dp stat */


      

Marco PRO_GW_SIGMESH_TOPO_UPDATE

#define PRO_GW_SIGMESH_TOPO_UPDATE 33 /* cloud -> dev sigmesh topo update */


      

Marco PRO_UG_SUMMER_TABLE

#define PRO_UG_SUMMER_TABLE        41 // ug sumer timer table


      

Marco PRO_GW_UPLOAD_LOG

#define PRO_GW_UPLOAD_LOG          45 /* dev -> cloud, upload log*/


      

Marco PRO_GW_LINKAGE_UPDATE

#define PRO_GW_LINKAGE_UPDATE      49 /* cloud -> dev 场景更新推送 */


      

Marco PRO_MQ_THINGCONFIG

#define PRO_MQ_THINGCONFIG         51 /* 设备免密配网 */


      

Marco PRO_MQ_PEGASUS_CONFIG

#define PRO_MQ_PEGASUS_CONFIG      63 /* 闪电配网 */


      

Marco PRO_MQ_APP_PROTOCOL_RX

#define PRO_MQ_APP_PROTOCOL_RX     64 /* 应用用户自定义协议 cloud->dev */


      

Marco PRO_MQ_APP_PROTOCOL_TX

#define PRO_MQ_APP_PROTOCOL_TX     65 /* 应用用户自定义协议 dev->cloud */


      

Marco PRO_MQ_NG_DEV_EVENT

#define PRO_MQ_NG_DEV_EVENT        55 /* NG下发的设备事件 */


      

Marco PRO_DEV_WAKEUP

#define PRO_DEV_WAKEUP             102 /* cloud -> dev, 更新子设备待唤醒标志 */


      

Marco PRO_MQ_COMMON

#define PRO_MQ_COMMON              100 /* cloud -> dev common protocol*/


      

Marco PRO_MQ_EN_GW_ADD_DEV_REQ

#define PRO_MQ_EN_GW_ADD_DEV_REQ   200 // gw enable add sub device request


      

Marco PRO_MQ_EN_GW_ADD_DEV_RESP

#define PRO_MQ_EN_GW_ADD_DEV_RESP  201 // gw enable add sub device respond


      

Marco PRO_DEV_LC_GROUP_OPER

#define PRO_DEV_LC_GROUP_OPER      202 /* cloud -> dev */


      

Marco PRO_DEV_LC_GROUP_OPER_RESP

#define PRO_DEV_LC_GROUP_OPER_RESP 203 /* dev -> cloud */


      

Marco PRO_DEV_LC_SENCE_OPER

#define PRO_DEV_LC_SENCE_OPER      204 /* cloud -> dev */


      

Marco PRO_DEV_LC_SENCE_OPER_RESP

#define PRO_DEV_LC_SENCE_OPER_RESP 205 /* dev -> cloud */


      

Marco PRO_DEV_LC_SENCE_EXEC

#define PRO_DEV_LC_SENCE_EXEC      206 /* cloud -> dev */


      

Marco PRO_CLOUD_STORAGE_ORDER_REQ

#define PRO_CLOUD_STORAGE_ORDER_REQ 300 /* 云存储订单 */


      

Marco PRO_3RD_PARTY_STREAMING_REQ

#define PRO_3RD_PARTY_STREAMING_REQ 301 /* echo show/chromecast request */


      

Marco PRO_RTC_REQ

#define PRO_RTC_REQ                302 /* cloud -> dev */


      

Marco PRO_AI_DETECT_DATA_SYNC_REQ

#define PRO_AI_DETECT_DATA_SYNC_REQ 304 /* 本地AI数据更新,当前用于人脸检测样本数据更新(新增/删除/变更) */


      

Marco PRO_FACE_DETECT_DATA_SYNC

#define PRO_FACE_DETECT_DATA_SYNC  306 /* 人脸识别数据同步通知,门禁设备使用 */


      

Marco PRO_CLOUD_STORAGE_EVENT_REQ

#define PRO_CLOUD_STORAGE_EVENT_REQ 307 /* 联动触发云存储 */


      

Marco PRO_DOORBELL_STATUS_REQ

#define PRO_DOORBELL_STATUS_REQ    308 /* 门铃请求被用户处理,接听或者拒绝 */


      

Marco PRO_MQ_CLOUD_STREAM_GATEWAY

#define PRO_MQ_CLOUD_STREAM_GATEWAY 312


      

Marco PRO_GW_COM_SENCE_EXE

#define PRO_GW_COM_SENCE_EXE       403 /* cloud -> dev 原云端场景放到本地执行 */


      

Marco PRO_DEV_ALARM_DOWN

#define PRO_DEV_ALARM_DOWN   		701 /* cloud -> dev */


      

Marco PRO_DEV_ALARM_UP

#define PRO_DEV_ALARM_UP     		702 /* dev -> cloud */


      

Marco mqc_subscribe_multi_topics(topics, cnt, msg_cb)

#define mqc_subscribe_multi_topics(topics, cnt, msg_cb) mqc_subscribe_multi_topics_ext(topics, cnt, msg_cb, TRUE)
/**
 * @brief Subcribe multiple topics within one MQTT request
 * 
 * @param[in] topics Array of topics to subscribe
 * @param[in] cnt Count of topics to subscribe
 * @param[in] msg_cb Callback when MQTT msgs recv. If msg_cb is NULL, 
 * msgs will transfer to default recv_cb of MQTT client
 * @param[in] auto_resub Re-subscribe when mqtt re-connect
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Marco __NETCFG_MODULE__

#define __NETCFG_MODULE__


      

Marco VENDOR_TUYA

#define VENDOR_TUYA		(1 << 0)
/*
	配网提供方:
	tuya, jd, weixin

*/

Marco VENDOR_JD

#define VENDOR_JD		(1 << 1)


      

Marco VENDOR_WEIXIN

#define VENDOR_WEIXIN	(1 << 2)


      

Marco VENDOR_AMAZON

#define VENDOR_AMAZON	(1 << 3)


      

Marco WIFI_SMARTCFG

#define WIFI_SMARTCFG				(1 << 0)


      

Marco WIFI_AP

#define WIFI_AP					(1 << 1)


      

Marco BLE

#define BLE						(1 << 2)


      

Marco CAMERA_QR

#define CAMERA_QR				(1 << 3)


      

Marco WIFI_SMARTCFG_COEXIST

#define WIFI_SMARTCFG_COEXIST		(1 << 4)


      

Marco WIFI_AP_COEXIST

#define WIFI_AP_COEXIST			(1 << 5)


      

Marco WIFI_FFS

#define WIFI_FFS				(1 << 6)


      

Marco WIFI_PEGASUS

#define WIFI_PEGASUS			(1 << 7)//无感配网


      

Marco API_USER

#define API_USER   				(1 << 8)//用户通过api配网


      

Marco NETCFG_TY_WIFI_SMARTCFG

#define NETCFG_TY_WIFI_SMARTCFG				((VENDOR_TUYA << 16) | WIFI_SMARTCFG)
// ez

Marco NETCFG_TY_WIFI_SMARTCFG_COEXIST

#define NETCFG_TY_WIFI_SMARTCFG_COEXIST		((VENDOR_TUYA << 16) | WIFI_SMARTCFG_COEXIST)
// ez in WF_START_SMART_AP_CONCURRENT

Marco NETCFG_TY_WIFI_AP

#define NETCFG_TY_WIFI_AP			((VENDOR_TUYA << 16) | WIFI_AP)
//ap 

Marco NETCFG_TY_WIFI_AP_COEXIST

#define NETCFG_TY_WIFI_AP_COEXIST	((VENDOR_TUYA << 16) | WIFI_AP_COEXIST)
//ap in WF_START_SMART_AP_CONCURRENT

Marco NETCFG_TY_BLE

#define NETCFG_TY_BLE				((VENDOR_TUYA << 16) | BLE)
//ble 

Marco NETCFG_TY_CAMERA_QR

#define NETCFG_TY_CAMERA_QR			((VENDOR_TUYA << 16) | CAMERA_QR)
//qr

Marco NETCFG_TY_API_USER

#define NETCFG_TY_API_USER 			((VENDOR_TUYA << 16) | API_USER)
//user or uart

Marco NETCFG_JD_WIFI_SMART

#define NETCFG_JD_WIFI_SMART		((VENDOR_JD << 16) | WIFI_SMARTCFG)


      

Marco NETCFG_WX_WIFI_AIRKISS

#define NETCFG_WX_WIFI_AIRKISS		((VENDOR_WEIXIN << 16) | WIFI_SMARTCFG)
//wechat airkiss

Marco NETCFG_AMAZON_WIFI_FFS

#define NETCFG_AMAZON_WIFI_FFS		((VENDOR_AMAZON << 16) | (WIFI_FFS))
//amazon ffs netcfg

Marco NETCFG_TY_WIFI_PEGASUS

#define NETCFG_TY_WIFI_PEGASUS		((VENDOR_TUYA << 16) | WIFI_PEGASUS)
//tuya pegasus netcfg

Marco NETCFG_STOP_ALL_CFG_MODULE

#define NETCFG_STOP_ALL_CFG_MODULE	(0)


      

Marco DEF_AP_SSID_PF

#define DEF_AP_SSID_PF "SmartLife"


      

Marco WL_TOKEN_LEN

#define WL_TOKEN_LEN (16)


      

Marco __WIFI_NETCFG_FRAME_SNIFFER_H__

#define __WIFI_NETCFG_FRAME_SNIFFER_H__


      

Marco __WIFI_NETCFG_FRAME_TRANSPORTER_H__

#define __WIFI_NETCFG_FRAME_TRANSPORTER_H__


      

Marco __TUYA_SVC_ONLINE_LOG_H__

#define __TUYA_SVC_ONLINE_LOG_H__


      

Marco __PEGASUS_FRAME_H__

#define __PEGASUS_FRAME_H__


      

Marco PEGASUS_FRAME_LEN_MAX

#define PEGASUS_FRAME_LEN_MAX                  512
/*============================ MACROS ========================================*/

Marco PEGASUS_DATA_LEN_MAX

#define PEGASUS_DATA_LEN_MAX                   256


      

Marco PEGASUS_MAC_LEN

#define PEGASUS_MAC_LEN                        6


      

Marco WNC_PEGASUS

#define WNC_PEGASUS                            4


      

Marco TUYA_PEGASUS_BEACON

#define TUYA_PEGASUS_BEACON                    "pegasus"


      

Marco TUYA_PEGASUS_SSID

#define TUYA_PEGASUS_SSID                      NULL


      

Marco PEGASUS_TYPE_CMD

#define PEGASUS_TYPE_CMD                       1


      

Marco PEGASUS_TYPE_PRODUCT_ID

#define PEGASUS_TYPE_PRODUCT_ID                2


      

Marco PEGASUS_TYPE_DEV_ID

#define PEGASUS_TYPE_DEV_ID                    3


      

Marco PEGASUS_TYPE_DEV_MAC

#define PEGASUS_TYPE_DEV_MAC                   4


      

Marco PEGASUS_TYPE_RA_UUID_HMAC

#define PEGASUS_TYPE_RA_UUID_HMAC              5


      

Marco PEGASUS_TYPE_RA_AES

#define PEGASUS_TYPE_RA_AES                    6


      

Marco PEGASUS_TYPE_RA_HMAC

#define PEGASUS_TYPE_RA_HMAC                   7


      

Marco PEGASUS_TYPE_RB_AES

#define PEGASUS_TYPE_RB_AES                    8


      

Marco PEGASUS_TYPE_RB_HMAC

#define PEGASUS_TYPE_RB_HMAC                   9


      

Marco PEGASUS_TYPE_UUID_HMAC

#define PEGASUS_TYPE_UUID_HMAC                 0xa


      

Marco PEGASUS_TYPE_AP_MAC

#define PEGASUS_TYPE_AP_MAC                    0xb


      

Marco WFC_TYPE_TAG

#define WFC_TYPE_TAG                           253


      

Marco PEGASUS_TYPE_CRC32

#define PEGASUS_TYPE_CRC32                     254


      

Marco PEGASUS_TYPE_DATA

#define PEGASUS_TYPE_DATA                      255


      

Marco PEGASUS_CMD_CLIENT_FIRST_REQ

#define PEGASUS_CMD_CLIENT_FIRST_REQ                  0
//1.1 Client Request First Config

Marco PEGASUS_CMD_CLIENT_SECOND_REQ

#define PEGASUS_CMD_CLIENT_SECOND_REQ                 1
//1.1 Client Request Second Config

Marco PEGASUS_CMD_SERVER_FIRST_SECOND_REQ_ACK

#define PEGASUS_CMD_SERVER_FIRST_SECOND_REQ_ACK       130
//1.2 Server Ack to Client Request

Marco PEGASUS_CMD_SERVER_RECHECK_REQ

#define PEGASUS_CMD_SERVER_RECHECK_REQ                131
//2.1 Server Request Check

Marco PEGASUS_CMD_CLIENT_RECHECK_ACK

#define PEGASUS_CMD_CLIENT_RECHECK_ACK                3
//2.2 Clien Ack to Server Check

Marco PEGASUS_CMD_SERVER_CONFIG_CANCEL

#define PEGASUS_CMD_SERVER_CONFIG_CANCEL              132
/*cancel pegasus netcfg ,go to concurrent共存配网*/

Marco PEGASUS_CMD_SERVER_FIRST_CONFIG_RSP

#define PEGASUS_CMD_SERVER_FIRST_CONFIG_RSP           128
//3.1 Server Send ssid&passwd&token First Config

Marco PEGASUS_CMD_SERVER_SECOND_CONFIG_RSP

#define PEGASUS_CMD_SERVER_SECOND_CONFIG_RSP          129
//3.1 Server Send ssid&passwd&token Second Config

Marco PEGASUS_CMD_CLIENT_NET_CONFIG_ACK

#define PEGASUS_CMD_CLIENT_NET_CONFIG_ACK             2
//3.2 Client Ack to Server Send ssid&passwd&token

Marco PEGASUS_DATA_TYPE_SSID

#define PEGASUS_DATA_TYPE_SSID                 1


      

Marco PEGASUS_DATA_TYPE_SECURITY_MODE

#define PEGASUS_DATA_TYPE_SECURITY_MODE        2


      

Marco PEGASUS_DATA_TYPE_PASSWD

#define PEGASUS_DATA_TYPE_PASSWD               3


      

Marco PEGASUS_DATA_TYPE_CHANNEL

#define PEGASUS_DATA_TYPE_CHANNEL              4


      

Marco PEGASUS_DATA_TYPE_BSSID

#define PEGASUS_DATA_TYPE_BSSID                5


      

Marco PEGASUS_DATA_TYPE_TOKEN

#define PEGASUS_DATA_TYPE_TOKEN                6


      

Marco __PEGASUS_NETCFG__

#define __PEGASUS_NETCFG__


      

Marco __SVC_PEGASUS_H__

#define __SVC_PEGASUS_H__


      

Marco _COM_PROTOCOL_H

#define _COM_PROTOCOL_H


      

Marco _BASE_RPC_COM_H

#define _BASE_RPC_COM_H


      

Marco COM_KEY_LEN_LMT

#define COM_KEY_LEN_LMT            16


      

Marco BRC_SET_PRIV_DATA_CMD

#define BRC_SET_PRIV_DATA_CMD      0


      

Marco BRC_GET_PRIV_DATA_CMD

#define BRC_GET_PRIV_DATA_CMD      1


      

Marco __C_TLV_H__

#define __C_TLV_H__


      

Marco UINT8(ptr)

#define UINT8(ptr)                  ((UINT8_T *)(ptr))
/* 强转成某一类型的指针 */

Marco INT8(ptr)

#define INT8(ptr)                   ((INT8_T *)(ptr))


      

Marco UINT16(ptr)

#define UINT16(ptr)                 ((UINT16_T *)(ptr))


      

Marco INT16(ptr)

#define INT16(ptr)                  ((INT16_T *)(ptr))


      

Marco UINT32(ptr)

#define UINT32(ptr)                 ((UINT_T *)(ptr))


      

Marco INT32(ptr)

#define INT32(ptr)                  ((INT_T *)(ptr))


      

Marco PACKED

#define PACKED                  __attribute__((packed))
/* 向指针赋值 */

Marco PUT8(ptr, c)

#define PUT8(ptr, c)            (*UINT8((ptr)) = (UINT8_T)(c))


      

Marco PUT16(ptr, s)

#define PUT16(ptr, s)           (*UINT16((ptr)) = (UINT16_T)(s))


      

Marco PUT32(ptr, l)

#define PUT32(ptr, l)           (*UINT32((ptr)) = (UINT_T)(l))


      

Marco GET_UINT8(ptr)

#define GET_UINT8(ptr)             (*UINT8((ptr)))
/* 从指针取值 */

Marco GET_INT8(ptr)

#define GET_INT8(ptr)              (*INT8((ptr)))


      

Marco GET_UINT16(ptr)

#define GET_UINT16(ptr)            (*UINT16((ptr)))


      

Marco GET_INT16(ptr)

#define GET_INT16(ptr)             (*INT16((ptr)))


      

Marco GET_UINT32(ptr)

#define GET_UINT32(ptr)            (*UINT32((ptr)))


      

Marco GET_INT32(ptr)

#define GET_INT32(ptr)             (*INT32((ptr)))


      

Marco ADVANCE8(ptr)

#define ADVANCE8(ptr)               ptr = (UINT8(UINT8((ptr)) + 1))
/* 指针向下移位 */

Marco ADVANCE16(ptr)

#define ADVANCE16(ptr)              ptr = (UINT8(UINT16((ptr)) + 1))


      

Marco ADVANCE32(ptr)

#define ADVANCE32(ptr)              ptr = (UINT8(UINT32((ptr)) + 1))


      

Marco MSG_MAGIC

#define MSG_MAGIC                (305419896)


      

Marco MSG_AVAILABLE_TLVS(msg)

#define MSG_AVAILABLE_TLVS(msg)  (((msg)->capacity) - ((msg)->nitems))


      

Marco MSG_TLV(msg, index)

#define MSG_TLV(msg, index)      (&((msg)->tlvs[(index)]))


      

Marco MSG_LAST_TLV(msg)

#define MSG_LAST_TLV(msg)     (MSG_TLV((msg), (msg)->nitems)) //last unvalid tlv element


      

Marco MSG_SIZE(msg)

#define MSG_SIZE(msg)         ((UINT16_T)(SIZEOF(message_t) + SIZEOF(tlv_t) * (msg)->capacity))


      

Marco __JSON_RPC_H__

#define __JSON_RPC_H__


      

Marco JRPC_PASER_ERROR

#define JRPC_PASER_ERROR           -32700


      

Marco JPRC_INVALID_REQUEST

#define JPRC_INVALID_REQUEST       -32600 


      

Marco JPRC_METHOD_NOT_FOUND

#define JPRC_METHOD_NOT_FOUND      -32601


      

Marco __LAN_RPC_H__

#define __LAN_RPC_H__


      

Marco LAN_RPC_ID_LEN

#define LAN_RPC_ID_LEN                 (GW_ID_LEN)


      

Marco LAN_RPC_KEY_LEN

#define LAN_RPC_KEY_LEN                (LOCAL_KEY_LEN)


      

Marco LAN_RPC_NODE_TIMEOUT

#define LAN_RPC_NODE_TIMEOUT            20


      

Marco LAN_RPC_NODE_ADD

#define LAN_RPC_NODE_ADD                0  


      

Marco LAN_RPC_NODE_DEL

#define LAN_RPC_NODE_DEL                1 


      

Marco LAN_RPC_NODE_REJOIN

#define LAN_RPC_NODE_REJOIN             2


      

Marco __RPC_UDP_H__

#define __RPC_UDP_H__


      

Marco OPRT_RPC_CALL_TIMEOUT

#define OPRT_RPC_CALL_TIMEOUT      -10


      

Marco OPRT_RPC_CALL_ERROR

#define OPRT_RPC_CALL_ERROR        -11


      

Marco RPC_DEFAULT_BUFSIZE

#define RPC_DEFAULT_BUFSIZE        256


      

Marco _TUYA_OPERATOR_H_

#define _TUYA_OPERATOR_H_


      

Marco TY_CUCC_UPLOAD_RESULT_OK

#define TY_CUCC_UPLOAD_RESULT_OK           0 // upload ok


      

Marco TY_CUCC_UPLOAD_ERR

#define TY_CUCC_UPLOAD_ERR                 1 // upload error


      

Marco TY_CUCC_IS_UNICOM_NETWORK

#define TY_CUCC_IS_UNICOM_NETWORK          0 // is unicom network


      

Marco TY_CUCC_NOT_UNICOM_NETWORK

#define TY_CUCC_NOT_UNICOM_NETWORK         1 // not unicom network


      

Marco TY_CUCC_NUMBER_ATTR_OK

#define TY_CUCC_NUMBER_ATTR_OK             0 // number attr ok


      

Marco TY_CUCC_NUMBER_NOT_BIND

#define TY_CUCC_NUMBER_NOT_BIND            1 // number not bind


      

Marco TY_CUCC_LOCATION_ERR

#define TY_CUCC_LOCATION_ERR               2 // location error


      

Marco EVENT_OPERATOR_INFO_UPLOAD

#define EVENT_OPERATOR_INFO_UPLOAD "EVT_OPR_UPLOAD" // event definition


      

Marco __TUYA_SVC_TIME_TASK_H__

#define __TUYA_SVC_TIME_TASK_H__


      

Marco __TUYA_SVC_SCHEMA_UPGRADE_H__

#define __TUYA_SVC_SCHEMA_UPGRADE_H__


      

Marco EVT_DEV_SCHEMA_UPGRADE

#define EVT_DEV_SCHEMA_UPGRADE "schema.ug.cid"


      

Marco __TUYA_SVC_UPGRADE_H__

#define __TUYA_SVC_UPGRADE_H__


      

Marco TUS_DOWNLOAD_START

#define TUS_DOWNLOAD_START 10 // download start


      

Marco TUS_DOWNLOAD_COMPLETE

#define TUS_DOWNLOAD_COMPLETE 11 // download complete


      

Marco TUS_UPGRADE_START

#define TUS_UPGRADE_START 12 // upgrade start


      

Marco TUS_UPGRADE_SUCCESS

#define TUS_UPGRADE_SUCCESS 3 //upgrade success


      

Marco TUS_DOWNLOAD_ERROR_UNKONW

#define TUS_DOWNLOAD_ERROR_UNKONW 40 // unknown error


      

Marco TUS_DOWNLOAD_ERROR_LOW_BATTERY

#define TUS_DOWNLOAD_ERROR_LOW_BATTERY 41 // low battery


      

Marco TUS_DOWNLOAD_ERROR_STORAGE_NOT_ENOUGH

#define TUS_DOWNLOAD_ERROR_STORAGE_NOT_ENOUGH 42 // storage not enough


      

Marco TUS_DOWNLOAD_ERROR_MALLOC_FAIL

#define TUS_DOWNLOAD_ERROR_MALLOC_FAIL 43 // malloc fail


      

Marco TUS_DOWNLOAD_ERROR_TIMEOUT

#define TUS_DOWNLOAD_ERROR_TIMEOUT 44 // download timeout


      

Marco TUS_DOWNLOAD_ERROR_HMAC

#define TUS_DOWNLOAD_ERROR_HMAC 45 // hmac not match


      

Marco TUS_UPGRADE_ERROR_LOW_BATTERY

#define TUS_UPGRADE_ERROR_LOW_BATTERY 46 // low battery


      

Marco TUS_UPGRADE_ERROR_MALLOC_FAIL

#define TUS_UPGRADE_ERROR_MALLOC_FAIL 47 // malloc fail


      

Marco TUS_UPGRADE_ERROR_VERSION

#define TUS_UPGRADE_ERROR_VERSION 48 // version invalid


      

Marco TUS_UPGRADE_ERROR_HMAC

#define TUS_UPGRADE_ERROR_HMAC 49 // hmac not match


      

Marco __TUYA_SVC_UPGRADE_HTTP_H__

#define __TUYA_SVC_UPGRADE_HTTP_H__


      

Marco __TUYA_FFC_APP_H__

#define __TUYA_FFC_APP_H__


      

Marco FFC_MASTER

#define FFC_MASTER                   1


      

Marco FFC_SLAVER

#define FFC_SLAVER                   2


      

Marco FFC_LOWPOWER_EVENT

#define FFC_LOWPOWER_EVENT           "ffc.lowpower"


      

Marco ffc_init

#define ffc_init       tuya_iot_wifi_ffc_init


      

Marco ffc_bind

#define ffc_bind       tuya_iot_wifi_ffc_bind


      

Marco ffc_unbind

#define ffc_unbind     tuya_iot_wifi_ffc_unbind


      

Marco ffc_send

#define ffc_send       tuya_iot_wifi_ffc_send


      

Marco ffc_control

#define ffc_control    tuya_iot_wifi_ffc_control


      

Marco COAP_ADDRESS_H_

#define COAP_ADDRESS_H_


      

Marco _coap_address_equals_impl(A, B)

#define _coap_address_equals_impl(A, B) \
       ((A)->port == (B)->port       \
       && (!!ip_addr_cmp(&(A)->addr,&(B)->addr)))


      

Marco _coap_address_isany_impl(A)

#define _coap_address_isany_impl(A) ip_addr_isany(&(A)->addr)


      

Marco _coap_is_mcast_impl(Address)

#define _coap_is_mcast_impl(Address) ip_addr_ismulticast(&(Address)->addr)


      

Marco _coap_address_equals_impl(A,B)

#define _coap_address_equals_impl(A,B) \
       ((A)->port == (B)->port       \
       && uip_ipaddr_cmp(&((A)->addr),&((B)->addr)))


      

Marco _coap_address_isany_impl(A)

#define _coap_address_isany_impl(A) 0
/** @todo implementation of _coap_address_isany_impl() for Contiki */

Marco _coap_is_mcast_impl(Address)

#define _coap_is_mcast_impl(Address) uip_is_addr_mcast(&((Address)->addr))


      

Marco ip_addr_cmp(addr1, addr2)

#define ip_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr)


      

Marco ip_addr_isany(addr1)

#define ip_addr_isany(addr1) ((addr1) == NULL || (addr1)->addr == TY_IPADDR_ANY)


      

Marco ip_addr_ismulticast(addr1)

#define ip_addr_ismulticast(addr1) (((addr1)->addr & UNI_HTONL(0xf0000000UL)) == UNI_HTONL(0xe0000000UL))


      

Marco _coap_address_equals_impl(A, B)

#define _coap_address_equals_impl(A, B) \
       ((A)->port == (B)->port       \
       && (!!ip_addr_cmp(&(A)->addr,&(B)->addr)))


      

Marco _coap_address_isany_impl(A)

#define _coap_address_isany_impl(A) ip_addr_isany(&(A)->addr)


      

Marco _coap_is_mcast_impl(Address)

#define _coap_is_mcast_impl(Address) ip_addr_ismulticast(&(Address)->addr)


      

Marco COAP_ASYNC_H_

#define COAP_ASYNC_H_


      

Marco COAP_ASYNC_CONFIRM

#define COAP_ASYNC_CONFIRM  1 /**< send confirmable response */
/* Definitions for Async Status Flags These flags can be used to control the
 * behaviour of asynchronous response generation.
 */

Marco COAP_ASYNC_SEPARATE

#define COAP_ASYNC_SEPARATE 2 /**< send separate response */


      

Marco COAP_ASYNC_OBSERVED

#define COAP_ASYNC_OBSERVED 4 /**< the resource is being observed */


      

Marco COAP_ASYNC_RELEASE_DATA

#define COAP_ASYNC_RELEASE_DATA 8
/** release application data on destruction */

Marco COAP_BITS_H_

#define COAP_BITS_H_


      

Marco COAP_BLOCK_H_

#define COAP_BLOCK_H_


      

Marco COAP_MAX_BLOCK_SZX

#define COAP_MAX_BLOCK_SZX     6
/**
 * The largest value for the SZX component in a Block option.
 */

Marco COAP_OPT_BLOCK_LAST(opt)

#define COAP_OPT_BLOCK_LAST(opt) \
 (coap_opt_length(opt) ? (coap_opt_value(opt) + (coap_opt_length(opt)-1)) : 0)
/**
 * Returns the value of the least significant byte of a Block option @p opt.
 * For zero-length options (i.e. num == m == szx == 0), COAP_OPT_BLOCK_LAST
 * returns @c NULL.
 */

Marco COAP_OPT_BLOCK_MORE(opt)

#define COAP_OPT_BLOCK_MORE(opt) \
 (coap_opt_length(opt) ? (*COAP_OPT_BLOCK_LAST(opt) & 8) : 0)
/** Returns the value of the More-bit of a Block option @p opt. */

Marco COAP_OPT_BLOCK_SZX(opt)

#define COAP_OPT_BLOCK_SZX(opt) \
 (coap_opt_length(opt) ? (*COAP_OPT_BLOCK_LAST(opt) & 7) : 0)
/** Returns the value of the SZX-field of a Block option @p opt. */

Marco COAP_H_

#define COAP_H_


      

Marco LIBCOAP_PACKAGE_BUGREPORT

#define LIBCOAP_PACKAGE_BUGREPORT "libcoap-developers@lists.sourceforge.net"
/* Define the address where bug reports for libcoap should be sent. */

Marco LIBCOAP_PACKAGE_NAME

#define LIBCOAP_PACKAGE_NAME "libcoap"
/* Define the full name of libcoap. */

Marco LIBCOAP_PACKAGE_STRING

#define LIBCOAP_PACKAGE_STRING "libcoap 4.2.0"
/* Define the full name and version of libcoap. */

Marco LIBCOAP_PACKAGE_URL

#define LIBCOAP_PACKAGE_URL "https://libcoap.net/"
/* Define the home page for libcoap. */

Marco LIBCOAP_PACKAGE_VERSION

#define LIBCOAP_PACKAGE_VERSION "4.2.0rc4"
/* Define the version of libcoap this file belongs to. */

Marco COAP_DEBUG_H_

#define COAP_DEBUG_H_


      

Marco COAP_DEBUG_FD

#define COAP_DEBUG_FD stdout
/**
 * Used for output for @c LOG_DEBUG to @c LOG_ERR.
 */

Marco COAP_ERR_FD

#define COAP_ERR_FD stderr
/**
 * Used for output for @c LOG_CRIT to @c LOG_EMERG.
 */

Marco coap_log(level, ...)

#define coap_log(level, ...) do { \
 if ((int)((level))<=(int)coap_get_log_level()) \
    PR_DEBUG(__VA_ARGS__);  \
} while(0)
/**
 * Logging function.
 * Writes the given text to @c COAP_ERR_FD (for @p level <= @c LOG_CRIT) or @c
 * COAP_DEBUG_FD (for @p level >= @c LOG_ERR). The text is output only when
 * @p level is below or equal to the log level that set by coap_set_log_level().
 *
 * @param level One of the LOG_* values.
 */

Marco COAP_DTLS_H_

#define COAP_DTLS_H_


      

Marco COAP_TLS_LIBRARY_NOTLS

#define COAP_TLS_LIBRARY_NOTLS 0 /**< No DTLS library */


      

Marco COAP_TLS_LIBRARY_TINYDTLS

#define COAP_TLS_LIBRARY_TINYDTLS 1 /**< Using TinyDTLS library */


      

Marco COAP_TLS_LIBRARY_OPENSSL

#define COAP_TLS_LIBRARY_OPENSSL 2 /**< Using OpenSSL library */


      

Marco COAP_TLS_LIBRARY_GNUTLS

#define COAP_TLS_LIBRARY_GNUTLS 3 /**< Using GnuTLS library */


      

Marco COAP_DTLS_PKI_SETUP_VERSION

#define COAP_DTLS_PKI_SETUP_VERSION 1 /**< Latest PKI setup version */


      

Marco COAP_EVENT_H_

#define COAP_EVENT_H_


      

Marco COAP_EVENT_DTLS_CLOSED

#define COAP_EVENT_DTLS_CLOSED       0
/**
 * (D)TLS events for COAP_PROTO_DTLS and COAP_PROTO_TLS
 */

Marco COAP_EVENT_DTLS_CONNECTED

#define COAP_EVENT_DTLS_CONNECTED    1DE


      

Marco COAP_EVENT_DTLS_RENEGOTIATE

#define COAP_EVENT_DTLS_RENEGOTIATE  1DF


      

Marco COAP_EVENT_DTLS_ERROR

#define COAP_EVENT_DTLS_ERROR        512


      

Marco COAP_EVENT_TCP_CONNECTED

#define COAP_EVENT_TCP_CONNECTED     4097
/**
 * TCP events for COAP_PROTO_TCP and COAP_PROTO_TLS
 */

Marco COAP_EVENT_TCP_CLOSED

#define COAP_EVENT_TCP_CLOSED        4098


      

Marco COAP_EVENT_TCP_FAILED

#define COAP_EVENT_TCP_FAILED        4099


      

Marco COAP_EVENT_SESSION_CONNECTED

#define COAP_EVENT_SESSION_CONNECTED 8193
/**
 * CSM exchange events for reliable protocols only
 */

Marco COAP_EVENT_SESSION_CLOSED

#define COAP_EVENT_SESSION_CLOSED    8194


      

Marco COAP_EVENT_SESSION_FAILED

#define COAP_EVENT_SESSION_FAILED    8195


      

Marco COAP_HASHKEY_H_

#define COAP_HASHKEY_H_


      

Marco coap_hash(String,Length,Result)

#define coap_hash(String,Length,Result) \
 coap_hash_impl((String),(Length),(Result))


      

Marco COAP_DEFAULT_HASH

#define COAP_DEFAULT_HASH
/* This is used to control the pre-set hash-keys for resources. */

Marco coap_str_hash(Str,H)

#define coap_str_hash(Str,H) {              \
   assert(Str);                            \
   memset((H), 0, sizeof(coap_key_t));     \
   coap_hash((Str)->s, (Str)->length, (H)); \
 }
/**
 * Calls coap_hash() with given @c coap_string_t object as parameter.
 *
 * @param Str Must contain a pointer to a coap string object.
 * @param H   A coap_key_t object to store the result.
 *
 * @hideinitializer
 */

Marco COAP_IO_H_

#define COAP_IO_H_


      

Marco COAP_RXBUFFER_SIZE

#define COAP_RXBUFFER_SIZE 1472


      

Marco COAP_SOCKET_EMPTY

#define COAP_SOCKET_EMPTY       0 /**< the socket is not used */
/**
 * coap_socket_flags_t values
 */

Marco COAP_SOCKET_NOT_EMPTY

#define COAP_SOCKET_NOT_EMPTY   1 /**< the socket is not empty */


      

Marco COAP_SOCKET_BOUND

#define COAP_SOCKET_BOUND       2 /**< the socket is bound */


      

Marco COAP_SOCKET_CONNECTED

#define COAP_SOCKET_CONNECTED   4 /**< the socket is connected */


      

Marco COAP_SOCKET_WANT_READ

#define COAP_SOCKET_WANT_READ   16 /**< non blocking socket is waiting for reading */


      

Marco COAP_SOCKET_WANT_WRITE

#define COAP_SOCKET_WANT_WRITE  32 /**< non blocking socket is waiting for writing */


      

Marco COAP_SOCKET_WANT_ACCEPT

#define COAP_SOCKET_WANT_ACCEPT 64 /**< non blocking server socket is waiting for accept */


      

Marco COAP_SOCKET_WANT_CONNECT

#define COAP_SOCKET_WANT_CONNECT 128 /**< non blocking client socket is waiting for connect */


      

Marco COAP_SOCKET_CAN_READ

#define COAP_SOCKET_CAN_READ    256 /**< non blocking socket can now read without blocking */


      

Marco COAP_SOCKET_CAN_WRITE

#define COAP_SOCKET_CAN_WRITE   512 /**< non blocking socket can now write without blocking */


      

Marco COAP_SOCKET_CAN_ACCEPT

#define COAP_SOCKET_CAN_ACCEPT  1024 /**< non blocking server socket can now accept without blocking */


      

Marco COAP_SOCKET_CAN_CONNECT

#define COAP_SOCKET_CAN_CONNECT 2048 /**< non blocking client socket can now connect without blocking */


      

Marco COAP_SOCKET_MULTICAST

#define COAP_SOCKET_MULTICAST   4096 /**< socket is used for multicast communication */


      

Marco COAP_MEM_H_

#define COAP_MEM_H_


      

Marco coap_malloc_type(type, size)

#define coap_malloc_type(type, size) memp_malloc(MEMP_ ## type)
/* It would be nice to check that size equals the size given at the memp
 * declaration, but i currently don't see a standard way to check that without
 * sourcing the custom memp pools and becoming dependent of its syntax
 */

Marco coap_free_type(type, p)

#define coap_free_type(type, p) memp_free(MEMP_ ## type, p)


      

Marco COAP_NET_H_

#define COAP_NET_H_


      

Marco COAP_SESSION_H_

#define COAP_SESSION_H_


      

Marco COAP_DEFAULT_SESSION_TIMEOUT

#define COAP_DEFAULT_SESSION_TIMEOUT 300


      

Marco COAP_PARTIAL_SESSION_TIMEOUT_TICKS

#define COAP_PARTIAL_SESSION_TIMEOUT_TICKS (30 * COAP_TICKS_PER_SECOND)


      

Marco COAP_DEFAULT_MAX_HANDSHAKE_SESSIONS

#define COAP_DEFAULT_MAX_HANDSHAKE_SESSIONS 100


      

Marco COAP_PROTO_NOT_RELIABLE(p)

#define COAP_PROTO_NOT_RELIABLE(p) ((p)==COAP_PROTO_UDP || (p)==COAP_PROTO_DTLS)


      

Marco COAP_PROTO_RELIABLE(p)

#define COAP_PROTO_RELIABLE(p) ((p)==COAP_PROTO_TCP || (p)==COAP_PROTO_TLS)


      

Marco COAP_SESSION_TYPE_CLIENT

#define COAP_SESSION_TYPE_CLIENT 1 /**< client-side */
/**
 * coap_session_type_t values
 */

Marco COAP_SESSION_TYPE_SERVER

#define COAP_SESSION_TYPE_SERVER 2 /**< server-side */


      

Marco COAP_SESSION_TYPE_HELLO

#define COAP_SESSION_TYPE_HELLO 3 /**< server-side ephemeral session for responding to a client hello */


      

Marco COAP_SESSION_STATE_NONE

#define COAP_SESSION_STATE_NONE               0
/**
 * coap_session_state_t values
 */

Marco COAP_SESSION_STATE_CONNECTING

#define COAP_SESSION_STATE_CONNECTING       1


      

Marco COAP_SESSION_STATE_HANDSHAKE

#define COAP_SESSION_STATE_HANDSHAKE       2


      

Marco COAP_SESSION_STATE_CSM

#define COAP_SESSION_STATE_CSM               3


      

Marco COAP_SESSION_STATE_ESTABLISHED

#define COAP_SESSION_STATE_ESTABLISHED       4


      

Marco COAP_DEFAULT_ACK_TIMEOUT

#define COAP_DEFAULT_ACK_TIMEOUT ((coap_fixed_point_t){2,0})
/**
   * Number of seconds when to expect an ACK or a response to an
   * outstanding CON message.
   * RFC 7252, Section 4.8 Default value of ACK_TIMEOUT is 2
   */

Marco COAP_DEFAULT_ACK_RANDOM_FACTOR

#define COAP_DEFAULT_ACK_RANDOM_FACTOR ((coap_fixed_point_t){1,500})
/**
    * A factor that is used to randomize the wait time before a message
    * is retransmitted to prevent synchronization effects.
    * RFC 7252, Section 4.8 Default value of ACK_RANDOM_FACTOR is 1.5
    */

Marco COAP_DEFAULT_MAX_RETRANSMIT

#define COAP_DEFAULT_MAX_RETRANSMIT 4
/**
     * Number of message retransmissions before message sending is stopped
     * RFC 7252, Section 4.8 Default value of MAX_RETRANSMIT is 4
     */

Marco COAP_DEFAULT_NSTART

#define COAP_DEFAULT_NSTART 1
/**
      * The number of simultaneous outstanding interactions that a client
      * maintains to a given server.
      * RFC 7252, Section 4.8 Default value of NSTART is 1
      */

Marco COAP_TIME_H_

#define COAP_TIME_H_


      

Marco COAP_TICKS_PER_SECOND

#define COAP_TICKS_PER_SECOND 1000
/* lwIP provides ms in sys_now */

Marco coap_clock_init

#define coap_clock_init coap_clock_init_impl


      

Marco coap_ticks

#define coap_ticks coap_ticks_impl


      

Marco COAP_TICKS_PER_SECOND

#define COAP_TICKS_PER_SECOND CLOCK_SECOND


      

Marco COAP_TICKS_PER_SECOND

#define COAP_TICKS_PER_SECOND ((coap_tick_t)(1000U))
/** Use ms resolution on POSIX systems */

Marco COAP_ENCODE_H_

#define COAP_ENCODE_H_


      

Marco Nn

#define Nn 8 /* duplicate definition of N if built on sky motes */


      

Marco ENCODE_HEADER_SIZE

#define ENCODE_HEADER_SIZE 4


      

Marco HIBIT

#define HIBIT (1 << (Nn - 1))


      

Marco EMASK

#define EMASK ((1 << ENCODE_HEADER_SIZE) - 1)


      

Marco MMASK

#define MMASK ((1 << Nn) - 1 - EMASK)


      

Marco MAX_VALUE

#define MAX_VALUE ( (1 << Nn) - (1 << ENCODE_HEADER_SIZE) ) * (1 << ((1 << ENCODE_HEADER_SIZE) - 1))


      

Marco COAP_PSEUDOFP_DECODE_8_4(r)

#define COAP_PSEUDOFP_DECODE_8_4(r) (r < HIBIT ? r : (r & MMASK) << (r & EMASK))


      

Marco coap_fls(i)

#define coap_fls(i) fls(i)


      

Marco coap_flsll(i)

#define coap_flsll(i) flsll(i)


      

Marco COAP_PSEUDOFP_ENCODE_8_4_DOWN(v,ls)

#define COAP_PSEUDOFP_ENCODE_8_4_DOWN(v,ls) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (v >> ls) & MMASK) + ls)
/* ls and s must be integer variables */

Marco COAP_PSEUDOFP_ENCODE_8_4_UP(v,ls,s)

#define COAP_PSEUDOFP_ENCODE_8_4_UP(v,ls,s) (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (s = (((v + ((1<> ls) & MMASK)), s == 0 ? HIBIT + ls + 1 : s + ls))


      

Marco COAP_LIBCOAP_H_

#define COAP_LIBCOAP_H_


      

Marco MEMP_NUM_COAPCONTEXT

#define MEMP_NUM_COAPCONTEXT 1


      

Marco MEMP_NUM_COAPENDPOINT

#define MEMP_NUM_COAPENDPOINT 1


      

Marco MEMP_NUM_COAPPACKET

#define MEMP_NUM_COAPPACKET 1


      

Marco MEMP_NUM_COAPNODE

#define MEMP_NUM_COAPNODE 4


      

Marco MEMP_NUM_COAPPDU

#define MEMP_NUM_COAPPDU MEMP_NUM_COAPNODE


      

Marco MEMP_NUM_COAPSESSION

#define MEMP_NUM_COAPSESSION 2


      

Marco MEMP_NUM_COAP_SUBSCRIPTION

#define MEMP_NUM_COAP_SUBSCRIPTION 4


      

Marco MEMP_NUM_COAPRESOURCE

#define MEMP_NUM_COAPRESOURCE 10


      

Marco MEMP_NUM_COAPRESOURCEATTR

#define MEMP_NUM_COAPRESOURCEATTR 20


      

Marco MEMP_NUM_COAPOPTLIST

#define MEMP_NUM_COAPOPTLIST 1


      

Marco MEMP_LEN_COAPOPTLIST

#define MEMP_LEN_COAPOPTLIST 12


      

Marco MEMP_NUM_COAPSTRING

#define MEMP_NUM_COAPSTRING 10


      

Marco MEMP_LEN_COAPSTRING

#define MEMP_LEN_COAPSTRING 32


      

Marco COAP_OPTION_H_

#define COAP_OPTION_H_


      

Marco COAP_OPT_FILTER_SHORT

#define COAP_OPT_FILTER_SHORT 6
/**
 * The number of option types below 256 that can be stored in an
 * option filter. COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be
 * at most 16. Each coap_option_filter_t object reserves
 * ((COAP_OPT_FILTER_SHORT + 1) / 2) * 2 bytes for short options.
 */

Marco COAP_OPT_FILTER_LONG

#define COAP_OPT_FILTER_LONG 2
/**
 * The number of option types above 255 that can be stored in an
 * option filter. COAP_OPT_FILTER_SHORT + COAP_OPT_FILTER_LONG must be
 * at most 16. Each coap_option_filter_t object reserves
 * COAP_OPT_FILTER_LONG * 2 bytes for short options.
 */

Marco COAP_OPT_FILTER_SIZE

#define COAP_OPT_FILTER_SIZE                                       \
 (((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) +1
/** The number of elements in coap_opt_filter_t. */

Marco COAP_OPT_ALL

#define COAP_OPT_ALL NULL
/** Pre-defined filter that includes all options. */

Marco COAP_PDU_H_

#define COAP_PDU_H_


      

Marco COAP_DEFAULT_PORT

#define COAP_DEFAULT_PORT     5683 /* CoAP default UDP/TCP port */


      

Marco COAPS_DEFAULT_PORT

#define COAPS_DEFAULT_PORT    5684 /* CoAP default UDP/TCP port for secure transmission */


      

Marco COAP_DEFAULT_MAX_AGE

#define COAP_DEFAULT_MAX_AGE    60 /* default maximum object lifetime in seconds */


      

Marco COAP_DEFAULT_MTU

#define COAP_DEFAULT_MTU      1152


      

Marco COAP_MESSAGE_SIZE_OFFSET_TCP8

#define COAP_MESSAGE_SIZE_OFFSET_TCP8 13
/* TCP Message format constants, do not modify */

Marco COAP_MESSAGE_SIZE_OFFSET_TCP16

#define COAP_MESSAGE_SIZE_OFFSET_TCP16 269 /* 13 + 256 */


      

Marco COAP_MESSAGE_SIZE_OFFSET_TCP32

#define COAP_MESSAGE_SIZE_OFFSET_TCP32 65805 /* 269 + 65536 */


      

Marco COAP_MAX_MESSAGE_SIZE_TCP0

#define COAP_MAX_MESSAGE_SIZE_TCP0 (COAP_MESSAGE_SIZE_OFFSET_TCP8-1) /* 12 */
/* Derived message size limits */

Marco COAP_MAX_MESSAGE_SIZE_TCP8

#define COAP_MAX_MESSAGE_SIZE_TCP8 (COAP_MESSAGE_SIZE_OFFSET_TCP16-1) /* 268 */


      

Marco COAP_MAX_MESSAGE_SIZE_TCP16

#define COAP_MAX_MESSAGE_SIZE_TCP16 (COAP_MESSAGE_SIZE_OFFSET_TCP32-1) /* 65804 */


      

Marco COAP_MAX_MESSAGE_SIZE_TCP32

#define COAP_MAX_MESSAGE_SIZE_TCP32 (COAP_MESSAGE_SIZE_OFFSET_TCP32+4294967295)


      

Marco COAP_DEFAULT_MAX_PDU_RX_SIZE

#define COAP_DEFAULT_MAX_PDU_RX_SIZE (COAP_MAX_MESSAGE_SIZE_TCP16+4)


      

Marco COAP_DEFAULT_MAX_PDU_RX_SIZE

#define COAP_DEFAULT_MAX_PDU_RX_SIZE (8*1024*1024+256)
/* 8 MiB max-message-size plus some space for options */

Marco COAP_DEBUG_BUF_SIZE

#define COAP_DEBUG_BUF_SIZE 128


      

Marco COAP_DEBUG_BUF_SIZE

#define COAP_DEBUG_BUF_SIZE (8 + 1024 * 2)
/* 1024 derived from RFC7252 4.6.  Message Size max payload */

Marco COAP_DEFAULT_VERSION

#define COAP_DEFAULT_VERSION     1 /* version of CoAP supported */


      

Marco COAP_DEFAULT_SCHEME

#define COAP_DEFAULT_SCHEME "coap" /* the default scheme for CoAP URIs */


      

Marco COAP_DEFAULT_URI_WELLKNOWN

#define COAP_DEFAULT_URI_WELLKNOWN ".well-known/core"
/** well-known resources URI */

Marco COAP_MESSAGE_CON

#define COAP_MESSAGE_CON      0 /* confirmable message (requires ACK/RST) */


      

Marco COAP_MESSAGE_NON

#define COAP_MESSAGE_NON      1 /* non-confirmable message (one-shot message) */


      

Marco COAP_MESSAGE_ACK

#define COAP_MESSAGE_ACK      2 /* used to acknowledge confirmable messages */


      

Marco COAP_MESSAGE_RST

#define COAP_MESSAGE_RST      3 /* indicates error in received messages */


      

Marco COAP_REQUEST_GET

#define COAP_REQUEST_GET      1


      

Marco COAP_REQUEST_POST

#define COAP_REQUEST_POST     2


      

Marco COAP_REQUEST_PUT

#define COAP_REQUEST_PUT      3


      

Marco COAP_REQUEST_DELETE

#define COAP_REQUEST_DELETE   4


      

Marco COAP_REQUEST_FETCH

#define COAP_REQUEST_FETCH    5 /* RFC 8132 */


      

Marco COAP_REQUEST_PATCH

#define COAP_REQUEST_PATCH    6 /* RFC 8132 */


      

Marco COAP_REQUEST_IPATCH

#define COAP_REQUEST_IPATCH   7 /* RFC 8132 */


      

Marco COAP_OPTION_IF_MATCH

#define COAP_OPTION_IF_MATCH       1 /* C, opaque, 0-8 B, (none) */


      

Marco COAP_OPTION_URI_HOST

#define COAP_OPTION_URI_HOST       3 /* C, String, 1-255 B, destination address */


      

Marco COAP_OPTION_ETAG

#define COAP_OPTION_ETAG           4 /* E, opaque, 1-8 B, (none) */


      

Marco COAP_OPTION_IF_NONE_MATCH

#define COAP_OPTION_IF_NONE_MATCH  5 /* empty, 0 B, (none) */


      

Marco COAP_OPTION_URI_PORT

#define COAP_OPTION_URI_PORT       7 /* C, uint, 0-2 B, destination port */


      

Marco COAP_OPTION_LOCATION_PATH

#define COAP_OPTION_LOCATION_PATH  8 /* E, String, 0-255 B, - */


      

Marco COAP_OPTION_URI_PATH

#define COAP_OPTION_URI_PATH      11 /* C, String, 0-255 B, (none) */


      

Marco COAP_OPTION_CONTENT_FORMAT

#define COAP_OPTION_CONTENT_FORMAT 12 /* E, uint, 0-2 B, (none) */


      

Marco COAP_OPTION_CONTENT_TYPE

#define COAP_OPTION_CONTENT_TYPE COAP_OPTION_CONTENT_FORMAT


      

Marco COAP_OPTION_MAXAGE

#define COAP_OPTION_MAXAGE        14 /* E, uint, 0--4 B, 60 Seconds */


      

Marco COAP_OPTION_URI_QUERY

#define COAP_OPTION_URI_QUERY     15 /* C, String, 1-255 B, (none) */


      

Marco COAP_OPTION_ACCEPT

#define COAP_OPTION_ACCEPT        17 /* C, uint,   0-2 B, (none) */


      

Marco COAP_OPTION_LOCATION_QUERY

#define COAP_OPTION_LOCATION_QUERY 20 /* E, String,   0-255 B, (none) */


      

Marco COAP_OPTION_SIZE2

#define COAP_OPTION_SIZE2         28 /* E, uint, 0-4 B, (none) */


      

Marco COAP_OPTION_PROXY_URI

#define COAP_OPTION_PROXY_URI     35 /* C, String, 1-1034 B, (none) */


      

Marco COAP_OPTION_PROXY_SCHEME

#define COAP_OPTION_PROXY_SCHEME  39 /* C, String, 1-255 B, (none) */


      

Marco COAP_OPTION_SIZE1

#define COAP_OPTION_SIZE1         60 /* E, uint, 0-4 B, (none) */


      

Marco COAP_OPTION_OBSERVE

#define COAP_OPTION_OBSERVE        6 /* E, empty/uint, 0 B/0-3 B, (none) */


      

Marco COAP_OPTION_SUBSCRIPTION

#define COAP_OPTION_SUBSCRIPTION COAP_OPTION_OBSERVE


      

Marco COAP_OPTION_BLOCK2

#define COAP_OPTION_BLOCK2        23 /* C, uint, 0--3 B, (none) */


      

Marco COAP_OPTION_BLOCK1

#define COAP_OPTION_BLOCK1        27 /* C, uint, 0--3 B, (none) */


      

Marco COAP_OPTION_NORESPONSE

#define COAP_OPTION_NORESPONSE   258 /* N, uint, 0--1 B, 0 */


      

Marco COAP_MAX_OPT

#define COAP_MAX_OPT           65535 /**< the highest option number we know */


      

Marco COAP_RESPONSE_CODE(N)

#define COAP_RESPONSE_CODE(N) (((N)/100 << 5) | (N)%100)
/* As of draft-ietf-core-coap-04, response codes are encoded to base
 * 32, i.e.  the three upper bits determine the response class while
 * the remaining five fine-grained information specific to that class.
 */

Marco COAP_RESPONSE_CLASS(C)

#define COAP_RESPONSE_CLASS(C) (((C) >> 5) & 255)
/* Determines the class of response code C */

Marco COAP_ERROR_PHRASE_LENGTH

#define COAP_ERROR_PHRASE_LENGTH  32 /**< maximum length of error phrase */


      

Marco coap_response_phrase(x)

#define coap_response_phrase(x) ((char *)NULL)


      

Marco COAP_ERROR_PHRASE_LENGTH

#define COAP_ERROR_PHRASE_LENGTH   0 /**< maximum length of error phrase */


      

Marco COAP_RESPONSE_100

#define COAP_RESPONSE_100     40 /* 100 Continue */


      

Marco COAP_RESPONSE_200

#define COAP_RESPONSE_200     COAP_RESPONSE_CODE(200) /* 2.00 OK */


      

Marco COAP_RESPONSE_201

#define COAP_RESPONSE_201     COAP_RESPONSE_CODE(201) /* 2.01 Created */


      

Marco COAP_RESPONSE_304

#define COAP_RESPONSE_304     COAP_RESPONSE_CODE(203) /* 2.03 Valid */


      

Marco COAP_RESPONSE_400

#define COAP_RESPONSE_400     COAP_RESPONSE_CODE(400) /* 4.00 Bad Request */


      

Marco COAP_RESPONSE_404

#define COAP_RESPONSE_404     COAP_RESPONSE_CODE(404) /* 4.04 Not Found */


      

Marco COAP_RESPONSE_405

#define COAP_RESPONSE_405     COAP_RESPONSE_CODE(405) /* 4.05 Method Not Allowed */


      

Marco COAP_RESPONSE_415

#define COAP_RESPONSE_415     COAP_RESPONSE_CODE(415) /* 4.15 Unsupported Media Type */


      

Marco COAP_RESPONSE_500

#define COAP_RESPONSE_500     COAP_RESPONSE_CODE(500) /* 5.00 Internal Server Error */


      

Marco COAP_RESPONSE_501

#define COAP_RESPONSE_501     COAP_RESPONSE_CODE(501) /* 5.01 Not Implemented */


      

Marco COAP_RESPONSE_503

#define COAP_RESPONSE_503     COAP_RESPONSE_CODE(503) /* 5.03 Service Unavailable */


      

Marco COAP_RESPONSE_504

#define COAP_RESPONSE_504     COAP_RESPONSE_CODE(504) /* 5.04 Gateway Timeout */


      

Marco COAP_RESPONSE_X_242

#define COAP_RESPONSE_X_242   COAP_RESPONSE_CODE(402) /* Critical Option not supported */


      

Marco COAP_SIGNALING_CODE(N)

#define COAP_SIGNALING_CODE(N) (((N)/100 << 5) | (N)%100)


      

Marco COAP_SIGNALING_CSM

#define COAP_SIGNALING_CSM    COAP_SIGNALING_CODE(701)


      

Marco COAP_SIGNALING_PING

#define COAP_SIGNALING_PING   COAP_SIGNALING_CODE(702)


      

Marco COAP_SIGNALING_PONG

#define COAP_SIGNALING_PONG   COAP_SIGNALING_CODE(703)


      

Marco COAP_SIGNALING_RELEASE

#define COAP_SIGNALING_RELEASE COAP_SIGNALING_CODE(704)


      

Marco COAP_SIGNALING_ABORT

#define COAP_SIGNALING_ABORT  COAP_SIGNALING_CODE(705)


      

Marco COAP_SIGNALING_OPTION_MAX_MESSAGE_SIZE

#define COAP_SIGNALING_OPTION_MAX_MESSAGE_SIZE 2
/* Applies to COAP_SIGNALING_CSM */

Marco COAP_SIGNALING_OPTION_BLOCK_WISE_TRANSFER

#define COAP_SIGNALING_OPTION_BLOCK_WISE_TRANSFER 4


      

Marco COAP_SIGNALING_OPTION_CUSTODY

#define COAP_SIGNALING_OPTION_CUSTODY 2
/* Applies to COAP_SIGNALING_PING / COAP_SIGNALING_PONG */

Marco COAP_SIGNALING_OPTION_ALTERNATIVE_ADDRESS

#define COAP_SIGNALING_OPTION_ALTERNATIVE_ADDRESS 2
/* Applies to COAP_SIGNALING_RELEASE */

Marco COAP_SIGNALING_OPTION_HOLD_OFF

#define COAP_SIGNALING_OPTION_HOLD_OFF 4


      

Marco COAP_SIGNALING_OPTION_BAD_CSM_OPTION

#define COAP_SIGNALING_OPTION_BAD_CSM_OPTION 2
/* Applies to COAP_SIGNALING_ABORT */

Marco COAP_MEDIATYPE_TEXT_PLAIN

#define COAP_MEDIATYPE_TEXT_PLAIN                0 /* text/plain (UTF-8) */


      
      
#define COAP_MEDIATYPE_APPLICATION_LINK_FORMAT  40 /* application/link-format */


      

Marco COAP_MEDIATYPE_APPLICATION_XML

#define COAP_MEDIATYPE_APPLICATION_XML          41 /* application/xml */


      

Marco COAP_MEDIATYPE_APPLICATION_OCTET_STREAM

#define COAP_MEDIATYPE_APPLICATION_OCTET_STREAM 42 /* application/octet-stream */


      

Marco COAP_MEDIATYPE_APPLICATION_RDF_XML

#define COAP_MEDIATYPE_APPLICATION_RDF_XML      43 /* application/rdf+xml */


      

Marco COAP_MEDIATYPE_APPLICATION_EXI

#define COAP_MEDIATYPE_APPLICATION_EXI          47 /* application/exi  */


      

Marco COAP_MEDIATYPE_APPLICATION_JSON

#define COAP_MEDIATYPE_APPLICATION_JSON         50 /* application/json  */


      

Marco COAP_MEDIATYPE_APPLICATION_CBOR

#define COAP_MEDIATYPE_APPLICATION_CBOR         60 /* application/cbor  */


      

Marco COAP_MEDIATYPE_APPLICATION_COSE_SIGN

#define COAP_MEDIATYPE_APPLICATION_COSE_SIGN    98 /* application/cose; cose-type="cose-sign"     */
/* Content formats from RFC 8152 */

Marco COAP_MEDIATYPE_APPLICATION_COSE_SIGN1

#define COAP_MEDIATYPE_APPLICATION_COSE_SIGN1   18 /* application/cose; cose-type="cose-sign1"    */


      

Marco COAP_MEDIATYPE_APPLICATION_COSE_ENCRYPT

#define COAP_MEDIATYPE_APPLICATION_COSE_ENCRYPT 96 /* application/cose; cose-type="cose-encrypt"  */


      

Marco COAP_MEDIATYPE_APPLICATION_COSE_ENCRYPT0

#define COAP_MEDIATYPE_APPLICATION_COSE_ENCRYPT0 16 /* application/cose; cose-type="cose-encrypt0" */


      

Marco COAP_MEDIATYPE_APPLICATION_COSE_MAC

#define COAP_MEDIATYPE_APPLICATION_COSE_MAC     97 /* application/cose; cose-type="cose-mac"      */


      

Marco COAP_MEDIATYPE_APPLICATION_COSE_MAC0

#define COAP_MEDIATYPE_APPLICATION_COSE_MAC0    17 /* application/cose; cose-type="cose-mac0"     */


      

Marco COAP_MEDIATYPE_APPLICATION_COSE_KEY

#define COAP_MEDIATYPE_APPLICATION_COSE_KEY    101 /* application/cose-key  */


      

Marco COAP_MEDIATYPE_APPLICATION_COSE_KEY_SET

#define COAP_MEDIATYPE_APPLICATION_COSE_KEY_SET 102 /* application/cose-key-set  */


      

Marco COAP_MEDIATYPE_APPLICATION_SENML_JSON

#define COAP_MEDIATYPE_APPLICATION_SENML_JSON  110 /* application/senml+json  */
/* Content formats from RFC 8428 */

Marco COAP_MEDIATYPE_APPLICATION_SENSML_JSON

#define COAP_MEDIATYPE_APPLICATION_SENSML_JSON 111 /* application/sensml+json */


      

Marco COAP_MEDIATYPE_APPLICATION_SENML_CBOR

#define COAP_MEDIATYPE_APPLICATION_SENML_CBOR  112 /* application/senml+cbor  */


      

Marco COAP_MEDIATYPE_APPLICATION_SENSML_CBOR

#define COAP_MEDIATYPE_APPLICATION_SENSML_CBOR 113 /* application/sensml+cbor */


      

Marco COAP_MEDIATYPE_APPLICATION_SENML_EXI

#define COAP_MEDIATYPE_APPLICATION_SENML_EXI   114 /* application/senml-exi   */


      

Marco COAP_MEDIATYPE_APPLICATION_SENSML_EXI

#define COAP_MEDIATYPE_APPLICATION_SENSML_EXI  115 /* application/sensml-exi  */


      

Marco COAP_MEDIATYPE_APPLICATION_SENML_XML

#define COAP_MEDIATYPE_APPLICATION_SENML_XML   310 /* application/senml+xml   */


      

Marco COAP_MEDIATYPE_APPLICATION_SENSML_XML

#define COAP_MEDIATYPE_APPLICATION_SENSML_XML  311 /* application/sensml+xml  */


      

Marco COAP_MEDIATYPE_ANY

#define COAP_MEDIATYPE_ANY                        255 /* any media type */
/* Note that identifiers for registered media types are in the range 0-65535. We
 * use an unallocated type here and hope for the best. */

Marco COAP_INVALID_TID

#define COAP_INVALID_TID -1
/** Indicates an invalid transaction id. */

Marco COAP_DROPPED_RESPONSE

#define COAP_DROPPED_RESPONSE -2
/**
 * Indicates that a response is suppressed. This will occur for error
 * responses if the request was received via IP multicast.
 */

Marco COAP_PDU_DELAYED

#define COAP_PDU_DELAYED -3


      

Marco COAP_OPT_LONG

#define COAP_OPT_LONG 15     /* OC == 0b1111 indicates that the option list
                                 * in a CoAP message is limited by 0b11110000
                                 * marker */


      

Marco COAP_OPT_END

#define COAP_OPT_END 240      /* end marker */


      

Marco COAP_PAYLOAD_START

#define COAP_PAYLOAD_START 255 /* payload marker */


      

Marco COAP_OPTION_KEY(option)

#define COAP_OPTION_KEY(option) (option).key


      

Marco COAP_OPTION_LENGTH(option)

#define COAP_OPTION_LENGTH(option) (option).length


      

Marco COAP_OPTION_DATA(option)

#define COAP_OPTION_DATA(option) ((unsigned char *)&(option) + sizeof(coap_option))


      

Marco COAP_PDU_IS_EMPTY(pdu)

#define COAP_PDU_IS_EMPTY(pdu)    ((pdu)->code == 0)


      

Marco COAP_PDU_IS_REQUEST(pdu)

#define COAP_PDU_IS_REQUEST(pdu)  (!COAP_PDU_IS_EMPTY(pdu) && (pdu)->code < 32)


      

Marco COAP_PDU_IS_RESPONSE(pdu)

#define COAP_PDU_IS_RESPONSE(pdu) ((pdu)->code >= 64 && (pdu)->code < 224)


      

Marco COAP_PDU_IS_SIGNALING(pdu)

#define COAP_PDU_IS_SIGNALING(pdu) ((pdu)->code >= 224)


      

Marco COAP_PDU_MAX_UDP_HEADER_SIZE

#define COAP_PDU_MAX_UDP_HEADER_SIZE 4


      

Marco COAP_PDU_MAX_TCP_HEADER_SIZE

#define COAP_PDU_MAX_TCP_HEADER_SIZE 6


      

Marco COAP_PROTO_NONE

#define COAP_PROTO_NONE        0
/**
* coap_proto_t values
*/

Marco COAP_PROTO_UDP

#define COAP_PROTO_UDP         1


      

Marco COAP_PROTO_DTLS

#define COAP_PROTO_DTLS        2


      

Marco COAP_PROTO_TCP

#define COAP_PROTO_TCP         3


      

Marco COAP_PROTO_TLS

#define COAP_PROTO_TLS         4


      

Marco COAP_PRNG_H_

#define COAP_PRNG_H_


      

Marco prng(Buf,Length)

#define prng(Buf,Length) contiki_prng_impl((Buf), (Length))


      

Marco prng_init(Value)

#define prng_init(Value) random_init((uint16_t)(Value))


      

Marco prng(Buf,Length)

#define prng(Buf,Length) lwip_prng_impl((Buf), (Length))


      

Marco prng_init

#define prng_init(Value)


      

Marco prng_init

#define prng_init(Value)


      

Marco prng(Buf,Length)

#define prng(Buf,Length) coap_prng_impl((Buf), (Length))
/**
 * Fills \p Buf with \p Length bytes of random data.
 *
 * @hideinitializer
 */

Marco prng_init(Value)

#define prng_init(Value) srand((unsigned long)(Value))
/**
 * Called to set the PRNG seed. You may want to re-define this to allow for a
 * better PRNG.
 *
 * @hideinitializer
 */

Marco COAP_RESOURCE_H_

#define COAP_RESOURCE_H_


      

Marco COAP_RESOURCE_CHECK_TIME

#define COAP_RESOURCE_CHECK_TIME 2
/** The interval in seconds to check if resources have changed. */

Marco COAP_ATTR_FLAGS_RELEASE_NAME

#define COAP_ATTR_FLAGS_RELEASE_NAME 1


      

Marco COAP_ATTR_FLAGS_RELEASE_VALUE

#define COAP_ATTR_FLAGS_RELEASE_VALUE 2


      

Marco COAP_RESOURCE_FLAGS_RELEASE_URI

#define COAP_RESOURCE_FLAGS_RELEASE_URI 1
/** The URI passed to coap_resource_init() is free'd by coap_delete_resource(). */

Marco COAP_RESOURCE_FLAGS_NOTIFY_NON

#define COAP_RESOURCE_FLAGS_NOTIFY_NON 0
/**
 * Notifications will be sent non-confirmable by default. RFC 7641 Section 4.5
 * https://tools.ietf.org/html/rfc7641#section-4.5
 */

Marco COAP_RESOURCE_FLAGS_NOTIFY_CON

#define COAP_RESOURCE_FLAGS_NOTIFY_CON 2
/**
 * Notifications will be sent confirmable by default. RFC 7641 Section 4.5
 * https://tools.ietf.org/html/rfc7641#section-4.5
 */

Marco COAP_PRINT_STATUS_MASK

#define COAP_PRINT_STATUS_MASK 4026531840u


      

Marco COAP_PRINT_OUTPUT_LENGTH(v)

#define COAP_PRINT_OUTPUT_LENGTH(v) ((v) & ~COAP_PRINT_STATUS_MASK)


      

Marco COAP_PRINT_STATUS_ERROR

#define COAP_PRINT_STATUS_ERROR 2147483648u


      

Marco COAP_PRINT_STATUS_TRUNC

#define COAP_PRINT_STATUS_TRUNC 1073741824u


      

Marco RESOURCES_ADD(r, obj)

#define RESOURCES_ADD(r, obj) \
 HASH_ADD(hh, (r), uri_path->s[0], (obj)->uri_path->length, (obj))


      

Marco RESOURCES_DELETE(r, obj)

#define RESOURCES_DELETE(r, obj) \
 HASH_DELETE(hh, (r), (obj))


      

Marco RESOURCES_ITER(r,tmp)

#define RESOURCES_ITER(r,tmp) \
 coap_resource_t *tmp, *rtmp; \
 HASH_ITER(hh, (r), tmp, rtmp)


      

Marco RESOURCES_FIND(r, k, res)

#define RESOURCES_FIND(r, k, res) {                    \
   HASH_FIND(hh, (r), (k)->s, (k)->length, (res)); \
 }


      

Marco COAP_STR_H_

#define COAP_STR_H_


      

Marco COAP_SET_STR(st,l,v)

#define COAP_SET_STR(st,l,v) { (st)->length = (l), (st)->s = (v); }


      

Marco coap_make_str_const(CStr)

#define coap_make_str_const(CStr)                                      \
 libcoap::CoAPStrConst{sizeof(CStr)-1, reinterpret_cast(CStr)}


      

Marco coap_make_str_const(string)

#define coap_make_str_const(string)                                    \
 (&(coap_str_const_t){sizeof(string)-1,(const uint8_t *)(string)})


      

Marco coap_string_equal(string1,string2)

#define coap_string_equal(string1,string2) \
       ((string1)->length == (string2)->length && ((string1)->length == 0 || \
        memcmp((string1)->s, (string2)->s, (string1)->length) == 0))
/**
 * Compares the two strings for equality
 *
 * @param string1 The first string.
 * @param string2 The second string.
 *
 * @return         @c 1 if the strings are equal
 *                 @c 0 otherwise.
 */

Marco COAP_SUBSCRIBE_H_

#define COAP_SUBSCRIBE_H_


      

Marco COAP_OBSERVE_ESTABLISH

#define COAP_OBSERVE_ESTABLISH 0
/**
 * The value COAP_OBSERVE_ESTABLISH in a GET request indicates a new observe
 * relationship for (sender address, token) is requested.
 */

Marco COAP_OBSERVE_CANCEL

#define COAP_OBSERVE_CANCEL 1
/**
 * The value COAP_OBSERVE_CANCEL in a GET request indicates that the observe
 * relationship for (sender address, token) must be cancelled.
 */

Marco COAP_OBS_MAX_NON

#define COAP_OBS_MAX_NON  5
/**
 * Number of notifications that may be sent non-confirmable before a confirmable
 * message is sent to detect if observers are alive. The maximum allowed value
 * here is @c 15.
 */

Marco COAP_OBS_MAX_FAIL

#define COAP_OBS_MAX_FAIL 3
/**
 * Number of confirmable notifications that may fail (i.e. time out without
 * being ACKed) before an observer is removed. The maximum value for
 * COAP_OBS_MAX_FAIL is @c 3.
 */

Marco COAP_URI_H_

#define COAP_URI_H_


      

Marco COAP_URI_SCHEME_SECURE_MASK

#define COAP_URI_SCHEME_SECURE_MASK 1
/** This mask can be used to check if a parsed URI scheme is secure. */

Marco UTHASH_H

#define UTHASH_H


      

Marco UTHASH_VERSION

#define UTHASH_VERSION 2.0.2


      

Marco DECLTYPE(x)

#define DECLTYPE(x) (decltype(x))


      

Marco NO_DECLTYPE

#define NO_DECLTYPE


      

Marco NO_DECLTYPE

#define NO_DECLTYPE


      

Marco DECLTYPE(x)

#define DECLTYPE(x) (__typeof(x))


      

Marco DECLTYPE

#define DECLTYPE(x)


      

Marco DECLTYPE_ASSIGN(dst,src)

#define DECLTYPE_ASSIGN(dst,src)                                                \
do {                                                                            \
 char **_da_dst = (char**)(&(dst));                                            \
 *_da_dst = (char*)(src);                                                      \
} while (0)


      

Marco DECLTYPE_ASSIGN(dst,src)

#define DECLTYPE_ASSIGN(dst,src)                                                \
do {                                                                            \
 (dst) = DECLTYPE(dst)(src);                                                   \
} while (0)


      

Marco uthash_fatal(msg)

#define uthash_fatal(msg) exit(-1)       /* fatal error (out of memory,etc) */


      

Marco uthash_malloc(sz)

#define uthash_malloc(sz) malloc(sz)     /* malloc fcn                      */


      

Marco uthash_free(ptr,sz)

#define uthash_free(ptr,sz) free(ptr)    /* free fcn                        */


      

Marco uthash_bzero(a,n)

#define uthash_bzero(a,n) memset(a,'\0',n)


      

Marco uthash_memcmp(a,b,n)

#define uthash_memcmp(a,b,n) memcmp(a,b,n)


      

Marco uthash_strlen(s)

#define uthash_strlen(s) strlen(s)


      

Marco uthash_noexpand_fyi(tbl)

#define uthash_noexpand_fyi(tbl)         /* can be defined to log noexpand  */


      

Marco uthash_expand_fyi(tbl)

#define uthash_expand_fyi(tbl)           /* can be defined to log expands   */


      

Marco HASH_INITIAL_NUM_BUCKETS

#define HASH_INITIAL_NUM_BUCKETS 32U    /* initial number of buckets        */
/* initial number of buckets */

Marco HASH_INITIAL_NUM_BUCKETS_LOG2

#define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */


      

Marco HASH_BKT_CAPACITY_THRESH

#define HASH_BKT_CAPACITY_THRESH 10U    /* expand when bucket count reaches */


      

Marco ELMT_FROM_HH(tbl,hhp)

#define ELMT_FROM_HH(tbl,hhp) ((void*)(((char*)(hhp)) - ((tbl)->hho)))
/* calculate the element whose hash handle address is hhp */

Marco HH_FROM_ELMT(tbl,elp)

#define HH_FROM_ELMT(tbl,elp) ((UT_hash_handle *)(((char*)(elp)) + ((tbl)->hho)))
/* calculate the hash handle from element address elp */

Marco HASH_VALUE(keyptr,keylen,hashv)

#define HASH_VALUE(keyptr,keylen,hashv)                                         \
do {                                                                            \
 HASH_FCN(keyptr, keylen, hashv);                                              \
} while (0)


      

Marco HASH_FIND_BYHASHVALUE(hh,head,keyptr,keylen,hashval,out)

#define HASH_FIND_BYHASHVALUE(hh,head,keyptr,keylen,hashval,out)                \
do {                                                                            \
 (out) = NULL;                                                                 \
 if (head) {                                                                   \
   unsigned _hf_bkt;                                                           \
   HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _hf_bkt);                 \
   if (HASH_BLOOM_TEST((head)->hh.tbl, hashval) != 0) {                        \
     HASH_FIND_IN_BKT((head)->hh.tbl, hh, (head)->hh.tbl->buckets[ _hf_bkt ], keyptr, keylen, hashval, out); \
   }                                                                           \
 }                                                                             \
} while (0)


      

Marco HASH_FIND(hh,head,keyptr,keylen,out)

#define HASH_FIND(hh,head,keyptr,keylen,out)                                    \
do {                                                                            \
 unsigned _hf_hashv;                                                           \
 HASH_VALUE(keyptr, keylen, _hf_hashv);                                        \
 HASH_FIND_BYHASHVALUE(hh, head, keyptr, keylen, _hf_hashv, out);              \
} while (0)


      

Marco HASH_BLOOM_BITLEN

#define HASH_BLOOM_BITLEN (1UL << HASH_BLOOM)


      

Marco HASH_BLOOM_BYTELEN

#define HASH_BLOOM_BYTELEN (HASH_BLOOM_BITLEN/8UL) + (((HASH_BLOOM_BITLEN%8UL)!=0UL) ? 1UL : 0UL)


      

Marco HASH_BLOOM_MAKE(tbl)

#define HASH_BLOOM_MAKE(tbl)                                                    \
do {                                                                            \
 (tbl)->bloom_nbits = HASH_BLOOM;                                              \
 (tbl)->bloom_bv = (uint8_t*)uthash_malloc(HASH_BLOOM_BYTELEN);                \
 if (!(tbl)->bloom_bv) {                                                       \
   uthash_fatal("out of memory");                                              \
 }                                                                             \
 uthash_bzero((tbl)->bloom_bv, HASH_BLOOM_BYTELEN);                            \
 (tbl)->bloom_sig = HASH_BLOOM_SIGNATURE;                                      \
} while (0)


      

Marco HASH_BLOOM_FREE(tbl)

#define HASH_BLOOM_FREE(tbl)                                                    \
do {                                                                            \
 uthash_free((tbl)->bloom_bv, HASH_BLOOM_BYTELEN);                             \
} while (0)


      

Marco HASH_BLOOM_BITSET(bv,idx)

#define HASH_BLOOM_BITSET(bv,idx) (bv[(idx)/8U] |= (1U << ((idx)%8U)))


      

Marco HASH_BLOOM_BITTEST(bv,idx)

#define HASH_BLOOM_BITTEST(bv,idx) (bv[(idx)/8U] & (1U << ((idx)%8U)))


      

Marco HASH_BLOOM_ADD(tbl,hashv)

#define HASH_BLOOM_ADD(tbl,hashv)                                               \
 HASH_BLOOM_BITSET((tbl)->bloom_bv, (hashv & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U)))


      

Marco HASH_BLOOM_TEST(tbl,hashv)

#define HASH_BLOOM_TEST(tbl,hashv)                                              \
 HASH_BLOOM_BITTEST((tbl)->bloom_bv, (hashv & (uint32_t)((1UL << (tbl)->bloom_nbits) - 1U)))


      

Marco HASH_BLOOM_MAKE

#define HASH_BLOOM_MAKE(tbl)


      

Marco HASH_BLOOM_FREE

#define HASH_BLOOM_FREE(tbl)


      

Marco HASH_BLOOM_ADD

#define HASH_BLOOM_ADD(tbl,hashv)


      

Marco HASH_BLOOM_TEST(tbl,hashv)

#define HASH_BLOOM_TEST(tbl,hashv) (1)


      

Marco HASH_BLOOM_BYTELEN

#define HASH_BLOOM_BYTELEN 0U


      

Marco HASH_MAKE_TABLE(hh,head)

#define HASH_MAKE_TABLE(hh,head)                                                \
do {                                                                            \
 (head)->hh.tbl = (UT_hash_table*)uthash_malloc(sizeof(UT_hash_table));        \
 if (!(head)->hh.tbl) {                                                        \
   uthash_fatal("out of memory");                                              \
 }                                                                             \
 uthash_bzero((head)->hh.tbl, sizeof(UT_hash_table));                          \
 (head)->hh.tbl->tail = &((head)->hh);                                         \
 (head)->hh.tbl->num_buckets = HASH_INITIAL_NUM_BUCKETS;                       \
 (head)->hh.tbl->log2_num_buckets = HASH_INITIAL_NUM_BUCKETS_LOG2;             \
 (head)->hh.tbl->hho = (char*)(&(head)->hh) - (char*)(head);                   \
 (head)->hh.tbl->buckets = (UT_hash_bucket*)uthash_malloc(                     \
     HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket));                \
 if (!(head)->hh.tbl->buckets) {                                               \
   uthash_fatal("out of memory");                                              \
 }                                                                             \
 uthash_bzero((head)->hh.tbl->buckets,                                         \
     HASH_INITIAL_NUM_BUCKETS * sizeof(struct UT_hash_bucket));                \
 HASH_BLOOM_MAKE((head)->hh.tbl);                                              \
 (head)->hh.tbl->signature = HASH_SIGNATURE;                                   \
} while (0)


      

Marco HASH_REPLACE_BYHASHVALUE_INORDER(hh,head,fieldname,keylen_in,hashval,add,replaced,cmpfcn)

#define HASH_REPLACE_BYHASHVALUE_INORDER(hh,head,fieldname,keylen_in,hashval,add,replaced,cmpfcn) \
do {                                                                            \
 (replaced) = NULL;                                                            \
 HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \
 if (replaced) {                                                               \
   HASH_DELETE(hh, head, replaced);                                            \
 }                                                                             \
 HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn); \
} while (0)


      

Marco HASH_REPLACE_BYHASHVALUE(hh,head,fieldname,keylen_in,hashval,add,replaced)

#define HASH_REPLACE_BYHASHVALUE(hh,head,fieldname,keylen_in,hashval,add,replaced) \
do {                                                                            \
 (replaced) = NULL;                                                            \
 HASH_FIND_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, replaced); \
 if (replaced) {                                                               \
   HASH_DELETE(hh, head, replaced);                                            \
 }                                                                             \
 HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add); \
} while (0)


      

Marco HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced)

#define HASH_REPLACE(hh,head,fieldname,keylen_in,add,replaced)                  \
do {                                                                            \
 unsigned _hr_hashv;                                                           \
 HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv);                        \
 HASH_REPLACE_BYHASHVALUE(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced); \
} while (0)


      

Marco HASH_REPLACE_INORDER(hh,head,fieldname,keylen_in,add,replaced,cmpfcn)

#define HASH_REPLACE_INORDER(hh,head,fieldname,keylen_in,add,replaced,cmpfcn)   \
do {                                                                            \
 unsigned _hr_hashv;                                                           \
 HASH_VALUE(&((add)->fieldname), keylen_in, _hr_hashv);                        \
 HASH_REPLACE_BYHASHVALUE_INORDER(hh, head, fieldname, keylen_in, _hr_hashv, add, replaced, cmpfcn); \
} while (0)


      

Marco HASH_APPEND_LIST(hh, head, add)

#define HASH_APPEND_LIST(hh, head, add)                                         \
do {                                                                            \
 (add)->hh.next = NULL;                                                        \
 (add)->hh.prev = ELMT_FROM_HH((head)->hh.tbl, (head)->hh.tbl->tail);          \
 (head)->hh.tbl->tail->next = (add);                                           \
 (head)->hh.tbl->tail = &((add)->hh);                                          \
} while (0)


      

Marco HASH_AKBI_INNER_LOOP(hh,head,add,cmpfcn)

#define HASH_AKBI_INNER_LOOP(hh,head,add,cmpfcn)                                \
do {                                                                            \
 do {                                                                          \
   if (cmpfcn(DECLTYPE(head)(_hs_iter), add) > 0) {                            \
     break;                                                                    \
   }                                                                           \
 } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next));          \
} while (0)


      

Marco HASH_AKBI_INNER_LOOP(hh,head,add,cmpfcn)

#define HASH_AKBI_INNER_LOOP(hh,head,add,cmpfcn)                                \
do {                                                                            \
 char *_hs_saved_head = (char*)(head);                                         \
 do {                                                                          \
   DECLTYPE_ASSIGN(head, _hs_iter);                                            \
   if (cmpfcn(head, add) > 0) {                                                \
     DECLTYPE_ASSIGN(head, _hs_saved_head);                                    \
     break;                                                                    \
   }                                                                           \
   DECLTYPE_ASSIGN(head, _hs_saved_head);                                      \
 } while ((_hs_iter = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->next));          \
} while (0)


      

Marco HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh,head,keyptr,keylen_in,hashval,add,cmpfcn)

#define HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh,head,keyptr,keylen_in,hashval,add,cmpfcn) \
do {                                                                            \
 unsigned _ha_bkt;                                                             \
 (add)->hh.hashv = (hashval);                                                  \
 (add)->hh.key = (char*) (keyptr);                                             \
 (add)->hh.keylen = (unsigned) (keylen_in);                                    \
 if (!(head)) {                                                                \
   (add)->hh.next = NULL;                                                      \
   (add)->hh.prev = NULL;                                                      \
   (head) = (add);                                                             \
   HASH_MAKE_TABLE(hh, head);                                                  \
 } else {                                                                      \
   void *_hs_iter = (head);                                                    \
   (add)->hh.tbl = (head)->hh.tbl;                                             \
   HASH_AKBI_INNER_LOOP(hh, head, add, cmpfcn);                                \
   if (_hs_iter) {                                                             \
     (add)->hh.next = _hs_iter;                                                \
     if (((add)->hh.prev = HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev)) {    \
       HH_FROM_ELMT((head)->hh.tbl, (add)->hh.prev)->next = (add);             \
     } else {                                                                  \
       (head) = (add);                                                         \
     }                                                                         \
     HH_FROM_ELMT((head)->hh.tbl, _hs_iter)->prev = (add);                     \
   } else {                                                                    \
     HASH_APPEND_LIST(hh, head, add);                                          \
   }                                                                           \
 }                                                                             \
 (head)->hh.tbl->num_items++;                                                  \
 HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt);                   \
 HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], &(add)->hh);                \
 HASH_BLOOM_ADD((head)->hh.tbl, hashval);                                      \
 HASH_EMIT_KEY(hh, head, keyptr, keylen_in);                                   \
 HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE_INORDER");                   \
} while (0)


      

Marco HASH_ADD_KEYPTR_INORDER(hh,head,keyptr,keylen_in,add,cmpfcn)

#define HASH_ADD_KEYPTR_INORDER(hh,head,keyptr,keylen_in,add,cmpfcn)            \
do {                                                                            \
 unsigned _hs_hashv;                                                           \
 HASH_VALUE(keyptr, keylen_in, _hs_hashv);                                     \
 HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, keyptr, keylen_in, _hs_hashv, add, cmpfcn); \
} while (0)


      

Marco HASH_ADD_BYHASHVALUE_INORDER(hh,head,fieldname,keylen_in,hashval,add,cmpfcn)

#define HASH_ADD_BYHASHVALUE_INORDER(hh,head,fieldname,keylen_in,hashval,add,cmpfcn) \
 HASH_ADD_KEYPTR_BYHASHVALUE_INORDER(hh, head, &((add)->fieldname), keylen_in, hashval, add, cmpfcn)


      

Marco HASH_ADD_INORDER(hh,head,fieldname,keylen_in,add,cmpfcn)

#define HASH_ADD_INORDER(hh,head,fieldname,keylen_in,add,cmpfcn)                \
 HASH_ADD_KEYPTR_INORDER(hh, head, &((add)->fieldname), keylen_in, add, cmpfcn)


      

Marco HASH_ADD_KEYPTR_BYHASHVALUE(hh,head,keyptr,keylen_in,hashval,add)

#define HASH_ADD_KEYPTR_BYHASHVALUE(hh,head,keyptr,keylen_in,hashval,add)       \
do {                                                                            \
 unsigned _ha_bkt;                                                             \
 (add)->hh.hashv = (hashval);                                                  \
 (add)->hh.key = (const void *) (keyptr);                                      \
 (add)->hh.keylen = (unsigned) (keylen_in);                                    \
 if (!(head)) {                                                                \
   (add)->hh.next = NULL;                                                      \
   (add)->hh.prev = NULL;                                                      \
   (head) = (add);                                                             \
   HASH_MAKE_TABLE(hh, head);                                                  \
 } else {                                                                      \
   (add)->hh.tbl = (head)->hh.tbl;                                             \
   HASH_APPEND_LIST(hh, head, add);                                            \
 }                                                                             \
 (head)->hh.tbl->num_items++;                                                  \
 HASH_TO_BKT(hashval, (head)->hh.tbl->num_buckets, _ha_bkt);                   \
 HASH_ADD_TO_BKT((head)->hh.tbl->buckets[_ha_bkt], &(add)->hh);                \
 HASH_BLOOM_ADD((head)->hh.tbl, hashval);                                      \
 HASH_EMIT_KEY(hh, head, keyptr, keylen_in);                                   \
 HASH_FSCK(hh, head, "HASH_ADD_KEYPTR_BYHASHVALUE");                           \
} while (0)


      

Marco HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add)

#define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add)                           \
do {                                                                            \
 unsigned _ha_hashv;                                                           \
 HASH_VALUE(keyptr, keylen_in, _ha_hashv);                                     \
 HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, keyptr, keylen_in, _ha_hashv, add);     \
} while (0)


      

Marco HASH_ADD_BYHASHVALUE(hh,head,fieldname,keylen_in,hashval,add)

#define HASH_ADD_BYHASHVALUE(hh,head,fieldname,keylen_in,hashval,add)           \
 HASH_ADD_KEYPTR_BYHASHVALUE(hh, head, &((add)->fieldname), keylen_in, hashval, add)


      

Marco HASH_ADD(hh,head,fieldname,keylen_in,add)

#define HASH_ADD(hh,head,fieldname,keylen_in,add)                               \
 HASH_ADD_KEYPTR(hh, head, &((add)->fieldname), keylen_in, add)


      

Marco HASH_TO_BKT(hashv,num_bkts,bkt)

#define HASH_TO_BKT(hashv,num_bkts,bkt)                                         \
do {                                                                            \
 bkt = ((hashv) & ((num_bkts) - 1U));                                          \
} while (0)


      

Marco HASH_DELETE(hh,head,delptr)

#define HASH_DELETE(hh,head,delptr)                                             \
   HASH_DELETE_HH(hh, head, &(delptr)->hh)
/* delete "delptr" from the hash table.
 * "the usual" patch-up process for the app-order doubly-linked-list.
 * The use of _hd_hh_del below deserves special explanation.
 * These used to be expressed using (delptr) but that led to a bug
 * if someone used the same symbol for the head and deletee, like
 *  HASH_DELETE(hh,users,users);
 * We want that to work, but by changing the head (users) below
 * we were forfeiting our ability to further refer to the deletee (users)
 * in the patch-up process. Solution: use scratch space to
 * copy the deletee pointer, then the latter references are via that
 * scratch pointer rather than through the repointed (users) symbol.
 */

Marco HASH_DELETE_HH(hh,head,delptrhh)

#define HASH_DELETE_HH(hh,head,delptrhh)                                        \
do {                                                                            \
 struct UT_hash_handle *_hd_hh_del = (delptrhh);                               \
 if ((_hd_hh_del->prev == NULL) && (_hd_hh_del->next == NULL)) {               \
   HASH_BLOOM_FREE((head)->hh.tbl);                                            \
   uthash_free((head)->hh.tbl->buckets,                                        \
               (head)->hh.tbl->num_buckets * sizeof(struct UT_hash_bucket));   \
   uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                         \
   (head) = NULL;                                                              \
 } else {                                                                      \
   unsigned _hd_bkt;                                                           \
   if (_hd_hh_del == (head)->hh.tbl->tail) {                                   \
     (head)->hh.tbl->tail = HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev);    \
   }                                                                           \
   if (_hd_hh_del->prev != NULL) {                                             \
     HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->prev)->next = _hd_hh_del->next;  \
   } else {                                                                    \
     DECLTYPE_ASSIGN(head, _hd_hh_del->next);                                  \
   }                                                                           \
   if (_hd_hh_del->next != NULL) {                                             \
     HH_FROM_ELMT((head)->hh.tbl, _hd_hh_del->next)->prev = _hd_hh_del->prev;  \
   }                                                                           \
   HASH_TO_BKT(_hd_hh_del->hashv, (head)->hh.tbl->num_buckets, _hd_bkt);       \
   HASH_DEL_IN_BKT((head)->hh.tbl->buckets[_hd_bkt], _hd_hh_del);              \
   (head)->hh.tbl->num_items--;                                                \
 }                                                                             \
 HASH_FSCK(hh, head, "HASH_DELETE");                                           \
} while (0)


      

Marco HASH_FIND_STR(head,findstr,out)

#define HASH_FIND_STR(head,findstr,out)                                         \
   HASH_FIND(hh,head,findstr,(unsigned)uthash_strlen(findstr),out)
/* convenience forms of HASH_FIND/HASH_ADD/HASH_DEL */

Marco HASH_ADD_STR(head,strfield,add)

#define HASH_ADD_STR(head,strfield,add)                                         \
   HASH_ADD(hh,head,strfield[0],(unsigned)uthash_strlen(add->strfield),add)


      

Marco HASH_REPLACE_STR(head,strfield,add,replaced)

#define HASH_REPLACE_STR(head,strfield,add,replaced)                            \
   HASH_REPLACE(hh,head,strfield[0],(unsigned)uthash_strlen(add->strfield),add,replaced)


      

Marco HASH_FIND_INT(head,findint,out)

#define HASH_FIND_INT(head,findint,out)                                         \
   HASH_FIND(hh,head,findint,sizeof(int),out)


      

Marco HASH_ADD_INT(head,intfield,add)

#define HASH_ADD_INT(head,intfield,add)                                         \
   HASH_ADD(hh,head,intfield,sizeof(int),add)


      

Marco HASH_REPLACE_INT(head,intfield,add,replaced)

#define HASH_REPLACE_INT(head,intfield,add,replaced)                            \
   HASH_REPLACE(hh,head,intfield,sizeof(int),add,replaced)


      

Marco HASH_FIND_PTR(head,findptr,out)

#define HASH_FIND_PTR(head,findptr,out)                                         \
   HASH_FIND(hh,head,findptr,sizeof(void *),out)


      

Marco HASH_ADD_PTR(head,ptrfield,add)

#define HASH_ADD_PTR(head,ptrfield,add)                                         \
   HASH_ADD(hh,head,ptrfield,sizeof(void *),add)


      

Marco HASH_REPLACE_PTR(head,ptrfield,add,replaced)

#define HASH_REPLACE_PTR(head,ptrfield,add,replaced)                            \
   HASH_REPLACE(hh,head,ptrfield,sizeof(void *),add,replaced)


      

Marco HASH_DEL(head,delptr)

#define HASH_DEL(head,delptr)                                                   \
   HASH_DELETE(hh,head,delptr)


      

Marco HASH_OOPS(...)

#define HASH_OOPS(...) do { fprintf(stderr,__VA_ARGS__); exit(-1); } while (0)


      

Marco HASH_FSCK(hh,head,where)

#define HASH_FSCK(hh,head,where)                                                \
do {                                                                            \
 struct UT_hash_handle *_thh;                                                  \
 if (head) {                                                                   \
   unsigned _bkt_i;                                                            \
   unsigned _count = 0;                                                        \
   char *_prev;                                                                \
   for (_bkt_i = 0; _bkt_i < (head)->hh.tbl->num_buckets; ++_bkt_i) {          \
     unsigned _bkt_count = 0;                                                  \
     _thh = (head)->hh.tbl->buckets[_bkt_i].hh_head;                           \
     _prev = NULL;                                                             \
     while (_thh) {                                                            \
       if (_prev != (char*)(_thh->hh_prev)) {                                  \
         HASH_OOPS("%s: invalid hh_prev %p, actual %p\n",                      \
             (where), (void*)_thh->hh_prev, (void*)_prev);                     \
       }                                                                       \
       _bkt_count++;                                                           \
       _prev = (char*)(_thh);                                                  \
       _thh = _thh->hh_next;                                                   \
     }                                                                         \
     _count += _bkt_count;                                                     \
     if ((head)->hh.tbl->buckets[_bkt_i].count != _bkt_count) {               \
       HASH_OOPS("%s: invalid bucket count %u, actual %u\n",                   \
           (where), (head)->hh.tbl->buckets[_bkt_i].count, _bkt_count);        \
     }                                                                         \
   }                                                                           \
   if (_count != (head)->hh.tbl->num_items) {                                  \
     HASH_OOPS("%s: invalid hh item count %u, actual %u\n",                    \
         (where), (head)->hh.tbl->num_items, _count);                          \
   }                                                                           \
   _count = 0;                                                                 \
   _prev = NULL;                                                               \
   _thh = &(head)->hh;                                                        \
   while (_thh) {                                                              \
     _count++;                                                                 \
     if (_prev != (char*)_thh->prev) {                                         \
       HASH_OOPS("%s: invalid prev %p, actual %p\n",                           \
           (where), (void*)_thh->prev, (void*)_prev);                          \
     }                                                                         \
     _prev = (char*)ELMT_FROM_HH((head)->hh.tbl, _thh);                        \
     _thh = (_thh->next ? HH_FROM_ELMT((head)->hh.tbl, _thh->next) : NULL);    \
   }                                                                           \
   if (_count != (head)->hh.tbl->num_items) {                                  \
     HASH_OOPS("%s: invalid app item count %u, actual %u\n",                   \
         (where), (head)->hh.tbl->num_items, _count);                          \
   }                                                                           \
 }                                                                             \
} while (0)


      

Marco HASH_FSCK

#define HASH_FSCK(hh,head,where)


      

Marco HASH_EMIT_KEY(hh,head,keyptr,fieldlen)

#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)                                  \
do {                                                                            \
 unsigned _klen = fieldlen;                                                    \
 write(HASH_EMIT_KEYS, &_klen, sizeof(_klen));                                 \
 write(HASH_EMIT_KEYS, keyptr, (unsigned long)fieldlen);                       \
} while (0)


      

Marco HASH_EMIT_KEY

#define HASH_EMIT_KEY(hh,head,keyptr,fieldlen)


      

Marco HASH_FCN

#define HASH_FCN HASH_FUNCTION


      

Marco HASH_FCN

#define HASH_FCN HASH_JEN


      

Marco HASH_BER(key,keylen,hashv)

#define HASH_BER(key,keylen,hashv)                                              \
do {                                                                            \
 unsigned _hb_keylen = (unsigned)keylen;                                       \
 const unsigned char *_hb_key = (const unsigned char*)(key);                   \
 (hashv) = 0;                                                                  \
 while (_hb_keylen-- != 0U) {                                                  \
   (hashv) = (((hashv) << 5) + (hashv)) + *_hb_key++;                          \
 }                                                                             \
} while (0)
/* The Bernstein hash function, used in Perl prior to v5.6. Note (x<<5+x)=x*33. */

Marco HASH_SAX(key,keylen,hashv)

#define HASH_SAX(key,keylen,hashv)                                              \
do {                                                                            \
 unsigned _sx_i;                                                               \
 const unsigned char *_hs_key = (const unsigned char*)(key);                   \
 hashv = 0;                                                                    \
 for (_sx_i=0; _sx_i < keylen; _sx_i++) {                                      \
   hashv ^= (hashv << 5) + (hashv >> 2) + _hs_key[_sx_i];                      \
 }                                                                             \
} while (0)
/* SAX/FNV/OAT/JEN hash functions are macro variants of those listed at
 * http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx */

Marco HASH_FNV(key,keylen,hashv)

#define HASH_FNV(key,keylen,hashv)                                              \
do {                                                                            \
 unsigned _fn_i;                                                               \
 const unsigned char *_hf_key = (const unsigned char*)(key);                   \
 (hashv) = 2166136261U;                                                        \
 for (_fn_i=0; _fn_i < keylen; _fn_i++) {                                      \
   hashv = hashv ^ _hf_key[_fn_i];                                             \
   hashv = hashv * 16777619U;                                                  \
 }                                                                             \
} while (0)
/* FNV-1a variation */

Marco HASH_OAT(key,keylen,hashv)

#define HASH_OAT(key,keylen,hashv)                                              \
do {                                                                            \
 unsigned _ho_i;                                                               \
 const unsigned char *_ho_key=(const unsigned char*)(key);                     \
 hashv = 0;                                                                    \
 for(_ho_i=0; _ho_i < keylen; _ho_i++) {                                       \
     hashv += _ho_key[_ho_i];                                                  \
     hashv += (hashv << 10);                                                   \
     hashv ^= (hashv >> 6);                                                    \
 }                                                                             \
 hashv += (hashv << 3);                                                        \
 hashv ^= (hashv >> 11);                                                       \
 hashv += (hashv << 15);                                                       \
} while (0)


      

Marco HASH_JEN_MIX(a,b,c)

#define HASH_JEN_MIX(a,b,c)                                                     \
do {                                                                            \
 a -= b; a -= c; a ^= ( c >> 13 );                                             \
 b -= c; b -= a; b ^= ( a << 8 );                                              \
 c -= a; c -= b; c ^= ( b >> 13 );                                             \
 a -= b; a -= c; a ^= ( c >> 12 );                                             \
 b -= c; b -= a; b ^= ( a << 16 );                                             \
 c -= a; c -= b; c ^= ( b >> 5 );                                              \
 a -= b; a -= c; a ^= ( c >> 3 );                                              \
 b -= c; b -= a; b ^= ( a << 10 );                                             \
 c -= a; c -= b; c ^= ( b >> 15 );                                             \
} while (0)


      

Marco HASH_JEN(key,keylen,hashv)

#define HASH_JEN(key,keylen,hashv)                                              \
do {                                                                            \
 unsigned _hj_i,_hj_j,_hj_k;                                                   \
 unsigned const char *_hj_key=(unsigned const char*)(key);                     \
 hashv = 15eedbeefu;                                                          \
 _hj_i = _hj_j = 9e3779b9u;                                                  \
 _hj_k = (unsigned)(keylen);                                                   \
 while (_hj_k >= 12U) {                                                        \
   _hj_i +=   (_hj_key[0] + ( (unsigned)_hj_key[1] << 8 )                     \
       + ( (unsigned)_hj_key[2] << 16 )                                        \
       + ( (unsigned)_hj_key[3] << 24 ) );                                     \
   _hj_j +=   (_hj_key[4] + ( (unsigned)_hj_key[5] << 8 )                     \
       + ( (unsigned)_hj_key[6] << 16 )                                        \
       + ( (unsigned)_hj_key[7] << 24 ) );                                     \
   hashv += (_hj_key[8] + ( (unsigned)_hj_key[9] << 8 )                        \
       + ( (unsigned)_hj_key[10] << 16 )                                       \
       + ( (unsigned)_hj_key[11] << 24 ) );                                    \
                                                                                \
    HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                         \
                                                                                \
    _hj_key += 12;                                                             \
    _hj_k -= 12U;                                                              \
 }                                                                             \
 hashv += (unsigned)(keylen);                                                  \
 switch ( _hj_k ) {                                                            \
   case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); /* FALLTHROUGH */        \
   case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); /* FALLTHROUGH */        \
   case 9: hashv += ( (unsigned)_hj_key[8] << 8 );  /* FALLTHROUGH */        \
   case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); /* FALLTHROUGH */        \
   case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); /* FALLTHROUGH */        \
   case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 );  /* FALLTHROUGH */        \
   case 5: _hj_j += _hj_key[4];                     /* FALLTHROUGH */        \
   case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); /* FALLTHROUGH */        \
   case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); /* FALLTHROUGH */        \
   case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 );  /* FALLTHROUGH */        \
   case 1: _hj_i += _hj_key[0];                                               \
   default: ;                                        /* does not happen */    \
 }                                                                             \
 HASH_JEN_MIX(_hj_i, _hj_j, hashv);                                            \
} while (0)


      

Marco get16bits(d)

#define get16bits(d) (*((const uint16_t *) (d)))


      

Marco get16bits(d)

#define get16bits(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)            \
                      +(uint32_t)(((const uint8_t *)(d))[0]) )


      

Marco HASH_SFH(key,keylen,hashv)

#define HASH_SFH(key,keylen,hashv)                                              \
do {                                                                            \
 unsigned const char *_sfh_key=(unsigned const char*)(key);                    \
 uint32_t _sfh_tmp, _sfh_len = (uint32_t)keylen;                               \
                                                                                \
 unsigned _sfh_rem = _sfh_len & 3U;                                            \
 _sfh_len >>= 2;                                                               \
 hashv = 0xcafebabeu;                                                          \
                                                                                \
 /* Main loop */                                                               \
 for (;_sfh_len > 0U; _sfh_len--) {                                            \
   hashv   += get16bits (_sfh_key);                                           \
   _sfh_tmp = ((uint32_t)(get16bits (_sfh_key+2)) << 11) ^ hashv;             \
   hashv    = (hashv << 16) ^ _sfh_tmp;                                       \
   _sfh_key += 2U*sizeof (uint16_t);                                           \
   hashv   += hashv >> 11;                                                    \
 }                                                                             \
                                                                                \
 /* Handle end cases */                                                        \
 switch (_sfh_rem) {                                                           \
   case 3: hashv += get16bits (_sfh_key);                                      \
           hashv ^= hashv << 16;                                               \
           hashv ^= (uint32_t)(_sfh_key[sizeof (uint16_t)]) << 18;             \
           hashv += hashv >> 11;                                               \
           break;                                                              \
   case 2: hashv += get16bits (_sfh_key);                                      \
           hashv ^= hashv << 11;                                               \
           hashv += hashv >> 17;                                               \
           break;                                                              \
   case 1: hashv += *_sfh_key;                                                 \
           hashv ^= hashv << 10;                                               \
           hashv += hashv >> 1;                                                \
 }                                                                             \
                                                                                \
 /* Force "avalanching" of final 127 bits */                                   \
 hashv ^= hashv << 3;                                                          \
 hashv += hashv >> 5;                                                          \
 hashv ^= hashv << 4;                                                          \
 hashv += hashv >> 17;                                                         \
 hashv ^= hashv << 25;                                                         \
 hashv += hashv >> 6;                                                          \
} while (0)


      

Marco MUR_GETBLOCK(p,i)

#define MUR_GETBLOCK(p,i) p[i]


      

Marco MUR_PLUS0_ALIGNED(p)

#define MUR_PLUS0_ALIGNED(p) (((unsigned long)p & 3UL) == 0UL)


      

Marco MUR_PLUS1_ALIGNED(p)

#define MUR_PLUS1_ALIGNED(p) (((unsigned long)p & 3UL) == 1UL)


      

Marco MUR_PLUS2_ALIGNED(p)

#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 3UL) == 2UL)


      

Marco MUR_PLUS3_ALIGNED(p)

#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 3UL) == 3UL)


      

Marco WP(p)

#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))


      

Marco MUR_THREE_ONE(p)

#define MUR_THREE_ONE(p) ((((*WP(p))&16777215) << 8) | (((*(WP(p)+1))&4278190080) >> 24))


      

Marco MUR_TWO_TWO(p)

#define MUR_TWO_TWO(p)  ((((*WP(p))&65535) <<16) | (((*(WP(p)+1))&4294901760) >> 16))


      

Marco MUR_ONE_THREE(p)

#define MUR_ONE_THREE(p) ((((*WP(p))&255) <<24) | (((*(WP(p)+1))&4294967040) >> 8))


      

Marco MUR_THREE_ONE(p)

#define MUR_THREE_ONE(p) ((((*WP(p))&4294967040) >> 8) | (((*(WP(p)+1))&255) << 24))


      

Marco MUR_TWO_TWO(p)

#define MUR_TWO_TWO(p)  ((((*WP(p))&4294901760) >>16) | (((*(WP(p)+1))&65535) << 16))


      

Marco MUR_ONE_THREE(p)

#define MUR_ONE_THREE(p) ((((*WP(p))&4278190080) >>24) | (((*(WP(p)+1))&16777215) << 8))


      

Marco MUR_GETBLOCK(p,i)

#define MUR_GETBLOCK(p,i) (MUR_PLUS0_ALIGNED(p) ? ((p)[i]) :          \
                           (MUR_PLUS1_ALIGNED(p) ? MUR_THREE_ONE(p) : \
                            (MUR_PLUS2_ALIGNED(p) ? MUR_TWO_TWO(p) : \
                                                     MUR_ONE_THREE(p))))


      

Marco MUR_ROTL32(x,r)

#define MUR_ROTL32(x,r) (((x) << (r)) | ((x) >> (32 - (r))))


      

Marco MUR_FMIX(_h)

#define MUR_FMIX(_h) \
do {                \
 _h ^= _h >> 16;   \
 _h *= 133ebca6bu; \
 _h ^= _h >> 13;   \
 _h *= 0xc2b2ae35u; \
 _h ^= _h >> 16;   \
} while (0)


      

Marco HASH_MUR(key,keylen,hashv)

#define HASH_MUR(key,keylen,hashv)                                    \
do {                                                                  \
 const uint8_t *_mur_data = (const uint8_t*)(key);                   \
 const int _mur_nblocks = (int)(keylen) / 4;                         \
 uint32_t _mur_h1 = 3976D5353u;                                     \
 uint32_t _mur_c1 = 0xcc9e2d51u;                                     \
 uint32_t _mur_c2 = 1b873593u;                                     \
 uint32_t _mur_k1 = 0;                                               \
 const uint8_t *_mur_tail;                                           \
 const uint32_t *_mur_blocks = (const uint32_t*)(_mur_data+(_mur_nblocks*4)); \
 int _mur_i;                                                         \
 for (_mur_i = -_mur_nblocks; _mur_i != 0; _mur_i++) {               \
   _mur_k1 = MUR_GETBLOCK(_mur_blocks,_mur_i);                       \
   _mur_k1 *= _mur_c1;                                               \
   _mur_k1 = MUR_ROTL32(_mur_k1,15);                                 \
   _mur_k1 *= _mur_c2;                                               \
                                                                      \
   _mur_h1 ^= _mur_k1;                                               \
   _mur_h1 = MUR_ROTL32(_mur_h1,13);                                 \
   _mur_h1 = (_mur_h1*5U) + 0xe6546b64u;                             \
 }                                                                   \
 _mur_tail = (const uint8_t*)(_mur_data + (_mur_nblocks*4));         \
 _mur_k1=0;                                                          \
 switch ((keylen) & 3U) {                                            \
   case 0: break;                                                    \
   case 3: _mur_k1 ^= (uint32_t)_mur_tail[2] << 16; /* FALLTHROUGH */ \
   case 2: _mur_k1 ^= (uint32_t)_mur_tail[1] << 8; /* FALLTHROUGH */ \
   case 1: _mur_k1 ^= (uint32_t)_mur_tail[0];                        \
   _mur_k1 *= _mur_c1;                                               \
   _mur_k1 = MUR_ROTL32(_mur_k1,15);                                 \
   _mur_k1 *= _mur_c2;                                               \
   _mur_h1 ^= _mur_k1;                                               \
 }                                                                   \
 _mur_h1 ^= (uint32_t)(keylen);                                      \
 MUR_FMIX(_mur_h1);                                                  \
 hashv = _mur_h1;                                                    \
} while (0)


      

Marco HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,hashval,out)

#define HASH_FIND_IN_BKT(tbl,hh,head,keyptr,keylen_in,hashval,out)              \
do {                                                                            \
 if ((head).hh_head != NULL) {                                                 \
   DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (head).hh_head));                    \
 } else {                                                                      \
   (out) = NULL;                                                               \
 }                                                                             \
 while ((out) != NULL) {                                                       \
   if ((out)->hh.hashv == (hashval) && (out)->hh.keylen == (keylen_in)) {      \
     if (uthash_memcmp((out)->hh.key, keyptr, keylen_in) == 0) {               \
       break;                                                                  \
     }                                                                         \
   }                                                                           \
   if ((out)->hh.hh_next != NULL) {                                            \
     DECLTYPE_ASSIGN(out, ELMT_FROM_HH(tbl, (out)->hh.hh_next));               \
   } else {                                                                    \
     (out) = NULL;                                                             \
   }                                                                           \
 }                                                                             \
} while (0)
/* iterate over items in a known bucket to find desired item */

Marco HASH_ADD_TO_BKT(head,addhh)

#define HASH_ADD_TO_BKT(head,addhh)                                             \
do {                                                                            \
 UT_hash_bucket *_ha_head = &(head);                                           \
 _ha_head->count++;                                                            \
 (addhh)->hh_next = _ha_head->hh_head;                                         \
 (addhh)->hh_prev = NULL;                                                      \
 if (_ha_head->hh_head != NULL) {                                              \
   _ha_head->hh_head->hh_prev = (addhh);                                       \
 }                                                                             \
 _ha_head->hh_head = (addhh);                                                  \
 if ((_ha_head->count >= ((_ha_head->expand_mult + 1U) * HASH_BKT_CAPACITY_THRESH)) \
     && !(addhh)->tbl->noexpand) {                                             \
   HASH_EXPAND_BUCKETS((addhh)->tbl);                                          \
 }                                                                             \
} while (0)
/* add an item to a bucket  */

Marco HASH_DEL_IN_BKT(head,delhh)

#define HASH_DEL_IN_BKT(head,delhh)                                             \
do {                                                                            \
 UT_hash_bucket *_hd_head = &(head);                                           \
 _hd_head->count--;                                                            \
 if (_hd_head->hh_head == (delhh)) {                                           \
   _hd_head->hh_head = (delhh)->hh_next;                                       \
 }                                                                             \
 if ((delhh)->hh_prev) {                                                       \
   (delhh)->hh_prev->hh_next = (delhh)->hh_next;                               \
 }                                                                             \
 if ((delhh)->hh_next) {                                                       \
   (delhh)->hh_next->hh_prev = (delhh)->hh_prev;                               \
 }                                                                             \
} while (0)
/* remove an item from a given bucket */

Marco HASH_EXPAND_BUCKETS(tbl)

#define HASH_EXPAND_BUCKETS(tbl)                                                \
do {                                                                            \
 unsigned _he_bkt;                                                             \
 unsigned _he_bkt_i;                                                           \
 struct UT_hash_handle *_he_thh, *_he_hh_nxt;                                  \
 UT_hash_bucket *_he_new_buckets, *_he_newbkt;                                 \
 _he_new_buckets = (UT_hash_bucket*)uthash_malloc(                             \
          2UL * (tbl)->num_buckets * sizeof(struct UT_hash_bucket));           \
 if (!_he_new_buckets) {                                                       \
   uthash_fatal("out of memory");                                              \
 }                                                                             \
 uthash_bzero(_he_new_buckets,                                                 \
         2UL * (tbl)->num_buckets * sizeof(struct UT_hash_bucket));            \
 (tbl)->ideal_chain_maxlen =                                                   \
    ((tbl)->num_items >> ((tbl)->log2_num_buckets+1U)) +                       \
    ((((tbl)->num_items & (((tbl)->num_buckets*2U)-1U)) != 0U) ? 1U : 0U);     \
 (tbl)->nonideal_items = 0;                                                    \
 for (_he_bkt_i = 0; _he_bkt_i < (tbl)->num_buckets; _he_bkt_i++) {            \
   _he_thh = (tbl)->buckets[ _he_bkt_i ].hh_head;                              \
   while (_he_thh != NULL) {                                                   \
     _he_hh_nxt = _he_thh->hh_next;                                            \
     HASH_TO_BKT(_he_thh->hashv, (tbl)->num_buckets * 2U, _he_bkt);            \
     _he_newbkt = &(_he_new_buckets[_he_bkt]);                                 \
     if (++(_he_newbkt->count) > (tbl)->ideal_chain_maxlen) {                  \
       (tbl)->nonideal_items++;                                                \
       _he_newbkt->expand_mult = _he_newbkt->count / (tbl)->ideal_chain_maxlen; \
     }                                                                         \
     _he_thh->hh_prev = NULL;                                                  \
     _he_thh->hh_next = _he_newbkt->hh_head;                                   \
     if (_he_newbkt->hh_head != NULL) {                                        \
       _he_newbkt->hh_head->hh_prev = _he_thh;                                 \
     }                                                                         \
     _he_newbkt->hh_head = _he_thh;                                            \
     _he_thh = _he_hh_nxt;                                                     \
   }                                                                           \
 }                                                                             \
 uthash_free((tbl)->buckets, (tbl)->num_buckets * sizeof(struct UT_hash_bucket)); \
 (tbl)->num_buckets *= 2U;                                                     \
 (tbl)->log2_num_buckets++;                                                    \
 (tbl)->buckets = _he_new_buckets;                                             \
 (tbl)->ineff_expands = ((tbl)->nonideal_items > ((tbl)->num_items >> 1)) ?    \
     ((tbl)->ineff_expands+1U) : 0U;                                           \
 if ((tbl)->ineff_expands > 1U) {                                              \
   (tbl)->noexpand = 1;                                                        \
   uthash_noexpand_fyi(tbl);                                                   \
 }                                                                             \
 uthash_expand_fyi(tbl);                                                       \
} while (0)
/* Bucket expansion has the effect of doubling the number of buckets
 * and redistributing the items into the new buckets. Ideally the
 * items will distribute more or less evenly into the new buckets
 * (the extent to which this is true is a measure of the quality of
 * the hash function as it applies to the key domain).
 *
 * With the items distributed into more buckets, the chain length
 * (item count) in each bucket is reduced. Thus by expanding buckets
 * the hash keeps a bound on the chain length. This bounded chain
 * length is the essence of how a hash provides constant time lookup.
 *
 * The calculation of tbl->ideal_chain_maxlen below deserves some
 * explanation. First, keep in mind that we're calculating the ideal
 * maximum chain length based on the *new* (doubled) bucket count.
 * In fractions this is just n/b (n=number of items,b=new num buckets).
 * Since the ideal chain length is an integer, we want to calculate
 * ceil(n/b). We don't depend on floating point arithmetic in this
 * hash, so to calculate ceil(n/b) with integers we could write
 *
 *      ceil(n/b) = (n/b) + ((n%b)?1:0)
 *
 * and in fact a previous version of this hash did just that.
 * But now we have improved things a bit by recognizing that b is
 * always a power of two. We keep its base 2 log handy (call it lb),
 * so now we can write this with a bit shift and logical AND:
 *
 *      ceil(n/b) = (n>>lb) + ( (n & (b-1)) ? 1:0)
 *
 */

Marco HASH_SORT(head,cmpfcn)

#define HASH_SORT(head,cmpfcn) HASH_SRT(hh,head,cmpfcn)
/* Note that HASH_SORT assumes the hash handle name to be hh.
 * HASH_SRT was added to allow the hash handle name to be passed in. */

Marco HASH_SRT(hh,head,cmpfcn)

#define HASH_SRT(hh,head,cmpfcn)                                                \
do {                                                                            \
 unsigned _hs_i;                                                               \
 unsigned _hs_looping,_hs_nmerges,_hs_insize,_hs_psize,_hs_qsize;              \
 struct UT_hash_handle *_hs_p, *_hs_q, *_hs_e, *_hs_list, *_hs_tail;           \
 if (head != NULL) {                                                           \
   _hs_insize = 1;                                                             \
   _hs_looping = 1;                                                            \
   _hs_list = &((head)->hh);                                                   \
   while (_hs_looping != 0U) {                                                 \
     _hs_p = _hs_list;                                                         \
     _hs_list = NULL;                                                          \
     _hs_tail = NULL;                                                          \
     _hs_nmerges = 0;                                                          \
     while (_hs_p != NULL) {                                                   \
       _hs_nmerges++;                                                          \
       _hs_q = _hs_p;                                                          \
       _hs_psize = 0;                                                          \
       for (_hs_i = 0; _hs_i < _hs_insize; ++_hs_i) {                          \
         _hs_psize++;                                                          \
         _hs_q = ((_hs_q->next != NULL) ?                                      \
           HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL);                  \
         if (_hs_q == NULL) {                                                  \
           break;                                                              \
         }                                                                     \
       }                                                                       \
       _hs_qsize = _hs_insize;                                                 \
       while ((_hs_psize != 0U) || ((_hs_qsize != 0U) && (_hs_q != NULL))) {   \
         if (_hs_psize == 0U) {                                                \
           _hs_e = _hs_q;                                                      \
           _hs_q = ((_hs_q->next != NULL) ?                                    \
             HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL);                \
           _hs_qsize--;                                                        \
         } else if ((_hs_qsize == 0U) || (_hs_q == NULL)) {                    \
           _hs_e = _hs_p;                                                      \
           if (_hs_p != NULL) {                                                \
             _hs_p = ((_hs_p->next != NULL) ?                                  \
               HH_FROM_ELMT((head)->hh.tbl, _hs_p->next) : NULL);              \
           }                                                                   \
           _hs_psize--;                                                        \
         } else if ((cmpfcn(                                                   \
               DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl, _hs_p)),            \
               DECLTYPE(head)(ELMT_FROM_HH((head)->hh.tbl, _hs_q))             \
               )) <= 0) {                                                      \
           _hs_e = _hs_p;                                                      \
           if (_hs_p != NULL) {                                                \
             _hs_p = ((_hs_p->next != NULL) ?                                  \
               HH_FROM_ELMT((head)->hh.tbl, _hs_p->next) : NULL);              \
           }                                                                   \
           _hs_psize--;                                                        \
         } else {                                                              \
           _hs_e = _hs_q;                                                      \
           _hs_q = ((_hs_q->next != NULL) ?                                    \
             HH_FROM_ELMT((head)->hh.tbl, _hs_q->next) : NULL);                \
           _hs_qsize--;                                                        \
         }                                                                     \
         if ( _hs_tail != NULL ) {                                             \
           _hs_tail->next = ((_hs_e != NULL) ?                                 \
             ELMT_FROM_HH((head)->hh.tbl, _hs_e) : NULL);                      \
         } else {                                                              \
           _hs_list = _hs_e;                                                   \
         }                                                                     \
         if (_hs_e != NULL) {                                                  \
           _hs_e->prev = ((_hs_tail != NULL) ?                                 \
             ELMT_FROM_HH((head)->hh.tbl, _hs_tail) : NULL);                   \
         }                                                                     \
         _hs_tail = _hs_e;                                                     \
       }                                                                       \
       _hs_p = _hs_q;                                                          \
     }                                                                         \
     if (_hs_tail != NULL) {                                                   \
       _hs_tail->next = NULL;                                                  \
     }                                                                         \
     if (_hs_nmerges <= 1U) {                                                  \
       _hs_looping = 0;                                                        \
       (head)->hh.tbl->tail = _hs_tail;                                        \
       DECLTYPE_ASSIGN(head, ELMT_FROM_HH((head)->hh.tbl, _hs_list));          \
     }                                                                         \
     _hs_insize *= 2U;                                                         \
   }                                                                           \
   HASH_FSCK(hh, head, "HASH_SRT");                                            \
 }                                                                             \
} while (0)


      

Marco HASH_SELECT(hh_dst, dst, hh_src, src, cond)

#define HASH_SELECT(hh_dst, dst, hh_src, src, cond)                             \
do {                                                                            \
 unsigned _src_bkt, _dst_bkt;                                                  \
 void *_last_elt = NULL, *_elt;                                                \
 UT_hash_handle *_src_hh, *_dst_hh, *_last_elt_hh=NULL;                        \
 ptrdiff_t _dst_hho = ((char*)(&(dst)->hh_dst) - (char*)(dst));                \
 if ((src) != NULL) {                                                          \
   for (_src_bkt=0; _src_bkt < (src)->hh_src.tbl->num_buckets; _src_bkt++) {   \
     for (_src_hh = (src)->hh_src.tbl->buckets[_src_bkt].hh_head;              \
       _src_hh != NULL;                                                        \
       _src_hh = _src_hh->hh_next) {                                           \
       _elt = ELMT_FROM_HH((src)->hh_src.tbl, _src_hh);                        \
       if (cond(_elt)) {                                                       \
         _dst_hh = (UT_hash_handle*)(((char*)_elt) + _dst_hho);                \
         _dst_hh->key = _src_hh->key;                                          \
         _dst_hh->keylen = _src_hh->keylen;                                    \
         _dst_hh->hashv = _src_hh->hashv;                                      \
         _dst_hh->prev = _last_elt;                                            \
         _dst_hh->next = NULL;                                                 \
         if (_last_elt_hh != NULL) {                                           \
           _last_elt_hh->next = _elt;                                          \
         }                                                                     \
         if ((dst) == NULL) {                                                  \
           DECLTYPE_ASSIGN(dst, _elt);                                         \
           HASH_MAKE_TABLE(hh_dst, dst);                                       \
         } else {                                                              \
           _dst_hh->tbl = (dst)->hh_dst.tbl;                                   \
         }                                                                     \
         HASH_TO_BKT(_dst_hh->hashv, _dst_hh->tbl->num_buckets, _dst_bkt);     \
         HASH_ADD_TO_BKT(_dst_hh->tbl->buckets[_dst_bkt], _dst_hh);            \
         HASH_BLOOM_ADD(_dst_hh->tbl, _dst_hh->hashv);                         \
         (dst)->hh_dst.tbl->num_items++;                                       \
         _last_elt = _elt;                                                     \
         _last_elt_hh = _dst_hh;                                               \
       }                                                                       \
     }                                                                         \
   }                                                                           \
 }                                                                             \
 HASH_FSCK(hh_dst, dst, "HASH_SELECT");                                        \
} while (0)
/* This function selects items from one hash into another hash.
 * The end result is that the selected items have dual presence
 * in both hashes. There is no copy of the items made; rather
 * they are added into the new hash through a secondary hash
 * hash handle that must be present in the structure. */

Marco HASH_CLEAR(hh,head)

#define HASH_CLEAR(hh,head)                                                     \
do {                                                                            \
 if ((head) != NULL) {                                                         \
   HASH_BLOOM_FREE((head)->hh.tbl);                                            \
   uthash_free((head)->hh.tbl->buckets,                                        \
               (head)->hh.tbl->num_buckets*sizeof(struct UT_hash_bucket));     \
   uthash_free((head)->hh.tbl, sizeof(UT_hash_table));                         \
   (head) = NULL;                                                              \
 }                                                                             \
} while (0)


      

Marco HASH_OVERHEAD(hh,head)

#define HASH_OVERHEAD(hh,head)                                                  \
 (((head) != NULL) ? (                                                          \
 (size_t)(((head)->hh.tbl->num_items  * sizeof(UT_hash_handle))  +            \
         ((head)->hh.tbl->num_buckets * sizeof(UT_hash_bucket))  +            \
          sizeof(UT_hash_table)                                  +            \
          (HASH_BLOOM_BYTELEN))) : 0U)


      

Marco HASH_ITER(hh,head,el,tmp)

#define HASH_ITER(hh,head,el,tmp)                                               \
for(((el)=(head)), ((*(char**)(&(tmp)))=(char*)((head!=NULL)?(head)->hh.next:NULL)); \
 (el) != NULL; ((el)=(tmp)), ((*(char**)(&(tmp)))=(char*)((tmp!=NULL)?(tmp)->hh.next:NULL)))


      

Marco HASH_ITER(hh,head,el,tmp)

#define HASH_ITER(hh,head,el,tmp)                                               \
for(((el)=(head)), ((tmp)=DECLTYPE(el)((head!=NULL)?(head)->hh.next:NULL));     \
 (el) != NULL; ((el)=(tmp)), ((tmp)=DECLTYPE(el)((tmp!=NULL)?(tmp)->hh.next:NULL)))


      

Marco HASH_COUNT(head)

#define HASH_COUNT(head) HASH_CNT(hh,head)
/* obtain a count of items in the hash */

Marco HASH_CNT(hh,head)

#define HASH_CNT(hh,head) ((head != NULL)?((head)->hh.tbl->num_items):0U)


      

Marco HASH_SIGNATURE

#define HASH_SIGNATURE 0xa0111fe1u
/* random signature used only to find hash tables in external analysis */

Marco HASH_BLOOM_SIGNATURE

#define HASH_BLOOM_SIGNATURE 0xb12220f2u


      

Marco UTLIST_H

#define UTLIST_H


      

Marco UTLIST_VERSION

#define UTLIST_VERSION 2.0.2


      

Marco LDECLTYPE(x)

#define LDECLTYPE(x) decltype(x)


      

Marco NO_DECLTYPE

#define NO_DECLTYPE


      

Marco NO_DECLTYPE

#define NO_DECLTYPE


      

Marco LDECLTYPE(x)

#define LDECLTYPE(x) __typeof(x)


      

Marco IF_NO_DECLTYPE(x)

#define IF_NO_DECLTYPE(x) x


      

Marco LDECLTYPE(x)

#define LDECLTYPE(x) char*


      

Marco UTLIST_SV(elt,list)

#define UTLIST_SV(elt,list) _tmp = (char*)(list); {char **_alias = (char**)&(list); *_alias = (elt); }


      

Marco UTLIST_NEXT(elt,list,next)

#define UTLIST_NEXT(elt,list,next) ((char*)((list)->next))


      

Marco UTLIST_NEXTASGN(elt,list,to,next)

#define UTLIST_NEXTASGN(elt,list,to,next) { char **_alias = (char**)&((list)->next); *_alias=(char*)(to); }


      

Marco UTLIST_PREVASGN(elt,list,to,prev)

#define UTLIST_PREVASGN(elt,list,to,prev) { char **_alias = (char**)&((list)->prev); *_alias=(char*)(to); }
/* #define UTLIST_PREV(elt,list,prev) ((char*)((list)->prev)) */

Marco UTLIST_RS(list)

#define UTLIST_RS(list) { char **_alias = (char**)&(list); *_alias=_tmp; }


      

Marco UTLIST_CASTASGN(a,b)

#define UTLIST_CASTASGN(a,b) { char **_alias = (char**)&(a); *_alias=(char*)(b); }


      

Marco IF_NO_DECLTYPE

#define IF_NO_DECLTYPE(x)


      

Marco UTLIST_SV

#define UTLIST_SV(elt,list)


      

Marco UTLIST_NEXT(elt,list,next)

#define UTLIST_NEXT(elt,list,next) ((elt)->next)


      

Marco UTLIST_NEXTASGN(elt,list,to,next)

#define UTLIST_NEXTASGN(elt,list,to,next) ((elt)->next)=(to)


      

Marco UTLIST_PREVASGN(elt,list,to,prev)

#define UTLIST_PREVASGN(elt,list,to,prev) ((elt)->prev)=(to)
/* #define UTLIST_PREV(elt,list,prev) ((elt)->prev) */

Marco UTLIST_RS

#define UTLIST_RS(list)


      

Marco UTLIST_CASTASGN(a,b)

#define UTLIST_CASTASGN(a,b) (a)=(b)


      

Marco LL_SORT(list, cmp)

#define LL_SORT(list, cmp)                                                                    \
   LL_SORT2(list, cmp, next)
/******************************************************************************
 * The sort macro is an adaptation of Simon Tatham's O(n log(n)) mergesort    *
 * Unwieldy variable names used here to avoid shadowing passed-in variables.  *
 *****************************************************************************/

Marco LL_SORT2(list, cmp, next)

#define LL_SORT2(list, cmp, next)                                                             \
do {                                                                                          \
 LDECLTYPE(list) _ls_p;                                                                      \
 LDECLTYPE(list) _ls_q;                                                                      \
 LDECLTYPE(list) _ls_e;                                                                      \
 LDECLTYPE(list) _ls_tail;                                                                   \
 IF_NO_DECLTYPE(LDECLTYPE(list) _tmp;)                                                       \
 int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                      \
 if (list) {                                                                                 \
   _ls_insize = 1;                                                                           \
   _ls_looping = 1;                                                                          \
   while (_ls_looping) {                                                                     \
     UTLIST_CASTASGN(_ls_p,list);                                                            \
     (list) = NULL;                                                                          \
     _ls_tail = NULL;                                                                        \
     _ls_nmerges = 0;                                                                        \
     while (_ls_p) {                                                                         \
       _ls_nmerges++;                                                                        \
       _ls_q = _ls_p;                                                                        \
       _ls_psize = 0;                                                                        \
       for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                        \
         _ls_psize++;                                                                        \
         UTLIST_SV(_ls_q,list); _ls_q = UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list);       \
         if (!_ls_q) break;                                                                  \
       }                                                                                     \
       _ls_qsize = _ls_insize;                                                               \
       while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                   \
         if (_ls_psize == 0) {                                                               \
           _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q =                                     \
             UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--;                     \
         } else if (_ls_qsize == 0 || !_ls_q) {                                              \
           _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p =                                     \
             UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--;                     \
         } else if (cmp(_ls_p,_ls_q) <= 0) {                                                 \
           _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p =                                     \
             UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--;                     \
         } else {                                                                            \
           _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q =                                     \
             UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--;                     \
         }                                                                                   \
         if (_ls_tail) {                                                                     \
           UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \
         } else {                                                                            \
           UTLIST_CASTASGN(list,_ls_e);                                                      \
         }                                                                                   \
         _ls_tail = _ls_e;                                                                   \
       }                                                                                     \
       _ls_p = _ls_q;                                                                        \
     }                                                                                       \
     if (_ls_tail) {                                                                         \
       UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,NULL,next); UTLIST_RS(list);  \
     }                                                                                       \
     if (_ls_nmerges <= 1) {                                                                 \
       _ls_looping=0;                                                                        \
     }                                                                                       \
     _ls_insize *= 2;                                                                        \
   }                                                                                         \
 }                                                                                           \
} while (0)


      

Marco DL_SORT(list, cmp)

#define DL_SORT(list, cmp)                                                                    \
   DL_SORT2(list, cmp, prev, next)


      

Marco DL_SORT2(list, cmp, prev, next)

#define DL_SORT2(list, cmp, prev, next)                                                       \
do {                                                                                          \
 LDECLTYPE(list) _ls_p;                                                                      \
 LDECLTYPE(list) _ls_q;                                                                      \
 LDECLTYPE(list) _ls_e;                                                                      \
 LDECLTYPE(list) _ls_tail;                                                                   \
 IF_NO_DECLTYPE(LDECLTYPE(list) _tmp;)                                                       \
 int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                      \
 if (list) {                                                                                 \
   _ls_insize = 1;                                                                           \
   _ls_looping = 1;                                                                          \
   while (_ls_looping) {                                                                     \
     UTLIST_CASTASGN(_ls_p,list);                                                            \
     (list) = NULL;                                                                          \
     _ls_tail = NULL;                                                                        \
     _ls_nmerges = 0;                                                                        \
     while (_ls_p) {                                                                         \
       _ls_nmerges++;                                                                        \
       _ls_q = _ls_p;                                                                        \
       _ls_psize = 0;                                                                        \
       for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                        \
         _ls_psize++;                                                                        \
         UTLIST_SV(_ls_q,list); _ls_q = UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list);       \
         if (!_ls_q) break;                                                                  \
       }                                                                                     \
       _ls_qsize = _ls_insize;                                                               \
       while ((_ls_psize > 0) || ((_ls_qsize > 0) && _ls_q)) {                               \
         if (_ls_psize == 0) {                                                               \
           _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q =                                     \
             UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--;                     \
         } else if ((_ls_qsize == 0) || (!_ls_q)) {                                          \
           _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p =                                     \
             UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--;                     \
         } else if (cmp(_ls_p,_ls_q) <= 0) {                                                 \
           _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p =                                     \
             UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--;                     \
         } else {                                                                            \
           _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q =                                     \
             UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--;                     \
         }                                                                                   \
         if (_ls_tail) {                                                                     \
           UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \
         } else {                                                                            \
           UTLIST_CASTASGN(list,_ls_e);                                                      \
         }                                                                                   \
         UTLIST_SV(_ls_e,list); UTLIST_PREVASGN(_ls_e,list,_ls_tail,prev); UTLIST_RS(list);  \
         _ls_tail = _ls_e;                                                                   \
       }                                                                                     \
       _ls_p = _ls_q;                                                                        \
     }                                                                                       \
     UTLIST_CASTASGN((list)->prev, _ls_tail);                                                \
     UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,NULL,next); UTLIST_RS(list);    \
     if (_ls_nmerges <= 1) {                                                                 \
       _ls_looping=0;                                                                        \
     }                                                                                       \
     _ls_insize *= 2;                                                                        \
   }                                                                                         \
 }                                                                                           \
} while (0)


      

Marco CDL_SORT(list, cmp)

#define CDL_SORT(list, cmp)                                                                   \
   CDL_SORT2(list, cmp, prev, next)


      

Marco CDL_SORT2(list, cmp, prev, next)

#define CDL_SORT2(list, cmp, prev, next)                                                      \
do {                                                                                          \
 LDECLTYPE(list) _ls_p;                                                                      \
 LDECLTYPE(list) _ls_q;                                                                      \
 LDECLTYPE(list) _ls_e;                                                                      \
 LDECLTYPE(list) _ls_tail;                                                                   \
 LDECLTYPE(list) _ls_oldhead;                                                                \
 LDECLTYPE(list) _tmp;                                                                       \
 int _ls_insize, _ls_nmerges, _ls_psize, _ls_qsize, _ls_i, _ls_looping;                      \
 if (list) {                                                                                 \
   _ls_insize = 1;                                                                           \
   _ls_looping = 1;                                                                          \
   while (_ls_looping) {                                                                     \
     UTLIST_CASTASGN(_ls_p,list);                                                            \
     UTLIST_CASTASGN(_ls_oldhead,list);                                                      \
     (list) = NULL;                                                                          \
     _ls_tail = NULL;                                                                        \
     _ls_nmerges = 0;                                                                        \
     while (_ls_p) {                                                                         \
       _ls_nmerges++;                                                                        \
       _ls_q = _ls_p;                                                                        \
       _ls_psize = 0;                                                                        \
       for (_ls_i = 0; _ls_i < _ls_insize; _ls_i++) {                                        \
         _ls_psize++;                                                                        \
         UTLIST_SV(_ls_q,list);                                                              \
         if (UTLIST_NEXT(_ls_q,list,next) == _ls_oldhead) {                                  \
           _ls_q = NULL;                                                                     \
         } else {                                                                            \
           _ls_q = UTLIST_NEXT(_ls_q,list,next);                                             \
         }                                                                                   \
         UTLIST_RS(list);                                                                    \
         if (!_ls_q) break;                                                                  \
       }                                                                                     \
       _ls_qsize = _ls_insize;                                                               \
       while (_ls_psize > 0 || (_ls_qsize > 0 && _ls_q)) {                                   \
         if (_ls_psize == 0) {                                                               \
           _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q =                                     \
             UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--;                     \
           if (_ls_q == _ls_oldhead) { _ls_q = NULL; }                                       \
         } else if (_ls_qsize == 0 || !_ls_q) {                                              \
           _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p =                                     \
             UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--;                     \
           if (_ls_p == _ls_oldhead) { _ls_p = NULL; }                                       \
         } else if (cmp(_ls_p,_ls_q) <= 0) {                                                 \
           _ls_e = _ls_p; UTLIST_SV(_ls_p,list); _ls_p =                                     \
             UTLIST_NEXT(_ls_p,list,next); UTLIST_RS(list); _ls_psize--;                     \
           if (_ls_p == _ls_oldhead) { _ls_p = NULL; }                                       \
         } else {                                                                            \
           _ls_e = _ls_q; UTLIST_SV(_ls_q,list); _ls_q =                                     \
             UTLIST_NEXT(_ls_q,list,next); UTLIST_RS(list); _ls_qsize--;                     \
           if (_ls_q == _ls_oldhead) { _ls_q = NULL; }                                       \
         }                                                                                   \
         if (_ls_tail) {                                                                     \
           UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_ls_e,next); UTLIST_RS(list); \
         } else {                                                                            \
           UTLIST_CASTASGN(list,_ls_e);                                                      \
         }                                                                                   \
         UTLIST_SV(_ls_e,list); UTLIST_PREVASGN(_ls_e,list,_ls_tail,prev); UTLIST_RS(list);  \
         _ls_tail = _ls_e;                                                                   \
       }                                                                                     \
       _ls_p = _ls_q;                                                                        \
     }                                                                                       \
     UTLIST_CASTASGN((list)->prev,_ls_tail);                                                 \
     UTLIST_CASTASGN(_tmp,list);                                                             \
     UTLIST_SV(_ls_tail,list); UTLIST_NEXTASGN(_ls_tail,list,_tmp,next); UTLIST_RS(list);    \
     if (_ls_nmerges <= 1) {                                                                 \
       _ls_looping=0;                                                                        \
     }                                                                                       \
     _ls_insize *= 2;                                                                        \
   }                                                                                         \
 }                                                                                           \
} while (0)


      

Marco LL_PREPEND(head,add)

#define LL_PREPEND(head,add)                                                                  \
   LL_PREPEND2(head,add,next)
/******************************************************************************
 * singly linked list macros (non-circular)                                   *
 *****************************************************************************/

Marco LL_PREPEND2(head,add,next)

#define LL_PREPEND2(head,add,next)                                                            \
do {                                                                                          \
 (add)->next = (head);                                                                       \
 (head) = (add);                                                                             \
} while (0)


      

Marco LL_CONCAT(head1,head2)

#define LL_CONCAT(head1,head2)                                                                \
   LL_CONCAT2(head1,head2,next)


      

Marco LL_CONCAT2(head1,head2,next)

#define LL_CONCAT2(head1,head2,next)                                                          \
do {                                                                                          \
 LDECLTYPE(head1) _tmp;                                                                      \
 if (head1) {                                                                                \
   _tmp = (head1);                                                                           \
   while (_tmp->next) { _tmp = _tmp->next; }                                                 \
   _tmp->next=(head2);                                                                       \
 } else {                                                                                    \
   (head1)=(head2);                                                                          \
 }                                                                                           \
} while (0)


      

Marco LL_APPEND(head,add)

#define LL_APPEND(head,add)                                                                   \
   LL_APPEND2(head,add,next)


      

Marco LL_APPEND2(head,add,next)

#define LL_APPEND2(head,add,next)                                                             \
do {                                                                                          \
 LDECLTYPE(head) _tmp;                                                                       \
 (add)->next=NULL;                                                                           \
 if (head) {                                                                                 \
   _tmp = (head);                                                                            \
   while (_tmp->next) { _tmp = _tmp->next; }                                                 \
   _tmp->next=(add);                                                                         \
 } else {                                                                                    \
   (head)=(add);                                                                             \
 }                                                                                           \
} while (0)


      

Marco LL_INSERT_INORDER(head,add,cmp)

#define LL_INSERT_INORDER(head,add,cmp)                                                       \
   LL_INSERT_INORDER2(head,add,cmp,next)


      

Marco LL_INSERT_INORDER2(head,add,cmp,next)

#define LL_INSERT_INORDER2(head,add,cmp,next)                                                 \
do {                                                                                          \
 LDECLTYPE(head) _tmp;                                                                       \
 if (head) {                                                                                 \
   LL_LOWER_BOUND(head, _tmp, add, cmp);                                                     \
   LL_APPEND_ELEM(head, _tmp, add);                                                          \
 } else {                                                                                    \
   (head) = (add);                                                                           \
   (head)->next = NULL;                                                                      \
 }                                                                                           \
} while (0)


      

Marco LL_LOWER_BOUND(head,elt,like,cmp)

#define LL_LOWER_BOUND(head,elt,like,cmp)                                                     \
   LL_LOWER_BOUND2(head,elt,like,cmp,next)


      

Marco LL_LOWER_BOUND2(head,elt,like,cmp,next)

#define LL_LOWER_BOUND2(head,elt,like,cmp,next)                                               \
 do {                                                                                        \
   if ((head) == NULL || (cmp(head, like)) >= 0) {                                           \
     (elt) = NULL;                                                                           \
   } else {                                                                                  \
     for ((elt) = (head); (elt)->next != NULL; (elt) = (elt)->next) {                        \
       if (cmp((elt)->next, like) >= 0) {                                                    \
         break;                                                                              \
       }                                                                                     \
     }                                                                                       \
   }                                                                                         \
 } while (0)


      

Marco LL_DELETE(head,del)

#define LL_DELETE(head,del)                                                                   \
   LL_DELETE2(head,del,next)


      

Marco LL_DELETE2(head,del,next)

#define LL_DELETE2(head,del,next)                                                             \
do {                                                                                          \
 LDECLTYPE(head) _tmp;                                                                       \
 if ((head) == (del)) {                                                                      \
   (head)=(head)->next;                                                                      \
 } else {                                                                                    \
   _tmp = (head);                                                                            \
   while (_tmp->next && (_tmp->next != (del))) {                                             \
     _tmp = _tmp->next;                                                                      \
   }                                                                                         \
   if (_tmp->next) {                                                                         \
     _tmp->next = (del)->next;                                                               \
   }                                                                                         \
 }                                                                                           \
} while (0)


      

Marco LL_COUNT(head,el,counter)

#define LL_COUNT(head,el,counter)                                                             \
   LL_COUNT2(head,el,counter,next)                                                           \



      

Marco LL_COUNT2(head,el,counter,next)

#define LL_COUNT2(head,el,counter,next)                                                       \
do {                                                                                          \
 (counter) = 0;                                                                              \
 LL_FOREACH2(head,el,next) { ++(counter); }                                                  \
} while (0)


      

Marco LL_FOREACH(head,el)

#define LL_FOREACH(head,el)                                                                   \
   LL_FOREACH2(head,el,next)


      

Marco LL_FOREACH2(head,el,next)

#define LL_FOREACH2(head,el,next)                                                             \
   for ((el) = (head); el; (el) = (el)->next)


      

Marco LL_FOREACH_SAFE(head,el,tmp)

#define LL_FOREACH_SAFE(head,el,tmp)                                                          \
   LL_FOREACH_SAFE2(head,el,tmp,next)


      

Marco LL_FOREACH_SAFE2(head,el,tmp,next)

#define LL_FOREACH_SAFE2(head,el,tmp,next)                                                    \
 for ((el) = (head); (el) && ((tmp) = (el)->next, 1); (el) = (tmp))


      

Marco LL_SEARCH_SCALAR(head,out,field,val)

#define LL_SEARCH_SCALAR(head,out,field,val)                                                  \
   LL_SEARCH_SCALAR2(head,out,field,val,next)


      

Marco LL_SEARCH_SCALAR2(head,out,field,val,next)

#define LL_SEARCH_SCALAR2(head,out,field,val,next)                                            \
do {                                                                                          \
   LL_FOREACH2(head,out,next) {                                                              \
     if ((out)->field == (val)) break;                                                       \
   }                                                                                         \
} while (0)


      

Marco LL_SEARCH(head,out,elt,cmp)

#define LL_SEARCH(head,out,elt,cmp)                                                           \
   LL_SEARCH2(head,out,elt,cmp,next)


      

Marco LL_SEARCH2(head,out,elt,cmp,next)

#define LL_SEARCH2(head,out,elt,cmp,next)                                                     \
do {                                                                                          \
   LL_FOREACH2(head,out,next) {                                                              \
     if ((cmp(out,elt))==0) break;                                                           \
   }                                                                                         \
} while (0)


      

Marco LL_REPLACE_ELEM2(head, el, add, next)

#define LL_REPLACE_ELEM2(head, el, add, next)                                                 \
do {                                                                                          \
 LDECLTYPE(head) _tmp;                                                                        \
 assert((head) != NULL);                                                                      \
 assert((el) != NULL);                                                                        \
 assert((add) != NULL);                                                                       \
 (add)->next = (el)->next;                                                                    \
 if ((head) == (el)) {                                                                        \
 (head) = (add);                                                                             \
 } else {                                                                                     \
 _tmp = (head);                                                                              \
 while (_tmp->next && (_tmp->next != (el))) {                                                \
  _tmp = _tmp->next;                                                                         \
 }                                                                                           \
 if (_tmp->next) {                                                                           \
   _tmp->next = (add);                                                                       \
 }                                                                                           \
 }                                                                                            \
} while (0)


      

Marco LL_REPLACE_ELEM(head, el, add)

#define LL_REPLACE_ELEM(head, el, add)                                                        \
   LL_REPLACE_ELEM2(head, el, add, next)


      

Marco LL_PREPEND_ELEM2(head, el, add, next)

#define LL_PREPEND_ELEM2(head, el, add, next)                                                 \
do {                                                                                          \
 if (el) {                                                                                    \
 LDECLTYPE(head) _tmp;                                                                       \
 assert((head) != NULL);                                                                     \
 assert((add) != NULL);                                                                      \
 (add)->next = (el);                                                                         \
 if ((head) == (el)) {                                                                       \
  (head) = (add);                                                                            \
 } else {                                                                                    \
  _tmp = (head);                                                                             \
  while (_tmp->next && (_tmp->next != (el))) {                                               \
   _tmp = _tmp->next;                                                                        \
  }                                                                                          \
  if (_tmp->next) {                                                                          \
    _tmp->next = (add);                                                                      \
  }                                                                                          \
 }                                                                                           \
 } else {                                                                                     \
 LL_APPEND2(head, add, next);                                                                \
 }                                                                                            \
} while (0)                                                                                   \



      

Marco LL_PREPEND_ELEM(head, el, add)

#define LL_PREPEND_ELEM(head, el, add)                                                        \
   LL_PREPEND_ELEM2(head, el, add, next)


      

Marco LL_APPEND_ELEM2(head, el, add, next)

#define LL_APPEND_ELEM2(head, el, add, next)                                                  \
do {                                                                                          \
 if (el) {                                                                                    \
 assert((head) != NULL);                                                                     \
 assert((add) != NULL);                                                                      \
 (add)->next = (el)->next;                                                                   \
 (el)->next = (add);                                                                         \
 } else {                                                                                     \
 LL_PREPEND2(head, add, next);                                                               \
 }                                                                                            \
} while (0)                                                                                   \



      

Marco LL_APPEND_ELEM(head, el, add)

#define LL_APPEND_ELEM(head, el, add)                                                         \
   LL_APPEND_ELEM2(head, el, add, next)


      

Marco LL_CONCAT2(head1,head2,next)

#define LL_CONCAT2(head1,head2,next)                                                          \
do {                                                                                          \
 char *_tmp;                                                                                 \
 if (head1) {                                                                                \
   _tmp = (char*)(head1);                                                                    \
   while ((head1)->next) { (head1) = (head1)->next; }                                        \
   (head1)->next = (head2);                                                                  \
   UTLIST_RS(head1);                                                                         \
 } else {                                                                                    \
   (head1)=(head2);                                                                          \
 }                                                                                           \
} while (0)


      

Marco LL_APPEND2(head,add,next)

#define LL_APPEND2(head,add,next)                                                             \
do {                                                                                          \
 if (head) {                                                                                 \
   (add)->next = head;    /* use add->next as a temp variable */                            \
   while ((add)->next->next) { (add)->next = (add)->next->next; }                            \
   (add)->next->next=(add);                                                                  \
 } else {                                                                                    \
   (head)=(add);                                                                             \
 }                                                                                           \
 (add)->next=NULL;                                                                           \
} while (0)


      

Marco LL_INSERT_INORDER2(head,add,cmp,next)

#define LL_INSERT_INORDER2(head,add,cmp,next)                                                 \
do {                                                                                          \
 if ((head) == NULL || (cmp(head, add)) >= 0) {                                              \
   (add)->next = (head);                                                                     \
   (head) = (add);                                                                           \
 } else {                                                                                    \
   char *_tmp = (char*)(head);                                                               \
   while ((head)->next != NULL && (cmp((head)->next, add)) < 0) {                            \
     (head) = (head)->next;                                                                  \
   }                                                                                         \
   (add)->next = (head)->next;                                                               \
   (head)->next = (add);                                                                     \
   UTLIST_RS(head);                                                                          \
 }                                                                                           \
} while (0)


      

Marco LL_DELETE2(head,del,next)

#define LL_DELETE2(head,del,next)                                                             \
do {                                                                                          \
 if ((head) == (del)) {                                                                      \
   (head)=(head)->next;                                                                      \
 } else {                                                                                    \
   char *_tmp = (char*)(head);                                                               \
   while ((head)->next && ((head)->next != (del))) {                                         \
     (head) = (head)->next;                                                                  \
   }                                                                                         \
   if ((head)->next) {                                                                       \
     (head)->next = ((del)->next);                                                           \
   }                                                                                         \
   UTLIST_RS(head);                                                                          \
 }                                                                                           \
} while (0)


      

Marco LL_REPLACE_ELEM2(head, el, add, next)

#define LL_REPLACE_ELEM2(head, el, add, next)                                                 \
do {                                                                                          \
 assert((head) != NULL);                                                                     \
 assert((el) != NULL);                                                                       \
 assert((add) != NULL);                                                                      \
 if ((head) == (el)) {                                                                       \
   (head) = (add);                                                                           \
 } else {                                                                                    \
   (add)->next = head;                                                                       \
   while ((add)->next->next && ((add)->next->next != (el))) {                                \
     (add)->next = (add)->next->next;                                                        \
   }                                                                                         \
   if ((add)->next->next) {                                                                  \
     (add)->next->next = (add);                                                              \
   }                                                                                         \
 }                                                                                           \
 (add)->next = (el)->next;                                                                   \
} while (0)


      

Marco LL_PREPEND_ELEM2(head, el, add, next)

#define LL_PREPEND_ELEM2(head, el, add, next)                                                 \
do {                                                                                          \
 if (el) {                                                                                   \
   assert((head) != NULL);                                                                   \
   assert((add) != NULL);                                                                    \
   if ((head) == (el)) {                                                                     \
     (head) = (add);                                                                         \
   } else {                                                                                  \
     (add)->next = (head);                                                                   \
     while ((add)->next->next && ((add)->next->next != (el))) {                              \
       (add)->next = (add)->next->next;                                                      \
     }                                                                                       \
     if ((add)->next->next) {                                                                \
       (add)->next->next = (add);                                                            \
     }                                                                                       \
   }                                                                                         \
   (add)->next = (el);                                                                       \
 } else {                                                                                    \
   LL_APPEND2(head, add, next);                                                              \
 }                                                                                           \
} while (0)                                                                                   \



      

Marco DL_PREPEND(head,add)

#define DL_PREPEND(head,add)                                                                  \
   DL_PREPEND2(head,add,prev,next)
/******************************************************************************
 * doubly linked list macros (non-circular)                                   *
 *****************************************************************************/

Marco DL_PREPEND2(head,add,prev,next)

#define DL_PREPEND2(head,add,prev,next)                                                       \
do {                                                                                          \
 (add)->next = (head);                                                                        \
 if (head) {                                                                                  \
  (add)->prev = (head)->prev;                                                                \
  (head)->prev = (add);                                                                      \
 } else {                                                                                     \
  (add)->prev = (add);                                                                       \
 }                                                                                            \
 (head) = (add);                                                                              \
} while (0)


      

Marco DL_APPEND(head,add)

#define DL_APPEND(head,add)                                                                   \
   DL_APPEND2(head,add,prev,next)


      

Marco DL_APPEND2(head,add,prev,next)

#define DL_APPEND2(head,add,prev,next)                                                        \
do {                                                                                          \
 if (head) {                                                                                 \
     (add)->prev = (head)->prev;                                                             \
     (head)->prev->next = (add);                                                             \
     (head)->prev = (add);                                                                   \
     (add)->next = NULL;                                                                     \
 } else {                                                                                    \
     (head)=(add);                                                                           \
     (head)->prev = (head);                                                                  \
     (head)->next = NULL;                                                                    \
 }                                                                                           \
} while (0)


      

Marco DL_INSERT_INORDER(head,add,cmp)

#define DL_INSERT_INORDER(head,add,cmp)                                                       \
   DL_INSERT_INORDER2(head,add,cmp,next)


      

Marco DL_INSERT_INORDER2(head,add,cmp,next)

#define DL_INSERT_INORDER2(head,add,cmp,next)                                                 \
do {                                                                                          \
 LDECLTYPE(head) _tmp;                                                                       \
 if (head) {                                                                                 \
   DL_LOWER_BOUND(head, _tmp, add, cmp);                                                     \
   DL_APPEND_ELEM(head, _tmp, add);                                                          \
 } else {                                                                                    \
   (head) = (add);                                                                           \
   (head)->prev = (head);                                                                    \
   (head)->next = NULL;                                                                      \
 }                                                                                           \
} while (0)


      

Marco DL_LOWER_BOUND(head,elt,like,cmp)

#define DL_LOWER_BOUND(head,elt,like,cmp)                                                     \
   DL_LOWER_BOUND2(head,elt,like,cmp,next)


      

Marco DL_LOWER_BOUND2(head,elt,like,cmp,next)

#define DL_LOWER_BOUND2(head,elt,like,cmp,next)                                               \
do {                                                                                          \
 if ((head) == NULL || (cmp(head, like)) >= 0) {                                             \
   (elt) = NULL;                                                                             \
 } else {                                                                                    \
   for ((elt) = (head); (elt)->next != NULL; (elt) = (elt)->next) {                          \
     if ((cmp((elt)->next, like)) >= 0) {                                                    \
       break;                                                                                \
     }                                                                                       \
   }                                                                                         \
 }                                                                                           \
} while (0)


      

Marco DL_CONCAT(head1,head2)

#define DL_CONCAT(head1,head2)                                                                \
   DL_CONCAT2(head1,head2,prev,next)


      

Marco DL_CONCAT2(head1,head2,prev,next)

#define DL_CONCAT2(head1,head2,prev,next)                                                     \
do {                                                                                          \
 LDECLTYPE(head1) _tmp;                                                                      \
 if (head2) {                                                                                \
   if (head1) {                                                                              \
       UTLIST_CASTASGN(_tmp, (head2)->prev);                                                 \
       (head2)->prev = (head1)->prev;                                                        \
       (head1)->prev->next = (head2);                                                        \
       UTLIST_CASTASGN((head1)->prev, _tmp);                                                 \
   } else {                                                                                  \
       (head1)=(head2);                                                                      \
   }                                                                                         \
 }                                                                                           \
} while (0)


      

Marco DL_DELETE(head,del)

#define DL_DELETE(head,del)                                                                   \
   DL_DELETE2(head,del,prev,next)


      

Marco DL_DELETE2(head,del,prev,next)

#define DL_DELETE2(head,del,prev,next)                                                        \
do {                                                                                          \
 assert((head) != NULL);                                                                     \
 assert((del)->prev != NULL);                                                                \
 if ((del)->prev == (del)) {                                                                 \
     (head)=NULL;                                                                            \
 } else if ((del)==(head)) {                                                                 \
     (del)->next->prev = (del)->prev;                                                        \
     (head) = (del)->next;                                                                   \
 } else {                                                                                    \
     (del)->prev->next = (del)->next;                                                        \
     if ((del)->next) {                                                                      \
         (del)->next->prev = (del)->prev;                                                    \
     } else {                                                                                \
         (head)->prev = (del)->prev;                                                         \
     }                                                                                       \
 }                                                                                           \
} while (0)


      

Marco DL_COUNT(head,el,counter)

#define DL_COUNT(head,el,counter)                                                             \
   DL_COUNT2(head,el,counter,next)                                                           \



      

Marco DL_COUNT2(head,el,counter,next)

#define DL_COUNT2(head,el,counter,next)                                                       \
do {                                                                                          \
 (counter) = 0;                                                                              \
 DL_FOREACH2(head,el,next) { ++(counter); }                                                  \
} while (0)


      

Marco DL_FOREACH(head,el)

#define DL_FOREACH(head,el)                                                                   \
   DL_FOREACH2(head,el,next)


      

Marco DL_FOREACH2(head,el,next)

#define DL_FOREACH2(head,el,next)                                                             \
   for ((el) = (head); el; (el) = (el)->next)


      

Marco DL_FOREACH_SAFE(head,el,tmp)

#define DL_FOREACH_SAFE(head,el,tmp)                                                          \
   DL_FOREACH_SAFE2(head,el,tmp,next)
/* this version is safe for deleting the elements during iteration */

Marco DL_FOREACH_SAFE2(head,el,tmp,next)

#define DL_FOREACH_SAFE2(head,el,tmp,next)                                                    \
 for ((el) = (head); (el) && ((tmp) = (el)->next, 1); (el) = (tmp))


      

Marco DL_SEARCH_SCALAR

#define DL_SEARCH_SCALAR LL_SEARCH_SCALAR
/* these are identical to their singly-linked list counterparts */
#define DL_SEARCH LL_SEARCH


      

Marco DL_SEARCH_SCALAR2

#define DL_SEARCH_SCALAR2 LL_SEARCH_SCALAR2


      

Marco DL_SEARCH2

#define DL_SEARCH2 LL_SEARCH2


      

Marco DL_REPLACE_ELEM2(head, el, add, prev, next)

#define DL_REPLACE_ELEM2(head, el, add, prev, next)                                           \
do {                                                                                          \
 assert((head) != NULL);                                                                      \
 assert((el) != NULL);                                                                        \
 assert((add) != NULL);                                                                       \
 if ((head) == (el)) {                                                                        \
 (head) = (add);                                                                             \
 (add)->next = (el)->next;                                                                   \
 if ((el)->next == NULL) {                                                                   \
  (add)->prev = (add);                                                                       \
 } else {                                                                                    \
  (add)->prev = (el)->prev;                                                                  \
  (add)->next->prev = (add);                                                                 \
 }                                                                                           \
 } else {                                                                                     \
 (add)->next = (el)->next;                                                                   \
 (add)->prev = (el)->prev;                                                                   \
 (add)->prev->next = (add);                                                                  \
 if ((el)->next == NULL) {                                                                   \
  (head)->prev = (add);                                                                      \
 } else {                                                                                    \
  (add)->next->prev = (add);                                                                 \
 }                                                                                           \
 }                                                                                            \
} while (0)


      

Marco DL_REPLACE_ELEM(head, el, add)

#define DL_REPLACE_ELEM(head, el, add)                                                        \
   DL_REPLACE_ELEM2(head, el, add, prev, next)


      

Marco DL_PREPEND_ELEM2(head, el, add, prev, next)

#define DL_PREPEND_ELEM2(head, el, add, prev, next)                                           \
do {                                                                                          \
 if (el) {                                                                                    \
 assert((head) != NULL);                                                                     \
 assert((add) != NULL);                                                                      \
 (add)->next = (el);                                                                         \
 (add)->prev = (el)->prev;                                                                   \
 (el)->prev = (add);                                                                         \
 if ((head) == (el)) {                                                                       \
  (head) = (add);                                                                            \
 } else {                                                                                    \
  (add)->prev->next = (add);                                                                 \
 }                                                                                           \
 } else {                                                                                     \
 DL_APPEND2(head, add, prev, next);                                                          \
 }                                                                                            \
} while (0)                                                                                   \



      

Marco DL_PREPEND_ELEM(head, el, add)

#define DL_PREPEND_ELEM(head, el, add)                                                        \
   DL_PREPEND_ELEM2(head, el, add, prev, next)


      

Marco DL_APPEND_ELEM2(head, el, add, prev, next)

#define DL_APPEND_ELEM2(head, el, add, prev, next)                                            \
do {                                                                                          \
 if (el) {                                                                                    \
 assert((head) != NULL);                                                                     \
 assert((add) != NULL);                                                                      \
 (add)->next = (el)->next;                                                                   \
 (add)->prev = (el);                                                                         \
 (el)->next = (add);                                                                         \
 if ((add)->next) {                                                                          \
  (add)->next->prev = (add);                                                                 \
 } else {                                                                                    \
  (head)->prev = (add);                                                                      \
 }                                                                                           \
 } else {                                                                                     \
 DL_PREPEND2(head, add, prev, next);                                                         \
 }                                                                                            \
} while (0)                                                                                   \



      

Marco DL_APPEND_ELEM(head, el, add)

#define DL_APPEND_ELEM(head, el, add)                                                         \
  DL_APPEND_ELEM2(head, el, add, prev, next)


      

Marco DL_INSERT_INORDER2(head,add,cmp,next)

#define DL_INSERT_INORDER2(head,add,cmp,next)                                                 \
do {                                                                                          \
 if ((head) == NULL) {                                                                       \
   (add)->prev = (add);                                                                      \
   (add)->next = NULL;                                                                       \
   (head) = (add);                                                                           \
 } else if ((cmp(head, add)) >= 0) {                                                         \
   (add)->prev = (head)->prev;                                                               \
   (add)->next = (head);                                                                     \
   (head)->prev = (add);                                                                     \
   (head) = (add);                                                                           \
 } else {                                                                                    \
   char *_tmp = (char*)(head);                                                               \
   while ((char*)(head)->next != _tmp && (cmp((head)->next, add)) < 0) {                     \
     (head) = (head)->next;                                                                  \
   }                                                                                         \
   (add)->prev = (head);                                                                     \
   (add)->next = (head)->next;                                                               \
   (head)->next = (add);                                                                     \
   UTLIST_RS(head);                                                                          \
   if ((add)->next) {                                                                        \
     (add)->next->prev = (add);                                                              \
   } else {                                                                                  \
     (head)->prev = (add);                                                                   \
   }                                                                                         \
 }                                                                                           \
} while (0)


      

Marco CDL_APPEND(head,add)

#define CDL_APPEND(head,add)                                                                  \
   CDL_APPEND2(head,add,prev,next)
/******************************************************************************
 * circular doubly linked list macros                                         *
 *****************************************************************************/

Marco CDL_APPEND2(head,add,prev,next)

#define CDL_APPEND2(head,add,prev,next)                                                       \
do {                                                                                          \
 if (head) {                                                                                  \
  (add)->prev = (head)->prev;                                                                \
  (add)->next = (head);                                                                      \
  (head)->prev = (add);                                                                      \
  (add)->prev->next = (add);                                                                 \
 } else {                                                                                     \
  (add)->prev = (add);                                                                       \
  (add)->next = (add);                                                                       \
  (head) = (add);                                                                            \
 }                                                                                            \
} while (0)


      

Marco CDL_PREPEND(head,add)

#define CDL_PREPEND(head,add)                                                                 \
   CDL_PREPEND2(head,add,prev,next)


      

Marco CDL_PREPEND2(head,add,prev,next)

#define CDL_PREPEND2(head,add,prev,next)                                                      \
do {                                                                                          \
 if (head) {                                                                                  \
  (add)->prev = (head)->prev;                                                                \
  (add)->next = (head);                                                                      \
  (head)->prev = (add);                                                                      \
  (add)->prev->next = (add);                                                                 \
 } else {                                                                                     \
  (add)->prev = (add);                                                                       \
  (add)->next = (add);                                                                       \
 }                                                                                            \
 (head) = (add);                                                                              \
} while (0)


      

Marco CDL_INSERT_INORDER(head,add,cmp)

#define CDL_INSERT_INORDER(head,add,cmp)                                                      \
   CDL_INSERT_INORDER2(head,add,cmp,next)


      

Marco CDL_INSERT_INORDER2(head,add,cmp,next)

#define CDL_INSERT_INORDER2(head,add,cmp,next)                                                \
do {                                                                                          \
 LDECLTYPE(head) _tmp;                                                                       \
 if (head) {                                                                                 \
   CDL_LOWER_BOUND(head, _tmp, add, cmp);                                                    \
   CDL_APPEND_ELEM(head, _tmp, add);                                                         \
 } else {                                                                                    \
   (head) = (add);                                                                           \
   (head)->next = (head);                                                                    \
   (head)->prev = (head);                                                                    \
 }                                                                                           \
} while (0)


      

Marco CDL_LOWER_BOUND(head,elt,like,cmp)

#define CDL_LOWER_BOUND(head,elt,like,cmp)                                                    \
   CDL_LOWER_BOUND2(head,elt,like,cmp,next)


      

Marco CDL_LOWER_BOUND2(head,elt,like,cmp,next)

#define CDL_LOWER_BOUND2(head,elt,like,cmp,next)                                              \
do {                                                                                          \
 if ((head) == NULL || (cmp(head, like)) >= 0) {                                             \
   (elt) = NULL;                                                                             \
 } else {                                                                                    \
   for ((elt) = (head); (elt)->next != (head); (elt) = (elt)->next) {                        \
     if ((cmp((elt)->next, like)) >= 0) {                                                    \
       break;                                                                                \
     }                                                                                       \
   }                                                                                         \
 }                                                                                           \
} while (0)


      

Marco CDL_DELETE(head,del)

#define CDL_DELETE(head,del)                                                                  \
   CDL_DELETE2(head,del,prev,next)


      

Marco CDL_DELETE2(head,del,prev,next)

#define CDL_DELETE2(head,del,prev,next)                                                       \
do {                                                                                          \
 if (((head)==(del)) && ((head)->next == (head))) {                                          \
     (head) = NULL;                                                                          \
 } else {                                                                                    \
    (del)->next->prev = (del)->prev;                                                         \
    (del)->prev->next = (del)->next;                                                         \
    if ((del) == (head)) (head)=(del)->next;                                                 \
 }                                                                                           \
} while (0)


      

Marco CDL_COUNT(head,el,counter)

#define CDL_COUNT(head,el,counter)                                                            \
   CDL_COUNT2(head,el,counter,next)                                                          \



      

Marco CDL_COUNT2(head, el, counter,next)

#define CDL_COUNT2(head, el, counter,next)                                                    \
do {                                                                                          \
 (counter) = 0;                                                                              \
 CDL_FOREACH2(head,el,next) { ++(counter); }                                                 \
} while (0)


      

Marco CDL_FOREACH(head,el)

#define CDL_FOREACH(head,el)                                                                  \
   CDL_FOREACH2(head,el,next)


      

Marco CDL_FOREACH2(head,el,next)

#define CDL_FOREACH2(head,el,next)                                                            \
   for ((el)=(head);el;(el)=(((el)->next==(head)) ? NULL : (el)->next))


      

Marco CDL_FOREACH_SAFE(head,el,tmp1,tmp2)

#define CDL_FOREACH_SAFE(head,el,tmp1,tmp2)                                                   \
   CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next)


      

Marco CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next)

#define CDL_FOREACH_SAFE2(head,el,tmp1,tmp2,prev,next)                                        \
 for ((el) = (head), (tmp1) = (head) ? (head)->prev : NULL;                                  \
      (el) && ((tmp2) = (el)->next, 1);                                                      \
      (el) = ((el) == (tmp1) ? NULL : (tmp2)))


      

Marco CDL_SEARCH_SCALAR(head,out,field,val)

#define CDL_SEARCH_SCALAR(head,out,field,val)                                                 \
   CDL_SEARCH_SCALAR2(head,out,field,val,next)


      

Marco CDL_SEARCH_SCALAR2(head,out,field,val,next)

#define CDL_SEARCH_SCALAR2(head,out,field,val,next)                                           \
do {                                                                                          \
   CDL_FOREACH2(head,out,next) {                                                             \
     if ((out)->field == (val)) break;                                                       \
   }                                                                                         \
} while (0)


      

Marco CDL_SEARCH(head,out,elt,cmp)

#define CDL_SEARCH(head,out,elt,cmp)                                                          \
   CDL_SEARCH2(head,out,elt,cmp,next)


      

Marco CDL_SEARCH2(head,out,elt,cmp,next)

#define CDL_SEARCH2(head,out,elt,cmp,next)                                                    \
do {                                                                                          \
   CDL_FOREACH2(head,out,next) {                                                             \
     if ((cmp(out,elt))==0) break;                                                           \
   }                                                                                         \
} while (0)


      

Marco CDL_REPLACE_ELEM2(head, el, add, prev, next)

#define CDL_REPLACE_ELEM2(head, el, add, prev, next)                                          \
do {                                                                                          \
 assert((head) != NULL);                                                                      \
 assert((el) != NULL);                                                                        \
 assert((add) != NULL);                                                                       \
 if ((el)->next == (el)) {                                                                    \
 (add)->next = (add);                                                                        \
 (add)->prev = (add);                                                                        \
 (head) = (add);                                                                             \
 } else {                                                                                     \
 (add)->next = (el)->next;                                                                   \
 (add)->prev = (el)->prev;                                                                   \
 (add)->next->prev = (add);                                                                  \
 (add)->prev->next = (add);                                                                  \
 if ((head) == (el)) {                                                                       \
  (head) = (add);                                                                            \
 }                                                                                           \
 }                                                                                            \
} while (0)


      

Marco CDL_REPLACE_ELEM(head, el, add)

#define CDL_REPLACE_ELEM(head, el, add)                                                       \
   CDL_REPLACE_ELEM2(head, el, add, prev, next)


      

Marco CDL_PREPEND_ELEM2(head, el, add, prev, next)

#define CDL_PREPEND_ELEM2(head, el, add, prev, next)                                          \
do {                                                                                          \
 if (el) {                                                                                   \
   assert((head) != NULL);                                                                   \
   assert((add) != NULL);                                                                    \
   (add)->next = (el);                                                                       \
   (add)->prev = (el)->prev;                                                                 \
   (el)->prev = (add);                                                                       \
   (add)->prev->next = (add);                                                                \
   if ((head) == (el)) {                                                                     \
     (head) = (add);                                                                         \
   }                                                                                         \
 } else {                                                                                    \
   CDL_APPEND2(head, add, prev, next);                                                       \
 }                                                                                           \
} while (0)


      

Marco CDL_PREPEND_ELEM(head, el, add)

#define CDL_PREPEND_ELEM(head, el, add)                                                       \
   CDL_PREPEND_ELEM2(head, el, add, prev, next)


      

Marco CDL_APPEND_ELEM2(head, el, add, prev, next)

#define CDL_APPEND_ELEM2(head, el, add, prev, next)                                           \
do {                                                                                          \
 if (el) {                                                                                    \
 assert((head) != NULL);                                                                     \
 assert((add) != NULL);                                                                      \
 (add)->next = (el)->next;                                                                   \
 (add)->prev = (el);                                                                         \
 (el)->next = (add);                                                                         \
 (add)->next->prev = (add);                                                                  \
 } else {                                                                                     \
 CDL_PREPEND2(head, add, prev, next);                                                        \
 }                                                                                            \
} while (0)


      

Marco CDL_APPEND_ELEM(head, el, add)

#define CDL_APPEND_ELEM(head, el, add)                                                        \
   CDL_APPEND_ELEM2(head, el, add, prev, next)


      

Marco CDL_INSERT_INORDER2(head,add,cmp,next)

#define CDL_INSERT_INORDER2(head,add,cmp,next)                                                \
do {                                                                                          \
 if ((head) == NULL) {                                                                       \
   (add)->prev = (add);                                                                      \
   (add)->next = (add);                                                                      \
   (head) = (add);                                                                           \
 } else if ((cmp(head, add)) >= 0) {                                                         \
   (add)->prev = (head)->prev;                                                               \
   (add)->next = (head);                                                                     \
   (add)->prev->next = (add);                                                                \
   (head)->prev = (add);                                                                     \
   (head) = (add);                                                                           \
 } else {                                                                                    \
   char *_tmp = (char*)(head);                                                               \
   while ((char*)(head)->next != _tmp && (cmp((head)->next, add)) < 0) {                     \
     (head) = (head)->next;                                                                  \
   }                                                                                         \
   (add)->prev = (head);                                                                     \
   (add)->next = (head)->next;                                                               \
   (add)->next->prev = (add);                                                                \
   (head)->next = (add);                                                                     \
   UTLIST_RS(head);                                                                          \
 }                                                                                           \
} while (0)


      

Marco HAVE_ARPA_INET_H

#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_ASSERT_H

#define HAVE_ASSERT_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_DLFCN_H

#define HAVE_DLFCN_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_GETADDRINFO

#define HAVE_GETADDRINFO 1
/* Define to 1 if you have the `getaddrinfo' function. */

Marco HAVE_INTTYPES_H

#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_LIMITS_H

#define HAVE_LIMITS_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_MALLOC

#define HAVE_MALLOC 1
/* Define to 1 if you have the `malloc' function. */

Marco HAVE_MEMORY_H

#define HAVE_MEMORY_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_MEMSET

#define HAVE_MEMSET 1
/* Define to 1 if you have the `memset' function. */

Marco HAVE_NETDB_H

#define HAVE_NETDB_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_NETINET_IN_H

#define HAVE_NETINET_IN_H 1 // commeted by changcheng
/* Define to 1 if you have the  header file. */

Marco HAVE_SELECT

#define HAVE_SELECT 1
/* Define to 1 if you have the `select' function. */

Marco HAVE_SOCKET

#define HAVE_SOCKET 1
/* Define to 1 if you have the `socket' function. */

Marco HAVE_STDINT_H

#define HAVE_STDINT_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_STDLIB_H

#define HAVE_STDLIB_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_STRCASECMP

#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strcasecmp' function. */

Marco HAVE_STRINGS_H

#define HAVE_STRINGS_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_STRING_H

#define HAVE_STRING_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_STRNLEN

#define HAVE_STRNLEN 1
/* Define to 1 if you have the `strnlen' function. */

Marco HAVE_STRRCHR

#define HAVE_STRRCHR 1
/* Define to 1 if you have the `strrchr' function. */

Marco HAVE_SYSLOG_H

#define HAVE_SYSLOG_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_SYS_IOCTL_H

#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_SYS_SOCKET_H

#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_SYS_STAT_H

#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_SYS_TIME_H

#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_SYS_TYPES_H

#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_SYS_UNISTD_H

#define HAVE_SYS_UNISTD_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_TIME_H

#define HAVE_TIME_H 1
/* Define to 1 if you have the  header file. */

Marco HAVE_UNISTD_H

#define HAVE_UNISTD_H 1
/* Define to 1 if you have the  header file. */

Marco LT_OBJDIR

#define LT_OBJDIR ".libs/"
/* Define to the sub-directory where libtool stores uninstalled libraries. */

Marco PACKAGE_BUGREPORT

#define PACKAGE_BUGREPORT "libcoap-developers@lists.sourceforge.net"
/* Define to the address where bug reports for this package should be sent. */

Marco PACKAGE_NAME

#define PACKAGE_NAME "libcoap"
/* Define to the full name of this package. */

Marco PACKAGE_STRING

#define PACKAGE_STRING "libcoap 4.2.0rc4"
/* Define to the full name and version of this package. */

Marco PACKAGE_TARNAME

#define PACKAGE_TARNAME "libcoap"
/* Define to the one symbol short name of this package. */

Marco PACKAGE_URL

#define PACKAGE_URL "https://libcoap.net/"
/* Define to the home page for this package. */

Marco PACKAGE_VERSION

#define PACKAGE_VERSION "4.2.0"
/* Define to the version of this package. */

Marco STDC_HEADERS

#define STDC_HEADERS 1
/* Define to 1 if you have the ANSI C header files. */

Marco WITH_TY_UNI_NETWORK

#define WITH_TY_UNI_NETWORK 1


      

Marco _COAP_SERVER_H

#define _COAP_SERVER_H


      

Marco _HTTP_INF_H

#define _HTTP_INF_H


      

Marco DEF_URL_LEN

#define DEF_URL_LEN 1024 // max length of HTTP url


      

Marco http_inf_client_get(url, callback, pri_data)

#define http_inf_client_get(url, callback, pri_data) \
   http_inf_client_get_with_head(url, callback, pri_data, NULL, NULL)
/**
 * @brief This API is used to GET HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] callback Handler of HTTP response
 * @param[in] pri_data Private data used by HTTP request
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Marco http_inf_client_post(url, callback, data, len, add_head_cb, add_head_data, p_decode_key, pri_data)

#define http_inf_client_post(url, callback, data, len, add_head_cb, add_head_data, p_decode_key, pri_data) \
   http_inf_client_post_field(url, callback, data, len, add_head_cb, add_head_data, p_decode_key, pri_data, \
       STANDARD_HDR_FLAGS|HDR_ADD_CONN_KEEP_ALIVE|HDR_ADD_CONTENT_TYPE_FORM_URLENCODE)


      

Marco http_inf_client_post_raw(url, len, p_inf)

#define http_inf_client_post_raw(url, len, p_inf)  \
   http_inf_client_post_raw_field(url, len, p_inf, \
       HRD_ADD_HTTP_RAW | STANDARD_HDR_FLAGS | HDR_ADD_CONN_KEEP_ALIVE | HDR_ADD_CONTENT_TYPE_JSON)


      

Marco http_inf_client_get_raw(url, p_inf, offset, total_len)

#define http_inf_client_get_raw(url, p_inf, offset, total_len) \
   http_inf_client_get_raw_with_head(url, p_inf, offset, total_len, NULL, NULL)
/**
 * @brief This API is used to GET raw HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] p_inf Pointer to HTTP_INF_H_S
 * @param[in] offset Offset of file content
 * @param[in] total_len Max size to get from file
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Marco __HTTP_MANAGER_H_

#define __HTTP_MANAGER_H_


      

Marco MAX_HTTP_SESSION_NUM

#define MAX_HTTP_SESSION_NUM   16 // max number of active session


      

Marco INVALID_HTTP_SESSION_ID

#define INVALID_HTTP_SESSION_ID 4294967295 // invalid HTTP session handle


      

Marco MAX_HTTP_URL_LEN

#define MAX_HTTP_URL_LEN       256 // max len of url


      

Marco _HTTPC_H_

#define _HTTPC_H_


      

Marco STANDARD_HDR_FLAGS

#define STANDARD_HDR_FLAGS		\
    (HDR_ADD_DEFAULT_USER_AGENT)


      

Marco HTTP_RESP_INFORMATIONAL(x)

#define HTTP_RESP_INFORMATIONAL(x) (x >=100 && < 200)
/* Status codes */

Marco HTTP_RESP_SUCCESS(x)

#define HTTP_RESP_SUCCESS(x) (x >= 200 && x < 300)


      

Marco HTTP_RESP_REDIR(x)

#define HTTP_RESP_REDIR(x) (x >= 300 && x < 400)


      

Marco HTTP_RESP_CLIENT_ERR(x)

#define HTTP_RESP_CLIENT_ERR(x) (x >= 400 && x < 500)


      

Marco HTTP_RESP_SERVER_ERR(x)

#define HTTP_RESP_SERVER_ERR(x) (x >= 500 && x < 600)


      

Marco HTTP_OK

#define HTTP_OK 200
/*
 * These macros are not of any use to the HTTP client itself. They are used
 * by the users of the HTTP client. This list may be extended if required
 */

Marco HTTP_CREATED

#define HTTP_CREATED 201


      

Marco HTTP_ACCEPTED

#define HTTP_ACCEPTED 202


      

Marco HTTP_FOUND

#define HTTP_FOUND 302


      

Marco HTTP_NOT_MODIFIED

#define HTTP_NOT_MODIFIED 304


      

Marco HTTP_BAD_REQUEST

#define HTTP_BAD_REQUEST 400


      

Marco HTTP_NOT_AUTH

#define HTTP_NOT_AUTH 401


      

Marco HTTP_FORBIDDEN

#define HTTP_FORBIDDEN 403


      

Marco HTTP_NOT_FOUND

#define HTTP_NOT_FOUND 404


      

Marco REDIRECT_CNT_MAX

#define REDIRECT_CNT_MAX     5
/* max redirect count */

Marco REDIRECT_CNT_DEFAULT

#define REDIRECT_CNT_DEFAULT 3
/* default redirect count */

Marco REDIRECT_CNT_DISABLED

#define REDIRECT_CNT_DISABLED 0
/* zero means disable http redirect */

Marco _MQTT_CLIENT_H

#define _MQTT_CLIENT_H


      

Marco MBEDTLS_AES_H

#define MBEDTLS_AES_H


      

Marco MBEDTLS_AES_ENCRYPT

#define MBEDTLS_AES_ENCRYPT    1 /**< AES encryption. */
/* padlock.c and aesni.c rely on these values! */

Marco MBEDTLS_AES_DECRYPT

#define MBEDTLS_AES_DECRYPT    0 /**< AES decryption. */


      

Marco MBEDTLS_ERR_AES_INVALID_KEY_LENGTH

#define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH               -32 /**< Invalid key length. */
/* Error codes in range 0x0020-0x0022 */

Marco MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH

#define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH             -34 /**< Invalid data input length. */


      

Marco MBEDTLS_ERR_AES_BAD_INPUT_DATA

#define MBEDTLS_ERR_AES_BAD_INPUT_DATA                   -33 /**< Invalid input data. */
/* Error codes in range 0x0021-0x0025 */

Marco MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE              -35 /**< Feature not available. For example, an unsupported AES key size. */
/* MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE is deprecated and should not be used. */

Marco MBEDTLS_ERR_AES_HW_ACCEL_FAILED

#define MBEDTLS_ERR_AES_HW_ACCEL_FAILED                  -37 /**< AES hardware accelerator failed. */
/* MBEDTLS_ERR_AES_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco inline

#define inline __inline


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_AES_INF_H

#define MBEDTLS_AES_INF_H


      

Marco MBEDTLS_AESNI_H

#define MBEDTLS_AESNI_H


      

Marco MBEDTLS_AESNI_AES

#define MBEDTLS_AESNI_AES     33554432u


      

Marco MBEDTLS_AESNI_CLMUL

#define MBEDTLS_AESNI_CLMUL   2u


      

Marco MBEDTLS_HAVE_X86_64

#define MBEDTLS_HAVE_X86_64


      

Marco MBEDTLS_ARC4_H

#define MBEDTLS_ARC4_H


      

Marco MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED

#define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED                 -25 /**< ARC4 hardware accelerator failed. */
/* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_ARIA_H

#define MBEDTLS_ARIA_H


      

Marco MBEDTLS_ARIA_ENCRYPT

#define MBEDTLS_ARIA_ENCRYPT    1 /**< ARIA encryption. */


      

Marco MBEDTLS_ARIA_DECRYPT

#define MBEDTLS_ARIA_DECRYPT    0 /**< ARIA decryption. */


      

Marco MBEDTLS_ARIA_BLOCKSIZE

#define MBEDTLS_ARIA_BLOCKSIZE  16 /**< ARIA block size in bytes. */


      

Marco MBEDTLS_ARIA_MAX_ROUNDS

#define MBEDTLS_ARIA_MAX_ROUNDS 16 /**< Maxiumum number of rounds in ARIA. */


      

Marco MBEDTLS_ARIA_MAX_KEYSIZE

#define MBEDTLS_ARIA_MAX_KEYSIZE 32 /**< Maximum size of an ARIA key in bytes. */


      

Marco MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH

#define MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH  MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -5C )


      

Marco MBEDTLS_ERR_ARIA_BAD_INPUT_DATA

#define MBEDTLS_ERR_ARIA_BAD_INPUT_DATA -5C /**< Bad input data. */


      

Marco MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH

#define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -5E /**< Invalid data input length. */


      

Marco MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE -5A /**< Feature not available. For example, an unsupported ARIA key size. */
/* MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE is deprecated and should not be used.
 */

Marco MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED

#define MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED     -88 /**< ARIA hardware accelerator failed. */
/* MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_ASN1_H

#define MBEDTLS_ASN1_H


      

Marco MBEDTLS_ERR_ASN1_OUT_OF_DATA

#define MBEDTLS_ERR_ASN1_OUT_OF_DATA                     -96 /**< Out of data when parsing an ASN1 data structure. */
/**
 * \name ASN1 Error codes
 * These error codes are OR'ed to X509 error codes for
 * higher error granularity.
 * ASN1 is a standard to specify data structures.
 * \{
 */

Marco MBEDTLS_ERR_ASN1_UNEXPECTED_TAG

#define MBEDTLS_ERR_ASN1_UNEXPECTED_TAG                  -98 /**< ASN1 tag was of an unexpected value. */


      

Marco MBEDTLS_ERR_ASN1_INVALID_LENGTH

#define MBEDTLS_ERR_ASN1_INVALID_LENGTH                  -100 /**< Error when trying to determine the length or invalid length. */


      

Marco MBEDTLS_ERR_ASN1_LENGTH_MISMATCH

#define MBEDTLS_ERR_ASN1_LENGTH_MISMATCH                 -102 /**< Actual length differs from expected length. */


      

Marco MBEDTLS_ERR_ASN1_INVALID_DATA

#define MBEDTLS_ERR_ASN1_INVALID_DATA                    -104 /**< Data is invalid. (not used) */


      

Marco MBEDTLS_ERR_ASN1_ALLOC_FAILED

#define MBEDTLS_ERR_ASN1_ALLOC_FAILED                    -6A /**< Memory allocation failed */


      

Marco MBEDTLS_ERR_ASN1_BUF_TOO_SMALL

#define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL                   -6C /**< Buffer too small when writing ASN.1 data structure. */


      

Marco MBEDTLS_ASN1_BOOLEAN

#define MBEDTLS_ASN1_BOOLEAN                1
/**
 * \name DER constants
 * These constants comply with the DER encoded ASN.1 type tags.
 * DER encoding uses hexadecimal representation.
 * An example DER sequence is:\n
 * - 0x02 -- tag indicating INTEGER
 * - 0x01 -- length in octets
 * - 0x05 -- value
 * Such sequences are typically read into \c ::mbedtls_x509_buf.
 * \{
 */

Marco MBEDTLS_ASN1_INTEGER

#define MBEDTLS_ASN1_INTEGER                2


      

Marco MBEDTLS_ASN1_BIT_STRING

#define MBEDTLS_ASN1_BIT_STRING             3


      

Marco MBEDTLS_ASN1_OCTET_STRING

#define MBEDTLS_ASN1_OCTET_STRING           4


      

Marco MBEDTLS_ASN1_NULL

#define MBEDTLS_ASN1_NULL                   5


      

Marco MBEDTLS_ASN1_OID

#define MBEDTLS_ASN1_OID                    6


      

Marco MBEDTLS_ASN1_UTF8_STRING

#define MBEDTLS_ASN1_UTF8_STRING            0C


      

Marco MBEDTLS_ASN1_SEQUENCE

#define MBEDTLS_ASN1_SEQUENCE               16


      

Marco MBEDTLS_ASN1_SET

#define MBEDTLS_ASN1_SET                    17


      

Marco MBEDTLS_ASN1_PRINTABLE_STRING

#define MBEDTLS_ASN1_PRINTABLE_STRING       19


      

Marco MBEDTLS_ASN1_T61_STRING

#define MBEDTLS_ASN1_T61_STRING             20


      

Marco MBEDTLS_ASN1_IA5_STRING

#define MBEDTLS_ASN1_IA5_STRING             22


      

Marco MBEDTLS_ASN1_UTC_TIME

#define MBEDTLS_ASN1_UTC_TIME               23


      

Marco MBEDTLS_ASN1_GENERALIZED_TIME

#define MBEDTLS_ASN1_GENERALIZED_TIME       24


      

Marco MBEDTLS_ASN1_UNIVERSAL_STRING

#define MBEDTLS_ASN1_UNIVERSAL_STRING       1C


      

Marco MBEDTLS_ASN1_BMP_STRING

#define MBEDTLS_ASN1_BMP_STRING             1E


      

Marco MBEDTLS_ASN1_PRIMITIVE

#define MBEDTLS_ASN1_PRIMITIVE              0


      

Marco MBEDTLS_ASN1_CONSTRUCTED

#define MBEDTLS_ASN1_CONSTRUCTED            32


      

Marco MBEDTLS_ASN1_CONTEXT_SPECIFIC

#define MBEDTLS_ASN1_CONTEXT_SPECIFIC       128


      

Marco MBEDTLS_ASN1_TAG_CLASS_MASK

#define MBEDTLS_ASN1_TAG_CLASS_MASK         0xC0
/*
 * Bit masks for each of the components of an ASN.1 tag as specified in
 * ITU X.690 (08/2015), section 8.1 "General rules for encoding",
 * paragraph 8.1.2.2:
 *
 * Bit  8     7   6   5          1
 *     +-------+-----+------------+
 *     | Class | P/C | Tag number |
 *     +-------+-----+------------+
 */

Marco MBEDTLS_ASN1_TAG_PC_MASK

#define MBEDTLS_ASN1_TAG_PC_MASK            32


      

Marco MBEDTLS_ASN1_TAG_VALUE_MASK

#define MBEDTLS_ASN1_TAG_VALUE_MASK         31


      

Marco MBEDTLS_OID_SIZE(x)

#define MBEDTLS_OID_SIZE(x) (sizeof(x) - 1)
/** Returns the size of the binary string, without the trailing \\0 */

Marco MBEDTLS_OID_CMP(oid_str, oid_buf)

#define MBEDTLS_OID_CMP(oid_str, oid_buf)                                  \
       ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf)->len ) ||               \
         memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 )
/**
 * Compares an mbedtls_asn1_buf structure to a reference OID.
 *
 * Only works for 'defined' oid_str values (MBEDTLS_OID_HMAC_SHA1), you cannot use a
 * 'unsigned char *oid' here!
 */

Marco MBEDTLS_ASN1_WRITE_H

#define MBEDTLS_ASN1_WRITE_H


      

Marco MBEDTLS_ASN1_CHK_ADD(g, f)

#define MBEDTLS_ASN1_CHK_ADD(g, f)                     \
   do                                                 \
   {                                                  \
       if( ( ret = (f) ) < 0 )                        \
           return( ret );                             \
       else                                           \
           (g) += ret;                                \
   } while( 0 )


      

Marco MBEDTLS_BASE64_H

#define MBEDTLS_BASE64_H


      

Marco MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL

#define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL              -2A /**< Output buffer too small. */


      

Marco MBEDTLS_ERR_BASE64_INVALID_CHARACTER

#define MBEDTLS_ERR_BASE64_INVALID_CHARACTER             -2C /**< Invalid character in input. */


      

Marco MBEDTLS_BIGNUM_H

#define MBEDTLS_BIGNUM_H


      

Marco MBEDTLS_ERR_MPI_FILE_IO_ERROR

#define MBEDTLS_ERR_MPI_FILE_IO_ERROR                    -2 /**< An error occurred while reading from or writing to a file. */


      

Marco MBEDTLS_ERR_MPI_BAD_INPUT_DATA

#define MBEDTLS_ERR_MPI_BAD_INPUT_DATA                   -4 /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_MPI_INVALID_CHARACTER

#define MBEDTLS_ERR_MPI_INVALID_CHARACTER                -6 /**< There is an invalid character in the digit string. */


      

Marco MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL

#define MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL                 -8 /**< The buffer is too small to write to. */


      

Marco MBEDTLS_ERR_MPI_NEGATIVE_VALUE

#define MBEDTLS_ERR_MPI_NEGATIVE_VALUE                   0A /**< The input arguments are negative or result in illegal output. */


      

Marco MBEDTLS_ERR_MPI_DIVISION_BY_ZERO

#define MBEDTLS_ERR_MPI_DIVISION_BY_ZERO                 0C /**< The input argument for division is zero, which is not allowed. */


      

Marco MBEDTLS_ERR_MPI_NOT_ACCEPTABLE

#define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE                   0E /**< The input arguments are not acceptable. */


      

Marco MBEDTLS_ERR_MPI_ALLOC_FAILED

#define MBEDTLS_ERR_MPI_ALLOC_FAILED                     -16 /**< Memory allocation failed. */


      

Marco MBEDTLS_MPI_CHK(f)

#define MBEDTLS_MPI_CHK(f)      \
   do                          \
   {                           \
       if( ( ret = (f) ) != 0 ) \
           goto cleanup;       \
   } while( 0 )


      

Marco MBEDTLS_MPI_MAX_LIMBS

#define MBEDTLS_MPI_MAX_LIMBS                            10000
/*
 * Maximum size MPIs are allowed to grow to in number of limbs.
 */

Marco MBEDTLS_MPI_WINDOW_SIZE

#define MBEDTLS_MPI_WINDOW_SIZE                          6       /**< Maximum windows size used. */
/*
 * Maximum window size used for modular exponentiation. Default: 6
 * Minimum value: 1. Maximum value: 6.
 *
 * Result is an array of ( 2 << MBEDTLS_MPI_WINDOW_SIZE ) MPIs used
 * for the sliding window calculation. (So 64 by default)
 *
 * Reduction in size, reduces speed.
 */

Marco MBEDTLS_MPI_MAX_SIZE

#define MBEDTLS_MPI_MAX_SIZE                             1024    /**< Maximum number of bytes for usable MPIs. */
/*
 * Maximum size of MPIs allowed in bits and bytes for user-MPIs.
 * ( Default: 512 bytes => 4096 bits, Maximum tested: 2048 bytes => 16384 bits )
 *
 * Note: Calculations can temporarily result in larger MPIs. So the number
 * of limbs required (MBEDTLS_MPI_MAX_LIMBS) is higher.
 */

Marco MBEDTLS_MPI_MAX_BITS

#define MBEDTLS_MPI_MAX_BITS                             ( 8 * MBEDTLS_MPI_MAX_SIZE )   /**< Maximum number of bits for usable MPIs. */


      

Marco MBEDTLS_MPI_MAX_BITS_SCALE100

#define MBEDTLS_MPI_MAX_BITS_SCALE100         ( 100 * MBEDTLS_MPI_MAX_BITS )
/*
 * When reading from files with mbedtls_mpi_read_file() and writing to files with
 * mbedtls_mpi_write_file() the buffer should have space
 * for a (short) label, the MPI (in the provided radix), the newline
 * characters and the '\0'.
 *
 * By default we assume at least a 10 char label, a minimum radix of 10
 * (decimal) and a maximum of 4096 bit numbers (1234 decimal chars).
 * Autosized at compile time for at least a 10 char label, a minimum radix
 * of 10 (decimal) for a number of MBEDTLS_MPI_MAX_BITS size.
 *
 * This used to be statically sized to 1250 for a maximum of 4096 bit
 * numbers (1234 decimal chars).
 *
 * Calculate using the formula:
 *  MBEDTLS_MPI_RW_BUFFER_SIZE = ceil(MBEDTLS_MPI_MAX_BITS / ln(10) * ln(2)) +
 *                                LabelSize + 6
 */

Marco MBEDTLS_LN_2_DIV_LN_10_SCALE100

#define MBEDTLS_LN_2_DIV_LN_10_SCALE100                332


      

Marco MBEDTLS_MPI_RW_BUFFER_SIZE

#define MBEDTLS_MPI_RW_BUFFER_SIZE            ( ((MBEDTLS_MPI_MAX_BITS_SCALE100 + MBEDTLS_LN_2_DIV_LN_10_SCALE100 - 1) / MBEDTLS_LN_2_DIV_LN_10_SCALE100) + 10 + 6 )


      

Marco MBEDTLS_HAVE_INT64

#define MBEDTLS_HAVE_INT64


      

Marco MBEDTLS_HAVE_INT64

#define MBEDTLS_HAVE_INT64


      

Marco MBEDTLS_HAVE_UDBL

#define MBEDTLS_HAVE_UDBL


      

Marco MBEDTLS_HAVE_INT64

#define MBEDTLS_HAVE_INT64


      

Marco MBEDTLS_HAVE_UDBL

#define MBEDTLS_HAVE_UDBL


      

Marco MBEDTLS_HAVE_INT32

#define MBEDTLS_HAVE_INT32


      

Marco MBEDTLS_HAVE_UDBL

#define MBEDTLS_HAVE_UDBL


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_BLOWFISH_H

#define MBEDTLS_BLOWFISH_H


      

Marco MBEDTLS_BLOWFISH_ENCRYPT

#define MBEDTLS_BLOWFISH_ENCRYPT    1


      

Marco MBEDTLS_BLOWFISH_DECRYPT

#define MBEDTLS_BLOWFISH_DECRYPT    0


      

Marco MBEDTLS_BLOWFISH_MAX_KEY_BITS

#define MBEDTLS_BLOWFISH_MAX_KEY_BITS    448


      

Marco MBEDTLS_BLOWFISH_MIN_KEY_BITS

#define MBEDTLS_BLOWFISH_MIN_KEY_BITS    32


      

Marco MBEDTLS_BLOWFISH_ROUNDS

#define MBEDTLS_BLOWFISH_ROUNDS     16        /**< Rounds to use. When increasing this value, make sure to extend the initialisation vectors */


      

Marco MBEDTLS_BLOWFISH_BLOCKSIZE

#define MBEDTLS_BLOWFISH_BLOCKSIZE  8         /* Blowfish uses 64 bit blocks */


      

Marco MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH

#define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH  MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -22 )


      

Marco MBEDTLS_ERR_BLOWFISH_BAD_INPUT_DATA

#define MBEDTLS_ERR_BLOWFISH_BAD_INPUT_DATA -22 /**< Bad input data. */


      

Marco MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH

#define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -24 /**< Invalid data input length. */


      

Marco MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED

#define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED                  -23 /**< Blowfish hardware accelerator failed. */
/* MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED is deprecated and should not be used.
 */

Marco MBEDTLS_BN_MUL_H

#define MBEDTLS_BN_MUL_H


      

Marco asm

#define asm __asm


      

Marco MULADDC_INIT

#define MULADDC_INIT                       \
   asm(                                   \
       "movl   %%ebx, %0           \n\t"  \
       "movl   %5, %%esi           \n\t"  \
       "movl   %6, %%edi           \n\t"  \
       "movl   %7, %%ecx           \n\t"  \
       "movl   %8, %%ebx           \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                       \
       "lodsl                      \n\t"  \
       "mull   %%ebx               \n\t"  \
       "addl   %%ecx,   %%eax      \n\t"  \
       "adcl   $0,      %%edx      \n\t"  \
       "addl   (%%edi), %%eax      \n\t"  \
       "adcl   $0,      %%edx      \n\t"  \
       "movl   %%edx,   %%ecx      \n\t"  \
       "stosl                      \n\t"


      

Marco MULADDC_HUIT

#define MULADDC_HUIT                           \
       "movd     %%ecx,     %%mm1      \n\t"  \
       "movd     %%ebx,     %%mm0      \n\t"  \
       "movd     (%%edi),   %%mm3      \n\t"  \
       "paddq    %%mm3,     %%mm1      \n\t"  \
       "movd     (%%esi),   %%mm2      \n\t"  \
       "pmuludq  %%mm0,     %%mm2      \n\t"  \
       "movd     4(%%esi),  %%mm4      \n\t"  \
       "pmuludq  %%mm0,     %%mm4      \n\t"  \
       "movd     8(%%esi),  %%mm6      \n\t"  \
       "pmuludq  %%mm0,     %%mm6      \n\t"  \
       "movd     12(%%esi), %%mm7      \n\t"  \
       "pmuludq  %%mm0,     %%mm7      \n\t"  \
       "paddq    %%mm2,     %%mm1      \n\t"  \
       "movd     4(%%edi),  %%mm3      \n\t"  \
       "paddq    %%mm4,     %%mm3      \n\t"  \
       "movd     8(%%edi),  %%mm5      \n\t"  \
       "paddq    %%mm6,     %%mm5      \n\t"  \
       "movd     12(%%edi), %%mm4      \n\t"  \
       "paddq    %%mm4,     %%mm7      \n\t"  \
       "movd     %%mm1,     (%%edi)    \n\t"  \
       "movd     16(%%esi), %%mm2      \n\t"  \
       "pmuludq  %%mm0,     %%mm2      \n\t"  \
       "psrlq    $32,       %%mm1      \n\t"  \
       "movd     20(%%esi), %%mm4      \n\t"  \
       "pmuludq  %%mm0,     %%mm4      \n\t"  \
       "paddq    %%mm3,     %%mm1      \n\t"  \
       "movd     24(%%esi), %%mm6      \n\t"  \
       "pmuludq  %%mm0,     %%mm6      \n\t"  \
       "movd     %%mm1,     4(%%edi)   \n\t"  \
       "psrlq    $32,       %%mm1      \n\t"  \
       "movd     28(%%esi), %%mm3      \n\t"  \
       "pmuludq  %%mm0,     %%mm3      \n\t"  \
       "paddq    %%mm5,     %%mm1      \n\t"  \
       "movd     16(%%edi), %%mm5      \n\t"  \
       "paddq    %%mm5,     %%mm2      \n\t"  \
       "movd     %%mm1,     8(%%edi)   \n\t"  \
       "psrlq    $32,       %%mm1      \n\t"  \
       "paddq    %%mm7,     %%mm1      \n\t"  \
       "movd     20(%%edi), %%mm5      \n\t"  \
       "paddq    %%mm5,     %%mm4      \n\t"  \
       "movd     %%mm1,     12(%%edi)  \n\t"  \
       "psrlq    $32,       %%mm1      \n\t"  \
       "paddq    %%mm2,     %%mm1      \n\t"  \
       "movd     24(%%edi), %%mm5      \n\t"  \
       "paddq    %%mm5,     %%mm6      \n\t"  \
       "movd     %%mm1,     16(%%edi)  \n\t"  \
       "psrlq    $32,       %%mm1      \n\t"  \
       "paddq    %%mm4,     %%mm1      \n\t"  \
       "movd     28(%%edi), %%mm5      \n\t"  \
       "paddq    %%mm5,     %%mm3      \n\t"  \
       "movd     %%mm1,     20(%%edi)  \n\t"  \
       "psrlq    $32,       %%mm1      \n\t"  \
       "paddq    %%mm6,     %%mm1      \n\t"  \
       "movd     %%mm1,     24(%%edi)  \n\t"  \
       "psrlq    $32,       %%mm1      \n\t"  \
       "paddq    %%mm3,     %%mm1      \n\t"  \
       "movd     %%mm1,     28(%%edi)  \n\t"  \
       "addl     $32,       %%edi      \n\t"  \
       "addl     $32,       %%esi      \n\t"  \
       "psrlq    $32,       %%mm1      \n\t"  \
       "movd     %%mm1,     %%ecx      \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                   \
       "emms                   \n\t"  \
       "movl   %4, %%ebx       \n\t"  \
       "movl   %%ecx, %1       \n\t"  \
       "movl   %%edi, %2       \n\t"  \
       "movl   %%esi, %3       \n\t"  \
       : "=m" (t), "=m" (c), "=m" (d), "=m" (s)       \
       : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b)  \
       : "eax", "ebx", "ecx", "edx", "esi", "edi"     \
   );


      

Marco MULADDC_STOP

#define MULADDC_STOP                   \
       "movl   %4, %%ebx       \n\t"  \
       "movl   %%ecx, %1       \n\t"  \
       "movl   %%edi, %2       \n\t"  \
       "movl   %%esi, %3       \n\t"  \
       : "=m" (t), "=m" (c), "=m" (d), "=m" (s)       \
       : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b)  \
       : "eax", "ebx", "ecx", "edx", "esi", "edi"     \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                       \
   asm(                                   \
       "xorq   %%r8, %%r8\n"


      

Marco MULADDC_CORE

#define MULADDC_CORE                       \
       "movq   (%%rsi), %%rax\n"          \
       "mulq   %%rbx\n"                   \
       "addq   $8, %%rsi\n"               \
       "addq   %%rcx, %%rax\n"            \
       "movq   %%r8, %%rcx\n"             \
       "adcq   $0, %%rdx\n"               \
       "nop    \n"                        \
       "addq   %%rax, (%%rdi)\n"          \
       "adcq   %%rdx, %%rcx\n"            \
       "addq   $8, %%rdi\n"


      

Marco MULADDC_STOP

#define MULADDC_STOP                       \
       : "+c" (c), "+D" (d), "+S" (s)     \
       : "b" (b)                          \
       : "rax", "rdx", "r8"               \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                   \
   asm(                               \
       "movl   %3, %%a2        \n\t"  \
       "movl   %4, %%a3        \n\t"  \
       "movl   %5, %%d3        \n\t"  \
       "movl   %6, %%d2        \n\t"  \
       "moveq  #0, %%d0        \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                   \
       "movel  %%a2@+, %%d1    \n\t"  \
       "mulul  %%d2, %%d4:%%d1 \n\t"  \
       "addl   %%d3, %%d1      \n\t"  \
       "addxl  %%d0, %%d4      \n\t"  \
       "moveq  #0,   %%d3      \n\t"  \
       "addl   %%d1, %%a3@+    \n\t"  \
       "addxl  %%d4, %%d3      \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                   \
       "movl   %%d3, %0        \n\t"  \
       "movl   %%a3, %1        \n\t"  \
       "movl   %%a2, %2        \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)             \
       : "m" (s), "m" (d), "m" (c), "m" (b)       \
       : "d0", "d1", "d2", "d3", "d4", "a2", "a3" \
   );


      

Marco MULADDC_HUIT

#define MULADDC_HUIT                       \
       "movel  %%a2@+,  %%d1       \n\t"  \
       "mulul  %%d2,    %%d4:%%d1  \n\t"  \
       "addxl  %%d3,    %%d1       \n\t"  \
       "addxl  %%d0,    %%d4       \n\t"  \
       "addl   %%d1,    %%a3@+     \n\t"  \
       "movel  %%a2@+,  %%d1       \n\t"  \
       "mulul  %%d2,    %%d3:%%d1  \n\t"  \
       "addxl  %%d4,    %%d1       \n\t"  \
       "addxl  %%d0,    %%d3       \n\t"  \
       "addl   %%d1,    %%a3@+     \n\t"  \
       "movel  %%a2@+,  %%d1       \n\t"  \
       "mulul  %%d2,    %%d4:%%d1  \n\t"  \
       "addxl  %%d3,    %%d1       \n\t"  \
       "addxl  %%d0,    %%d4       \n\t"  \
       "addl   %%d1,    %%a3@+     \n\t"  \
       "movel  %%a2@+,  %%d1       \n\t"  \
       "mulul  %%d2,    %%d3:%%d1  \n\t"  \
       "addxl  %%d4,    %%d1       \n\t"  \
       "addxl  %%d0,    %%d3       \n\t"  \
       "addl   %%d1,    %%a3@+     \n\t"  \
       "movel  %%a2@+,  %%d1       \n\t"  \
       "mulul  %%d2,    %%d4:%%d1  \n\t"  \
       "addxl  %%d3,    %%d1       \n\t"  \
       "addxl  %%d0,    %%d4       \n\t"  \
       "addl   %%d1,    %%a3@+     \n\t"  \
       "movel  %%a2@+,  %%d1       \n\t"  \
       "mulul  %%d2,    %%d3:%%d1  \n\t"  \
       "addxl  %%d4,    %%d1       \n\t"  \
       "addxl  %%d0,    %%d3       \n\t"  \
       "addl   %%d1,    %%a3@+     \n\t"  \
       "movel  %%a2@+,  %%d1       \n\t"  \
       "mulul  %%d2,    %%d4:%%d1  \n\t"  \
       "addxl  %%d3,    %%d1       \n\t"  \
       "addxl  %%d0,    %%d4       \n\t"  \
       "addl   %%d1,    %%a3@+     \n\t"  \
       "movel  %%a2@+,  %%d1       \n\t"  \
       "mulul  %%d2,    %%d3:%%d1  \n\t"  \
       "addxl  %%d4,    %%d1       \n\t"  \
       "addxl  %%d0,    %%d3       \n\t"  \
       "addl   %%d1,    %%a3@+     \n\t"  \
       "addxl  %%d0,    %%d3       \n\t"


      

Marco MULADDC_INIT

#define MULADDC_INIT                       \
   asm(                                   \
       "ld     r3, %3              \n\t"  \
       "ld     r4, %4              \n\t"  \
       "ld     r5, %5              \n\t"  \
       "ld     r6, %6              \n\t"  \
       "addi   r3, r3, -8          \n\t"  \
       "addi   r4, r4, -8          \n\t"  \
       "addic  r5, r5,  0          \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                       \
       "ldu    r7, 8(r3)           \n\t"  \
       "mulld  r8, r7, r6          \n\t"  \
       "mulhdu r9, r7, r6          \n\t"  \
       "adde   r8, r8, r5          \n\t"  \
       "ld     r7, 8(r4)           \n\t"  \
       "addze  r5, r9              \n\t"  \
       "addc   r8, r8, r7          \n\t"  \
       "stdu   r8, 8(r4)           \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                       \
       "addze  r5, r5              \n\t"  \
       "addi   r4, r4, 8           \n\t"  \
       "addi   r3, r3, 8           \n\t"  \
       "std    r5, %0              \n\t"  \
       "std    r4, %1              \n\t"  \
       "std    r3, %2              \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)             \
       : "m" (s), "m" (d), "m" (c), "m" (b)       \
       : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                       \
   asm(                                   \
       "ld     %%r3, %3            \n\t"  \
       "ld     %%r4, %4            \n\t"  \
       "ld     %%r5, %5            \n\t"  \
       "ld     %%r6, %6            \n\t"  \
       "addi   %%r3, %%r3, -8      \n\t"  \
       "addi   %%r4, %%r4, -8      \n\t"  \
       "addic  %%r5, %%r5,  0      \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                       \
       "ldu    %%r7, 8(%%r3)       \n\t"  \
       "mulld  %%r8, %%r7, %%r6    \n\t"  \
       "mulhdu %%r9, %%r7, %%r6    \n\t"  \
       "adde   %%r8, %%r8, %%r5    \n\t"  \
       "ld     %%r7, 8(%%r4)       \n\t"  \
       "addze  %%r5, %%r9          \n\t"  \
       "addc   %%r8, %%r8, %%r7    \n\t"  \
       "stdu   %%r8, 8(%%r4)       \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                       \
       "addze  %%r5, %%r5          \n\t"  \
       "addi   %%r4, %%r4, 8       \n\t"  \
       "addi   %%r3, %%r3, 8       \n\t"  \
       "std    %%r5, %0            \n\t"  \
       "std    %%r4, %1            \n\t"  \
       "std    %%r3, %2            \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)             \
       : "m" (s), "m" (d), "m" (c), "m" (b)       \
       : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                   \
   asm(                               \
       "lwz    r3, %3          \n\t"  \
       "lwz    r4, %4          \n\t"  \
       "lwz    r5, %5          \n\t"  \
       "lwz    r6, %6          \n\t"  \
       "addi   r3, r3, -4      \n\t"  \
       "addi   r4, r4, -4      \n\t"  \
       "addic  r5, r5,  0      \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                   \
       "lwzu   r7, 4(r3)       \n\t"  \
       "mullw  r8, r7, r6      \n\t"  \
       "mulhwu r9, r7, r6      \n\t"  \
       "adde   r8, r8, r5      \n\t"  \
       "lwz    r7, 4(r4)       \n\t"  \
       "addze  r5, r9          \n\t"  \
       "addc   r8, r8, r7      \n\t"  \
       "stwu   r8, 4(r4)       \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                   \
       "addze  r5, r5          \n\t"  \
       "addi   r4, r4, 4       \n\t"  \
       "addi   r3, r3, 4       \n\t"  \
       "stw    r5, %0          \n\t"  \
       "stw    r4, %1          \n\t"  \
       "stw    r3, %2          \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)             \
       : "m" (s), "m" (d), "m" (c), "m" (b)       \
       : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                       \
   asm(                                   \
       "lwz    %%r3, %3            \n\t"  \
       "lwz    %%r4, %4            \n\t"  \
       "lwz    %%r5, %5            \n\t"  \
       "lwz    %%r6, %6            \n\t"  \
       "addi   %%r3, %%r3, -4      \n\t"  \
       "addi   %%r4, %%r4, -4      \n\t"  \
       "addic  %%r5, %%r5,  0      \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                       \
       "lwzu   %%r7, 4(%%r3)       \n\t"  \
       "mullw  %%r8, %%r7, %%r6    \n\t"  \
       "mulhwu %%r9, %%r7, %%r6    \n\t"  \
       "adde   %%r8, %%r8, %%r5    \n\t"  \
       "lwz    %%r7, 4(%%r4)       \n\t"  \
       "addze  %%r5, %%r9          \n\t"  \
       "addc   %%r8, %%r8, %%r7    \n\t"  \
       "stwu   %%r8, 4(%%r4)       \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                       \
       "addze  %%r5, %%r5          \n\t"  \
       "addi   %%r4, %%r4, 4       \n\t"  \
       "addi   %%r3, %%r3, 4       \n\t"  \
       "stw    %%r5, %0            \n\t"  \
       "stw    %%r4, %1            \n\t"  \
       "stw    %%r3, %2            \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)             \
       : "m" (s), "m" (d), "m" (c), "m" (b)       \
       : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                                   \
   asm(                                               \
               "ldx     %3, %%o0               \n\t"  \
               "ldx     %4, %%o1               \n\t"  \
               "ld      %5, %%o2               \n\t"  \
               "ld      %6, %%o3               \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                                   \
               "ld      [%%o0], %%o4           \n\t"  \
               "inc     4, %%o0                \n\t"  \
               "ld      [%%o1], %%o5           \n\t"  \
               "umul    %%o3, %%o4, %%o4       \n\t"  \
               "addcc   %%o4, %%o2, %%o4       \n\t"  \
               "rd      %%y, %%g1              \n\t"  \
               "addx    %%g1, 0, %%g1          \n\t"  \
               "addcc   %%o4, %%o5, %%o4       \n\t"  \
               "st      %%o4, [%%o1]           \n\t"  \
               "addx    %%g1, 0, %%o2          \n\t"  \
               "inc     4, %%o1                \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                           \
               "st      %%o2, %0               \n\t"  \
               "stx     %%o1, %1               \n\t"  \
               "stx     %%o0, %2               \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)         \
       : "m" (s), "m" (d), "m" (c), "m" (b)   \
       : "g1", "o0", "o1", "o2", "o3", "o4",  \
         "o5"                                 \
       );


      

Marco MULADDC_INIT

#define MULADDC_INIT                                   \
   asm(                                               \
               "ld      %3, %%o0               \n\t"  \
               "ld      %4, %%o1               \n\t"  \
               "ld      %5, %%o2               \n\t"  \
               "ld      %6, %%o3               \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                                   \
               "ld      [%%o0], %%o4           \n\t"  \
               "inc     4, %%o0                \n\t"  \
               "ld      [%%o1], %%o5           \n\t"  \
               "umul    %%o3, %%o4, %%o4       \n\t"  \
               "addcc   %%o4, %%o2, %%o4       \n\t"  \
               "rd      %%y, %%g1              \n\t"  \
               "addx    %%g1, 0, %%g1          \n\t"  \
               "addcc   %%o4, %%o5, %%o4       \n\t"  \
               "st      %%o4, [%%o1]           \n\t"  \
               "addx    %%g1, 0, %%o2          \n\t"  \
               "inc     4, %%o1                \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                                   \
               "st      %%o2, %0               \n\t"  \
               "st      %%o1, %1               \n\t"  \
               "st      %%o0, %2               \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)         \
       : "m" (s), "m" (d), "m" (c), "m" (b)   \
       : "g1", "o0", "o1", "o2", "o3", "o4",  \
         "o5"                                 \
       );


      

Marco MULADDC_INIT

#define MULADDC_INIT                   \
   asm(                               \
       "lwi   r3,   %3         \n\t"  \
       "lwi   r4,   %4         \n\t"  \
       "lwi   r5,   %5         \n\t"  \
       "lwi   r6,   %6         \n\t"  \
       "andi  r7,   r6, 0xffff \n\t"  \
       "bsrli r6,   r6, 16     \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                   \
       "lhui  r8,   r3,   0    \n\t"  \
       "addi  r3,   r3,   2    \n\t"  \
       "lhui  r9,   r3,   0    \n\t"  \
       "addi  r3,   r3,   2    \n\t"  \
       "mul   r10,  r9,  r6    \n\t"  \
       "mul   r11,  r8,  r7    \n\t"  \
       "mul   r12,  r9,  r7    \n\t"  \
       "mul   r13,  r8,  r6    \n\t"  \
       "bsrli  r8, r10,  16    \n\t"  \
       "bsrli  r9, r11,  16    \n\t"  \
       "add   r13, r13,  r8    \n\t"  \
       "add   r13, r13,  r9    \n\t"  \
       "bslli r10, r10,  16    \n\t"  \
       "bslli r11, r11,  16    \n\t"  \
       "add   r12, r12, r10    \n\t"  \
       "addc  r13, r13,  r0    \n\t"  \
       "add   r12, r12, r11    \n\t"  \
       "addc  r13, r13,  r0    \n\t"  \
       "lwi   r10,  r4,   0    \n\t"  \
       "add   r12, r12, r10    \n\t"  \
       "addc  r13, r13,  r0    \n\t"  \
       "add   r12, r12,  r5    \n\t"  \
       "addc   r5, r13,  r0    \n\t"  \
       "swi   r12,  r4,   0    \n\t"  \
       "addi   r4,  r4,   4    \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                   \
       "swi   r5,   %0         \n\t"  \
       "swi   r4,   %1         \n\t"  \
       "swi   r3,   %2         \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)             \
       : "m" (s), "m" (d), "m" (c), "m" (b)       \
       : "r3", "r4", "r5", "r6", "r7", "r8",      \
         "r9", "r10", "r11", "r12", "r13"         \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                           \
   asm(                                       \
       "ld.a   %%a2, %3                \n\t"  \
       "ld.a   %%a3, %4                \n\t"  \
       "ld.w   %%d4, %5                \n\t"  \
       "ld.w   %%d1, %6                \n\t"  \
       "xor    %%d5, %%d5              \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                           \
       "ld.w   %%d0,   [%%a2+]         \n\t"  \
       "madd.u %%e2, %%e4, %%d0, %%d1  \n\t"  \
       "ld.w   %%d0,   [%%a3]          \n\t"  \
       "addx   %%d2,    %%d2,  %%d0    \n\t"  \
       "addc   %%d3,    %%d3,    0     \n\t"  \
       "mov    %%d4,    %%d3           \n\t"  \
       "st.w  [%%a3+],  %%d2           \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                           \
       "st.w   %0, %%d4                \n\t"  \
       "st.a   %1, %%a3                \n\t"  \
       "st.a   %2, %%a2                \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)         \
       : "m" (s), "m" (d), "m" (c), "m" (b)   \
       : "d0", "d1", "e2", "d4", "a2", "a3"   \
   );


      

Marco MULADDC_CANNOT_USE_R7

#define MULADDC_CANNOT_USE_R7


      

Marco MULADDC_INIT

#define MULADDC_INIT                                   \
   asm(                                               \
           "ldr    r0, %3                      \n\t"  \
           "ldr    r1, %4                      \n\t"  \
           "ldr    r2, %5                      \n\t"  \
           "ldr    r3, %6                      \n\t"  \
           "lsr    r7, r3, #16                 \n\t"  \
           "mov    r9, r7                      \n\t"  \
           "lsl    r7, r3, #16                 \n\t"  \
           "lsr    r7, r7, #16                 \n\t"  \
           "mov    r8, r7                      \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                                   \
           "ldmia  r0!, {r6}                   \n\t"  \
           "lsr    r7, r6, #16                 \n\t"  \
           "lsl    r6, r6, #16                 \n\t"  \
           "lsr    r6, r6, #16                 \n\t"  \
           "mov    r4, r8                      \n\t"  \
           "mul    r4, r6                      \n\t"  \
           "mov    r3, r9                      \n\t"  \
           "mul    r6, r3                      \n\t"  \
           "mov    r5, r9                      \n\t"  \
           "mul    r5, r7                      \n\t"  \
           "mov    r3, r8                      \n\t"  \
           "mul    r7, r3                      \n\t"  \
           "lsr    r3, r6, #16                 \n\t"  \
           "add    r5, r5, r3                  \n\t"  \
           "lsr    r3, r7, #16                 \n\t"  \
           "add    r5, r5, r3                  \n\t"  \
           "add    r4, r4, r2                  \n\t"  \
           "mov    r2, #0                      \n\t"  \
           "adc    r5, r2                      \n\t"  \
           "lsl    r3, r6, #16                 \n\t"  \
           "add    r4, r4, r3                  \n\t"  \
           "adc    r5, r2                      \n\t"  \
           "lsl    r3, r7, #16                 \n\t"  \
           "add    r4, r4, r3                  \n\t"  \
           "adc    r5, r2                      \n\t"  \
           "ldr    r3, [r1]                    \n\t"  \
           "add    r4, r4, r3                  \n\t"  \
           "adc    r2, r5                      \n\t"  \
           "stmia  r1!, {r4}                   \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                                   \
           "str    r2, %0                      \n\t"  \
           "str    r1, %1                      \n\t"  \
           "str    r0, %2                      \n\t"  \
        : "=m" (c), "=m" (d), "=m" (s)       \
        : "m" (s), "m" (d), "m" (c), "m" (b)  \
        : "r0", "r1", "r2", "r3", "r4", "r5", \
          "r6", "r7", "r8", "r9", "cc"        \
        );


      

Marco MULADDC_INIT

#define MULADDC_INIT                           \
   asm(


      

Marco MULADDC_CORE

#define MULADDC_CORE                           \
           "ldr    r0, [%0], #4        \n\t"  \
           "ldr    r1, [%1]            \n\t"  \
           "umaal  r1, %2, %3, r0      \n\t"  \
           "str    r1, [%1], #4        \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                           \
        : "=r" (s), "=r" (d), "=r" (c)       \
        : "r" (b), "0" (s), "1" (d), "2" (c)  \
        : "r0", "r1", "memory"                \
        );


      

Marco MULADDC_INIT

#define MULADDC_INIT                                   \
   asm(                                               \
           "ldr    r0, %3                      \n\t"  \
           "ldr    r1, %4                      \n\t"  \
           "ldr    r2, %5                      \n\t"  \
           "ldr    r3, %6                      \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                                   \
           "ldr    r4, [r0], #4                \n\t"  \
           "mov    r5, #0                      \n\t"  \
           "ldr    r6, [r1]                    \n\t"  \
           "umlal  r2, r5, r3, r4              \n\t"  \
           "adds   r7, r6, r2                  \n\t"  \
           "adc    r2, r5, #0                  \n\t"  \
           "str    r7, [r1], #4                \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                                   \
           "str    r2, %0                      \n\t"  \
           "str    r1, %1                      \n\t"  \
           "str    r0, %2                      \n\t"  \
        : "=m" (c), "=m" (d), "=m" (s)       \
        : "m" (s), "m" (d), "m" (c), "m" (b)  \
        : "r0", "r1", "r2", "r3", "r4", "r5", \
          "r6", "r7", "cc"                    \
        );


      

Marco MULADDC_INIT

#define MULADDC_INIT                   \
   asm(                               \
       "ldq    $1, %3          \n\t"  \
       "ldq    $2, %4          \n\t"  \
       "ldq    $3, %5          \n\t"  \
       "ldq    $4, %6          \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                   \
       "ldq    $6,  0($1)      \n\t"  \
       "addq   $1,  8, $1      \n\t"  \
       "mulq   $6, $4, $7      \n\t"  \
       "umulh  $6, $4, $6      \n\t"  \
       "addq   $7, $3, $7      \n\t"  \
       "cmpult $7, $3, $3      \n\t"  \
       "ldq    $5,  0($2)      \n\t"  \
       "addq   $7, $5, $7      \n\t"  \
       "cmpult $7, $5, $5      \n\t"  \
       "stq    $7,  0($2)      \n\t"  \
       "addq   $2,  8, $2      \n\t"  \
       "addq   $6, $3, $3      \n\t"  \
       "addq   $5, $3, $3      \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                                   \
       "stq    $3, %0          \n\t"  \
       "stq    $2, %1          \n\t"  \
       "stq    $1, %2          \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)             \
       : "m" (s), "m" (d), "m" (c), "m" (b)       \
       : "$1", "$2", "$3", "$4", "$5", "$6", "$7" \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                   \
   asm(                               \
       "lw     $10, %3         \n\t"  \
       "lw     $11, %4         \n\t"  \
       "lw     $12, %5         \n\t"  \
       "lw     $13, %6         \n\t"


      

Marco MULADDC_CORE

#define MULADDC_CORE                   \
       "lw     $14, 0($10)     \n\t"  \
       "multu  $13, $14        \n\t"  \
       "addi   $10, $10, 4     \n\t"  \
       "mflo   $14             \n\t"  \
       "mfhi   $9              \n\t"  \
       "addu   $14, $12, $14   \n\t"  \
       "lw     $15, 0($11)     \n\t"  \
       "sltu   $12, $14, $12   \n\t"  \
       "addu   $15, $14, $15   \n\t"  \
       "sltu   $14, $15, $14   \n\t"  \
       "addu   $12, $12, $9    \n\t"  \
       "sw     $15, 0($11)     \n\t"  \
       "addu   $12, $12, $14   \n\t"  \
       "addi   $11, $11, 4     \n\t"


      

Marco MULADDC_STOP

#define MULADDC_STOP                   \
       "sw     $12, %0         \n\t"  \
       "sw     $11, %1         \n\t"  \
       "sw     $10, %2         \n\t"  \
       : "=m" (c), "=m" (d), "=m" (s)                     \
       : "m" (s), "m" (d), "m" (c), "m" (b)               \
       : "$9", "$10", "$11", "$12", "$13", "$14", "$15", "lo", "hi" \
   );


      

Marco MULADDC_INIT

#define MULADDC_INIT                           \
   __asm  mov    esi, s                     \
   __asm  mov    edi, d                     \
   __asm  mov    ecx, c                     \
   __asm  mov    ebx, b


      

Marco MULADDC_CORE

#define MULADDC_CORE                           \
   __asm  lodsd                              \
   __asm  mul    ebx                        \
   __asm  add    eax, ecx                   \
   __asm  adc    edx, 0                     \
   __asm  add    eax, [edi]                 \
   __asm  adc    edx, 0                     \
   __asm  mov    ecx, edx                   \
   __asm  stosd


      

Marco EMIT

#define EMIT __asm _emit


      

Marco MULADDC_HUIT

#define MULADDC_HUIT                           \
   EMIT 15 EMIT 6E EMIT 0xC9            \
   EMIT 15 EMIT 6E EMIT 0xC3            \
   EMIT 15 EMIT 6E EMIT 31            \
   EMIT 15 EMIT 0xD4 EMIT 0xCB            \
   EMIT 15 EMIT 6E EMIT 22            \
   EMIT 15 EMIT 244 EMIT 0xD0            \
   EMIT 15 EMIT 6E EMIT 102 EMIT 4 \
   EMIT 15 EMIT 244 EMIT 0xE0            \
   EMIT 15 EMIT 6E EMIT 118 EMIT 8 \
   EMIT 15 EMIT 244 EMIT 240            \
   EMIT 15 EMIT 6E EMIT 7E EMIT 0C \
   EMIT 15 EMIT 244 EMIT 248            \
   EMIT 15 EMIT 0xD4 EMIT 0xCA            \
   EMIT 15 EMIT 6E EMIT 95 EMIT 4 \
   EMIT 15 EMIT 0xD4 EMIT 0xDC            \
   EMIT 15 EMIT 6E EMIT 111 EMIT 8 \
   EMIT 15 EMIT 0xD4 EMIT 0xEE            \
   EMIT 15 EMIT 6E EMIT 103 EMIT 0C \
   EMIT 15 EMIT 0xD4 EMIT 15C            \
   EMIT 15 EMIT 7E EMIT 15            \
   EMIT 15 EMIT 6E EMIT 86 EMIT 16 \
   EMIT 15 EMIT 244 EMIT 0xD0            \
   EMIT 15 EMIT 115 EMIT 0xD1 EMIT 32 \
   EMIT 15 EMIT 6E EMIT 102 EMIT 20 \
   EMIT 15 EMIT 244 EMIT 0xE0            \
   EMIT 15 EMIT 0xD4 EMIT 0xCB            \
   EMIT 15 EMIT 6E EMIT 118 EMIT 24 \
   EMIT 15 EMIT 244 EMIT 240            \
   EMIT 15 EMIT 7E EMIT 79 EMIT 4 \
   EMIT 15 EMIT 115 EMIT 0xD1 EMIT 32 \
   EMIT 15 EMIT 6E EMIT 5E EMIT 1C \
   EMIT 15 EMIT 244 EMIT 0xD8            \
   EMIT 15 EMIT 0xD4 EMIT 0xCD            \
   EMIT 15 EMIT 6E EMIT 111 EMIT 16 \
   EMIT 15 EMIT 0xD4 EMIT 0xD5            \
   EMIT 15 EMIT 7E EMIT 79 EMIT 8 \
   EMIT 15 EMIT 115 EMIT 0xD1 EMIT 32 \
   EMIT 15 EMIT 0xD4 EMIT 0xCF            \
   EMIT 15 EMIT 6E EMIT 111 EMIT 20 \
   EMIT 15 EMIT 0xD4 EMIT 0xE5            \
   EMIT 15 EMIT 7E EMIT 79 EMIT 0C \
   EMIT 15 EMIT 115 EMIT 0xD1 EMIT 32 \
   EMIT 15 EMIT 0xD4 EMIT 0xCA            \
   EMIT 15 EMIT 6E EMIT 111 EMIT 24 \
   EMIT 15 EMIT 0xD4 EMIT 245            \
   EMIT 15 EMIT 7E EMIT 79 EMIT 16 \
   EMIT 15 EMIT 115 EMIT 0xD1 EMIT 32 \
   EMIT 15 EMIT 0xD4 EMIT 0xCC            \
   EMIT 15 EMIT 6E EMIT 111 EMIT 1C \
   EMIT 15 EMIT 0xD4 EMIT 0xDD            \
   EMIT 15 EMIT 7E EMIT 79 EMIT 20 \
   EMIT 15 EMIT 115 EMIT 0xD1 EMIT 32 \
   EMIT 15 EMIT 0xD4 EMIT 0xCE            \
   EMIT 15 EMIT 7E EMIT 79 EMIT 24 \
   EMIT 15 EMIT 115 EMIT 0xD1 EMIT 32 \
   EMIT 15 EMIT 0xD4 EMIT 0xCB            \
   EMIT 15 EMIT 7E EMIT 79 EMIT 1C \
   EMIT 131 EMIT 0xC7 EMIT 32            \
   EMIT 131 EMIT 0xC6 EMIT 32            \
   EMIT 15 EMIT 115 EMIT 0xD1 EMIT 32 \
   EMIT 15 EMIT 7E EMIT 0xC9


      

Marco MULADDC_STOP

#define MULADDC_STOP                           \
   EMIT 15 EMIT 119                       \
   __asm  mov    c, ecx                     \
   __asm  mov    d, edi                     \
   __asm  mov    s, esi                     \



      

Marco MULADDC_STOP

#define MULADDC_STOP                           \
   __asm  mov    c, ecx                     \
   __asm  mov    d, edi                     \
   __asm  mov    s, esi                     \



      

Marco MULADDC_INIT

#define MULADDC_INIT                   \
{                                      \
   mbedtls_t_udbl r;                          \
   mbedtls_mpi_uint r0, r1;


      

Marco MULADDC_CORE

#define MULADDC_CORE                   \
   r  = *(s++) * (mbedtls_t_udbl) b;         \
   r0 = (mbedtls_mpi_uint) r;                  \
   r1 = (mbedtls_mpi_uint)( r >> biL );        \
   r0 += c; r1 += (r0 < c);         \
   r0 += *d; r1 += (r0 < *d);         \
   c = r1; *(d++) = r0;


      

Marco MULADDC_STOP

#define MULADDC_STOP                   \
}


      

Marco MULADDC_INIT

#define MULADDC_INIT                   \
{                                      \
   mbedtls_mpi_uint s0, s1, b0, b1;             \
   mbedtls_mpi_uint r0, r1, rx, ry;             \
   b0 = ( b << biH ) >> biH;          \
   b1 = ( b >> biH );


      

Marco MULADDC_CORE

#define MULADDC_CORE                   \
   s0 = ( *s << biH ) >> biH;         \
   s1 = ( *s >> biH ); s++;           \
   rx = s0 * b1; r0 = s0 * b0;        \
   ry = s1 * b0; r1 = s1 * b1;        \
   r1 += ( rx >> biH );               \
   r1 += ( ry >> biH );               \
   rx <<= biH; ry <<= biH;            \
   r0 += rx; r1 += (r0 < rx);         \
   r0 += ry; r1 += (r0 < ry);         \
   r0 += c; r1 += (r0 < c);         \
   r0 += *d; r1 += (r0 < *d);         \
   c = r1; *(d++) = r0;


      

Marco MULADDC_STOP

#define MULADDC_STOP                   \
}


      

Marco MBEDTLS_CAMELLIA_H

#define MBEDTLS_CAMELLIA_H


      

Marco MBEDTLS_CAMELLIA_ENCRYPT

#define MBEDTLS_CAMELLIA_ENCRYPT    1


      

Marco MBEDTLS_CAMELLIA_DECRYPT

#define MBEDTLS_CAMELLIA_DECRYPT    0


      

Marco MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH

#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH  MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -36 )


      

Marco MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA

#define MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA -36 /**< Bad input data. */


      

Marco MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH

#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -38 /**< Invalid data input length. */


      

Marco MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED

#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED             -39 /**< Camellia hardware accelerator failed. */
/* MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED is deprecated and should not be used.
 */

Marco MBEDTLS_CCM_H

#define MBEDTLS_CCM_H


      

Marco MBEDTLS_ERR_CCM_BAD_INPUT

#define MBEDTLS_ERR_CCM_BAD_INPUT      0D /**< Bad input parameters to the function. */


      

Marco MBEDTLS_ERR_CCM_AUTH_FAILED

#define MBEDTLS_ERR_CCM_AUTH_FAILED    -15 /**< Authenticated decryption failed. */


      

Marco MBEDTLS_ERR_CCM_HW_ACCEL_FAILED

#define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED -17 /**< CCM hardware accelerator failed. */
/* MBEDTLS_ERR_CCM_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_CERTS_H

#define MBEDTLS_CERTS_H


      

Marco MBEDTLS_CHACHA20_H

#define MBEDTLS_CHACHA20_H


      

Marco MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA

#define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA        -81 /**< Invalid input parameter(s). */


      

Marco MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE   -83 /**< Feature not available. For example, s part of the API is not implemented. */
/* MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE is deprecated and should not be
 * used. */

Marco MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED

#define MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED       -85 /**< Chacha20 hardware accelerator failed. */
/* MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED is deprecated and should not be used.
 */

Marco MBEDTLS_CHACHAPOLY_H

#define MBEDTLS_CHACHAPOLY_H


      

Marco MBEDTLS_ERR_CHACHAPOLY_BAD_STATE

#define MBEDTLS_ERR_CHACHAPOLY_BAD_STATE           -84 /**< The requested operation is not permitted in the current state. */


      

Marco MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED

#define MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED         -86 /**< Authenticated decryption failed: data was not authentic. */


      

Marco MBEDTLS_CHECK_CONFIG_H

#define MBEDTLS_CHECK_CONFIG_H


      

Marco MBEDTLS_PLATFORM_SNPRINTF_ALT

#define MBEDTLS_PLATFORM_SNPRINTF_ALT


      

Marco MBEDTLS_THREADING_IMPL

#define MBEDTLS_THREADING_IMPL


      

Marco MBEDTLS_THREADING_IMPL

#define MBEDTLS_THREADING_IMPL


      

Marco MBEDTLS_CIPHER_H

#define MBEDTLS_CIPHER_H


      

Marco MBEDTLS_CIPHER_MODE_AEAD

#define MBEDTLS_CIPHER_MODE_AEAD


      

Marco MBEDTLS_CIPHER_MODE_WITH_PADDING

#define MBEDTLS_CIPHER_MODE_WITH_PADDING


      

Marco MBEDTLS_CIPHER_MODE_STREAM

#define MBEDTLS_CIPHER_MODE_STREAM


      

Marco inline

#define inline __inline


      

Marco MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE -24704 /**< The selected feature is not available. */


      

Marco MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA

#define MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA      -24832 /**< Bad input parameters. */


      

Marco MBEDTLS_ERR_CIPHER_ALLOC_FAILED

#define MBEDTLS_ERR_CIPHER_ALLOC_FAILED        -24960 /**< Failed to allocate memory. */


      

Marco MBEDTLS_ERR_CIPHER_INVALID_PADDING

#define MBEDTLS_ERR_CIPHER_INVALID_PADDING     -25088 /**< Input data contains invalid padding and is rejected. */


      

Marco MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED

#define MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED -25216 /**< Decryption of block requires a full block. */


      

Marco MBEDTLS_ERR_CIPHER_AUTH_FAILED

#define MBEDTLS_ERR_CIPHER_AUTH_FAILED         -25344 /**< Authentication failed (for AEAD modes). */


      

Marco MBEDTLS_ERR_CIPHER_INVALID_CONTEXT

#define MBEDTLS_ERR_CIPHER_INVALID_CONTEXT     -25472 /**< The context is invalid. For example, because it was freed. */


      

Marco MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED

#define MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED     -25600 /**< Cipher hardware accelerator failed. */
/* MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_CIPHER_VARIABLE_IV_LEN

#define MBEDTLS_CIPHER_VARIABLE_IV_LEN    1   /**< Cipher accepts IVs of variable length. */


      

Marco MBEDTLS_CIPHER_VARIABLE_KEY_LEN

#define MBEDTLS_CIPHER_VARIABLE_KEY_LEN   2   /**< Cipher accepts keys of variable length. */


      

Marco MBEDTLS_MAX_IV_LENGTH

#define MBEDTLS_MAX_IV_LENGTH     16
/** Maximum length of any IV, in Bytes. */

Marco MBEDTLS_MAX_BLOCK_LENGTH

#define MBEDTLS_MAX_BLOCK_LENGTH  16
/** Maximum block size of any cipher, in Bytes. */

Marco MBEDTLS_CIPHER_WRAP_H

#define MBEDTLS_CIPHER_WRAP_H


      

Marco MBEDTLS_CMAC_H

#define MBEDTLS_CMAC_H


      

Marco MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED

#define MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED -7A /**< CMAC hardware accelerator failed. */
/* MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_AES_BLOCK_SIZE

#define MBEDTLS_AES_BLOCK_SIZE         16


      

Marco MBEDTLS_DES3_BLOCK_SIZE

#define MBEDTLS_DES3_BLOCK_SIZE        8


      

Marco MBEDTLS_CIPHER_BLKSIZE_MAX

#define MBEDTLS_CIPHER_BLKSIZE_MAX     16 /**< The longest block used by CMAC is that of AES. */


      

Marco MBEDTLS_CIPHER_BLKSIZE_MAX

#define MBEDTLS_CIPHER_BLKSIZE_MAX     8  /**< The longest block used by CMAC is that of 3DES. */


      

Marco MBEDTLS_COMPAT13_H

#define MBEDTLS_COMPAT13_H


      

Marco POLARSSL_AESNI_C

#define POLARSSL_AESNI_C MBEDTLS_AESNI_C


      

Marco POLARSSL_AES_ALT

#define POLARSSL_AES_ALT MBEDTLS_AES_ALT


      

Marco POLARSSL_AES_C

#define POLARSSL_AES_C MBEDTLS_AES_C


      

Marco POLARSSL_AES_ROM_TABLES

#define POLARSSL_AES_ROM_TABLES MBEDTLS_AES_ROM_TABLES


      

Marco POLARSSL_ARC4_ALT

#define POLARSSL_ARC4_ALT MBEDTLS_ARC4_ALT


      

Marco POLARSSL_ARC4_C

#define POLARSSL_ARC4_C MBEDTLS_ARC4_C


      

Marco POLARSSL_ASN1_PARSE_C

#define POLARSSL_ASN1_PARSE_C MBEDTLS_ASN1_PARSE_C


      

Marco POLARSSL_ASN1_WRITE_C

#define POLARSSL_ASN1_WRITE_C MBEDTLS_ASN1_WRITE_C


      

Marco POLARSSL_BASE64_C

#define POLARSSL_BASE64_C MBEDTLS_BASE64_C


      

Marco POLARSSL_BIGNUM_C

#define POLARSSL_BIGNUM_C MBEDTLS_BIGNUM_C


      

Marco POLARSSL_BLOWFISH_ALT

#define POLARSSL_BLOWFISH_ALT MBEDTLS_BLOWFISH_ALT


      

Marco POLARSSL_BLOWFISH_C

#define POLARSSL_BLOWFISH_C MBEDTLS_BLOWFISH_C


      

Marco POLARSSL_CAMELLIA_ALT

#define POLARSSL_CAMELLIA_ALT MBEDTLS_CAMELLIA_ALT


      

Marco POLARSSL_CAMELLIA_C

#define POLARSSL_CAMELLIA_C MBEDTLS_CAMELLIA_C


      

Marco POLARSSL_CAMELLIA_SMALL_MEMORY

#define POLARSSL_CAMELLIA_SMALL_MEMORY MBEDTLS_CAMELLIA_SMALL_MEMORY


      

Marco POLARSSL_CCM_C

#define POLARSSL_CCM_C MBEDTLS_CCM_C


      

Marco POLARSSL_CERTS_C

#define POLARSSL_CERTS_C MBEDTLS_CERTS_C


      

Marco POLARSSL_CIPHER_C

#define POLARSSL_CIPHER_C MBEDTLS_CIPHER_C


      

Marco POLARSSL_CIPHER_MODE_CBC

#define POLARSSL_CIPHER_MODE_CBC MBEDTLS_CIPHER_MODE_CBC


      

Marco POLARSSL_CIPHER_MODE_CFB

#define POLARSSL_CIPHER_MODE_CFB MBEDTLS_CIPHER_MODE_CFB


      

Marco POLARSSL_CIPHER_MODE_CTR

#define POLARSSL_CIPHER_MODE_CTR MBEDTLS_CIPHER_MODE_CTR


      

Marco POLARSSL_CIPHER_NULL_CIPHER

#define POLARSSL_CIPHER_NULL_CIPHER MBEDTLS_CIPHER_NULL_CIPHER


      

Marco POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS

#define POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco POLARSSL_CIPHER_PADDING_PKCS7

#define POLARSSL_CIPHER_PADDING_PKCS7 MBEDTLS_CIPHER_PADDING_PKCS7


      

Marco POLARSSL_CIPHER_PADDING_ZEROS

#define POLARSSL_CIPHER_PADDING_ZEROS MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN

#define POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco POLARSSL_CTR_DRBG_C

#define POLARSSL_CTR_DRBG_C MBEDTLS_CTR_DRBG_C


      

Marco POLARSSL_DEBUG_C

#define POLARSSL_DEBUG_C MBEDTLS_DEBUG_C


      

Marco POLARSSL_DEPRECATED_REMOVED

#define POLARSSL_DEPRECATED_REMOVED MBEDTLS_DEPRECATED_REMOVED


      

Marco POLARSSL_DEPRECATED_WARNING

#define POLARSSL_DEPRECATED_WARNING MBEDTLS_DEPRECATED_WARNING


      

Marco POLARSSL_DES_ALT

#define POLARSSL_DES_ALT MBEDTLS_DES_ALT


      

Marco POLARSSL_DES_C

#define POLARSSL_DES_C MBEDTLS_DES_C


      

Marco POLARSSL_DHM_C

#define POLARSSL_DHM_C MBEDTLS_DHM_C


      

Marco POLARSSL_ECDH_C

#define POLARSSL_ECDH_C MBEDTLS_ECDH_C


      

Marco POLARSSL_ECDSA_C

#define POLARSSL_ECDSA_C MBEDTLS_ECDSA_C


      

Marco POLARSSL_ECDSA_DETERMINISTIC

#define POLARSSL_ECDSA_DETERMINISTIC MBEDTLS_ECDSA_DETERMINISTIC


      

Marco POLARSSL_ECP_C

#define POLARSSL_ECP_C MBEDTLS_ECP_C


      

Marco POLARSSL_ECP_DP_BP256R1_ENABLED

#define POLARSSL_ECP_DP_BP256R1_ENABLED MBEDTLS_ECP_DP_BP256R1_ENABLED


      

Marco POLARSSL_ECP_DP_BP384R1_ENABLED

#define POLARSSL_ECP_DP_BP384R1_ENABLED MBEDTLS_ECP_DP_BP384R1_ENABLED


      

Marco POLARSSL_ECP_DP_BP512R1_ENABLED

#define POLARSSL_ECP_DP_BP512R1_ENABLED MBEDTLS_ECP_DP_BP512R1_ENABLED


      

Marco POLARSSL_ECP_DP_M255_ENABLED

#define POLARSSL_ECP_DP_M255_ENABLED MBEDTLS_ECP_DP_CURVE25519_ENABLED


      

Marco POLARSSL_ECP_DP_SECP192K1_ENABLED

#define POLARSSL_ECP_DP_SECP192K1_ENABLED MBEDTLS_ECP_DP_SECP192K1_ENABLED


      

Marco POLARSSL_ECP_DP_SECP192R1_ENABLED

#define POLARSSL_ECP_DP_SECP192R1_ENABLED MBEDTLS_ECP_DP_SECP192R1_ENABLED


      

Marco POLARSSL_ECP_DP_SECP224K1_ENABLED

#define POLARSSL_ECP_DP_SECP224K1_ENABLED MBEDTLS_ECP_DP_SECP224K1_ENABLED


      

Marco POLARSSL_ECP_DP_SECP224R1_ENABLED

#define POLARSSL_ECP_DP_SECP224R1_ENABLED MBEDTLS_ECP_DP_SECP224R1_ENABLED


      

Marco POLARSSL_ECP_DP_SECP256K1_ENABLED

#define POLARSSL_ECP_DP_SECP256K1_ENABLED MBEDTLS_ECP_DP_SECP256K1_ENABLED


      

Marco POLARSSL_ECP_DP_SECP256R1_ENABLED

#define POLARSSL_ECP_DP_SECP256R1_ENABLED MBEDTLS_ECP_DP_SECP256R1_ENABLED


      

Marco POLARSSL_ECP_DP_SECP384R1_ENABLED

#define POLARSSL_ECP_DP_SECP384R1_ENABLED MBEDTLS_ECP_DP_SECP384R1_ENABLED


      

Marco POLARSSL_ECP_DP_SECP521R1_ENABLED

#define POLARSSL_ECP_DP_SECP521R1_ENABLED MBEDTLS_ECP_DP_SECP521R1_ENABLED


      

Marco POLARSSL_ECP_FIXED_POINT_OPTIM

#define POLARSSL_ECP_FIXED_POINT_OPTIM MBEDTLS_ECP_FIXED_POINT_OPTIM


      

Marco POLARSSL_ECP_MAX_BITS

#define POLARSSL_ECP_MAX_BITS MBEDTLS_ECP_MAX_BITS


      

Marco POLARSSL_ECP_NIST_OPTIM

#define POLARSSL_ECP_NIST_OPTIM MBEDTLS_ECP_NIST_OPTIM


      

Marco POLARSSL_ECP_WINDOW_SIZE

#define POLARSSL_ECP_WINDOW_SIZE MBEDTLS_ECP_WINDOW_SIZE


      

Marco POLARSSL_ENABLE_WEAK_CIPHERSUITES

#define POLARSSL_ENABLE_WEAK_CIPHERSUITES MBEDTLS_ENABLE_WEAK_CIPHERSUITES


      

Marco POLARSSL_ENTROPY_C

#define POLARSSL_ENTROPY_C MBEDTLS_ENTROPY_C


      

Marco POLARSSL_ENTROPY_FORCE_SHA256

#define POLARSSL_ENTROPY_FORCE_SHA256 MBEDTLS_ENTROPY_FORCE_SHA256


      

Marco POLARSSL_ERROR_C

#define POLARSSL_ERROR_C MBEDTLS_ERROR_C


      

Marco POLARSSL_ERROR_STRERROR_DUMMY

#define POLARSSL_ERROR_STRERROR_DUMMY MBEDTLS_ERROR_STRERROR_DUMMY


      

Marco POLARSSL_FS_IO

#define POLARSSL_FS_IO MBEDTLS_FS_IO


      

Marco POLARSSL_GCM_C

#define POLARSSL_GCM_C MBEDTLS_GCM_C


      

Marco POLARSSL_GENPRIME

#define POLARSSL_GENPRIME MBEDTLS_GENPRIME


      

Marco POLARSSL_HAVEGE_C

#define POLARSSL_HAVEGE_C MBEDTLS_HAVEGE_C


      

Marco POLARSSL_HAVE_ASM

#define POLARSSL_HAVE_ASM MBEDTLS_HAVE_ASM


      

Marco POLARSSL_HAVE_SSE2

#define POLARSSL_HAVE_SSE2 MBEDTLS_HAVE_SSE2


      

Marco POLARSSL_HAVE_TIME

#define POLARSSL_HAVE_TIME MBEDTLS_HAVE_TIME


      

Marco POLARSSL_HMAC_DRBG_C

#define POLARSSL_HMAC_DRBG_C MBEDTLS_HMAC_DRBG_C


      

Marco POLARSSL_HMAC_DRBG_MAX_INPUT

#define POLARSSL_HMAC_DRBG_MAX_INPUT MBEDTLS_HMAC_DRBG_MAX_INPUT


      

Marco POLARSSL_HMAC_DRBG_MAX_REQUEST

#define POLARSSL_HMAC_DRBG_MAX_REQUEST MBEDTLS_HMAC_DRBG_MAX_REQUEST


      

Marco POLARSSL_HMAC_DRBG_MAX_SEED_INPUT

#define POLARSSL_HMAC_DRBG_MAX_SEED_INPUT MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT


      

Marco POLARSSL_HMAC_DRBG_RESEED_INTERVAL

#define POLARSSL_HMAC_DRBG_RESEED_INTERVAL MBEDTLS_HMAC_DRBG_RESEED_INTERVAL


      

Marco POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED

#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED

#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED

#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED

#define POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED

#define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED

#define POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_PSK_ENABLED

#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_PSK_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_RSA_ENABLED

#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_RSA_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED

#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED


      

Marco POLARSSL_MD2_ALT

#define POLARSSL_MD2_ALT MBEDTLS_MD2_ALT


      

Marco POLARSSL_MD2_C

#define POLARSSL_MD2_C MBEDTLS_MD2_C


      

Marco POLARSSL_MD2_PROCESS_ALT

#define POLARSSL_MD2_PROCESS_ALT MBEDTLS_MD2_PROCESS_ALT


      

Marco POLARSSL_MD4_ALT

#define POLARSSL_MD4_ALT MBEDTLS_MD4_ALT


      

Marco POLARSSL_MD4_C

#define POLARSSL_MD4_C MBEDTLS_MD4_C


      

Marco POLARSSL_MD4_PROCESS_ALT

#define POLARSSL_MD4_PROCESS_ALT MBEDTLS_MD4_PROCESS_ALT


      

Marco POLARSSL_MD5_ALT

#define POLARSSL_MD5_ALT MBEDTLS_MD5_ALT


      

Marco POLARSSL_MD5_C

#define POLARSSL_MD5_C MBEDTLS_MD5_C


      

Marco POLARSSL_MD5_PROCESS_ALT

#define POLARSSL_MD5_PROCESS_ALT MBEDTLS_MD5_PROCESS_ALT


      

Marco POLARSSL_MD_C

#define POLARSSL_MD_C MBEDTLS_MD_C


      

Marco POLARSSL_MEMORY_ALIGN_MULTIPLE

#define POLARSSL_MEMORY_ALIGN_MULTIPLE MBEDTLS_MEMORY_ALIGN_MULTIPLE


      

Marco POLARSSL_MEMORY_BACKTRACE

#define POLARSSL_MEMORY_BACKTRACE MBEDTLS_MEMORY_BACKTRACE


      

Marco POLARSSL_MEMORY_BUFFER_ALLOC_C

#define POLARSSL_MEMORY_BUFFER_ALLOC_C MBEDTLS_MEMORY_BUFFER_ALLOC_C


      

Marco POLARSSL_MEMORY_DEBUG

#define POLARSSL_MEMORY_DEBUG MBEDTLS_MEMORY_DEBUG


      

Marco POLARSSL_MPI_MAX_SIZE

#define POLARSSL_MPI_MAX_SIZE MBEDTLS_MPI_MAX_SIZE


      

Marco POLARSSL_MPI_WINDOW_SIZE

#define POLARSSL_MPI_WINDOW_SIZE MBEDTLS_MPI_WINDOW_SIZE


      

Marco POLARSSL_NET_C

#define POLARSSL_NET_C MBEDTLS_NET_C


      

Marco POLARSSL_NO_DEFAULT_ENTROPY_SOURCES

#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES


      

Marco POLARSSL_NO_PLATFORM_ENTROPY

#define POLARSSL_NO_PLATFORM_ENTROPY MBEDTLS_NO_PLATFORM_ENTROPY


      

Marco POLARSSL_OID_C

#define POLARSSL_OID_C MBEDTLS_OID_C


      

Marco POLARSSL_PADLOCK_C

#define POLARSSL_PADLOCK_C MBEDTLS_PADLOCK_C


      

Marco POLARSSL_PEM_PARSE_C

#define POLARSSL_PEM_PARSE_C MBEDTLS_PEM_PARSE_C


      

Marco POLARSSL_PEM_WRITE_C

#define POLARSSL_PEM_WRITE_C MBEDTLS_PEM_WRITE_C


      

Marco POLARSSL_PKCS11_C

#define POLARSSL_PKCS11_C MBEDTLS_PKCS11_C


      

Marco POLARSSL_PKCS12_C

#define POLARSSL_PKCS12_C MBEDTLS_PKCS12_C


      

Marco POLARSSL_PKCS1_V15

#define POLARSSL_PKCS1_V15 MBEDTLS_PKCS1_V15


      

Marco POLARSSL_PKCS1_V21

#define POLARSSL_PKCS1_V21 MBEDTLS_PKCS1_V21


      

Marco POLARSSL_PKCS5_C

#define POLARSSL_PKCS5_C MBEDTLS_PKCS5_C


      

Marco POLARSSL_PK_C

#define POLARSSL_PK_C MBEDTLS_PK_C


      

Marco POLARSSL_PK_PARSE_C

#define POLARSSL_PK_PARSE_C MBEDTLS_PK_PARSE_C


      

Marco POLARSSL_PK_PARSE_EC_EXTENDED

#define POLARSSL_PK_PARSE_EC_EXTENDED MBEDTLS_PK_PARSE_EC_EXTENDED


      

Marco POLARSSL_PK_RSA_ALT_SUPPORT

#define POLARSSL_PK_RSA_ALT_SUPPORT MBEDTLS_PK_RSA_ALT_SUPPORT


      

Marco POLARSSL_PK_WRITE_C

#define POLARSSL_PK_WRITE_C MBEDTLS_PK_WRITE_C


      

Marco POLARSSL_PLATFORM_C

#define POLARSSL_PLATFORM_C MBEDTLS_PLATFORM_C


      

Marco POLARSSL_PLATFORM_EXIT_ALT

#define POLARSSL_PLATFORM_EXIT_ALT MBEDTLS_PLATFORM_EXIT_ALT


      

Marco POLARSSL_PLATFORM_EXIT_MACRO

#define POLARSSL_PLATFORM_EXIT_MACRO MBEDTLS_PLATFORM_EXIT_MACRO


      

Marco POLARSSL_PLATFORM_FPRINTF_ALT

#define POLARSSL_PLATFORM_FPRINTF_ALT MBEDTLS_PLATFORM_FPRINTF_ALT


      

Marco POLARSSL_PLATFORM_FPRINTF_MACRO

#define POLARSSL_PLATFORM_FPRINTF_MACRO MBEDTLS_PLATFORM_FPRINTF_MACRO


      

Marco POLARSSL_PLATFORM_FREE_MACRO

#define POLARSSL_PLATFORM_FREE_MACRO MBEDTLS_PLATFORM_FREE_MACRO


      

Marco POLARSSL_PLATFORM_MEMORY

#define POLARSSL_PLATFORM_MEMORY MBEDTLS_PLATFORM_MEMORY


      

Marco POLARSSL_PLATFORM_NO_STD_FUNCTIONS

#define POLARSSL_PLATFORM_NO_STD_FUNCTIONS MBEDTLS_PLATFORM_NO_STD_FUNCTIONS


      

Marco POLARSSL_PLATFORM_PRINTF_ALT

#define POLARSSL_PLATFORM_PRINTF_ALT MBEDTLS_PLATFORM_PRINTF_ALT


      

Marco POLARSSL_PLATFORM_PRINTF_MACRO

#define POLARSSL_PLATFORM_PRINTF_MACRO MBEDTLS_PLATFORM_PRINTF_MACRO


      

Marco POLARSSL_PLATFORM_SNPRINTF_ALT

#define POLARSSL_PLATFORM_SNPRINTF_ALT MBEDTLS_PLATFORM_SNPRINTF_ALT


      

Marco POLARSSL_PLATFORM_SNPRINTF_MACRO

#define POLARSSL_PLATFORM_SNPRINTF_MACRO MBEDTLS_PLATFORM_SNPRINTF_MACRO


      

Marco POLARSSL_PLATFORM_STD_EXIT

#define POLARSSL_PLATFORM_STD_EXIT MBEDTLS_PLATFORM_STD_EXIT


      

Marco POLARSSL_PLATFORM_STD_FPRINTF

#define POLARSSL_PLATFORM_STD_FPRINTF MBEDTLS_PLATFORM_STD_FPRINTF


      

Marco POLARSSL_PLATFORM_STD_FREE

#define POLARSSL_PLATFORM_STD_FREE MBEDTLS_PLATFORM_STD_FREE


      

Marco POLARSSL_PLATFORM_STD_MEM_HDR

#define POLARSSL_PLATFORM_STD_MEM_HDR MBEDTLS_PLATFORM_STD_MEM_HDR


      

Marco POLARSSL_PLATFORM_STD_PRINTF

#define POLARSSL_PLATFORM_STD_PRINTF MBEDTLS_PLATFORM_STD_PRINTF


      

Marco POLARSSL_PLATFORM_STD_SNPRINTF

#define POLARSSL_PLATFORM_STD_SNPRINTF MBEDTLS_PLATFORM_STD_SNPRINTF


      

Marco POLARSSL_PSK_MAX_LEN

#define POLARSSL_PSK_MAX_LEN MBEDTLS_PSK_MAX_LEN


      

Marco POLARSSL_REMOVE_ARC4_CIPHERSUITES

#define POLARSSL_REMOVE_ARC4_CIPHERSUITES MBEDTLS_REMOVE_ARC4_CIPHERSUITES


      

Marco POLARSSL_RIPEMD160_ALT

#define POLARSSL_RIPEMD160_ALT MBEDTLS_RIPEMD160_ALT


      

Marco POLARSSL_RIPEMD160_C

#define POLARSSL_RIPEMD160_C MBEDTLS_RIPEMD160_C


      

Marco POLARSSL_RIPEMD160_PROCESS_ALT

#define POLARSSL_RIPEMD160_PROCESS_ALT MBEDTLS_RIPEMD160_PROCESS_ALT


      

Marco POLARSSL_RSA_C

#define POLARSSL_RSA_C MBEDTLS_RSA_C


      

Marco POLARSSL_RSA_NO_CRT

#define POLARSSL_RSA_NO_CRT MBEDTLS_RSA_NO_CRT


      

Marco POLARSSL_SELF_TEST

#define POLARSSL_SELF_TEST MBEDTLS_SELF_TEST


      

Marco POLARSSL_SHA1_ALT

#define POLARSSL_SHA1_ALT MBEDTLS_SHA1_ALT


      

Marco POLARSSL_SHA1_C

#define POLARSSL_SHA1_C MBEDTLS_SHA1_C


      

Marco POLARSSL_SHA1_PROCESS_ALT

#define POLARSSL_SHA1_PROCESS_ALT MBEDTLS_SHA1_PROCESS_ALT


      

Marco POLARSSL_SHA256_ALT

#define POLARSSL_SHA256_ALT MBEDTLS_SHA256_ALT


      

Marco POLARSSL_SHA256_C

#define POLARSSL_SHA256_C MBEDTLS_SHA256_C


      

Marco POLARSSL_SHA256_PROCESS_ALT

#define POLARSSL_SHA256_PROCESS_ALT MBEDTLS_SHA256_PROCESS_ALT


      

Marco POLARSSL_SHA512_ALT

#define POLARSSL_SHA512_ALT MBEDTLS_SHA512_ALT


      

Marco POLARSSL_SHA512_C

#define POLARSSL_SHA512_C MBEDTLS_SHA512_C


      

Marco POLARSSL_SHA512_PROCESS_ALT

#define POLARSSL_SHA512_PROCESS_ALT MBEDTLS_SHA512_PROCESS_ALT


      

Marco POLARSSL_SSL_ALL_ALERT_MESSAGES

#define POLARSSL_SSL_ALL_ALERT_MESSAGES MBEDTLS_SSL_ALL_ALERT_MESSAGES


      

Marco POLARSSL_SSL_ALPN

#define POLARSSL_SSL_ALPN MBEDTLS_SSL_ALPN


      

Marco POLARSSL_SSL_CACHE_C

#define POLARSSL_SSL_CACHE_C MBEDTLS_SSL_CACHE_C


      

Marco POLARSSL_SSL_CBC_RECORD_SPLITTING

#define POLARSSL_SSL_CBC_RECORD_SPLITTING MBEDTLS_SSL_CBC_RECORD_SPLITTING


      

Marco POLARSSL_SSL_CLI_C

#define POLARSSL_SSL_CLI_C MBEDTLS_SSL_CLI_C


      
      
#define POLARSSL_SSL_COOKIE_C MBEDTLS_SSL_COOKIE_C


      
      
#define POLARSSL_SSL_COOKIE_TIMEOUT MBEDTLS_SSL_COOKIE_TIMEOUT


      

Marco POLARSSL_SSL_DEBUG_ALL

#define POLARSSL_SSL_DEBUG_ALL MBEDTLS_SSL_DEBUG_ALL


      

Marco POLARSSL_SSL_DTLS_ANTI_REPLAY

#define POLARSSL_SSL_DTLS_ANTI_REPLAY MBEDTLS_SSL_DTLS_ANTI_REPLAY


      

Marco POLARSSL_SSL_DTLS_BADMAC_LIMIT

#define POLARSSL_SSL_DTLS_BADMAC_LIMIT MBEDTLS_SSL_DTLS_BADMAC_LIMIT


      

Marco POLARSSL_SSL_DTLS_HELLO_VERIFY

#define POLARSSL_SSL_DTLS_HELLO_VERIFY MBEDTLS_SSL_DTLS_HELLO_VERIFY


      

Marco POLARSSL_SSL_ENCRYPT_THEN_MAC

#define POLARSSL_SSL_ENCRYPT_THEN_MAC MBEDTLS_SSL_ENCRYPT_THEN_MAC


      

Marco POLARSSL_SSL_EXTENDED_MASTER_SECRET

#define POLARSSL_SSL_EXTENDED_MASTER_SECRET MBEDTLS_SSL_EXTENDED_MASTER_SECRET


      

Marco POLARSSL_SSL_FALLBACK_SCSV

#define POLARSSL_SSL_FALLBACK_SCSV MBEDTLS_SSL_FALLBACK_SCSV


      

Marco POLARSSL_SSL_HW_RECORD_ACCEL

#define POLARSSL_SSL_HW_RECORD_ACCEL MBEDTLS_SSL_HW_RECORD_ACCEL


      

Marco POLARSSL_SSL_MAX_FRAGMENT_LENGTH

#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH MBEDTLS_SSL_MAX_FRAGMENT_LENGTH


      

Marco POLARSSL_SSL_PROTO_DTLS

#define POLARSSL_SSL_PROTO_DTLS MBEDTLS_SSL_PROTO_DTLS


      

Marco POLARSSL_SSL_PROTO_SSL3

#define POLARSSL_SSL_PROTO_SSL3 MBEDTLS_SSL_PROTO_SSL3


      

Marco POLARSSL_SSL_PROTO_TLS1

#define POLARSSL_SSL_PROTO_TLS1 MBEDTLS_SSL_PROTO_TLS1


      

Marco POLARSSL_SSL_PROTO_TLS1_1

#define POLARSSL_SSL_PROTO_TLS1_1 MBEDTLS_SSL_PROTO_TLS1_1


      

Marco POLARSSL_SSL_PROTO_TLS1_2

#define POLARSSL_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_2


      

Marco POLARSSL_SSL_RENEGOTIATION

#define POLARSSL_SSL_RENEGOTIATION MBEDTLS_SSL_RENEGOTIATION


      

Marco POLARSSL_SSL_SERVER_NAME_INDICATION

#define POLARSSL_SSL_SERVER_NAME_INDICATION MBEDTLS_SSL_SERVER_NAME_INDICATION


      

Marco POLARSSL_SSL_SESSION_TICKETS

#define POLARSSL_SSL_SESSION_TICKETS MBEDTLS_SSL_SESSION_TICKETS


      

Marco POLARSSL_SSL_SRV_C

#define POLARSSL_SSL_SRV_C MBEDTLS_SSL_SRV_C


      

Marco POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE

#define POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE


      

Marco POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO

#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO


      

Marco POLARSSL_SSL_TLS_C

#define POLARSSL_SSL_TLS_C MBEDTLS_SSL_TLS_C


      

Marco POLARSSL_SSL_TRUNCATED_HMAC

#define POLARSSL_SSL_TRUNCATED_HMAC MBEDTLS_SSL_TRUNCATED_HMAC


      

Marco POLARSSL_THREADING_ALT

#define POLARSSL_THREADING_ALT MBEDTLS_THREADING_ALT


      

Marco POLARSSL_THREADING_C

#define POLARSSL_THREADING_C MBEDTLS_THREADING_C


      

Marco POLARSSL_THREADING_PTHREAD

#define POLARSSL_THREADING_PTHREAD MBEDTLS_THREADING_PTHREAD


      

Marco POLARSSL_TIMING_ALT

#define POLARSSL_TIMING_ALT MBEDTLS_TIMING_ALT


      

Marco POLARSSL_TIMING_C

#define POLARSSL_TIMING_C MBEDTLS_TIMING_C


      

Marco POLARSSL_VERSION_C

#define POLARSSL_VERSION_C MBEDTLS_VERSION_C


      

Marco POLARSSL_VERSION_FEATURES

#define POLARSSL_VERSION_FEATURES MBEDTLS_VERSION_FEATURES


      

Marco POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3

#define POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3 MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3


      

Marco POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION

#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION


      

Marco POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE

#define POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE


      

Marco POLARSSL_X509_CHECK_KEY_USAGE

#define POLARSSL_X509_CHECK_KEY_USAGE MBEDTLS_X509_CHECK_KEY_USAGE


      

Marco POLARSSL_X509_CREATE_C

#define POLARSSL_X509_CREATE_C MBEDTLS_X509_CREATE_C


      

Marco POLARSSL_X509_CRL_PARSE_C

#define POLARSSL_X509_CRL_PARSE_C MBEDTLS_X509_CRL_PARSE_C


      

Marco POLARSSL_X509_CRT_PARSE_C

#define POLARSSL_X509_CRT_PARSE_C MBEDTLS_X509_CRT_PARSE_C


      

Marco POLARSSL_X509_CRT_WRITE_C

#define POLARSSL_X509_CRT_WRITE_C MBEDTLS_X509_CRT_WRITE_C


      

Marco POLARSSL_X509_CSR_PARSE_C

#define POLARSSL_X509_CSR_PARSE_C MBEDTLS_X509_CSR_PARSE_C


      

Marco POLARSSL_X509_CSR_WRITE_C

#define POLARSSL_X509_CSR_WRITE_C MBEDTLS_X509_CSR_WRITE_C


      

Marco POLARSSL_X509_MAX_INTERMEDIATE_CA

#define POLARSSL_X509_MAX_INTERMEDIATE_CA MBEDTLS_X509_MAX_INTERMEDIATE_CA


      

Marco POLARSSL_X509_RSASSA_PSS_SUPPORT

#define POLARSSL_X509_RSASSA_PSS_SUPPORT MBEDTLS_X509_RSASSA_PSS_SUPPORT


      

Marco POLARSSL_X509_USE_C

#define POLARSSL_X509_USE_C MBEDTLS_X509_USE_C


      

Marco POLARSSL_XTEA_ALT

#define POLARSSL_XTEA_ALT MBEDTLS_XTEA_ALT


      

Marco POLARSSL_XTEA_C

#define POLARSSL_XTEA_C MBEDTLS_XTEA_C


      

Marco POLARSSL_ZLIB_SUPPORT

#define POLARSSL_ZLIB_SUPPORT MBEDTLS_ZLIB_SUPPORT


      

Marco AES_DECRYPT

#define AES_DECRYPT MBEDTLS_AES_DECRYPT
/*
 * Misc names (macros, types, functions, enum constants...)
 */

Marco AES_ENCRYPT

#define AES_ENCRYPT MBEDTLS_AES_ENCRYPT


      

Marco ASN1_BIT_STRING

#define ASN1_BIT_STRING MBEDTLS_ASN1_BIT_STRING


      

Marco ASN1_BMP_STRING

#define ASN1_BMP_STRING MBEDTLS_ASN1_BMP_STRING


      

Marco ASN1_BOOLEAN

#define ASN1_BOOLEAN MBEDTLS_ASN1_BOOLEAN


      

Marco ASN1_CHK_ADD

#define ASN1_CHK_ADD MBEDTLS_ASN1_CHK_ADD


      

Marco ASN1_CONSTRUCTED

#define ASN1_CONSTRUCTED MBEDTLS_ASN1_CONSTRUCTED


      

Marco ASN1_CONTEXT_SPECIFIC

#define ASN1_CONTEXT_SPECIFIC MBEDTLS_ASN1_CONTEXT_SPECIFIC


      

Marco ASN1_GENERALIZED_TIME

#define ASN1_GENERALIZED_TIME MBEDTLS_ASN1_GENERALIZED_TIME


      

Marco ASN1_IA5_STRING

#define ASN1_IA5_STRING MBEDTLS_ASN1_IA5_STRING


      

Marco ASN1_INTEGER

#define ASN1_INTEGER MBEDTLS_ASN1_INTEGER


      

Marco ASN1_NULL

#define ASN1_NULL MBEDTLS_ASN1_NULL


      

Marco ASN1_OCTET_STRING

#define ASN1_OCTET_STRING MBEDTLS_ASN1_OCTET_STRING


      

Marco ASN1_OID

#define ASN1_OID MBEDTLS_ASN1_OID


      

Marco ASN1_PRIMITIVE

#define ASN1_PRIMITIVE MBEDTLS_ASN1_PRIMITIVE


      

Marco ASN1_PRINTABLE_STRING

#define ASN1_PRINTABLE_STRING MBEDTLS_ASN1_PRINTABLE_STRING


      

Marco ASN1_SEQUENCE

#define ASN1_SEQUENCE MBEDTLS_ASN1_SEQUENCE


      

Marco ASN1_SET

#define ASN1_SET MBEDTLS_ASN1_SET


      

Marco ASN1_T61_STRING

#define ASN1_T61_STRING MBEDTLS_ASN1_T61_STRING


      

Marco ASN1_UNIVERSAL_STRING

#define ASN1_UNIVERSAL_STRING MBEDTLS_ASN1_UNIVERSAL_STRING


      

Marco ASN1_UTC_TIME

#define ASN1_UTC_TIME MBEDTLS_ASN1_UTC_TIME


      

Marco ASN1_UTF8_STRING

#define ASN1_UTF8_STRING MBEDTLS_ASN1_UTF8_STRING


      

Marco BADCERT_CN_MISMATCH

#define BADCERT_CN_MISMATCH MBEDTLS_X509_BADCERT_CN_MISMATCH


      

Marco BADCERT_EXPIRED

#define BADCERT_EXPIRED MBEDTLS_X509_BADCERT_EXPIRED


      

Marco BADCERT_FUTURE

#define BADCERT_FUTURE MBEDTLS_X509_BADCERT_FUTURE


      

Marco BADCERT_MISSING

#define BADCERT_MISSING MBEDTLS_X509_BADCERT_MISSING


      

Marco BADCERT_NOT_TRUSTED

#define BADCERT_NOT_TRUSTED MBEDTLS_X509_BADCERT_NOT_TRUSTED


      

Marco BADCERT_OTHER

#define BADCERT_OTHER MBEDTLS_X509_BADCERT_OTHER


      

Marco BADCERT_REVOKED

#define BADCERT_REVOKED MBEDTLS_X509_BADCERT_REVOKED


      

Marco BADCERT_SKIP_VERIFY

#define BADCERT_SKIP_VERIFY MBEDTLS_X509_BADCERT_SKIP_VERIFY


      

Marco BADCRL_EXPIRED

#define BADCRL_EXPIRED MBEDTLS_X509_BADCRL_EXPIRED


      

Marco BADCRL_FUTURE

#define BADCRL_FUTURE MBEDTLS_X509_BADCRL_FUTURE


      

Marco BADCRL_NOT_TRUSTED

#define BADCRL_NOT_TRUSTED MBEDTLS_X509_BADCRL_NOT_TRUSTED


      

Marco BLOWFISH_BLOCKSIZE

#define BLOWFISH_BLOCKSIZE MBEDTLS_BLOWFISH_BLOCKSIZE


      

Marco BLOWFISH_DECRYPT

#define BLOWFISH_DECRYPT MBEDTLS_BLOWFISH_DECRYPT


      

Marco BLOWFISH_ENCRYPT

#define BLOWFISH_ENCRYPT MBEDTLS_BLOWFISH_ENCRYPT


      

Marco BLOWFISH_MAX_KEY

#define BLOWFISH_MAX_KEY MBEDTLS_BLOWFISH_MAX_KEY_BITS


      

Marco BLOWFISH_MIN_KEY

#define BLOWFISH_MIN_KEY MBEDTLS_BLOWFISH_MIN_KEY_BITS


      

Marco BLOWFISH_ROUNDS

#define BLOWFISH_ROUNDS MBEDTLS_BLOWFISH_ROUNDS


      

Marco CAMELLIA_DECRYPT

#define CAMELLIA_DECRYPT MBEDTLS_CAMELLIA_DECRYPT


      

Marco CAMELLIA_ENCRYPT

#define CAMELLIA_ENCRYPT MBEDTLS_CAMELLIA_ENCRYPT


      

Marco COLLECT_SIZE

#define COLLECT_SIZE MBEDTLS_HAVEGE_COLLECT_SIZE


      

Marco CTR_DRBG_BLOCKSIZE

#define CTR_DRBG_BLOCKSIZE MBEDTLS_CTR_DRBG_BLOCKSIZE


      

Marco CTR_DRBG_ENTROPY_LEN

#define CTR_DRBG_ENTROPY_LEN MBEDTLS_CTR_DRBG_ENTROPY_LEN


      

Marco CTR_DRBG_KEYBITS

#define CTR_DRBG_KEYBITS MBEDTLS_CTR_DRBG_KEYBITS


      

Marco CTR_DRBG_KEYSIZE

#define CTR_DRBG_KEYSIZE MBEDTLS_CTR_DRBG_KEYSIZE


      

Marco CTR_DRBG_MAX_INPUT

#define CTR_DRBG_MAX_INPUT MBEDTLS_CTR_DRBG_MAX_INPUT


      

Marco CTR_DRBG_MAX_REQUEST

#define CTR_DRBG_MAX_REQUEST MBEDTLS_CTR_DRBG_MAX_REQUEST


      

Marco CTR_DRBG_MAX_SEED_INPUT

#define CTR_DRBG_MAX_SEED_INPUT MBEDTLS_CTR_DRBG_MAX_SEED_INPUT


      

Marco CTR_DRBG_PR_OFF

#define CTR_DRBG_PR_OFF MBEDTLS_CTR_DRBG_PR_OFF


      

Marco CTR_DRBG_PR_ON

#define CTR_DRBG_PR_ON MBEDTLS_CTR_DRBG_PR_ON


      

Marco CTR_DRBG_RESEED_INTERVAL

#define CTR_DRBG_RESEED_INTERVAL MBEDTLS_CTR_DRBG_RESEED_INTERVAL


      

Marco CTR_DRBG_SEEDLEN

#define CTR_DRBG_SEEDLEN MBEDTLS_CTR_DRBG_SEEDLEN


      

Marco DEPRECATED

#define DEPRECATED MBEDTLS_DEPRECATED


      

Marco DES_DECRYPT

#define DES_DECRYPT MBEDTLS_DES_DECRYPT


      

Marco DES_ENCRYPT

#define DES_ENCRYPT MBEDTLS_DES_ENCRYPT


      

Marco DES_KEY_SIZE

#define DES_KEY_SIZE MBEDTLS_DES_KEY_SIZE


      

Marco ENTROPY_BLOCK_SIZE

#define ENTROPY_BLOCK_SIZE MBEDTLS_ENTROPY_BLOCK_SIZE


      

Marco ENTROPY_MAX_GATHER

#define ENTROPY_MAX_GATHER MBEDTLS_ENTROPY_MAX_GATHER


      

Marco ENTROPY_MAX_SEED_SIZE

#define ENTROPY_MAX_SEED_SIZE MBEDTLS_ENTROPY_MAX_SEED_SIZE


      

Marco ENTROPY_MAX_SOURCES

#define ENTROPY_MAX_SOURCES MBEDTLS_ENTROPY_MAX_SOURCES


      

Marco ENTROPY_MIN_HARDCLOCK

#define ENTROPY_MIN_HARDCLOCK MBEDTLS_ENTROPY_MIN_HARDCLOCK


      

Marco ENTROPY_MIN_HAVEGE

#define ENTROPY_MIN_HAVEGE MBEDTLS_ENTROPY_MIN_HAVEGE


      

Marco ENTROPY_MIN_PLATFORM

#define ENTROPY_MIN_PLATFORM MBEDTLS_ENTROPY_MIN_PLATFORM


      

Marco ENTROPY_SOURCE_MANUAL

#define ENTROPY_SOURCE_MANUAL MBEDTLS_ENTROPY_SOURCE_MANUAL


      

Marco EXT_AUTHORITY_KEY_IDENTIFIER

#define EXT_AUTHORITY_KEY_IDENTIFIER MBEDTLS_X509_EXT_AUTHORITY_KEY_IDENTIFIER


      

Marco EXT_BASIC_CONSTRAINTS

#define EXT_BASIC_CONSTRAINTS MBEDTLS_X509_EXT_BASIC_CONSTRAINTS


      

Marco EXT_CERTIFICATE_POLICIES

#define EXT_CERTIFICATE_POLICIES MBEDTLS_X509_EXT_CERTIFICATE_POLICIES


      

Marco EXT_CRL_DISTRIBUTION_POINTS

#define EXT_CRL_DISTRIBUTION_POINTS MBEDTLS_X509_EXT_CRL_DISTRIBUTION_POINTS


      

Marco EXT_EXTENDED_KEY_USAGE

#define EXT_EXTENDED_KEY_USAGE MBEDTLS_X509_EXT_EXTENDED_KEY_USAGE


      

Marco EXT_FRESHEST_CRL

#define EXT_FRESHEST_CRL MBEDTLS_X509_EXT_FRESHEST_CRL


      

Marco EXT_INIHIBIT_ANYPOLICY

#define EXT_INIHIBIT_ANYPOLICY MBEDTLS_X509_EXT_INIHIBIT_ANYPOLICY


      

Marco EXT_ISSUER_ALT_NAME

#define EXT_ISSUER_ALT_NAME MBEDTLS_X509_EXT_ISSUER_ALT_NAME


      

Marco EXT_KEY_USAGE

#define EXT_KEY_USAGE MBEDTLS_X509_EXT_KEY_USAGE


      

Marco EXT_NAME_CONSTRAINTS

#define EXT_NAME_CONSTRAINTS MBEDTLS_X509_EXT_NAME_CONSTRAINTS


      

Marco EXT_NS_CERT_TYPE

#define EXT_NS_CERT_TYPE MBEDTLS_X509_EXT_NS_CERT_TYPE


      

Marco EXT_POLICY_CONSTRAINTS

#define EXT_POLICY_CONSTRAINTS MBEDTLS_X509_EXT_POLICY_CONSTRAINTS


      

Marco EXT_POLICY_MAPPINGS

#define EXT_POLICY_MAPPINGS MBEDTLS_X509_EXT_POLICY_MAPPINGS


      

Marco EXT_SUBJECT_ALT_NAME

#define EXT_SUBJECT_ALT_NAME MBEDTLS_X509_EXT_SUBJECT_ALT_NAME


      

Marco EXT_SUBJECT_DIRECTORY_ATTRS

#define EXT_SUBJECT_DIRECTORY_ATTRS MBEDTLS_X509_EXT_SUBJECT_DIRECTORY_ATTRS


      

Marco EXT_SUBJECT_KEY_IDENTIFIER

#define EXT_SUBJECT_KEY_IDENTIFIER MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER


      

Marco GCM_DECRYPT

#define GCM_DECRYPT MBEDTLS_GCM_DECRYPT


      

Marco GCM_ENCRYPT

#define GCM_ENCRYPT MBEDTLS_GCM_ENCRYPT


      

Marco KU_CRL_SIGN

#define KU_CRL_SIGN MBEDTLS_X509_KU_CRL_SIGN


      

Marco KU_DATA_ENCIPHERMENT

#define KU_DATA_ENCIPHERMENT MBEDTLS_X509_KU_DATA_ENCIPHERMENT


      

Marco KU_DIGITAL_SIGNATURE

#define KU_DIGITAL_SIGNATURE MBEDTLS_X509_KU_DIGITAL_SIGNATURE


      

Marco KU_KEY_AGREEMENT

#define KU_KEY_AGREEMENT MBEDTLS_X509_KU_KEY_AGREEMENT


      

Marco KU_KEY_CERT_SIGN

#define KU_KEY_CERT_SIGN MBEDTLS_X509_KU_KEY_CERT_SIGN


      

Marco KU_KEY_ENCIPHERMENT

#define KU_KEY_ENCIPHERMENT MBEDTLS_X509_KU_KEY_ENCIPHERMENT


      

Marco KU_NON_REPUDIATION

#define KU_NON_REPUDIATION MBEDTLS_X509_KU_NON_REPUDIATION


      

Marco LN_2_DIV_LN_10_SCALE100

#define LN_2_DIV_LN_10_SCALE100 MBEDTLS_LN_2_DIV_LN_10_SCALE100


      

Marco MEMORY_VERIFY_ALLOC

#define MEMORY_VERIFY_ALLOC MBEDTLS_MEMORY_VERIFY_ALLOC


      

Marco MEMORY_VERIFY_ALWAYS

#define MEMORY_VERIFY_ALWAYS MBEDTLS_MEMORY_VERIFY_ALWAYS


      

Marco MEMORY_VERIFY_FREE

#define MEMORY_VERIFY_FREE MBEDTLS_MEMORY_VERIFY_FREE


      

Marco MEMORY_VERIFY_NONE

#define MEMORY_VERIFY_NONE MBEDTLS_MEMORY_VERIFY_NONE


      

Marco MPI_CHK

#define MPI_CHK MBEDTLS_MPI_CHK


      

Marco NET_PROTO_TCP

#define NET_PROTO_TCP MBEDTLS_NET_PROTO_TCP


      

Marco NET_PROTO_UDP

#define NET_PROTO_UDP MBEDTLS_NET_PROTO_UDP


      

Marco NS_CERT_TYPE_EMAIL

#define NS_CERT_TYPE_EMAIL MBEDTLS_X509_NS_CERT_TYPE_EMAIL


      

Marco NS_CERT_TYPE_EMAIL_CA

#define NS_CERT_TYPE_EMAIL_CA MBEDTLS_X509_NS_CERT_TYPE_EMAIL_CA


      

Marco NS_CERT_TYPE_OBJECT_SIGNING

#define NS_CERT_TYPE_OBJECT_SIGNING MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING


      

Marco NS_CERT_TYPE_OBJECT_SIGNING_CA

#define NS_CERT_TYPE_OBJECT_SIGNING_CA MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING_CA


      

Marco NS_CERT_TYPE_RESERVED

#define NS_CERT_TYPE_RESERVED MBEDTLS_X509_NS_CERT_TYPE_RESERVED


      

Marco NS_CERT_TYPE_SSL_CA

#define NS_CERT_TYPE_SSL_CA MBEDTLS_X509_NS_CERT_TYPE_SSL_CA


      

Marco NS_CERT_TYPE_SSL_CLIENT

#define NS_CERT_TYPE_SSL_CLIENT MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT


      

Marco NS_CERT_TYPE_SSL_SERVER

#define NS_CERT_TYPE_SSL_SERVER MBEDTLS_X509_NS_CERT_TYPE_SSL_SERVER


      

Marco OID_ANSI_X9_62

#define OID_ANSI_X9_62 MBEDTLS_OID_ANSI_X9_62


      

Marco OID_ANSI_X9_62_FIELD_TYPE

#define OID_ANSI_X9_62_FIELD_TYPE MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE


      

Marco OID_ANSI_X9_62_PRIME_FIELD

#define OID_ANSI_X9_62_PRIME_FIELD MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD


      

Marco OID_ANSI_X9_62_SIG

#define OID_ANSI_X9_62_SIG MBEDTLS_OID_ANSI_X9_62_SIG


      

Marco OID_ANSI_X9_62_SIG_SHA2

#define OID_ANSI_X9_62_SIG_SHA2 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2


      

Marco OID_ANY_EXTENDED_KEY_USAGE

#define OID_ANY_EXTENDED_KEY_USAGE MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE


      

Marco OID_AT

#define OID_AT MBEDTLS_OID_AT


      

Marco OID_AT_CN

#define OID_AT_CN MBEDTLS_OID_AT_CN


      

Marco OID_AT_COUNTRY

#define OID_AT_COUNTRY MBEDTLS_OID_AT_COUNTRY


      

Marco OID_AT_DN_QUALIFIER

#define OID_AT_DN_QUALIFIER MBEDTLS_OID_AT_DN_QUALIFIER


      

Marco OID_AT_GENERATION_QUALIFIER

#define OID_AT_GENERATION_QUALIFIER MBEDTLS_OID_AT_GENERATION_QUALIFIER


      

Marco OID_AT_GIVEN_NAME

#define OID_AT_GIVEN_NAME MBEDTLS_OID_AT_GIVEN_NAME


      

Marco OID_AT_INITIALS

#define OID_AT_INITIALS MBEDTLS_OID_AT_INITIALS


      

Marco OID_AT_LOCALITY

#define OID_AT_LOCALITY MBEDTLS_OID_AT_LOCALITY


      

Marco OID_AT_ORGANIZATION

#define OID_AT_ORGANIZATION MBEDTLS_OID_AT_ORGANIZATION


      

Marco OID_AT_ORG_UNIT

#define OID_AT_ORG_UNIT MBEDTLS_OID_AT_ORG_UNIT


      

Marco OID_AT_POSTAL_ADDRESS

#define OID_AT_POSTAL_ADDRESS MBEDTLS_OID_AT_POSTAL_ADDRESS


      

Marco OID_AT_POSTAL_CODE

#define OID_AT_POSTAL_CODE MBEDTLS_OID_AT_POSTAL_CODE


      

Marco OID_AT_PSEUDONYM

#define OID_AT_PSEUDONYM MBEDTLS_OID_AT_PSEUDONYM


      

Marco OID_AT_SERIAL_NUMBER

#define OID_AT_SERIAL_NUMBER MBEDTLS_OID_AT_SERIAL_NUMBER


      

Marco OID_AT_STATE

#define OID_AT_STATE MBEDTLS_OID_AT_STATE


      

Marco OID_AT_SUR_NAME

#define OID_AT_SUR_NAME MBEDTLS_OID_AT_SUR_NAME


      

Marco OID_AT_TITLE

#define OID_AT_TITLE MBEDTLS_OID_AT_TITLE


      

Marco OID_AT_UNIQUE_IDENTIFIER

#define OID_AT_UNIQUE_IDENTIFIER MBEDTLS_OID_AT_UNIQUE_IDENTIFIER


      

Marco OID_AUTHORITY_KEY_IDENTIFIER

#define OID_AUTHORITY_KEY_IDENTIFIER MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER


      

Marco OID_BASIC_CONSTRAINTS

#define OID_BASIC_CONSTRAINTS MBEDTLS_OID_BASIC_CONSTRAINTS


      

Marco OID_CERTICOM

#define OID_CERTICOM MBEDTLS_OID_CERTICOM


      

Marco OID_CERTIFICATE_POLICIES

#define OID_CERTIFICATE_POLICIES MBEDTLS_OID_CERTIFICATE_POLICIES


      

Marco OID_CLIENT_AUTH

#define OID_CLIENT_AUTH MBEDTLS_OID_CLIENT_AUTH


      

Marco OID_CMP

#define OID_CMP MBEDTLS_OID_CMP


      

Marco OID_CODE_SIGNING

#define OID_CODE_SIGNING MBEDTLS_OID_CODE_SIGNING


      

Marco OID_COUNTRY_US

#define OID_COUNTRY_US MBEDTLS_OID_COUNTRY_US


      

Marco OID_CRL_DISTRIBUTION_POINTS

#define OID_CRL_DISTRIBUTION_POINTS MBEDTLS_OID_CRL_DISTRIBUTION_POINTS


      

Marco OID_CRL_NUMBER

#define OID_CRL_NUMBER MBEDTLS_OID_CRL_NUMBER


      

Marco OID_DES_CBC

#define OID_DES_CBC MBEDTLS_OID_DES_CBC


      

Marco OID_DES_EDE3_CBC

#define OID_DES_EDE3_CBC MBEDTLS_OID_DES_EDE3_CBC


      

Marco OID_DIGEST_ALG_MD2

#define OID_DIGEST_ALG_MD2 MBEDTLS_OID_DIGEST_ALG_MD2


      

Marco OID_DIGEST_ALG_MD4

#define OID_DIGEST_ALG_MD4 MBEDTLS_OID_DIGEST_ALG_MD4


      

Marco OID_DIGEST_ALG_MD5

#define OID_DIGEST_ALG_MD5 MBEDTLS_OID_DIGEST_ALG_MD5


      

Marco OID_DIGEST_ALG_SHA1

#define OID_DIGEST_ALG_SHA1 MBEDTLS_OID_DIGEST_ALG_SHA1


      

Marco OID_DIGEST_ALG_SHA224

#define OID_DIGEST_ALG_SHA224 MBEDTLS_OID_DIGEST_ALG_SHA224


      

Marco OID_DIGEST_ALG_SHA256

#define OID_DIGEST_ALG_SHA256 MBEDTLS_OID_DIGEST_ALG_SHA256


      

Marco OID_DIGEST_ALG_SHA384

#define OID_DIGEST_ALG_SHA384 MBEDTLS_OID_DIGEST_ALG_SHA384


      

Marco OID_DIGEST_ALG_SHA512

#define OID_DIGEST_ALG_SHA512 MBEDTLS_OID_DIGEST_ALG_SHA512


      

Marco OID_DOMAIN_COMPONENT

#define OID_DOMAIN_COMPONENT MBEDTLS_OID_DOMAIN_COMPONENT


      

Marco OID_ECDSA_SHA1

#define OID_ECDSA_SHA1 MBEDTLS_OID_ECDSA_SHA1


      

Marco OID_ECDSA_SHA224

#define OID_ECDSA_SHA224 MBEDTLS_OID_ECDSA_SHA224


      

Marco OID_ECDSA_SHA256

#define OID_ECDSA_SHA256 MBEDTLS_OID_ECDSA_SHA256


      

Marco OID_ECDSA_SHA384

#define OID_ECDSA_SHA384 MBEDTLS_OID_ECDSA_SHA384


      

Marco OID_ECDSA_SHA512

#define OID_ECDSA_SHA512 MBEDTLS_OID_ECDSA_SHA512


      

Marco OID_EC_ALG_ECDH

#define OID_EC_ALG_ECDH MBEDTLS_OID_EC_ALG_ECDH


      

Marco OID_EC_ALG_UNRESTRICTED

#define OID_EC_ALG_UNRESTRICTED MBEDTLS_OID_EC_ALG_UNRESTRICTED


      

Marco OID_EC_BRAINPOOL_V1

#define OID_EC_BRAINPOOL_V1 MBEDTLS_OID_EC_BRAINPOOL_V1


      

Marco OID_EC_GRP_BP256R1

#define OID_EC_GRP_BP256R1 MBEDTLS_OID_EC_GRP_BP256R1


      

Marco OID_EC_GRP_BP384R1

#define OID_EC_GRP_BP384R1 MBEDTLS_OID_EC_GRP_BP384R1


      

Marco OID_EC_GRP_BP512R1

#define OID_EC_GRP_BP512R1 MBEDTLS_OID_EC_GRP_BP512R1


      

Marco OID_EC_GRP_SECP192K1

#define OID_EC_GRP_SECP192K1 MBEDTLS_OID_EC_GRP_SECP192K1


      

Marco OID_EC_GRP_SECP192R1

#define OID_EC_GRP_SECP192R1 MBEDTLS_OID_EC_GRP_SECP192R1


      

Marco OID_EC_GRP_SECP224K1

#define OID_EC_GRP_SECP224K1 MBEDTLS_OID_EC_GRP_SECP224K1


      

Marco OID_EC_GRP_SECP224R1

#define OID_EC_GRP_SECP224R1 MBEDTLS_OID_EC_GRP_SECP224R1


      

Marco OID_EC_GRP_SECP256K1

#define OID_EC_GRP_SECP256K1 MBEDTLS_OID_EC_GRP_SECP256K1


      

Marco OID_EC_GRP_SECP256R1

#define OID_EC_GRP_SECP256R1 MBEDTLS_OID_EC_GRP_SECP256R1


      

Marco OID_EC_GRP_SECP384R1

#define OID_EC_GRP_SECP384R1 MBEDTLS_OID_EC_GRP_SECP384R1


      

Marco OID_EC_GRP_SECP521R1

#define OID_EC_GRP_SECP521R1 MBEDTLS_OID_EC_GRP_SECP521R1


      

Marco OID_EMAIL_PROTECTION

#define OID_EMAIL_PROTECTION MBEDTLS_OID_EMAIL_PROTECTION


      

Marco OID_EXTENDED_KEY_USAGE

#define OID_EXTENDED_KEY_USAGE MBEDTLS_OID_EXTENDED_KEY_USAGE


      

Marco OID_FRESHEST_CRL

#define OID_FRESHEST_CRL MBEDTLS_OID_FRESHEST_CRL


      

Marco OID_GOV

#define OID_GOV MBEDTLS_OID_GOV


      

Marco OID_HMAC_SHA1

#define OID_HMAC_SHA1 MBEDTLS_OID_HMAC_SHA1


      

Marco OID_ID_CE

#define OID_ID_CE MBEDTLS_OID_ID_CE


      

Marco OID_INIHIBIT_ANYPOLICY

#define OID_INIHIBIT_ANYPOLICY MBEDTLS_OID_INIHIBIT_ANYPOLICY


      

Marco OID_ISO_CCITT_DS

#define OID_ISO_CCITT_DS MBEDTLS_OID_ISO_CCITT_DS


      

Marco OID_ISO_IDENTIFIED_ORG

#define OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ISO_IDENTIFIED_ORG


      

Marco OID_ISO_ITU_COUNTRY

#define OID_ISO_ITU_COUNTRY MBEDTLS_OID_ISO_ITU_COUNTRY


      

Marco OID_ISO_ITU_US_ORG

#define OID_ISO_ITU_US_ORG MBEDTLS_OID_ISO_ITU_US_ORG


      

Marco OID_ISO_MEMBER_BODIES

#define OID_ISO_MEMBER_BODIES MBEDTLS_OID_ISO_MEMBER_BODIES


      

Marco OID_ISSUER_ALT_NAME

#define OID_ISSUER_ALT_NAME MBEDTLS_OID_ISSUER_ALT_NAME


      

Marco OID_KEY_USAGE

#define OID_KEY_USAGE MBEDTLS_OID_KEY_USAGE


      

Marco OID_KP

#define OID_KP MBEDTLS_OID_KP


      

Marco OID_MGF1

#define OID_MGF1 MBEDTLS_OID_MGF1


      

Marco OID_NAME_CONSTRAINTS

#define OID_NAME_CONSTRAINTS MBEDTLS_OID_NAME_CONSTRAINTS


      

Marco OID_NETSCAPE

#define OID_NETSCAPE MBEDTLS_OID_NETSCAPE


      

Marco OID_NS_BASE_URL

#define OID_NS_BASE_URL MBEDTLS_OID_NS_BASE_URL


      

Marco OID_NS_CA_POLICY_URL

#define OID_NS_CA_POLICY_URL MBEDTLS_OID_NS_CA_POLICY_URL


      

Marco OID_NS_CA_REVOCATION_URL

#define OID_NS_CA_REVOCATION_URL MBEDTLS_OID_NS_CA_REVOCATION_URL


      

Marco OID_NS_CERT

#define OID_NS_CERT MBEDTLS_OID_NS_CERT


      

Marco OID_NS_CERT_SEQUENCE

#define OID_NS_CERT_SEQUENCE MBEDTLS_OID_NS_CERT_SEQUENCE


      

Marco OID_NS_CERT_TYPE

#define OID_NS_CERT_TYPE MBEDTLS_OID_NS_CERT_TYPE


      

Marco OID_NS_COMMENT

#define OID_NS_COMMENT MBEDTLS_OID_NS_COMMENT


      

Marco OID_NS_DATA_TYPE

#define OID_NS_DATA_TYPE MBEDTLS_OID_NS_DATA_TYPE


      

Marco OID_NS_RENEWAL_URL

#define OID_NS_RENEWAL_URL MBEDTLS_OID_NS_RENEWAL_URL


      

Marco OID_NS_REVOCATION_URL

#define OID_NS_REVOCATION_URL MBEDTLS_OID_NS_REVOCATION_URL


      

Marco OID_NS_SSL_SERVER_NAME

#define OID_NS_SSL_SERVER_NAME MBEDTLS_OID_NS_SSL_SERVER_NAME


      

Marco OID_OCSP_SIGNING

#define OID_OCSP_SIGNING MBEDTLS_OID_OCSP_SIGNING


      

Marco OID_OIW_SECSIG

#define OID_OIW_SECSIG MBEDTLS_OID_OIW_SECSIG


      

Marco OID_OIW_SECSIG_ALG

#define OID_OIW_SECSIG_ALG MBEDTLS_OID_OIW_SECSIG_ALG


      

Marco OID_OIW_SECSIG_SHA1

#define OID_OIW_SECSIG_SHA1 MBEDTLS_OID_OIW_SECSIG_SHA1


      

Marco OID_ORGANIZATION

#define OID_ORGANIZATION MBEDTLS_OID_ORGANIZATION


      

Marco OID_ORG_ANSI_X9_62

#define OID_ORG_ANSI_X9_62 MBEDTLS_OID_ORG_ANSI_X9_62


      

Marco OID_ORG_CERTICOM

#define OID_ORG_CERTICOM MBEDTLS_OID_ORG_CERTICOM


      

Marco OID_ORG_DOD

#define OID_ORG_DOD MBEDTLS_OID_ORG_DOD


      

Marco OID_ORG_GOV

#define OID_ORG_GOV MBEDTLS_OID_ORG_GOV


      

Marco OID_ORG_NETSCAPE

#define OID_ORG_NETSCAPE MBEDTLS_OID_ORG_NETSCAPE


      

Marco OID_ORG_OIW

#define OID_ORG_OIW MBEDTLS_OID_ORG_OIW


      

Marco OID_ORG_RSA_DATA_SECURITY

#define OID_ORG_RSA_DATA_SECURITY MBEDTLS_OID_ORG_RSA_DATA_SECURITY


      

Marco OID_ORG_TELETRUST

#define OID_ORG_TELETRUST MBEDTLS_OID_ORG_TELETRUST


      

Marco OID_PKCS

#define OID_PKCS MBEDTLS_OID_PKCS


      

Marco OID_PKCS1

#define OID_PKCS1 MBEDTLS_OID_PKCS1


      

Marco OID_PKCS12

#define OID_PKCS12 MBEDTLS_OID_PKCS12


      

Marco OID_PKCS12_PBE

#define OID_PKCS12_PBE MBEDTLS_OID_PKCS12_PBE


      

Marco OID_PKCS12_PBE_SHA1_DES2_EDE_CBC

#define OID_PKCS12_PBE_SHA1_DES2_EDE_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC


      

Marco OID_PKCS12_PBE_SHA1_DES3_EDE_CBC

#define OID_PKCS12_PBE_SHA1_DES3_EDE_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC


      

Marco OID_PKCS12_PBE_SHA1_RC2_128_CBC

#define OID_PKCS12_PBE_SHA1_RC2_128_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC


      

Marco OID_PKCS12_PBE_SHA1_RC2_40_CBC

#define OID_PKCS12_PBE_SHA1_RC2_40_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC


      

Marco OID_PKCS12_PBE_SHA1_RC4_128

#define OID_PKCS12_PBE_SHA1_RC4_128 MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128


      

Marco OID_PKCS12_PBE_SHA1_RC4_40

#define OID_PKCS12_PBE_SHA1_RC4_40 MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40


      

Marco OID_PKCS1_MD2

#define OID_PKCS1_MD2 MBEDTLS_OID_PKCS1_MD2


      

Marco OID_PKCS1_MD4

#define OID_PKCS1_MD4 MBEDTLS_OID_PKCS1_MD4


      

Marco OID_PKCS1_MD5

#define OID_PKCS1_MD5 MBEDTLS_OID_PKCS1_MD5


      

Marco OID_PKCS1_RSA

#define OID_PKCS1_RSA MBEDTLS_OID_PKCS1_RSA


      

Marco OID_PKCS1_SHA1

#define OID_PKCS1_SHA1 MBEDTLS_OID_PKCS1_SHA1


      

Marco OID_PKCS1_SHA224

#define OID_PKCS1_SHA224 MBEDTLS_OID_PKCS1_SHA224


      

Marco OID_PKCS1_SHA256

#define OID_PKCS1_SHA256 MBEDTLS_OID_PKCS1_SHA256


      

Marco OID_PKCS1_SHA384

#define OID_PKCS1_SHA384 MBEDTLS_OID_PKCS1_SHA384


      

Marco OID_PKCS1_SHA512

#define OID_PKCS1_SHA512 MBEDTLS_OID_PKCS1_SHA512


      

Marco OID_PKCS5

#define OID_PKCS5 MBEDTLS_OID_PKCS5


      

Marco OID_PKCS5_PBES2

#define OID_PKCS5_PBES2 MBEDTLS_OID_PKCS5_PBES2


      

Marco OID_PKCS5_PBE_MD2_DES_CBC

#define OID_PKCS5_PBE_MD2_DES_CBC MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC


      

Marco OID_PKCS5_PBE_MD2_RC2_CBC

#define OID_PKCS5_PBE_MD2_RC2_CBC MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC


      

Marco OID_PKCS5_PBE_MD5_DES_CBC

#define OID_PKCS5_PBE_MD5_DES_CBC MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC


      

Marco OID_PKCS5_PBE_MD5_RC2_CBC

#define OID_PKCS5_PBE_MD5_RC2_CBC MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC


      

Marco OID_PKCS5_PBE_SHA1_DES_CBC

#define OID_PKCS5_PBE_SHA1_DES_CBC MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC


      

Marco OID_PKCS5_PBE_SHA1_RC2_CBC

#define OID_PKCS5_PBE_SHA1_RC2_CBC MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC


      

Marco OID_PKCS5_PBKDF2

#define OID_PKCS5_PBKDF2 MBEDTLS_OID_PKCS5_PBKDF2


      

Marco OID_PKCS5_PBMAC1

#define OID_PKCS5_PBMAC1 MBEDTLS_OID_PKCS5_PBMAC1


      

Marco OID_PKCS9

#define OID_PKCS9 MBEDTLS_OID_PKCS9


      

Marco OID_PKCS9_CSR_EXT_REQ

#define OID_PKCS9_CSR_EXT_REQ MBEDTLS_OID_PKCS9_CSR_EXT_REQ


      

Marco OID_PKCS9_EMAIL

#define OID_PKCS9_EMAIL MBEDTLS_OID_PKCS9_EMAIL


      

Marco OID_PKIX

#define OID_PKIX MBEDTLS_OID_PKIX


      

Marco OID_POLICY_CONSTRAINTS

#define OID_POLICY_CONSTRAINTS MBEDTLS_OID_POLICY_CONSTRAINTS


      

Marco OID_POLICY_MAPPINGS

#define OID_POLICY_MAPPINGS MBEDTLS_OID_POLICY_MAPPINGS


      

Marco OID_PRIVATE_KEY_USAGE_PERIOD

#define OID_PRIVATE_KEY_USAGE_PERIOD MBEDTLS_OID_PRIVATE_KEY_USAGE_PERIOD


      

Marco OID_RSASSA_PSS

#define OID_RSASSA_PSS MBEDTLS_OID_RSASSA_PSS


      

Marco OID_RSA_COMPANY

#define OID_RSA_COMPANY MBEDTLS_OID_RSA_COMPANY


      

Marco OID_RSA_SHA_OBS

#define OID_RSA_SHA_OBS MBEDTLS_OID_RSA_SHA_OBS


      

Marco OID_SERVER_AUTH

#define OID_SERVER_AUTH MBEDTLS_OID_SERVER_AUTH


      

Marco OID_SIZE

#define OID_SIZE MBEDTLS_OID_SIZE


      

Marco OID_SUBJECT_ALT_NAME

#define OID_SUBJECT_ALT_NAME MBEDTLS_OID_SUBJECT_ALT_NAME


      

Marco OID_SUBJECT_DIRECTORY_ATTRS

#define OID_SUBJECT_DIRECTORY_ATTRS MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS


      

Marco OID_SUBJECT_KEY_IDENTIFIER

#define OID_SUBJECT_KEY_IDENTIFIER MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER


      

Marco OID_TELETRUST

#define OID_TELETRUST MBEDTLS_OID_TELETRUST


      

Marco OID_TIME_STAMPING

#define OID_TIME_STAMPING MBEDTLS_OID_TIME_STAMPING


      

Marco PADLOCK_ACE

#define PADLOCK_ACE MBEDTLS_PADLOCK_ACE


      

Marco PADLOCK_ALIGN16

#define PADLOCK_ALIGN16 MBEDTLS_PADLOCK_ALIGN16


      

Marco PADLOCK_PHE

#define PADLOCK_PHE MBEDTLS_PADLOCK_PHE


      

Marco PADLOCK_PMM

#define PADLOCK_PMM MBEDTLS_PADLOCK_PMM


      

Marco PADLOCK_RNG

#define PADLOCK_RNG MBEDTLS_PADLOCK_RNG


      

Marco PKCS12_DERIVE_IV

#define PKCS12_DERIVE_IV MBEDTLS_PKCS12_DERIVE_IV


      

Marco PKCS12_DERIVE_KEY

#define PKCS12_DERIVE_KEY MBEDTLS_PKCS12_DERIVE_KEY


      

Marco PKCS12_DERIVE_MAC_KEY

#define PKCS12_DERIVE_MAC_KEY MBEDTLS_PKCS12_DERIVE_MAC_KEY


      

Marco PKCS12_PBE_DECRYPT

#define PKCS12_PBE_DECRYPT MBEDTLS_PKCS12_PBE_DECRYPT


      

Marco PKCS12_PBE_ENCRYPT

#define PKCS12_PBE_ENCRYPT MBEDTLS_PKCS12_PBE_ENCRYPT


      

Marco PKCS5_DECRYPT

#define PKCS5_DECRYPT MBEDTLS_PKCS5_DECRYPT


      

Marco PKCS5_ENCRYPT

#define PKCS5_ENCRYPT MBEDTLS_PKCS5_ENCRYPT


      

Marco POLARSSL_AESNI_AES

#define POLARSSL_AESNI_AES MBEDTLS_AESNI_AES


      

Marco POLARSSL_AESNI_CLMUL

#define POLARSSL_AESNI_CLMUL MBEDTLS_AESNI_CLMUL


      

Marco POLARSSL_AESNI_H

#define POLARSSL_AESNI_H MBEDTLS_AESNI_H


      

Marco POLARSSL_AES_H

#define POLARSSL_AES_H MBEDTLS_AES_H


      

Marco POLARSSL_ARC4_H

#define POLARSSL_ARC4_H MBEDTLS_ARC4_H


      

Marco POLARSSL_ASN1_H

#define POLARSSL_ASN1_H MBEDTLS_ASN1_H


      

Marco POLARSSL_ASN1_WRITE_H

#define POLARSSL_ASN1_WRITE_H MBEDTLS_ASN1_WRITE_H


      

Marco POLARSSL_BASE64_H

#define POLARSSL_BASE64_H MBEDTLS_BASE64_H


      

Marco POLARSSL_BIGNUM_H

#define POLARSSL_BIGNUM_H MBEDTLS_BIGNUM_H


      

Marco POLARSSL_BLOWFISH_H

#define POLARSSL_BLOWFISH_H MBEDTLS_BLOWFISH_H


      

Marco POLARSSL_BN_MUL_H

#define POLARSSL_BN_MUL_H MBEDTLS_BN_MUL_H


      

Marco POLARSSL_CAMELLIA_H

#define POLARSSL_CAMELLIA_H MBEDTLS_CAMELLIA_H


      

Marco POLARSSL_CCM_H

#define POLARSSL_CCM_H MBEDTLS_CCM_H


      

Marco POLARSSL_CERTS_H

#define POLARSSL_CERTS_H MBEDTLS_CERTS_H


      

Marco POLARSSL_CHECK_CONFIG_H

#define POLARSSL_CHECK_CONFIG_H MBEDTLS_CHECK_CONFIG_H


      

Marco POLARSSL_CIPHERSUITE_NODTLS

#define POLARSSL_CIPHERSUITE_NODTLS MBEDTLS_CIPHERSUITE_NODTLS


      

Marco POLARSSL_CIPHERSUITE_SHORT_TAG

#define POLARSSL_CIPHERSUITE_SHORT_TAG MBEDTLS_CIPHERSUITE_SHORT_TAG


      

Marco POLARSSL_CIPHERSUITE_WEAK

#define POLARSSL_CIPHERSUITE_WEAK MBEDTLS_CIPHERSUITE_WEAK


      

Marco POLARSSL_CIPHER_AES_128_CBC

#define POLARSSL_CIPHER_AES_128_CBC MBEDTLS_CIPHER_AES_128_CBC


      

Marco POLARSSL_CIPHER_AES_128_CCM

#define POLARSSL_CIPHER_AES_128_CCM MBEDTLS_CIPHER_AES_128_CCM


      

Marco POLARSSL_CIPHER_AES_128_CFB128

#define POLARSSL_CIPHER_AES_128_CFB128 MBEDTLS_CIPHER_AES_128_CFB128


      

Marco POLARSSL_CIPHER_AES_128_CTR

#define POLARSSL_CIPHER_AES_128_CTR MBEDTLS_CIPHER_AES_128_CTR


      

Marco POLARSSL_CIPHER_AES_128_ECB

#define POLARSSL_CIPHER_AES_128_ECB MBEDTLS_CIPHER_AES_128_ECB


      

Marco POLARSSL_CIPHER_AES_128_GCM

#define POLARSSL_CIPHER_AES_128_GCM MBEDTLS_CIPHER_AES_128_GCM


      

Marco POLARSSL_CIPHER_AES_192_CBC

#define POLARSSL_CIPHER_AES_192_CBC MBEDTLS_CIPHER_AES_192_CBC


      

Marco POLARSSL_CIPHER_AES_192_CCM

#define POLARSSL_CIPHER_AES_192_CCM MBEDTLS_CIPHER_AES_192_CCM


      

Marco POLARSSL_CIPHER_AES_192_CFB128

#define POLARSSL_CIPHER_AES_192_CFB128 MBEDTLS_CIPHER_AES_192_CFB128


      

Marco POLARSSL_CIPHER_AES_192_CTR

#define POLARSSL_CIPHER_AES_192_CTR MBEDTLS_CIPHER_AES_192_CTR


      

Marco POLARSSL_CIPHER_AES_192_ECB

#define POLARSSL_CIPHER_AES_192_ECB MBEDTLS_CIPHER_AES_192_ECB


      

Marco POLARSSL_CIPHER_AES_192_GCM

#define POLARSSL_CIPHER_AES_192_GCM MBEDTLS_CIPHER_AES_192_GCM


      

Marco POLARSSL_CIPHER_AES_256_CBC

#define POLARSSL_CIPHER_AES_256_CBC MBEDTLS_CIPHER_AES_256_CBC


      

Marco POLARSSL_CIPHER_AES_256_CCM

#define POLARSSL_CIPHER_AES_256_CCM MBEDTLS_CIPHER_AES_256_CCM


      

Marco POLARSSL_CIPHER_AES_256_CFB128

#define POLARSSL_CIPHER_AES_256_CFB128 MBEDTLS_CIPHER_AES_256_CFB128


      

Marco POLARSSL_CIPHER_AES_256_CTR

#define POLARSSL_CIPHER_AES_256_CTR MBEDTLS_CIPHER_AES_256_CTR


      

Marco POLARSSL_CIPHER_AES_256_ECB

#define POLARSSL_CIPHER_AES_256_ECB MBEDTLS_CIPHER_AES_256_ECB


      

Marco POLARSSL_CIPHER_AES_256_GCM

#define POLARSSL_CIPHER_AES_256_GCM MBEDTLS_CIPHER_AES_256_GCM


      

Marco POLARSSL_CIPHER_ARC4_128

#define POLARSSL_CIPHER_ARC4_128 MBEDTLS_CIPHER_ARC4_128


      

Marco POLARSSL_CIPHER_BLOWFISH_CBC

#define POLARSSL_CIPHER_BLOWFISH_CBC MBEDTLS_CIPHER_BLOWFISH_CBC


      

Marco POLARSSL_CIPHER_BLOWFISH_CFB64

#define POLARSSL_CIPHER_BLOWFISH_CFB64 MBEDTLS_CIPHER_BLOWFISH_CFB64


      

Marco POLARSSL_CIPHER_BLOWFISH_CTR

#define POLARSSL_CIPHER_BLOWFISH_CTR MBEDTLS_CIPHER_BLOWFISH_CTR


      

Marco POLARSSL_CIPHER_BLOWFISH_ECB

#define POLARSSL_CIPHER_BLOWFISH_ECB MBEDTLS_CIPHER_BLOWFISH_ECB


      

Marco POLARSSL_CIPHER_CAMELLIA_128_CBC

#define POLARSSL_CIPHER_CAMELLIA_128_CBC MBEDTLS_CIPHER_CAMELLIA_128_CBC


      

Marco POLARSSL_CIPHER_CAMELLIA_128_CCM

#define POLARSSL_CIPHER_CAMELLIA_128_CCM MBEDTLS_CIPHER_CAMELLIA_128_CCM


      

Marco POLARSSL_CIPHER_CAMELLIA_128_CFB128

#define POLARSSL_CIPHER_CAMELLIA_128_CFB128 MBEDTLS_CIPHER_CAMELLIA_128_CFB128


      

Marco POLARSSL_CIPHER_CAMELLIA_128_CTR

#define POLARSSL_CIPHER_CAMELLIA_128_CTR MBEDTLS_CIPHER_CAMELLIA_128_CTR


      

Marco POLARSSL_CIPHER_CAMELLIA_128_ECB

#define POLARSSL_CIPHER_CAMELLIA_128_ECB MBEDTLS_CIPHER_CAMELLIA_128_ECB


      

Marco POLARSSL_CIPHER_CAMELLIA_128_GCM

#define POLARSSL_CIPHER_CAMELLIA_128_GCM MBEDTLS_CIPHER_CAMELLIA_128_GCM


      

Marco POLARSSL_CIPHER_CAMELLIA_192_CBC

#define POLARSSL_CIPHER_CAMELLIA_192_CBC MBEDTLS_CIPHER_CAMELLIA_192_CBC


      

Marco POLARSSL_CIPHER_CAMELLIA_192_CCM

#define POLARSSL_CIPHER_CAMELLIA_192_CCM MBEDTLS_CIPHER_CAMELLIA_192_CCM


      

Marco POLARSSL_CIPHER_CAMELLIA_192_CFB128

#define POLARSSL_CIPHER_CAMELLIA_192_CFB128 MBEDTLS_CIPHER_CAMELLIA_192_CFB128


      

Marco POLARSSL_CIPHER_CAMELLIA_192_CTR

#define POLARSSL_CIPHER_CAMELLIA_192_CTR MBEDTLS_CIPHER_CAMELLIA_192_CTR


      

Marco POLARSSL_CIPHER_CAMELLIA_192_ECB

#define POLARSSL_CIPHER_CAMELLIA_192_ECB MBEDTLS_CIPHER_CAMELLIA_192_ECB


      

Marco POLARSSL_CIPHER_CAMELLIA_192_GCM

#define POLARSSL_CIPHER_CAMELLIA_192_GCM MBEDTLS_CIPHER_CAMELLIA_192_GCM


      

Marco POLARSSL_CIPHER_CAMELLIA_256_CBC

#define POLARSSL_CIPHER_CAMELLIA_256_CBC MBEDTLS_CIPHER_CAMELLIA_256_CBC


      

Marco POLARSSL_CIPHER_CAMELLIA_256_CCM

#define POLARSSL_CIPHER_CAMELLIA_256_CCM MBEDTLS_CIPHER_CAMELLIA_256_CCM


      

Marco POLARSSL_CIPHER_CAMELLIA_256_CFB128

#define POLARSSL_CIPHER_CAMELLIA_256_CFB128 MBEDTLS_CIPHER_CAMELLIA_256_CFB128


      

Marco POLARSSL_CIPHER_CAMELLIA_256_CTR

#define POLARSSL_CIPHER_CAMELLIA_256_CTR MBEDTLS_CIPHER_CAMELLIA_256_CTR


      

Marco POLARSSL_CIPHER_CAMELLIA_256_ECB

#define POLARSSL_CIPHER_CAMELLIA_256_ECB MBEDTLS_CIPHER_CAMELLIA_256_ECB


      

Marco POLARSSL_CIPHER_CAMELLIA_256_GCM

#define POLARSSL_CIPHER_CAMELLIA_256_GCM MBEDTLS_CIPHER_CAMELLIA_256_GCM


      

Marco POLARSSL_CIPHER_DES_CBC

#define POLARSSL_CIPHER_DES_CBC MBEDTLS_CIPHER_DES_CBC


      

Marco POLARSSL_CIPHER_DES_ECB

#define POLARSSL_CIPHER_DES_ECB MBEDTLS_CIPHER_DES_ECB


      

Marco POLARSSL_CIPHER_DES_EDE3_CBC

#define POLARSSL_CIPHER_DES_EDE3_CBC MBEDTLS_CIPHER_DES_EDE3_CBC


      

Marco POLARSSL_CIPHER_DES_EDE3_ECB

#define POLARSSL_CIPHER_DES_EDE3_ECB MBEDTLS_CIPHER_DES_EDE3_ECB


      

Marco POLARSSL_CIPHER_DES_EDE_CBC

#define POLARSSL_CIPHER_DES_EDE_CBC MBEDTLS_CIPHER_DES_EDE_CBC


      

Marco POLARSSL_CIPHER_DES_EDE_ECB

#define POLARSSL_CIPHER_DES_EDE_ECB MBEDTLS_CIPHER_DES_EDE_ECB


      

Marco POLARSSL_CIPHER_H

#define POLARSSL_CIPHER_H MBEDTLS_CIPHER_H


      

Marco POLARSSL_CIPHER_ID_3DES

#define POLARSSL_CIPHER_ID_3DES MBEDTLS_CIPHER_ID_3DES


      

Marco POLARSSL_CIPHER_ID_AES

#define POLARSSL_CIPHER_ID_AES MBEDTLS_CIPHER_ID_AES


      

Marco POLARSSL_CIPHER_ID_ARC4

#define POLARSSL_CIPHER_ID_ARC4 MBEDTLS_CIPHER_ID_ARC4


      

Marco POLARSSL_CIPHER_ID_BLOWFISH

#define POLARSSL_CIPHER_ID_BLOWFISH MBEDTLS_CIPHER_ID_BLOWFISH


      

Marco POLARSSL_CIPHER_ID_CAMELLIA

#define POLARSSL_CIPHER_ID_CAMELLIA MBEDTLS_CIPHER_ID_CAMELLIA


      

Marco POLARSSL_CIPHER_ID_DES

#define POLARSSL_CIPHER_ID_DES MBEDTLS_CIPHER_ID_DES


      

Marco POLARSSL_CIPHER_ID_NONE

#define POLARSSL_CIPHER_ID_NONE MBEDTLS_CIPHER_ID_NONE


      

Marco POLARSSL_CIPHER_ID_NULL

#define POLARSSL_CIPHER_ID_NULL MBEDTLS_CIPHER_ID_NULL


      

Marco POLARSSL_CIPHER_MODE_AEAD

#define POLARSSL_CIPHER_MODE_AEAD MBEDTLS_CIPHER_MODE_AEAD


      

Marco POLARSSL_CIPHER_MODE_STREAM

#define POLARSSL_CIPHER_MODE_STREAM MBEDTLS_CIPHER_MODE_STREAM


      

Marco POLARSSL_CIPHER_MODE_WITH_PADDING

#define POLARSSL_CIPHER_MODE_WITH_PADDING MBEDTLS_CIPHER_MODE_WITH_PADDING


      

Marco POLARSSL_CIPHER_NONE

#define POLARSSL_CIPHER_NONE MBEDTLS_CIPHER_NONE


      

Marco POLARSSL_CIPHER_NULL

#define POLARSSL_CIPHER_NULL MBEDTLS_CIPHER_NULL


      

Marco POLARSSL_CIPHER_VARIABLE_IV_LEN

#define POLARSSL_CIPHER_VARIABLE_IV_LEN MBEDTLS_CIPHER_VARIABLE_IV_LEN


      

Marco POLARSSL_CIPHER_VARIABLE_KEY_LEN

#define POLARSSL_CIPHER_VARIABLE_KEY_LEN MBEDTLS_CIPHER_VARIABLE_KEY_LEN


      

Marco POLARSSL_CIPHER_WRAP_H

#define POLARSSL_CIPHER_WRAP_H MBEDTLS_CIPHER_WRAP_H


      

Marco POLARSSL_CONFIG_H

#define POLARSSL_CONFIG_H MBEDTLS_CONFIG_H


      

Marco POLARSSL_CTR_DRBG_H

#define POLARSSL_CTR_DRBG_H MBEDTLS_CTR_DRBG_H


      

Marco POLARSSL_DEBUG_H

#define POLARSSL_DEBUG_H MBEDTLS_DEBUG_H


      

Marco POLARSSL_DECRYPT

#define POLARSSL_DECRYPT MBEDTLS_DECRYPT


      

Marco POLARSSL_DES_H

#define POLARSSL_DES_H MBEDTLS_DES_H


      

Marco POLARSSL_DHM_H

#define POLARSSL_DHM_H MBEDTLS_DHM_H


      

Marco POLARSSL_DHM_RFC3526_MODP_2048_G

#define POLARSSL_DHM_RFC3526_MODP_2048_G MBEDTLS_DHM_RFC3526_MODP_2048_G


      

Marco POLARSSL_DHM_RFC3526_MODP_2048_P

#define POLARSSL_DHM_RFC3526_MODP_2048_P MBEDTLS_DHM_RFC3526_MODP_2048_P


      

Marco POLARSSL_DHM_RFC3526_MODP_3072_G

#define POLARSSL_DHM_RFC3526_MODP_3072_G MBEDTLS_DHM_RFC3526_MODP_3072_G


      

Marco POLARSSL_DHM_RFC3526_MODP_3072_P

#define POLARSSL_DHM_RFC3526_MODP_3072_P MBEDTLS_DHM_RFC3526_MODP_3072_P


      

Marco POLARSSL_DHM_RFC5114_MODP_2048_G

#define POLARSSL_DHM_RFC5114_MODP_2048_G MBEDTLS_DHM_RFC5114_MODP_2048_G


      

Marco POLARSSL_DHM_RFC5114_MODP_2048_P

#define POLARSSL_DHM_RFC5114_MODP_2048_P MBEDTLS_DHM_RFC5114_MODP_2048_P


      

Marco POLARSSL_ECDH_H

#define POLARSSL_ECDH_H MBEDTLS_ECDH_H


      

Marco POLARSSL_ECDH_OURS

#define POLARSSL_ECDH_OURS MBEDTLS_ECDH_OURS


      

Marco POLARSSL_ECDH_THEIRS

#define POLARSSL_ECDH_THEIRS MBEDTLS_ECDH_THEIRS


      

Marco POLARSSL_ECDSA_H

#define POLARSSL_ECDSA_H MBEDTLS_ECDSA_H


      

Marco POLARSSL_ECP_DP_BP256R1

#define POLARSSL_ECP_DP_BP256R1 MBEDTLS_ECP_DP_BP256R1


      

Marco POLARSSL_ECP_DP_BP384R1

#define POLARSSL_ECP_DP_BP384R1 MBEDTLS_ECP_DP_BP384R1


      

Marco POLARSSL_ECP_DP_BP512R1

#define POLARSSL_ECP_DP_BP512R1 MBEDTLS_ECP_DP_BP512R1


      

Marco POLARSSL_ECP_DP_M255

#define POLARSSL_ECP_DP_M255 MBEDTLS_ECP_DP_CURVE25519


      

Marco POLARSSL_ECP_DP_MAX

#define POLARSSL_ECP_DP_MAX MBEDTLS_ECP_DP_MAX


      

Marco POLARSSL_ECP_DP_NONE

#define POLARSSL_ECP_DP_NONE MBEDTLS_ECP_DP_NONE


      

Marco POLARSSL_ECP_DP_SECP192K1

#define POLARSSL_ECP_DP_SECP192K1 MBEDTLS_ECP_DP_SECP192K1


      

Marco POLARSSL_ECP_DP_SECP192R1

#define POLARSSL_ECP_DP_SECP192R1 MBEDTLS_ECP_DP_SECP192R1


      

Marco POLARSSL_ECP_DP_SECP224K1

#define POLARSSL_ECP_DP_SECP224K1 MBEDTLS_ECP_DP_SECP224K1


      

Marco POLARSSL_ECP_DP_SECP224R1

#define POLARSSL_ECP_DP_SECP224R1 MBEDTLS_ECP_DP_SECP224R1


      

Marco POLARSSL_ECP_DP_SECP256K1

#define POLARSSL_ECP_DP_SECP256K1 MBEDTLS_ECP_DP_SECP256K1


      

Marco POLARSSL_ECP_DP_SECP256R1

#define POLARSSL_ECP_DP_SECP256R1 MBEDTLS_ECP_DP_SECP256R1


      

Marco POLARSSL_ECP_DP_SECP384R1

#define POLARSSL_ECP_DP_SECP384R1 MBEDTLS_ECP_DP_SECP384R1


      

Marco POLARSSL_ECP_DP_SECP521R1

#define POLARSSL_ECP_DP_SECP521R1 MBEDTLS_ECP_DP_SECP521R1


      

Marco POLARSSL_ECP_H

#define POLARSSL_ECP_H MBEDTLS_ECP_H


      

Marco POLARSSL_ECP_MAX_BYTES

#define POLARSSL_ECP_MAX_BYTES MBEDTLS_ECP_MAX_BYTES


      

Marco POLARSSL_ECP_MAX_PT_LEN

#define POLARSSL_ECP_MAX_PT_LEN MBEDTLS_ECP_MAX_PT_LEN


      

Marco POLARSSL_ECP_PF_COMPRESSED

#define POLARSSL_ECP_PF_COMPRESSED MBEDTLS_ECP_PF_COMPRESSED


      

Marco POLARSSL_ECP_PF_UNCOMPRESSED

#define POLARSSL_ECP_PF_UNCOMPRESSED MBEDTLS_ECP_PF_UNCOMPRESSED


      

Marco POLARSSL_ECP_TLS_NAMED_CURVE

#define POLARSSL_ECP_TLS_NAMED_CURVE MBEDTLS_ECP_TLS_NAMED_CURVE


      

Marco POLARSSL_ENCRYPT

#define POLARSSL_ENCRYPT MBEDTLS_ENCRYPT


      

Marco POLARSSL_ENTROPY_H

#define POLARSSL_ENTROPY_H MBEDTLS_ENTROPY_H


      

Marco POLARSSL_ENTROPY_POLL_H

#define POLARSSL_ENTROPY_POLL_H MBEDTLS_ENTROPY_POLL_H


      

Marco POLARSSL_ENTROPY_SHA256_ACCUMULATOR

#define POLARSSL_ENTROPY_SHA256_ACCUMULATOR MBEDTLS_ENTROPY_SHA256_ACCUMULATOR


      

Marco POLARSSL_ENTROPY_SHA512_ACCUMULATOR

#define POLARSSL_ENTROPY_SHA512_ACCUMULATOR MBEDTLS_ENTROPY_SHA512_ACCUMULATOR


      

Marco POLARSSL_ERROR_H

#define POLARSSL_ERROR_H MBEDTLS_ERROR_H


      

Marco POLARSSL_ERR_AES_INVALID_INPUT_LENGTH

#define POLARSSL_ERR_AES_INVALID_INPUT_LENGTH MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH


      

Marco POLARSSL_ERR_AES_INVALID_KEY_LENGTH

#define POLARSSL_ERR_AES_INVALID_KEY_LENGTH MBEDTLS_ERR_AES_INVALID_KEY_LENGTH


      

Marco POLARSSL_ERR_ASN1_BUF_TOO_SMALL

#define POLARSSL_ERR_ASN1_BUF_TOO_SMALL MBEDTLS_ERR_ASN1_BUF_TOO_SMALL


      

Marco POLARSSL_ERR_ASN1_INVALID_DATA

#define POLARSSL_ERR_ASN1_INVALID_DATA MBEDTLS_ERR_ASN1_INVALID_DATA


      

Marco POLARSSL_ERR_ASN1_INVALID_LENGTH

#define POLARSSL_ERR_ASN1_INVALID_LENGTH MBEDTLS_ERR_ASN1_INVALID_LENGTH


      

Marco POLARSSL_ERR_ASN1_LENGTH_MISMATCH

#define POLARSSL_ERR_ASN1_LENGTH_MISMATCH MBEDTLS_ERR_ASN1_LENGTH_MISMATCH


      

Marco POLARSSL_ERR_ASN1_MALLOC_FAILED

#define POLARSSL_ERR_ASN1_MALLOC_FAILED MBEDTLS_ERR_ASN1_ALLOC_FAILED


      

Marco POLARSSL_ERR_ASN1_OUT_OF_DATA

#define POLARSSL_ERR_ASN1_OUT_OF_DATA MBEDTLS_ERR_ASN1_OUT_OF_DATA


      

Marco POLARSSL_ERR_ASN1_UNEXPECTED_TAG

#define POLARSSL_ERR_ASN1_UNEXPECTED_TAG MBEDTLS_ERR_ASN1_UNEXPECTED_TAG


      

Marco POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL

#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL


      

Marco POLARSSL_ERR_BASE64_INVALID_CHARACTER

#define POLARSSL_ERR_BASE64_INVALID_CHARACTER MBEDTLS_ERR_BASE64_INVALID_CHARACTER


      

Marco POLARSSL_ERR_BLOWFISH_INVALID_INPUT_LENGTH

#define POLARSSL_ERR_BLOWFISH_INVALID_INPUT_LENGTH MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH


      

Marco POLARSSL_ERR_BLOWFISH_INVALID_KEY_LENGTH

#define POLARSSL_ERR_BLOWFISH_INVALID_KEY_LENGTH MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH


      

Marco POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH

#define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH


      

Marco POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH

#define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH


      

Marco POLARSSL_ERR_CCM_AUTH_FAILED

#define POLARSSL_ERR_CCM_AUTH_FAILED MBEDTLS_ERR_CCM_AUTH_FAILED


      

Marco POLARSSL_ERR_CCM_BAD_INPUT

#define POLARSSL_ERR_CCM_BAD_INPUT MBEDTLS_ERR_CCM_BAD_INPUT


      

Marco POLARSSL_ERR_CIPHER_ALLOC_FAILED

#define POLARSSL_ERR_CIPHER_ALLOC_FAILED MBEDTLS_ERR_CIPHER_ALLOC_FAILED


      

Marco POLARSSL_ERR_CIPHER_AUTH_FAILED

#define POLARSSL_ERR_CIPHER_AUTH_FAILED MBEDTLS_ERR_CIPHER_AUTH_FAILED


      

Marco POLARSSL_ERR_CIPHER_BAD_INPUT_DATA

#define POLARSSL_ERR_CIPHER_BAD_INPUT_DATA MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED

#define POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED


      

Marco POLARSSL_ERR_CIPHER_INVALID_PADDING

#define POLARSSL_ERR_CIPHER_INVALID_PADDING MBEDTLS_ERR_CIPHER_INVALID_PADDING


      

Marco POLARSSL_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED

#define POLARSSL_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED


      

Marco POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR

#define POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR


      

Marco POLARSSL_ERR_CTR_DRBG_INPUT_TOO_BIG

#define POLARSSL_ERR_CTR_DRBG_INPUT_TOO_BIG MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG


      

Marco POLARSSL_ERR_CTR_DRBG_REQUEST_TOO_BIG

#define POLARSSL_ERR_CTR_DRBG_REQUEST_TOO_BIG MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG


      

Marco POLARSSL_ERR_DES_INVALID_INPUT_LENGTH

#define POLARSSL_ERR_DES_INVALID_INPUT_LENGTH MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH


      

Marco POLARSSL_ERR_DHM_BAD_INPUT_DATA

#define POLARSSL_ERR_DHM_BAD_INPUT_DATA MBEDTLS_ERR_DHM_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_DHM_CALC_SECRET_FAILED

#define POLARSSL_ERR_DHM_CALC_SECRET_FAILED MBEDTLS_ERR_DHM_CALC_SECRET_FAILED


      

Marco POLARSSL_ERR_DHM_FILE_IO_ERROR

#define POLARSSL_ERR_DHM_FILE_IO_ERROR MBEDTLS_ERR_DHM_FILE_IO_ERROR


      

Marco POLARSSL_ERR_DHM_INVALID_FORMAT

#define POLARSSL_ERR_DHM_INVALID_FORMAT MBEDTLS_ERR_DHM_INVALID_FORMAT


      

Marco POLARSSL_ERR_DHM_MAKE_PARAMS_FAILED

#define POLARSSL_ERR_DHM_MAKE_PARAMS_FAILED MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED


      

Marco POLARSSL_ERR_DHM_MAKE_PUBLIC_FAILED

#define POLARSSL_ERR_DHM_MAKE_PUBLIC_FAILED MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED


      

Marco POLARSSL_ERR_DHM_MALLOC_FAILED

#define POLARSSL_ERR_DHM_MALLOC_FAILED MBEDTLS_ERR_DHM_ALLOC_FAILED


      

Marco POLARSSL_ERR_DHM_READ_PARAMS_FAILED

#define POLARSSL_ERR_DHM_READ_PARAMS_FAILED MBEDTLS_ERR_DHM_READ_PARAMS_FAILED


      

Marco POLARSSL_ERR_DHM_READ_PUBLIC_FAILED

#define POLARSSL_ERR_DHM_READ_PUBLIC_FAILED MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED


      

Marco POLARSSL_ERR_ECP_BAD_INPUT_DATA

#define POLARSSL_ERR_ECP_BAD_INPUT_DATA MBEDTLS_ERR_ECP_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_ECP_BUFFER_TOO_SMALL

#define POLARSSL_ERR_ECP_BUFFER_TOO_SMALL MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL


      

Marco POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_ECP_INVALID_KEY

#define POLARSSL_ERR_ECP_INVALID_KEY MBEDTLS_ERR_ECP_INVALID_KEY


      

Marco POLARSSL_ERR_ECP_MALLOC_FAILED

#define POLARSSL_ERR_ECP_MALLOC_FAILED MBEDTLS_ERR_ECP_ALLOC_FAILED


      

Marco POLARSSL_ERR_ECP_RANDOM_FAILED

#define POLARSSL_ERR_ECP_RANDOM_FAILED MBEDTLS_ERR_ECP_RANDOM_FAILED


      

Marco POLARSSL_ERR_ECP_SIG_LEN_MISMATCH

#define POLARSSL_ERR_ECP_SIG_LEN_MISMATCH MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH


      

Marco POLARSSL_ERR_ECP_VERIFY_FAILED

#define POLARSSL_ERR_ECP_VERIFY_FAILED MBEDTLS_ERR_ECP_VERIFY_FAILED


      

Marco POLARSSL_ERR_ENTROPY_FILE_IO_ERROR

#define POLARSSL_ERR_ENTROPY_FILE_IO_ERROR MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR


      

Marco POLARSSL_ERR_ENTROPY_MAX_SOURCES

#define POLARSSL_ERR_ENTROPY_MAX_SOURCES MBEDTLS_ERR_ENTROPY_MAX_SOURCES


      

Marco POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED

#define POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED


      

Marco POLARSSL_ERR_ENTROPY_SOURCE_FAILED

#define POLARSSL_ERR_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_ENTROPY_SOURCE_FAILED


      

Marco POLARSSL_ERR_GCM_AUTH_FAILED

#define POLARSSL_ERR_GCM_AUTH_FAILED MBEDTLS_ERR_GCM_AUTH_FAILED


      

Marco POLARSSL_ERR_GCM_BAD_INPUT

#define POLARSSL_ERR_GCM_BAD_INPUT MBEDTLS_ERR_GCM_BAD_INPUT


      

Marco POLARSSL_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED

#define POLARSSL_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED


      

Marco POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR

#define POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR


      

Marco POLARSSL_ERR_HMAC_DRBG_INPUT_TOO_BIG

#define POLARSSL_ERR_HMAC_DRBG_INPUT_TOO_BIG MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG


      

Marco POLARSSL_ERR_HMAC_DRBG_REQUEST_TOO_BIG

#define POLARSSL_ERR_HMAC_DRBG_REQUEST_TOO_BIG MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG


      

Marco POLARSSL_ERR_MD_ALLOC_FAILED

#define POLARSSL_ERR_MD_ALLOC_FAILED MBEDTLS_ERR_MD_ALLOC_FAILED


      

Marco POLARSSL_ERR_MD_BAD_INPUT_DATA

#define POLARSSL_ERR_MD_BAD_INPUT_DATA MBEDTLS_ERR_MD_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_MD_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_MD_FEATURE_UNAVAILABLE MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_MD_FILE_IO_ERROR

#define POLARSSL_ERR_MD_FILE_IO_ERROR MBEDTLS_ERR_MD_FILE_IO_ERROR


      

Marco POLARSSL_ERR_MPI_BAD_INPUT_DATA

#define POLARSSL_ERR_MPI_BAD_INPUT_DATA MBEDTLS_ERR_MPI_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_MPI_BUFFER_TOO_SMALL

#define POLARSSL_ERR_MPI_BUFFER_TOO_SMALL MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL


      

Marco POLARSSL_ERR_MPI_DIVISION_BY_ZERO

#define POLARSSL_ERR_MPI_DIVISION_BY_ZERO MBEDTLS_ERR_MPI_DIVISION_BY_ZERO


      

Marco POLARSSL_ERR_MPI_FILE_IO_ERROR

#define POLARSSL_ERR_MPI_FILE_IO_ERROR MBEDTLS_ERR_MPI_FILE_IO_ERROR


      

Marco POLARSSL_ERR_MPI_INVALID_CHARACTER

#define POLARSSL_ERR_MPI_INVALID_CHARACTER MBEDTLS_ERR_MPI_INVALID_CHARACTER


      

Marco POLARSSL_ERR_MPI_MALLOC_FAILED

#define POLARSSL_ERR_MPI_MALLOC_FAILED MBEDTLS_ERR_MPI_ALLOC_FAILED


      

Marco POLARSSL_ERR_MPI_NEGATIVE_VALUE

#define POLARSSL_ERR_MPI_NEGATIVE_VALUE MBEDTLS_ERR_MPI_NEGATIVE_VALUE


      

Marco POLARSSL_ERR_MPI_NOT_ACCEPTABLE

#define POLARSSL_ERR_MPI_NOT_ACCEPTABLE MBEDTLS_ERR_MPI_NOT_ACCEPTABLE


      

Marco POLARSSL_ERR_NET_ACCEPT_FAILED

#define POLARSSL_ERR_NET_ACCEPT_FAILED MBEDTLS_ERR_NET_ACCEPT_FAILED


      

Marco POLARSSL_ERR_NET_BIND_FAILED

#define POLARSSL_ERR_NET_BIND_FAILED MBEDTLS_ERR_NET_BIND_FAILED


      

Marco POLARSSL_ERR_NET_CONNECT_FAILED

#define POLARSSL_ERR_NET_CONNECT_FAILED MBEDTLS_ERR_NET_CONNECT_FAILED


      

Marco POLARSSL_ERR_NET_CONN_RESET

#define POLARSSL_ERR_NET_CONN_RESET MBEDTLS_ERR_NET_CONN_RESET


      

Marco POLARSSL_ERR_NET_LISTEN_FAILED

#define POLARSSL_ERR_NET_LISTEN_FAILED MBEDTLS_ERR_NET_LISTEN_FAILED


      

Marco POLARSSL_ERR_NET_RECV_FAILED

#define POLARSSL_ERR_NET_RECV_FAILED MBEDTLS_ERR_NET_RECV_FAILED


      

Marco POLARSSL_ERR_NET_SEND_FAILED

#define POLARSSL_ERR_NET_SEND_FAILED MBEDTLS_ERR_NET_SEND_FAILED


      

Marco POLARSSL_ERR_NET_SOCKET_FAILED

#define POLARSSL_ERR_NET_SOCKET_FAILED MBEDTLS_ERR_NET_SOCKET_FAILED


      

Marco POLARSSL_ERR_NET_TIMEOUT

#define POLARSSL_ERR_NET_TIMEOUT MBEDTLS_ERR_SSL_TIMEOUT


      

Marco POLARSSL_ERR_NET_UNKNOWN_HOST

#define POLARSSL_ERR_NET_UNKNOWN_HOST MBEDTLS_ERR_NET_UNKNOWN_HOST


      

Marco POLARSSL_ERR_NET_WANT_READ

#define POLARSSL_ERR_NET_WANT_READ MBEDTLS_ERR_SSL_WANT_READ


      

Marco POLARSSL_ERR_NET_WANT_WRITE

#define POLARSSL_ERR_NET_WANT_WRITE MBEDTLS_ERR_SSL_WANT_WRITE


      

Marco POLARSSL_ERR_OID_BUF_TOO_SMALL

#define POLARSSL_ERR_OID_BUF_TOO_SMALL MBEDTLS_ERR_OID_BUF_TOO_SMALL


      

Marco POLARSSL_ERR_OID_NOT_FOUND

#define POLARSSL_ERR_OID_NOT_FOUND MBEDTLS_ERR_OID_NOT_FOUND


      

Marco POLARSSL_ERR_PADLOCK_DATA_MISALIGNED

#define POLARSSL_ERR_PADLOCK_DATA_MISALIGNED MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED


      

Marco POLARSSL_ERR_PEM_BAD_INPUT_DATA

#define POLARSSL_ERR_PEM_BAD_INPUT_DATA MBEDTLS_ERR_PEM_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_PEM_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_PEM_FEATURE_UNAVAILABLE MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_PEM_INVALID_DATA

#define POLARSSL_ERR_PEM_INVALID_DATA MBEDTLS_ERR_PEM_INVALID_DATA


      

Marco POLARSSL_ERR_PEM_INVALID_ENC_IV

#define POLARSSL_ERR_PEM_INVALID_ENC_IV MBEDTLS_ERR_PEM_INVALID_ENC_IV


      

Marco POLARSSL_ERR_PEM_MALLOC_FAILED

#define POLARSSL_ERR_PEM_MALLOC_FAILED MBEDTLS_ERR_PEM_ALLOC_FAILED


      
      
#define POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT


      

Marco POLARSSL_ERR_PEM_PASSWORD_MISMATCH

#define POLARSSL_ERR_PEM_PASSWORD_MISMATCH MBEDTLS_ERR_PEM_PASSWORD_MISMATCH


      

Marco POLARSSL_ERR_PEM_PASSWORD_REQUIRED

#define POLARSSL_ERR_PEM_PASSWORD_REQUIRED MBEDTLS_ERR_PEM_PASSWORD_REQUIRED


      

Marco POLARSSL_ERR_PEM_UNKNOWN_ENC_ALG

#define POLARSSL_ERR_PEM_UNKNOWN_ENC_ALG MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG


      

Marco POLARSSL_ERR_PKCS12_BAD_INPUT_DATA

#define POLARSSL_ERR_PKCS12_BAD_INPUT_DATA MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_PKCS12_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_PKCS12_FEATURE_UNAVAILABLE MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_PKCS12_PASSWORD_MISMATCH

#define POLARSSL_ERR_PKCS12_PASSWORD_MISMATCH MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH


      

Marco POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT

#define POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT


      

Marco POLARSSL_ERR_PKCS5_BAD_INPUT_DATA

#define POLARSSL_ERR_PKCS5_BAD_INPUT_DATA MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_PKCS5_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_PKCS5_FEATURE_UNAVAILABLE MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_PKCS5_INVALID_FORMAT

#define POLARSSL_ERR_PKCS5_INVALID_FORMAT MBEDTLS_ERR_PKCS5_INVALID_FORMAT


      

Marco POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH

#define POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH


      

Marco POLARSSL_ERR_PK_BAD_INPUT_DATA

#define POLARSSL_ERR_PK_BAD_INPUT_DATA MBEDTLS_ERR_PK_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_PK_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_PK_FEATURE_UNAVAILABLE MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_PK_FILE_IO_ERROR

#define POLARSSL_ERR_PK_FILE_IO_ERROR MBEDTLS_ERR_PK_FILE_IO_ERROR


      

Marco POLARSSL_ERR_PK_INVALID_ALG

#define POLARSSL_ERR_PK_INVALID_ALG MBEDTLS_ERR_PK_INVALID_ALG


      

Marco POLARSSL_ERR_PK_INVALID_PUBKEY

#define POLARSSL_ERR_PK_INVALID_PUBKEY MBEDTLS_ERR_PK_INVALID_PUBKEY


      

Marco POLARSSL_ERR_PK_KEY_INVALID_FORMAT

#define POLARSSL_ERR_PK_KEY_INVALID_FORMAT MBEDTLS_ERR_PK_KEY_INVALID_FORMAT


      

Marco POLARSSL_ERR_PK_KEY_INVALID_VERSION

#define POLARSSL_ERR_PK_KEY_INVALID_VERSION MBEDTLS_ERR_PK_KEY_INVALID_VERSION


      

Marco POLARSSL_ERR_PK_MALLOC_FAILED

#define POLARSSL_ERR_PK_MALLOC_FAILED MBEDTLS_ERR_PK_ALLOC_FAILED


      

Marco POLARSSL_ERR_PK_PASSWORD_MISMATCH

#define POLARSSL_ERR_PK_PASSWORD_MISMATCH MBEDTLS_ERR_PK_PASSWORD_MISMATCH


      

Marco POLARSSL_ERR_PK_PASSWORD_REQUIRED

#define POLARSSL_ERR_PK_PASSWORD_REQUIRED MBEDTLS_ERR_PK_PASSWORD_REQUIRED


      

Marco POLARSSL_ERR_PK_SIG_LEN_MISMATCH

#define POLARSSL_ERR_PK_SIG_LEN_MISMATCH MBEDTLS_ERR_PK_SIG_LEN_MISMATCH


      

Marco POLARSSL_ERR_PK_TYPE_MISMATCH

#define POLARSSL_ERR_PK_TYPE_MISMATCH MBEDTLS_ERR_PK_TYPE_MISMATCH


      

Marco POLARSSL_ERR_PK_UNKNOWN_NAMED_CURVE

#define POLARSSL_ERR_PK_UNKNOWN_NAMED_CURVE MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE


      

Marco POLARSSL_ERR_PK_UNKNOWN_PK_ALG

#define POLARSSL_ERR_PK_UNKNOWN_PK_ALG MBEDTLS_ERR_PK_UNKNOWN_PK_ALG


      

Marco POLARSSL_ERR_RSA_BAD_INPUT_DATA

#define POLARSSL_ERR_RSA_BAD_INPUT_DATA MBEDTLS_ERR_RSA_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_RSA_INVALID_PADDING

#define POLARSSL_ERR_RSA_INVALID_PADDING MBEDTLS_ERR_RSA_INVALID_PADDING


      

Marco POLARSSL_ERR_RSA_KEY_CHECK_FAILED

#define POLARSSL_ERR_RSA_KEY_CHECK_FAILED MBEDTLS_ERR_RSA_KEY_CHECK_FAILED


      

Marco POLARSSL_ERR_RSA_KEY_GEN_FAILED

#define POLARSSL_ERR_RSA_KEY_GEN_FAILED MBEDTLS_ERR_RSA_KEY_GEN_FAILED


      

Marco POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE

#define POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE


      

Marco POLARSSL_ERR_RSA_PRIVATE_FAILED

#define POLARSSL_ERR_RSA_PRIVATE_FAILED MBEDTLS_ERR_RSA_PRIVATE_FAILED


      

Marco POLARSSL_ERR_RSA_PUBLIC_FAILED

#define POLARSSL_ERR_RSA_PUBLIC_FAILED MBEDTLS_ERR_RSA_PUBLIC_FAILED


      

Marco POLARSSL_ERR_RSA_RNG_FAILED

#define POLARSSL_ERR_RSA_RNG_FAILED MBEDTLS_ERR_RSA_RNG_FAILED


      

Marco POLARSSL_ERR_RSA_VERIFY_FAILED

#define POLARSSL_ERR_RSA_VERIFY_FAILED MBEDTLS_ERR_RSA_VERIFY_FAILED


      

Marco POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE

#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE


      

Marco POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST

#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST


      

Marco POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY

#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY


      

Marco POLARSSL_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC

#define POLARSSL_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC


      

Marco POLARSSL_ERR_SSL_BAD_HS_CLIENT_HELLO

#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_HELLO MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO


      

Marco POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE

#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE


      

Marco POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS

#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS


      

Marco POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP

#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP


      

Marco POLARSSL_ERR_SSL_BAD_HS_FINISHED

#define POLARSSL_ERR_SSL_BAD_HS_FINISHED MBEDTLS_ERR_SSL_BAD_HS_FINISHED


      

Marco POLARSSL_ERR_SSL_BAD_HS_NEW_SESSION_TICKET

#define POLARSSL_ERR_SSL_BAD_HS_NEW_SESSION_TICKET MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET


      

Marco POLARSSL_ERR_SSL_BAD_HS_PROTOCOL_VERSION

#define POLARSSL_ERR_SSL_BAD_HS_PROTOCOL_VERSION MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION


      

Marco POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO

#define POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO


      

Marco POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO_DONE

#define POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO_DONE MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE


      

Marco POLARSSL_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE

#define POLARSSL_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE


      

Marco POLARSSL_ERR_SSL_BAD_INPUT_DATA

#define POLARSSL_ERR_SSL_BAD_INPUT_DATA MBEDTLS_ERR_SSL_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_SSL_BUFFER_TOO_SMALL

#define POLARSSL_ERR_SSL_BUFFER_TOO_SMALL MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL


      

Marco POLARSSL_ERR_SSL_CA_CHAIN_REQUIRED

#define POLARSSL_ERR_SSL_CA_CHAIN_REQUIRED MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED


      

Marco POLARSSL_ERR_SSL_CERTIFICATE_REQUIRED

#define POLARSSL_ERR_SSL_CERTIFICATE_REQUIRED MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED


      

Marco POLARSSL_ERR_SSL_CERTIFICATE_TOO_LARGE

#define POLARSSL_ERR_SSL_CERTIFICATE_TOO_LARGE MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE


      

Marco POLARSSL_ERR_SSL_COMPRESSION_FAILED

#define POLARSSL_ERR_SSL_COMPRESSION_FAILED MBEDTLS_ERR_SSL_COMPRESSION_FAILED


      

Marco POLARSSL_ERR_SSL_CONN_EOF

#define POLARSSL_ERR_SSL_CONN_EOF MBEDTLS_ERR_SSL_CONN_EOF


      

Marco POLARSSL_ERR_SSL_COUNTER_WRAPPING

#define POLARSSL_ERR_SSL_COUNTER_WRAPPING MBEDTLS_ERR_SSL_COUNTER_WRAPPING


      

Marco POLARSSL_ERR_SSL_FATAL_ALERT_MESSAGE

#define POLARSSL_ERR_SSL_FATAL_ALERT_MESSAGE MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE


      

Marco POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_SSL_HELLO_VERIFY_REQUIRED

#define POLARSSL_ERR_SSL_HELLO_VERIFY_REQUIRED MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED


      

Marco POLARSSL_ERR_SSL_HW_ACCEL_FAILED

#define POLARSSL_ERR_SSL_HW_ACCEL_FAILED MBEDTLS_ERR_SSL_HW_ACCEL_FAILED


      

Marco POLARSSL_ERR_SSL_HW_ACCEL_FALLTHROUGH

#define POLARSSL_ERR_SSL_HW_ACCEL_FALLTHROUGH MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH


      

Marco POLARSSL_ERR_SSL_INTERNAL_ERROR

#define POLARSSL_ERR_SSL_INTERNAL_ERROR MBEDTLS_ERR_SSL_INTERNAL_ERROR


      

Marco POLARSSL_ERR_SSL_INVALID_MAC

#define POLARSSL_ERR_SSL_INVALID_MAC MBEDTLS_ERR_SSL_INVALID_MAC


      

Marco POLARSSL_ERR_SSL_INVALID_RECORD

#define POLARSSL_ERR_SSL_INVALID_RECORD MBEDTLS_ERR_SSL_INVALID_RECORD


      

Marco POLARSSL_ERR_SSL_MALLOC_FAILED

#define POLARSSL_ERR_SSL_MALLOC_FAILED MBEDTLS_ERR_SSL_ALLOC_FAILED


      

Marco POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN

#define POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN


      

Marco POLARSSL_ERR_SSL_NO_CLIENT_CERTIFICATE

#define POLARSSL_ERR_SSL_NO_CLIENT_CERTIFICATE MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE


      

Marco POLARSSL_ERR_SSL_NO_RNG

#define POLARSSL_ERR_SSL_NO_RNG MBEDTLS_ERR_SSL_NO_RNG


      

Marco POLARSSL_ERR_SSL_NO_USABLE_CIPHERSUITE

#define POLARSSL_ERR_SSL_NO_USABLE_CIPHERSUITE MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE


      

Marco POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY

#define POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY


      

Marco POLARSSL_ERR_SSL_PEER_VERIFY_FAILED

#define POLARSSL_ERR_SSL_PEER_VERIFY_FAILED MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED


      

Marco POLARSSL_ERR_SSL_PK_TYPE_MISMATCH

#define POLARSSL_ERR_SSL_PK_TYPE_MISMATCH MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH


      

Marco POLARSSL_ERR_SSL_PRIVATE_KEY_REQUIRED

#define POLARSSL_ERR_SSL_PRIVATE_KEY_REQUIRED MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED


      

Marco POLARSSL_ERR_SSL_SESSION_TICKET_EXPIRED

#define POLARSSL_ERR_SSL_SESSION_TICKET_EXPIRED MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED


      

Marco POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE

#define POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE


      

Marco POLARSSL_ERR_SSL_UNKNOWN_CIPHER

#define POLARSSL_ERR_SSL_UNKNOWN_CIPHER MBEDTLS_ERR_SSL_UNKNOWN_CIPHER


      

Marco POLARSSL_ERR_SSL_UNKNOWN_IDENTITY

#define POLARSSL_ERR_SSL_UNKNOWN_IDENTITY MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY


      

Marco POLARSSL_ERR_SSL_WAITING_SERVER_HELLO_RENEGO

#define POLARSSL_ERR_SSL_WAITING_SERVER_HELLO_RENEGO MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO


      

Marco POLARSSL_ERR_THREADING_BAD_INPUT_DATA

#define POLARSSL_ERR_THREADING_BAD_INPUT_DATA MBEDTLS_ERR_THREADING_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_THREADING_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_THREADING_FEATURE_UNAVAILABLE MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_THREADING_MUTEX_ERROR

#define POLARSSL_ERR_THREADING_MUTEX_ERROR MBEDTLS_ERR_THREADING_MUTEX_ERROR


      

Marco POLARSSL_ERR_X509_BAD_INPUT_DATA

#define POLARSSL_ERR_X509_BAD_INPUT_DATA MBEDTLS_ERR_X509_BAD_INPUT_DATA


      

Marco POLARSSL_ERR_X509_CERT_UNKNOWN_FORMAT

#define POLARSSL_ERR_X509_CERT_UNKNOWN_FORMAT MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT


      

Marco POLARSSL_ERR_X509_CERT_VERIFY_FAILED

#define POLARSSL_ERR_X509_CERT_VERIFY_FAILED MBEDTLS_ERR_X509_CERT_VERIFY_FAILED


      

Marco POLARSSL_ERR_X509_FEATURE_UNAVAILABLE

#define POLARSSL_ERR_X509_FEATURE_UNAVAILABLE MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE


      

Marco POLARSSL_ERR_X509_FILE_IO_ERROR

#define POLARSSL_ERR_X509_FILE_IO_ERROR MBEDTLS_ERR_X509_FILE_IO_ERROR


      

Marco POLARSSL_ERR_X509_INVALID_ALG

#define POLARSSL_ERR_X509_INVALID_ALG MBEDTLS_ERR_X509_INVALID_ALG


      

Marco POLARSSL_ERR_X509_INVALID_DATE

#define POLARSSL_ERR_X509_INVALID_DATE MBEDTLS_ERR_X509_INVALID_DATE


      

Marco POLARSSL_ERR_X509_INVALID_EXTENSIONS

#define POLARSSL_ERR_X509_INVALID_EXTENSIONS MBEDTLS_ERR_X509_INVALID_EXTENSIONS


      

Marco POLARSSL_ERR_X509_INVALID_FORMAT

#define POLARSSL_ERR_X509_INVALID_FORMAT MBEDTLS_ERR_X509_INVALID_FORMAT


      

Marco POLARSSL_ERR_X509_INVALID_NAME

#define POLARSSL_ERR_X509_INVALID_NAME MBEDTLS_ERR_X509_INVALID_NAME


      

Marco POLARSSL_ERR_X509_INVALID_SERIAL

#define POLARSSL_ERR_X509_INVALID_SERIAL MBEDTLS_ERR_X509_INVALID_SERIAL


      

Marco POLARSSL_ERR_X509_INVALID_SIGNATURE

#define POLARSSL_ERR_X509_INVALID_SIGNATURE MBEDTLS_ERR_X509_INVALID_SIGNATURE


      

Marco POLARSSL_ERR_X509_INVALID_VERSION

#define POLARSSL_ERR_X509_INVALID_VERSION MBEDTLS_ERR_X509_INVALID_VERSION


      

Marco POLARSSL_ERR_X509_MALLOC_FAILED

#define POLARSSL_ERR_X509_MALLOC_FAILED MBEDTLS_ERR_X509_ALLOC_FAILED


      

Marco POLARSSL_ERR_X509_SIG_MISMATCH

#define POLARSSL_ERR_X509_SIG_MISMATCH MBEDTLS_ERR_X509_SIG_MISMATCH


      

Marco POLARSSL_ERR_X509_UNKNOWN_OID

#define POLARSSL_ERR_X509_UNKNOWN_OID MBEDTLS_ERR_X509_UNKNOWN_OID


      

Marco POLARSSL_ERR_X509_UNKNOWN_SIG_ALG

#define POLARSSL_ERR_X509_UNKNOWN_SIG_ALG MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG


      

Marco POLARSSL_ERR_X509_UNKNOWN_VERSION

#define POLARSSL_ERR_X509_UNKNOWN_VERSION MBEDTLS_ERR_X509_UNKNOWN_VERSION


      

Marco POLARSSL_ERR_XTEA_INVALID_INPUT_LENGTH

#define POLARSSL_ERR_XTEA_INVALID_INPUT_LENGTH MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH


      

Marco POLARSSL_GCM_H

#define POLARSSL_GCM_H MBEDTLS_GCM_H


      

Marco POLARSSL_HAVEGE_H

#define POLARSSL_HAVEGE_H MBEDTLS_HAVEGE_H


      

Marco POLARSSL_HAVE_INT32

#define POLARSSL_HAVE_INT32 MBEDTLS_HAVE_INT32


      

Marco POLARSSL_HAVE_INT64

#define POLARSSL_HAVE_INT64 MBEDTLS_HAVE_INT64


      

Marco POLARSSL_HAVE_UDBL

#define POLARSSL_HAVE_UDBL MBEDTLS_HAVE_UDBL


      

Marco POLARSSL_HAVE_X86

#define POLARSSL_HAVE_X86 MBEDTLS_HAVE_X86


      

Marco POLARSSL_HAVE_X86_64

#define POLARSSL_HAVE_X86_64 MBEDTLS_HAVE_X86_64


      

Marco POLARSSL_HMAC_DRBG_H

#define POLARSSL_HMAC_DRBG_H MBEDTLS_HMAC_DRBG_H


      

Marco POLARSSL_HMAC_DRBG_PR_OFF

#define POLARSSL_HMAC_DRBG_PR_OFF MBEDTLS_HMAC_DRBG_PR_OFF


      

Marco POLARSSL_HMAC_DRBG_PR_ON

#define POLARSSL_HMAC_DRBG_PR_ON MBEDTLS_HMAC_DRBG_PR_ON


      

Marco POLARSSL_KEY_EXCHANGE_DHE_PSK

#define POLARSSL_KEY_EXCHANGE_DHE_PSK MBEDTLS_KEY_EXCHANGE_DHE_PSK


      

Marco POLARSSL_KEY_EXCHANGE_DHE_RSA

#define POLARSSL_KEY_EXCHANGE_DHE_RSA MBEDTLS_KEY_EXCHANGE_DHE_RSA


      

Marco POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA

#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA


      

Marco POLARSSL_KEY_EXCHANGE_ECDHE_PSK

#define POLARSSL_KEY_EXCHANGE_ECDHE_PSK MBEDTLS_KEY_EXCHANGE_ECDHE_PSK


      

Marco POLARSSL_KEY_EXCHANGE_ECDHE_RSA

#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA MBEDTLS_KEY_EXCHANGE_ECDHE_RSA


      

Marco POLARSSL_KEY_EXCHANGE_ECDH_ECDSA

#define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA


      

Marco POLARSSL_KEY_EXCHANGE_ECDH_RSA

#define POLARSSL_KEY_EXCHANGE_ECDH_RSA MBEDTLS_KEY_EXCHANGE_ECDH_RSA


      

Marco POLARSSL_KEY_EXCHANGE_NONE

#define POLARSSL_KEY_EXCHANGE_NONE MBEDTLS_KEY_EXCHANGE_NONE


      

Marco POLARSSL_KEY_EXCHANGE_PSK

#define POLARSSL_KEY_EXCHANGE_PSK MBEDTLS_KEY_EXCHANGE_PSK


      

Marco POLARSSL_KEY_EXCHANGE_RSA

#define POLARSSL_KEY_EXCHANGE_RSA MBEDTLS_KEY_EXCHANGE_RSA


      

Marco POLARSSL_KEY_EXCHANGE_RSA_PSK

#define POLARSSL_KEY_EXCHANGE_RSA_PSK MBEDTLS_KEY_EXCHANGE_RSA_PSK


      

Marco POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED

#define POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED

#define POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED


      

Marco POLARSSL_KEY_EXCHANGE__WITH_CERT__ENABLED

#define POLARSSL_KEY_EXCHANGE__WITH_CERT__ENABLED MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED


      

Marco POLARSSL_KEY_LENGTH_DES

#define POLARSSL_KEY_LENGTH_DES MBEDTLS_KEY_LENGTH_DES


      

Marco POLARSSL_KEY_LENGTH_DES_EDE

#define POLARSSL_KEY_LENGTH_DES_EDE MBEDTLS_KEY_LENGTH_DES_EDE


      

Marco POLARSSL_KEY_LENGTH_DES_EDE3

#define POLARSSL_KEY_LENGTH_DES_EDE3 MBEDTLS_KEY_LENGTH_DES_EDE3


      

Marco POLARSSL_KEY_LENGTH_NONE

#define POLARSSL_KEY_LENGTH_NONE MBEDTLS_KEY_LENGTH_NONE


      

Marco POLARSSL_MAX_BLOCK_LENGTH

#define POLARSSL_MAX_BLOCK_LENGTH MBEDTLS_MAX_BLOCK_LENGTH


      

Marco POLARSSL_MAX_IV_LENGTH

#define POLARSSL_MAX_IV_LENGTH MBEDTLS_MAX_IV_LENGTH


      

Marco POLARSSL_MD2_H

#define POLARSSL_MD2_H MBEDTLS_MD2_H


      

Marco POLARSSL_MD4_H

#define POLARSSL_MD4_H MBEDTLS_MD4_H


      

Marco POLARSSL_MD5_H

#define POLARSSL_MD5_H MBEDTLS_MD5_H


      

Marco POLARSSL_MD_H

#define POLARSSL_MD_H MBEDTLS_MD_H


      

Marco POLARSSL_MD_MAX_SIZE

#define POLARSSL_MD_MAX_SIZE MBEDTLS_MD_MAX_SIZE


      

Marco POLARSSL_MD_MD2

#define POLARSSL_MD_MD2 MBEDTLS_MD_MD2


      

Marco POLARSSL_MD_MD4

#define POLARSSL_MD_MD4 MBEDTLS_MD_MD4


      

Marco POLARSSL_MD_MD5

#define POLARSSL_MD_MD5 MBEDTLS_MD_MD5


      

Marco POLARSSL_MD_NONE

#define POLARSSL_MD_NONE MBEDTLS_MD_NONE


      

Marco POLARSSL_MD_RIPEMD160

#define POLARSSL_MD_RIPEMD160 MBEDTLS_MD_RIPEMD160


      

Marco POLARSSL_MD_SHA1

#define POLARSSL_MD_SHA1 MBEDTLS_MD_SHA1


      

Marco POLARSSL_MD_SHA224

#define POLARSSL_MD_SHA224 MBEDTLS_MD_SHA224


      

Marco POLARSSL_MD_SHA256

#define POLARSSL_MD_SHA256 MBEDTLS_MD_SHA256


      

Marco POLARSSL_MD_SHA384

#define POLARSSL_MD_SHA384 MBEDTLS_MD_SHA384


      

Marco POLARSSL_MD_SHA512

#define POLARSSL_MD_SHA512 MBEDTLS_MD_SHA512


      

Marco POLARSSL_MD_WRAP_H

#define POLARSSL_MD_WRAP_H MBEDTLS_MD_WRAP_H


      

Marco POLARSSL_MEMORY_BUFFER_ALLOC_H

#define POLARSSL_MEMORY_BUFFER_ALLOC_H MBEDTLS_MEMORY_BUFFER_ALLOC_H


      

Marco POLARSSL_MODE_CBC

#define POLARSSL_MODE_CBC MBEDTLS_MODE_CBC


      

Marco POLARSSL_MODE_CCM

#define POLARSSL_MODE_CCM MBEDTLS_MODE_CCM


      

Marco POLARSSL_MODE_CFB

#define POLARSSL_MODE_CFB MBEDTLS_MODE_CFB


      

Marco POLARSSL_MODE_CTR

#define POLARSSL_MODE_CTR MBEDTLS_MODE_CTR


      

Marco POLARSSL_MODE_ECB

#define POLARSSL_MODE_ECB MBEDTLS_MODE_ECB


      

Marco POLARSSL_MODE_GCM

#define POLARSSL_MODE_GCM MBEDTLS_MODE_GCM


      

Marco POLARSSL_MODE_NONE

#define POLARSSL_MODE_NONE MBEDTLS_MODE_NONE


      

Marco POLARSSL_MODE_OFB

#define POLARSSL_MODE_OFB MBEDTLS_MODE_OFB


      

Marco POLARSSL_MODE_STREAM

#define POLARSSL_MODE_STREAM MBEDTLS_MODE_STREAM


      

Marco POLARSSL_MPI_MAX_BITS

#define POLARSSL_MPI_MAX_BITS MBEDTLS_MPI_MAX_BITS


      

Marco POLARSSL_MPI_MAX_BITS_SCALE100

#define POLARSSL_MPI_MAX_BITS_SCALE100 MBEDTLS_MPI_MAX_BITS_SCALE100


      

Marco POLARSSL_MPI_MAX_LIMBS

#define POLARSSL_MPI_MAX_LIMBS MBEDTLS_MPI_MAX_LIMBS


      

Marco POLARSSL_MPI_RW_BUFFER_SIZE

#define POLARSSL_MPI_RW_BUFFER_SIZE MBEDTLS_MPI_RW_BUFFER_SIZE


      

Marco POLARSSL_NET_H

#define POLARSSL_NET_H MBEDTLS_NET_SOCKETS_H


      

Marco POLARSSL_NET_LISTEN_BACKLOG

#define POLARSSL_NET_LISTEN_BACKLOG MBEDTLS_NET_LISTEN_BACKLOG


      

Marco POLARSSL_OID_H

#define POLARSSL_OID_H MBEDTLS_OID_H


      

Marco POLARSSL_OPERATION_NONE

#define POLARSSL_OPERATION_NONE MBEDTLS_OPERATION_NONE


      

Marco POLARSSL_PADDING_NONE

#define POLARSSL_PADDING_NONE MBEDTLS_PADDING_NONE


      

Marco POLARSSL_PADDING_ONE_AND_ZEROS

#define POLARSSL_PADDING_ONE_AND_ZEROS MBEDTLS_PADDING_ONE_AND_ZEROS


      

Marco POLARSSL_PADDING_PKCS7

#define POLARSSL_PADDING_PKCS7 MBEDTLS_PADDING_PKCS7


      

Marco POLARSSL_PADDING_ZEROS

#define POLARSSL_PADDING_ZEROS MBEDTLS_PADDING_ZEROS


      

Marco POLARSSL_PADDING_ZEROS_AND_LEN

#define POLARSSL_PADDING_ZEROS_AND_LEN MBEDTLS_PADDING_ZEROS_AND_LEN


      

Marco POLARSSL_PADLOCK_H

#define POLARSSL_PADLOCK_H MBEDTLS_PADLOCK_H


      

Marco POLARSSL_PEM_H

#define POLARSSL_PEM_H MBEDTLS_PEM_H


      

Marco POLARSSL_PKCS11_H

#define POLARSSL_PKCS11_H MBEDTLS_PKCS11_H


      

Marco POLARSSL_PKCS12_H

#define POLARSSL_PKCS12_H MBEDTLS_PKCS12_H


      

Marco POLARSSL_PKCS5_H

#define POLARSSL_PKCS5_H MBEDTLS_PKCS5_H


      

Marco POLARSSL_PK_DEBUG_ECP

#define POLARSSL_PK_DEBUG_ECP MBEDTLS_PK_DEBUG_ECP


      

Marco POLARSSL_PK_DEBUG_MAX_ITEMS

#define POLARSSL_PK_DEBUG_MAX_ITEMS MBEDTLS_PK_DEBUG_MAX_ITEMS


      

Marco POLARSSL_PK_DEBUG_MPI

#define POLARSSL_PK_DEBUG_MPI MBEDTLS_PK_DEBUG_MPI


      

Marco POLARSSL_PK_DEBUG_NONE

#define POLARSSL_PK_DEBUG_NONE MBEDTLS_PK_DEBUG_NONE


      

Marco POLARSSL_PK_ECDSA

#define POLARSSL_PK_ECDSA MBEDTLS_PK_ECDSA


      

Marco POLARSSL_PK_ECKEY

#define POLARSSL_PK_ECKEY MBEDTLS_PK_ECKEY


      

Marco POLARSSL_PK_ECKEY_DH

#define POLARSSL_PK_ECKEY_DH MBEDTLS_PK_ECKEY_DH


      

Marco POLARSSL_PK_H

#define POLARSSL_PK_H MBEDTLS_PK_H


      

Marco POLARSSL_PK_NONE

#define POLARSSL_PK_NONE MBEDTLS_PK_NONE


      

Marco POLARSSL_PK_RSA

#define POLARSSL_PK_RSA MBEDTLS_PK_RSA


      

Marco POLARSSL_PK_RSASSA_PSS

#define POLARSSL_PK_RSASSA_PSS MBEDTLS_PK_RSASSA_PSS


      

Marco POLARSSL_PK_RSA_ALT

#define POLARSSL_PK_RSA_ALT MBEDTLS_PK_RSA_ALT


      

Marco POLARSSL_PK_WRAP_H

#define POLARSSL_PK_WRAP_H MBEDTLS_PK_WRAP_H


      

Marco POLARSSL_PLATFORM_H

#define POLARSSL_PLATFORM_H MBEDTLS_PLATFORM_H


      

Marco POLARSSL_PREMASTER_SIZE

#define POLARSSL_PREMASTER_SIZE MBEDTLS_PREMASTER_SIZE


      

Marco POLARSSL_RIPEMD160_H

#define POLARSSL_RIPEMD160_H MBEDTLS_RIPEMD160_H


      

Marco POLARSSL_RSA_H

#define POLARSSL_RSA_H MBEDTLS_RSA_H


      

Marco POLARSSL_SHA1_H

#define POLARSSL_SHA1_H MBEDTLS_SHA1_H


      

Marco POLARSSL_SHA256_H

#define POLARSSL_SHA256_H MBEDTLS_SHA256_H


      

Marco POLARSSL_SHA512_H

#define POLARSSL_SHA512_H MBEDTLS_SHA512_H


      

Marco POLARSSL_SSL_CACHE_H

#define POLARSSL_SSL_CACHE_H MBEDTLS_SSL_CACHE_H


      

Marco POLARSSL_SSL_CIPHERSUITES_H

#define POLARSSL_SSL_CIPHERSUITES_H MBEDTLS_SSL_CIPHERSUITES_H


      
      
#define POLARSSL_SSL_COOKIE_H MBEDTLS_SSL_COOKIE_H


      

Marco POLARSSL_SSL_H

#define POLARSSL_SSL_H MBEDTLS_SSL_H


      

Marco POLARSSL_THREADING_H

#define POLARSSL_THREADING_H MBEDTLS_THREADING_H


      

Marco POLARSSL_THREADING_IMPL

#define POLARSSL_THREADING_IMPL MBEDTLS_THREADING_IMPL


      

Marco POLARSSL_TIMING_H

#define POLARSSL_TIMING_H MBEDTLS_TIMING_H


      

Marco POLARSSL_VERSION_H

#define POLARSSL_VERSION_H MBEDTLS_VERSION_H


      

Marco POLARSSL_VERSION_MAJOR

#define POLARSSL_VERSION_MAJOR MBEDTLS_VERSION_MAJOR


      

Marco POLARSSL_VERSION_MINOR

#define POLARSSL_VERSION_MINOR MBEDTLS_VERSION_MINOR


      

Marco POLARSSL_VERSION_NUMBER

#define POLARSSL_VERSION_NUMBER MBEDTLS_VERSION_NUMBER


      

Marco POLARSSL_VERSION_PATCH

#define POLARSSL_VERSION_PATCH MBEDTLS_VERSION_PATCH


      

Marco POLARSSL_VERSION_STRING

#define POLARSSL_VERSION_STRING MBEDTLS_VERSION_STRING


      

Marco POLARSSL_VERSION_STRING_FULL

#define POLARSSL_VERSION_STRING_FULL MBEDTLS_VERSION_STRING_FULL


      

Marco POLARSSL_X509_CRL_H

#define POLARSSL_X509_CRL_H MBEDTLS_X509_CRL_H


      

Marco POLARSSL_X509_CRT_H

#define POLARSSL_X509_CRT_H MBEDTLS_X509_CRT_H


      

Marco POLARSSL_X509_CSR_H

#define POLARSSL_X509_CSR_H MBEDTLS_X509_CSR_H


      

Marco POLARSSL_X509_H

#define POLARSSL_X509_H MBEDTLS_X509_H


      

Marco POLARSSL_XTEA_H

#define POLARSSL_XTEA_H MBEDTLS_XTEA_H


      

Marco RSA_CRYPT

#define RSA_CRYPT MBEDTLS_RSA_CRYPT


      

Marco RSA_PKCS_V15

#define RSA_PKCS_V15 MBEDTLS_RSA_PKCS_V15


      

Marco RSA_PKCS_V21

#define RSA_PKCS_V21 MBEDTLS_RSA_PKCS_V21


      

Marco RSA_PRIVATE

#define RSA_PRIVATE MBEDTLS_RSA_PRIVATE


      

Marco RSA_PUBLIC

#define RSA_PUBLIC MBEDTLS_RSA_PUBLIC


      

Marco RSA_SALT_LEN_ANY

#define RSA_SALT_LEN_ANY MBEDTLS_RSA_SALT_LEN_ANY


      

Marco RSA_SIGN

#define RSA_SIGN MBEDTLS_RSA_SIGN


      

Marco SSL_ALERT_LEVEL_FATAL

#define SSL_ALERT_LEVEL_FATAL MBEDTLS_SSL_ALERT_LEVEL_FATAL


      

Marco SSL_ALERT_LEVEL_WARNING

#define SSL_ALERT_LEVEL_WARNING MBEDTLS_SSL_ALERT_LEVEL_WARNING


      

Marco SSL_ALERT_MSG_ACCESS_DENIED

#define SSL_ALERT_MSG_ACCESS_DENIED MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED


      

Marco SSL_ALERT_MSG_BAD_CERT

#define SSL_ALERT_MSG_BAD_CERT MBEDTLS_SSL_ALERT_MSG_BAD_CERT


      

Marco SSL_ALERT_MSG_BAD_RECORD_MAC

#define SSL_ALERT_MSG_BAD_RECORD_MAC MBEDTLS_SSL_ALERT_MSG_BAD_RECORD_MAC


      

Marco SSL_ALERT_MSG_CERT_EXPIRED

#define SSL_ALERT_MSG_CERT_EXPIRED MBEDTLS_SSL_ALERT_MSG_CERT_EXPIRED


      

Marco SSL_ALERT_MSG_CERT_REVOKED

#define SSL_ALERT_MSG_CERT_REVOKED MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED


      

Marco SSL_ALERT_MSG_CERT_UNKNOWN

#define SSL_ALERT_MSG_CERT_UNKNOWN MBEDTLS_SSL_ALERT_MSG_CERT_UNKNOWN


      

Marco SSL_ALERT_MSG_CLOSE_NOTIFY

#define SSL_ALERT_MSG_CLOSE_NOTIFY MBEDTLS_SSL_ALERT_MSG_CLOSE_NOTIFY


      

Marco SSL_ALERT_MSG_DECODE_ERROR

#define SSL_ALERT_MSG_DECODE_ERROR MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR


      

Marco SSL_ALERT_MSG_DECOMPRESSION_FAILURE

#define SSL_ALERT_MSG_DECOMPRESSION_FAILURE MBEDTLS_SSL_ALERT_MSG_DECOMPRESSION_FAILURE


      

Marco SSL_ALERT_MSG_DECRYPTION_FAILED

#define SSL_ALERT_MSG_DECRYPTION_FAILED MBEDTLS_SSL_ALERT_MSG_DECRYPTION_FAILED


      

Marco SSL_ALERT_MSG_DECRYPT_ERROR

#define SSL_ALERT_MSG_DECRYPT_ERROR MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR


      

Marco SSL_ALERT_MSG_EXPORT_RESTRICTION

#define SSL_ALERT_MSG_EXPORT_RESTRICTION MBEDTLS_SSL_ALERT_MSG_EXPORT_RESTRICTION


      

Marco SSL_ALERT_MSG_HANDSHAKE_FAILURE

#define SSL_ALERT_MSG_HANDSHAKE_FAILURE MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE


      

Marco SSL_ALERT_MSG_ILLEGAL_PARAMETER

#define SSL_ALERT_MSG_ILLEGAL_PARAMETER MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER


      

Marco SSL_ALERT_MSG_INAPROPRIATE_FALLBACK

#define SSL_ALERT_MSG_INAPROPRIATE_FALLBACK MBEDTLS_SSL_ALERT_MSG_INAPROPRIATE_FALLBACK


      

Marco SSL_ALERT_MSG_INSUFFICIENT_SECURITY

#define SSL_ALERT_MSG_INSUFFICIENT_SECURITY MBEDTLS_SSL_ALERT_MSG_INSUFFICIENT_SECURITY


      

Marco SSL_ALERT_MSG_INTERNAL_ERROR

#define SSL_ALERT_MSG_INTERNAL_ERROR MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR


      

Marco SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL

#define SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL


      

Marco SSL_ALERT_MSG_NO_CERT

#define SSL_ALERT_MSG_NO_CERT MBEDTLS_SSL_ALERT_MSG_NO_CERT


      

Marco SSL_ALERT_MSG_NO_RENEGOTIATION

#define SSL_ALERT_MSG_NO_RENEGOTIATION MBEDTLS_SSL_ALERT_MSG_NO_RENEGOTIATION


      

Marco SSL_ALERT_MSG_PROTOCOL_VERSION

#define SSL_ALERT_MSG_PROTOCOL_VERSION MBEDTLS_SSL_ALERT_MSG_PROTOCOL_VERSION


      

Marco SSL_ALERT_MSG_RECORD_OVERFLOW

#define SSL_ALERT_MSG_RECORD_OVERFLOW MBEDTLS_SSL_ALERT_MSG_RECORD_OVERFLOW


      

Marco SSL_ALERT_MSG_UNEXPECTED_MESSAGE

#define SSL_ALERT_MSG_UNEXPECTED_MESSAGE MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE


      

Marco SSL_ALERT_MSG_UNKNOWN_CA

#define SSL_ALERT_MSG_UNKNOWN_CA MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA


      

Marco SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY

#define SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY MBEDTLS_SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY


      

Marco SSL_ALERT_MSG_UNRECOGNIZED_NAME

#define SSL_ALERT_MSG_UNRECOGNIZED_NAME MBEDTLS_SSL_ALERT_MSG_UNRECOGNIZED_NAME


      

Marco SSL_ALERT_MSG_UNSUPPORTED_CERT

#define SSL_ALERT_MSG_UNSUPPORTED_CERT MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT


      

Marco SSL_ALERT_MSG_UNSUPPORTED_EXT

#define SSL_ALERT_MSG_UNSUPPORTED_EXT MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT


      

Marco SSL_ALERT_MSG_USER_CANCELED

#define SSL_ALERT_MSG_USER_CANCELED MBEDTLS_SSL_ALERT_MSG_USER_CANCELED


      

Marco SSL_ANTI_REPLAY_DISABLED

#define SSL_ANTI_REPLAY_DISABLED MBEDTLS_SSL_ANTI_REPLAY_DISABLED


      

Marco SSL_ANTI_REPLAY_ENABLED

#define SSL_ANTI_REPLAY_ENABLED MBEDTLS_SSL_ANTI_REPLAY_ENABLED


      

Marco SSL_ARC4_DISABLED

#define SSL_ARC4_DISABLED MBEDTLS_SSL_ARC4_DISABLED


      

Marco SSL_ARC4_ENABLED

#define SSL_ARC4_ENABLED MBEDTLS_SSL_ARC4_ENABLED


      

Marco SSL_BUFFER_LEN

#define SSL_BUFFER_LEN ( ( ( MBEDTLS_SSL_IN_BUFFER_LEN ) < ( MBEDTLS_SSL_OUT_BUFFER_LEN ) ) \
                        ? ( MBEDTLS_SSL_IN_BUFFER_LEN ) : ( MBEDTLS_SSL_OUT_BUFFER_LEN ) )


      

Marco SSL_CACHE_DEFAULT_MAX_ENTRIES

#define SSL_CACHE_DEFAULT_MAX_ENTRIES MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES


      

Marco SSL_CACHE_DEFAULT_TIMEOUT

#define SSL_CACHE_DEFAULT_TIMEOUT MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT


      

Marco SSL_CBC_RECORD_SPLITTING_DISABLED

#define SSL_CBC_RECORD_SPLITTING_DISABLED MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED


      

Marco SSL_CBC_RECORD_SPLITTING_ENABLED

#define SSL_CBC_RECORD_SPLITTING_ENABLED MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED


      

Marco SSL_CERTIFICATE_REQUEST

#define SSL_CERTIFICATE_REQUEST MBEDTLS_SSL_CERTIFICATE_REQUEST


      

Marco SSL_CERTIFICATE_VERIFY

#define SSL_CERTIFICATE_VERIFY MBEDTLS_SSL_CERTIFICATE_VERIFY


      

Marco SSL_CERT_TYPE_ECDSA_SIGN

#define SSL_CERT_TYPE_ECDSA_SIGN MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN


      

Marco SSL_CERT_TYPE_RSA_SIGN

#define SSL_CERT_TYPE_RSA_SIGN MBEDTLS_SSL_CERT_TYPE_RSA_SIGN


      

Marco SSL_CHANNEL_INBOUND

#define SSL_CHANNEL_INBOUND MBEDTLS_SSL_CHANNEL_INBOUND


      

Marco SSL_CHANNEL_OUTBOUND

#define SSL_CHANNEL_OUTBOUND MBEDTLS_SSL_CHANNEL_OUTBOUND


      

Marco SSL_CIPHERSUITES

#define SSL_CIPHERSUITES MBEDTLS_SSL_CIPHERSUITES


      

Marco SSL_CLIENT_CERTIFICATE

#define SSL_CLIENT_CERTIFICATE MBEDTLS_SSL_CLIENT_CERTIFICATE


      

Marco SSL_CLIENT_CHANGE_CIPHER_SPEC

#define SSL_CLIENT_CHANGE_CIPHER_SPEC MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC


      

Marco SSL_CLIENT_FINISHED

#define SSL_CLIENT_FINISHED MBEDTLS_SSL_CLIENT_FINISHED


      

Marco SSL_CLIENT_HELLO

#define SSL_CLIENT_HELLO MBEDTLS_SSL_CLIENT_HELLO


      

Marco SSL_CLIENT_KEY_EXCHANGE

#define SSL_CLIENT_KEY_EXCHANGE MBEDTLS_SSL_CLIENT_KEY_EXCHANGE


      

Marco SSL_COMPRESSION_ADD

#define SSL_COMPRESSION_ADD MBEDTLS_SSL_COMPRESSION_ADD


      

Marco SSL_COMPRESS_DEFLATE

#define SSL_COMPRESS_DEFLATE MBEDTLS_SSL_COMPRESS_DEFLATE


      

Marco SSL_COMPRESS_NULL

#define SSL_COMPRESS_NULL MBEDTLS_SSL_COMPRESS_NULL


      

Marco SSL_DEBUG_BUF

#define SSL_DEBUG_BUF MBEDTLS_SSL_DEBUG_BUF


      

Marco SSL_DEBUG_CRT

#define SSL_DEBUG_CRT MBEDTLS_SSL_DEBUG_CRT


      

Marco SSL_DEBUG_ECP

#define SSL_DEBUG_ECP MBEDTLS_SSL_DEBUG_ECP


      

Marco SSL_DEBUG_MPI

#define SSL_DEBUG_MPI MBEDTLS_SSL_DEBUG_MPI


      

Marco SSL_DEBUG_MSG

#define SSL_DEBUG_MSG MBEDTLS_SSL_DEBUG_MSG


      

Marco SSL_DEBUG_RET

#define SSL_DEBUG_RET MBEDTLS_SSL_DEBUG_RET


      

Marco SSL_DEFAULT_TICKET_LIFETIME

#define SSL_DEFAULT_TICKET_LIFETIME MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME


      

Marco SSL_DTLS_TIMEOUT_DFL_MAX

#define SSL_DTLS_TIMEOUT_DFL_MAX MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MAX


      

Marco SSL_DTLS_TIMEOUT_DFL_MIN

#define SSL_DTLS_TIMEOUT_DFL_MIN MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MIN


      

Marco SSL_EMPTY_RENEGOTIATION_INFO

#define SSL_EMPTY_RENEGOTIATION_INFO MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO


      

Marco SSL_ETM_DISABLED

#define SSL_ETM_DISABLED MBEDTLS_SSL_ETM_DISABLED


      

Marco SSL_ETM_ENABLED

#define SSL_ETM_ENABLED MBEDTLS_SSL_ETM_ENABLED


      

Marco SSL_EXTENDED_MS_DISABLED

#define SSL_EXTENDED_MS_DISABLED MBEDTLS_SSL_EXTENDED_MS_DISABLED


      

Marco SSL_EXTENDED_MS_ENABLED

#define SSL_EXTENDED_MS_ENABLED MBEDTLS_SSL_EXTENDED_MS_ENABLED


      

Marco SSL_FALLBACK_SCSV

#define SSL_FALLBACK_SCSV MBEDTLS_SSL_FALLBACK_SCSV


      

Marco SSL_FLUSH_BUFFERS

#define SSL_FLUSH_BUFFERS MBEDTLS_SSL_FLUSH_BUFFERS


      

Marco SSL_HANDSHAKE_OVER

#define SSL_HANDSHAKE_OVER MBEDTLS_SSL_HANDSHAKE_OVER


      

Marco SSL_HANDSHAKE_WRAPUP

#define SSL_HANDSHAKE_WRAPUP MBEDTLS_SSL_HANDSHAKE_WRAPUP


      

Marco SSL_HASH_MD5

#define SSL_HASH_MD5 MBEDTLS_SSL_HASH_MD5


      

Marco SSL_HASH_NONE

#define SSL_HASH_NONE MBEDTLS_SSL_HASH_NONE


      

Marco SSL_HASH_SHA1

#define SSL_HASH_SHA1 MBEDTLS_SSL_HASH_SHA1


      

Marco SSL_HASH_SHA224

#define SSL_HASH_SHA224 MBEDTLS_SSL_HASH_SHA224


      

Marco SSL_HASH_SHA256

#define SSL_HASH_SHA256 MBEDTLS_SSL_HASH_SHA256


      

Marco SSL_HASH_SHA384

#define SSL_HASH_SHA384 MBEDTLS_SSL_HASH_SHA384


      

Marco SSL_HASH_SHA512

#define SSL_HASH_SHA512 MBEDTLS_SSL_HASH_SHA512


      

Marco SSL_HELLO_REQUEST

#define SSL_HELLO_REQUEST MBEDTLS_SSL_HELLO_REQUEST


      

Marco SSL_HS_CERTIFICATE

#define SSL_HS_CERTIFICATE MBEDTLS_SSL_HS_CERTIFICATE


      

Marco SSL_HS_CERTIFICATE_REQUEST

#define SSL_HS_CERTIFICATE_REQUEST MBEDTLS_SSL_HS_CERTIFICATE_REQUEST


      

Marco SSL_HS_CERTIFICATE_VERIFY

#define SSL_HS_CERTIFICATE_VERIFY MBEDTLS_SSL_HS_CERTIFICATE_VERIFY


      

Marco SSL_HS_CLIENT_HELLO

#define SSL_HS_CLIENT_HELLO MBEDTLS_SSL_HS_CLIENT_HELLO


      

Marco SSL_HS_CLIENT_KEY_EXCHANGE

#define SSL_HS_CLIENT_KEY_EXCHANGE MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE


      

Marco SSL_HS_FINISHED

#define SSL_HS_FINISHED MBEDTLS_SSL_HS_FINISHED


      

Marco SSL_HS_HELLO_REQUEST

#define SSL_HS_HELLO_REQUEST MBEDTLS_SSL_HS_HELLO_REQUEST


      

Marco SSL_HS_HELLO_VERIFY_REQUEST

#define SSL_HS_HELLO_VERIFY_REQUEST MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST


      

Marco SSL_HS_NEW_SESSION_TICKET

#define SSL_HS_NEW_SESSION_TICKET MBEDTLS_SSL_HS_NEW_SESSION_TICKET


      

Marco SSL_HS_SERVER_HELLO

#define SSL_HS_SERVER_HELLO MBEDTLS_SSL_HS_SERVER_HELLO


      

Marco SSL_HS_SERVER_HELLO_DONE

#define SSL_HS_SERVER_HELLO_DONE MBEDTLS_SSL_HS_SERVER_HELLO_DONE


      

Marco SSL_HS_SERVER_KEY_EXCHANGE

#define SSL_HS_SERVER_KEY_EXCHANGE MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE


      

Marco SSL_INITIAL_HANDSHAKE

#define SSL_INITIAL_HANDSHAKE MBEDTLS_SSL_INITIAL_HANDSHAKE


      

Marco SSL_IS_CLIENT

#define SSL_IS_CLIENT MBEDTLS_SSL_IS_CLIENT


      

Marco SSL_IS_FALLBACK

#define SSL_IS_FALLBACK MBEDTLS_SSL_IS_FALLBACK


      

Marco SSL_IS_NOT_FALLBACK

#define SSL_IS_NOT_FALLBACK MBEDTLS_SSL_IS_NOT_FALLBACK


      

Marco SSL_IS_SERVER

#define SSL_IS_SERVER MBEDTLS_SSL_IS_SERVER


      

Marco SSL_LEGACY_ALLOW_RENEGOTIATION

#define SSL_LEGACY_ALLOW_RENEGOTIATION MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION


      

Marco SSL_LEGACY_BREAK_HANDSHAKE

#define SSL_LEGACY_BREAK_HANDSHAKE MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE


      

Marco SSL_LEGACY_NO_RENEGOTIATION

#define SSL_LEGACY_NO_RENEGOTIATION MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION


      

Marco SSL_LEGACY_RENEGOTIATION

#define SSL_LEGACY_RENEGOTIATION MBEDTLS_SSL_LEGACY_RENEGOTIATION


      

Marco SSL_MAC_ADD

#define SSL_MAC_ADD MBEDTLS_SSL_MAC_ADD


      

Marco SSL_MAJOR_VERSION_3

#define SSL_MAJOR_VERSION_3 MBEDTLS_SSL_MAJOR_VERSION_3


      

Marco SSL_MAX_CONTENT_LEN

#define SSL_MAX_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN


      

Marco SSL_MAX_FRAG_LEN_1024

#define SSL_MAX_FRAG_LEN_1024 MBEDTLS_SSL_MAX_FRAG_LEN_1024


      

Marco SSL_MAX_FRAG_LEN_2048

#define SSL_MAX_FRAG_LEN_2048 MBEDTLS_SSL_MAX_FRAG_LEN_2048


      

Marco SSL_MAX_FRAG_LEN_4096

#define SSL_MAX_FRAG_LEN_4096 MBEDTLS_SSL_MAX_FRAG_LEN_4096


      

Marco SSL_MAX_FRAG_LEN_512

#define SSL_MAX_FRAG_LEN_512 MBEDTLS_SSL_MAX_FRAG_LEN_512


      

Marco SSL_MAX_FRAG_LEN_INVALID

#define SSL_MAX_FRAG_LEN_INVALID MBEDTLS_SSL_MAX_FRAG_LEN_INVALID


      

Marco SSL_MAX_FRAG_LEN_NONE

#define SSL_MAX_FRAG_LEN_NONE MBEDTLS_SSL_MAX_FRAG_LEN_NONE


      

Marco SSL_MAX_MAJOR_VERSION

#define SSL_MAX_MAJOR_VERSION MBEDTLS_SSL_MAX_MAJOR_VERSION


      

Marco SSL_MAX_MINOR_VERSION

#define SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MAX_MINOR_VERSION


      

Marco SSL_MINOR_VERSION_0

#define SSL_MINOR_VERSION_0 MBEDTLS_SSL_MINOR_VERSION_0


      

Marco SSL_MINOR_VERSION_1

#define SSL_MINOR_VERSION_1 MBEDTLS_SSL_MINOR_VERSION_1


      

Marco SSL_MINOR_VERSION_2

#define SSL_MINOR_VERSION_2 MBEDTLS_SSL_MINOR_VERSION_2


      

Marco SSL_MINOR_VERSION_3

#define SSL_MINOR_VERSION_3 MBEDTLS_SSL_MINOR_VERSION_3


      

Marco SSL_MIN_MAJOR_VERSION

#define SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MIN_MAJOR_VERSION


      

Marco SSL_MIN_MINOR_VERSION

#define SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MIN_MINOR_VERSION


      

Marco SSL_MSG_ALERT

#define SSL_MSG_ALERT MBEDTLS_SSL_MSG_ALERT


      

Marco SSL_MSG_APPLICATION_DATA

#define SSL_MSG_APPLICATION_DATA MBEDTLS_SSL_MSG_APPLICATION_DATA


      

Marco SSL_MSG_CHANGE_CIPHER_SPEC

#define SSL_MSG_CHANGE_CIPHER_SPEC MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC


      

Marco SSL_MSG_HANDSHAKE

#define SSL_MSG_HANDSHAKE MBEDTLS_SSL_MSG_HANDSHAKE


      

Marco SSL_PADDING_ADD

#define SSL_PADDING_ADD MBEDTLS_SSL_PADDING_ADD


      

Marco SSL_RENEGOTIATION

#define SSL_RENEGOTIATION MBEDTLS_SSL_RENEGOTIATION


      

Marco SSL_RENEGOTIATION_DISABLED

#define SSL_RENEGOTIATION_DISABLED MBEDTLS_SSL_RENEGOTIATION_DISABLED


      

Marco SSL_RENEGOTIATION_DONE

#define SSL_RENEGOTIATION_DONE MBEDTLS_SSL_RENEGOTIATION_DONE


      

Marco SSL_RENEGOTIATION_ENABLED

#define SSL_RENEGOTIATION_ENABLED MBEDTLS_SSL_RENEGOTIATION_ENABLED


      

Marco SSL_RENEGOTIATION_NOT_ENFORCED

#define SSL_RENEGOTIATION_NOT_ENFORCED MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED


      

Marco SSL_RENEGOTIATION_PENDING

#define SSL_RENEGOTIATION_PENDING MBEDTLS_SSL_RENEGOTIATION_PENDING


      

Marco SSL_RENEGO_MAX_RECORDS_DEFAULT

#define SSL_RENEGO_MAX_RECORDS_DEFAULT MBEDTLS_SSL_RENEGO_MAX_RECORDS_DEFAULT


      

Marco SSL_RETRANS_FINISHED

#define SSL_RETRANS_FINISHED MBEDTLS_SSL_RETRANS_FINISHED


      

Marco SSL_RETRANS_PREPARING

#define SSL_RETRANS_PREPARING MBEDTLS_SSL_RETRANS_PREPARING


      

Marco SSL_RETRANS_SENDING

#define SSL_RETRANS_SENDING MBEDTLS_SSL_RETRANS_SENDING


      

Marco SSL_RETRANS_WAITING

#define SSL_RETRANS_WAITING MBEDTLS_SSL_RETRANS_WAITING


      

Marco SSL_SECURE_RENEGOTIATION

#define SSL_SECURE_RENEGOTIATION MBEDTLS_SSL_SECURE_RENEGOTIATION


      

Marco SSL_SERVER_CERTIFICATE

#define SSL_SERVER_CERTIFICATE MBEDTLS_SSL_SERVER_CERTIFICATE


      

Marco SSL_SERVER_CHANGE_CIPHER_SPEC

#define SSL_SERVER_CHANGE_CIPHER_SPEC MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC


      

Marco SSL_SERVER_FINISHED

#define SSL_SERVER_FINISHED MBEDTLS_SSL_SERVER_FINISHED


      

Marco SSL_SERVER_HELLO

#define SSL_SERVER_HELLO MBEDTLS_SSL_SERVER_HELLO


      

Marco SSL_SERVER_HELLO_DONE

#define SSL_SERVER_HELLO_DONE MBEDTLS_SSL_SERVER_HELLO_DONE


      

Marco SSL_SERVER_HELLO_VERIFY_REQUEST_SENT

#define SSL_SERVER_HELLO_VERIFY_REQUEST_SENT MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT


      

Marco SSL_SERVER_KEY_EXCHANGE

#define SSL_SERVER_KEY_EXCHANGE MBEDTLS_SSL_SERVER_KEY_EXCHANGE


      

Marco SSL_SERVER_NEW_SESSION_TICKET

#define SSL_SERVER_NEW_SESSION_TICKET MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET


      

Marco SSL_SESSION_TICKETS_DISABLED

#define SSL_SESSION_TICKETS_DISABLED MBEDTLS_SSL_SESSION_TICKETS_DISABLED


      

Marco SSL_SESSION_TICKETS_ENABLED

#define SSL_SESSION_TICKETS_ENABLED MBEDTLS_SSL_SESSION_TICKETS_ENABLED


      

Marco SSL_SIG_ANON

#define SSL_SIG_ANON MBEDTLS_SSL_SIG_ANON


      

Marco SSL_SIG_ECDSA

#define SSL_SIG_ECDSA MBEDTLS_SSL_SIG_ECDSA


      

Marco SSL_SIG_RSA

#define SSL_SIG_RSA MBEDTLS_SSL_SIG_RSA


      

Marco SSL_TRANSPORT_DATAGRAM

#define SSL_TRANSPORT_DATAGRAM MBEDTLS_SSL_TRANSPORT_DATAGRAM


      

Marco SSL_TRANSPORT_STREAM

#define SSL_TRANSPORT_STREAM MBEDTLS_SSL_TRANSPORT_STREAM


      

Marco SSL_TRUNCATED_HMAC_LEN

#define SSL_TRUNCATED_HMAC_LEN MBEDTLS_SSL_TRUNCATED_HMAC_LEN


      

Marco SSL_TRUNC_HMAC_DISABLED

#define SSL_TRUNC_HMAC_DISABLED MBEDTLS_SSL_TRUNC_HMAC_DISABLED


      

Marco SSL_TRUNC_HMAC_ENABLED

#define SSL_TRUNC_HMAC_ENABLED MBEDTLS_SSL_TRUNC_HMAC_ENABLED


      

Marco SSL_VERIFY_DATA_MAX_LEN

#define SSL_VERIFY_DATA_MAX_LEN MBEDTLS_SSL_VERIFY_DATA_MAX_LEN


      

Marco SSL_VERIFY_NONE

#define SSL_VERIFY_NONE MBEDTLS_SSL_VERIFY_NONE


      

Marco SSL_VERIFY_OPTIONAL

#define SSL_VERIFY_OPTIONAL MBEDTLS_SSL_VERIFY_OPTIONAL


      

Marco SSL_VERIFY_REQUIRED

#define SSL_VERIFY_REQUIRED MBEDTLS_SSL_VERIFY_REQUIRED


      

Marco TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA

#define TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_DHE_PSK_WITH_AES_128_CBC_SHA

#define TLS_DHE_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA


      

Marco TLS_DHE_PSK_WITH_AES_128_CBC_SHA256

#define TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256


      

Marco TLS_DHE_PSK_WITH_AES_128_CCM

#define TLS_DHE_PSK_WITH_AES_128_CCM MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM


      

Marco TLS_DHE_PSK_WITH_AES_128_CCM_8

#define TLS_DHE_PSK_WITH_AES_128_CCM_8 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8


      

Marco TLS_DHE_PSK_WITH_AES_128_GCM_SHA256

#define TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256


      

Marco TLS_DHE_PSK_WITH_AES_256_CBC_SHA

#define TLS_DHE_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA


      

Marco TLS_DHE_PSK_WITH_AES_256_CBC_SHA384

#define TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384


      

Marco TLS_DHE_PSK_WITH_AES_256_CCM

#define TLS_DHE_PSK_WITH_AES_256_CCM MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM


      

Marco TLS_DHE_PSK_WITH_AES_256_CCM_8

#define TLS_DHE_PSK_WITH_AES_256_CCM_8 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8


      

Marco TLS_DHE_PSK_WITH_AES_256_GCM_SHA384

#define TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384


      

Marco TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384

#define TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384


      

Marco TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_DHE_PSK_WITH_NULL_SHA

#define TLS_DHE_PSK_WITH_NULL_SHA MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA


      

Marco TLS_DHE_PSK_WITH_NULL_SHA256

#define TLS_DHE_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256


      

Marco TLS_DHE_PSK_WITH_NULL_SHA384

#define TLS_DHE_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384


      

Marco TLS_DHE_PSK_WITH_RC4_128_SHA

#define TLS_DHE_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA


      

Marco TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA

#define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_DHE_RSA_WITH_AES_128_CBC_SHA

#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA


      

Marco TLS_DHE_RSA_WITH_AES_128_CBC_SHA256

#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256


      

Marco TLS_DHE_RSA_WITH_AES_128_CCM

#define TLS_DHE_RSA_WITH_AES_128_CCM MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM


      

Marco TLS_DHE_RSA_WITH_AES_128_CCM_8

#define TLS_DHE_RSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8


      

Marco TLS_DHE_RSA_WITH_AES_128_GCM_SHA256

#define TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256


      

Marco TLS_DHE_RSA_WITH_AES_256_CBC_SHA

#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA


      

Marco TLS_DHE_RSA_WITH_AES_256_CBC_SHA256

#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256


      

Marco TLS_DHE_RSA_WITH_AES_256_CCM

#define TLS_DHE_RSA_WITH_AES_256_CCM MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM


      

Marco TLS_DHE_RSA_WITH_AES_256_CCM_8

#define TLS_DHE_RSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8


      

Marco TLS_DHE_RSA_WITH_AES_256_GCM_SHA384

#define TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384


      

Marco TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA

#define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA


      

Marco TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA

#define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA


      

Marco TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256

#define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256


      

Marco TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_DHE_RSA_WITH_DES_CBC_SHA

#define TLS_DHE_RSA_WITH_DES_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA


      

Marco TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA

#define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA

#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA


      

Marco TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256

#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256


      

Marco TLS_ECDHE_ECDSA_WITH_AES_128_CCM

#define TLS_ECDHE_ECDSA_WITH_AES_128_CCM MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM


      

Marco TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8

#define TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8


      

Marco TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

#define TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256


      

Marco TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA

#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA


      

Marco TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384

#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384


      

Marco TLS_ECDHE_ECDSA_WITH_AES_256_CCM

#define TLS_ECDHE_ECDSA_WITH_AES_256_CCM MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM


      

Marco TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8

#define TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8


      

Marco TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384

#define TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384


      

Marco TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384

#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384


      

Marco TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_ECDHE_ECDSA_WITH_NULL_SHA

#define TLS_ECDHE_ECDSA_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA


      

Marco TLS_ECDHE_ECDSA_WITH_RC4_128_SHA

#define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA


      

Marco TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA

#define TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA

#define TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA


      

Marco TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256

#define TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256


      

Marco TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA

#define TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA


      

Marco TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384

#define TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384


      

Marco TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384

#define TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384


      

Marco TLS_ECDHE_PSK_WITH_NULL_SHA

#define TLS_ECDHE_PSK_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA


      

Marco TLS_ECDHE_PSK_WITH_NULL_SHA256

#define TLS_ECDHE_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256


      

Marco TLS_ECDHE_PSK_WITH_NULL_SHA384

#define TLS_ECDHE_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384


      

Marco TLS_ECDHE_PSK_WITH_RC4_128_SHA

#define TLS_ECDHE_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA


      

Marco TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA

#define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA

#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA


      

Marco TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256

#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256


      

Marco TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

#define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256


      

Marco TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA

#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA


      

Marco TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384

#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384


      

Marco TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

#define TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384


      

Marco TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384

#define TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384


      

Marco TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_ECDHE_RSA_WITH_NULL_SHA

#define TLS_ECDHE_RSA_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA


      

Marco TLS_ECDHE_RSA_WITH_RC4_128_SHA

#define TLS_ECDHE_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA


      

Marco TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA

#define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA

#define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA


      

Marco TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256

#define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256


      

Marco TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256

#define TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256


      

Marco TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA

#define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA


      

Marco TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384

#define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384


      

Marco TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384

#define TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384


      

Marco TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384

#define TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384


      

Marco TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_ECDH_ECDSA_WITH_NULL_SHA

#define TLS_ECDH_ECDSA_WITH_NULL_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA


      

Marco TLS_ECDH_ECDSA_WITH_RC4_128_SHA

#define TLS_ECDH_ECDSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA


      

Marco TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA

#define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_ECDH_RSA_WITH_AES_128_CBC_SHA

#define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA


      

Marco TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256

#define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256


      

Marco TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256

#define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256


      

Marco TLS_ECDH_RSA_WITH_AES_256_CBC_SHA

#define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA


      

Marco TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384

#define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384


      

Marco TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384

#define TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384


      

Marco TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384

#define TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384


      

Marco TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_ECDH_RSA_WITH_NULL_SHA

#define TLS_ECDH_RSA_WITH_NULL_SHA MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA


      

Marco TLS_ECDH_RSA_WITH_RC4_128_SHA

#define TLS_ECDH_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA


      

Marco TLS_EXT_ALPN

#define TLS_EXT_ALPN MBEDTLS_TLS_EXT_ALPN


      

Marco TLS_EXT_ENCRYPT_THEN_MAC

#define TLS_EXT_ENCRYPT_THEN_MAC MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC


      

Marco TLS_EXT_EXTENDED_MASTER_SECRET

#define TLS_EXT_EXTENDED_MASTER_SECRET MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET


      

Marco TLS_EXT_MAX_FRAGMENT_LENGTH

#define TLS_EXT_MAX_FRAGMENT_LENGTH MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH


      

Marco TLS_EXT_RENEGOTIATION_INFO

#define TLS_EXT_RENEGOTIATION_INFO MBEDTLS_TLS_EXT_RENEGOTIATION_INFO


      

Marco TLS_EXT_SERVERNAME

#define TLS_EXT_SERVERNAME MBEDTLS_TLS_EXT_SERVERNAME


      

Marco TLS_EXT_SERVERNAME_HOSTNAME

#define TLS_EXT_SERVERNAME_HOSTNAME MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME


      

Marco TLS_EXT_SESSION_TICKET

#define TLS_EXT_SESSION_TICKET MBEDTLS_TLS_EXT_SESSION_TICKET


      

Marco TLS_EXT_SIG_ALG

#define TLS_EXT_SIG_ALG MBEDTLS_TLS_EXT_SIG_ALG


      

Marco TLS_EXT_SUPPORTED_ELLIPTIC_CURVES

#define TLS_EXT_SUPPORTED_ELLIPTIC_CURVES MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES


      

Marco TLS_EXT_SUPPORTED_POINT_FORMATS

#define TLS_EXT_SUPPORTED_POINT_FORMATS MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS


      

Marco TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT

#define TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT


      

Marco TLS_EXT_TRUNCATED_HMAC

#define TLS_EXT_TRUNCATED_HMAC MBEDTLS_TLS_EXT_TRUNCATED_HMAC


      

Marco TLS_PSK_WITH_3DES_EDE_CBC_SHA

#define TLS_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_PSK_WITH_AES_128_CBC_SHA

#define TLS_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA


      

Marco TLS_PSK_WITH_AES_128_CBC_SHA256

#define TLS_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256


      

Marco TLS_PSK_WITH_AES_128_CCM

#define TLS_PSK_WITH_AES_128_CCM MBEDTLS_TLS_PSK_WITH_AES_128_CCM


      

Marco TLS_PSK_WITH_AES_128_CCM_8

#define TLS_PSK_WITH_AES_128_CCM_8 MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8


      

Marco TLS_PSK_WITH_AES_128_GCM_SHA256

#define TLS_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256


      

Marco TLS_PSK_WITH_AES_256_CBC_SHA

#define TLS_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA


      

Marco TLS_PSK_WITH_AES_256_CBC_SHA384

#define TLS_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384


      

Marco TLS_PSK_WITH_AES_256_CCM

#define TLS_PSK_WITH_AES_256_CCM MBEDTLS_TLS_PSK_WITH_AES_256_CCM


      

Marco TLS_PSK_WITH_AES_256_CCM_8

#define TLS_PSK_WITH_AES_256_CCM_8 MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8


      

Marco TLS_PSK_WITH_AES_256_GCM_SHA384

#define TLS_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384


      

Marco TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384

#define TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384


      

Marco TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_PSK_WITH_NULL_SHA

#define TLS_PSK_WITH_NULL_SHA MBEDTLS_TLS_PSK_WITH_NULL_SHA


      

Marco TLS_PSK_WITH_NULL_SHA256

#define TLS_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_PSK_WITH_NULL_SHA256


      

Marco TLS_PSK_WITH_NULL_SHA384

#define TLS_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_PSK_WITH_NULL_SHA384


      

Marco TLS_PSK_WITH_RC4_128_SHA

#define TLS_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_PSK_WITH_RC4_128_SHA


      

Marco TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA

#define TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_RSA_PSK_WITH_AES_128_CBC_SHA

#define TLS_RSA_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA


      

Marco TLS_RSA_PSK_WITH_AES_128_CBC_SHA256

#define TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256


      

Marco TLS_RSA_PSK_WITH_AES_128_GCM_SHA256

#define TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256


      

Marco TLS_RSA_PSK_WITH_AES_256_CBC_SHA

#define TLS_RSA_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA


      

Marco TLS_RSA_PSK_WITH_AES_256_CBC_SHA384

#define TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384


      

Marco TLS_RSA_PSK_WITH_AES_256_GCM_SHA384

#define TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384


      

Marco TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384

#define TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384


      

Marco TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_RSA_PSK_WITH_NULL_SHA

#define TLS_RSA_PSK_WITH_NULL_SHA MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA


      

Marco TLS_RSA_PSK_WITH_NULL_SHA256

#define TLS_RSA_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256


      

Marco TLS_RSA_PSK_WITH_NULL_SHA384

#define TLS_RSA_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384


      

Marco TLS_RSA_PSK_WITH_RC4_128_SHA

#define TLS_RSA_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA


      

Marco TLS_RSA_WITH_3DES_EDE_CBC_SHA

#define TLS_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA


      

Marco TLS_RSA_WITH_AES_128_CBC_SHA

#define TLS_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA


      

Marco TLS_RSA_WITH_AES_128_CBC_SHA256

#define TLS_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256


      

Marco TLS_RSA_WITH_AES_128_CCM

#define TLS_RSA_WITH_AES_128_CCM MBEDTLS_TLS_RSA_WITH_AES_128_CCM


      

Marco TLS_RSA_WITH_AES_128_CCM_8

#define TLS_RSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8


      

Marco TLS_RSA_WITH_AES_128_GCM_SHA256

#define TLS_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256


      

Marco TLS_RSA_WITH_AES_256_CBC_SHA

#define TLS_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA


      

Marco TLS_RSA_WITH_AES_256_CBC_SHA256

#define TLS_RSA_WITH_AES_256_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256


      

Marco TLS_RSA_WITH_AES_256_CCM

#define TLS_RSA_WITH_AES_256_CCM MBEDTLS_TLS_RSA_WITH_AES_256_CCM


      

Marco TLS_RSA_WITH_AES_256_CCM_8

#define TLS_RSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8


      

Marco TLS_RSA_WITH_AES_256_GCM_SHA384

#define TLS_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384


      

Marco TLS_RSA_WITH_CAMELLIA_128_CBC_SHA

#define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA


      

Marco TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256

#define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256


      

Marco TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256

#define TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256


      

Marco TLS_RSA_WITH_CAMELLIA_256_CBC_SHA

#define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA


      

Marco TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256

#define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256


      

Marco TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384

#define TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384


      

Marco TLS_RSA_WITH_DES_CBC_SHA

#define TLS_RSA_WITH_DES_CBC_SHA MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA


      

Marco TLS_RSA_WITH_NULL_MD5

#define TLS_RSA_WITH_NULL_MD5 MBEDTLS_TLS_RSA_WITH_NULL_MD5


      

Marco TLS_RSA_WITH_NULL_SHA

#define TLS_RSA_WITH_NULL_SHA MBEDTLS_TLS_RSA_WITH_NULL_SHA


      

Marco TLS_RSA_WITH_NULL_SHA256

#define TLS_RSA_WITH_NULL_SHA256 MBEDTLS_TLS_RSA_WITH_NULL_SHA256


      

Marco TLS_RSA_WITH_RC4_128_MD5

#define TLS_RSA_WITH_RC4_128_MD5 MBEDTLS_TLS_RSA_WITH_RC4_128_MD5


      

Marco TLS_RSA_WITH_RC4_128_SHA

#define TLS_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_RSA_WITH_RC4_128_SHA


      

Marco X509_CRT_VERSION_1

#define X509_CRT_VERSION_1 MBEDTLS_X509_CRT_VERSION_1


      

Marco X509_CRT_VERSION_2

#define X509_CRT_VERSION_2 MBEDTLS_X509_CRT_VERSION_2


      

Marco X509_CRT_VERSION_3

#define X509_CRT_VERSION_3 MBEDTLS_X509_CRT_VERSION_3


      

Marco X509_FORMAT_DER

#define X509_FORMAT_DER MBEDTLS_X509_FORMAT_DER


      

Marco X509_FORMAT_PEM

#define X509_FORMAT_PEM MBEDTLS_X509_FORMAT_PEM


      

Marco X509_MAX_DN_NAME_SIZE

#define X509_MAX_DN_NAME_SIZE MBEDTLS_X509_MAX_DN_NAME_SIZE


      

Marco X509_RFC5280_MAX_SERIAL_LEN

#define X509_RFC5280_MAX_SERIAL_LEN MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN


      

Marco X509_RFC5280_UTC_TIME_LEN

#define X509_RFC5280_UTC_TIME_LEN MBEDTLS_X509_RFC5280_UTC_TIME_LEN


      

Marco XTEA_DECRYPT

#define XTEA_DECRYPT MBEDTLS_XTEA_DECRYPT


      

Marco XTEA_ENCRYPT

#define XTEA_ENCRYPT MBEDTLS_XTEA_ENCRYPT


      

Marco _asn1_bitstring

#define _asn1_bitstring mbedtls_asn1_bitstring


      

Marco _asn1_buf

#define _asn1_buf mbedtls_asn1_buf


      

Marco _asn1_named_data

#define _asn1_named_data mbedtls_asn1_named_data


      

Marco _asn1_sequence

#define _asn1_sequence mbedtls_asn1_sequence


      

Marco _ssl_cache_context

#define _ssl_cache_context mbedtls_ssl_cache_context


      

Marco _ssl_cache_entry

#define _ssl_cache_entry mbedtls_ssl_cache_entry


      

Marco _ssl_ciphersuite_t

#define _ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t


      

Marco _ssl_context

#define _ssl_context mbedtls_ssl_context


      

Marco _ssl_flight_item

#define _ssl_flight_item mbedtls_ssl_flight_item


      

Marco _ssl_handshake_params

#define _ssl_handshake_params mbedtls_ssl_handshake_params


      

Marco _ssl_key_cert

#define _ssl_key_cert mbedtls_ssl_key_cert


      

Marco _ssl_premaster_secret

#define _ssl_premaster_secret mbedtls_ssl_premaster_secret


      

Marco _ssl_session

#define _ssl_session mbedtls_ssl_session


      

Marco _ssl_transform

#define _ssl_transform mbedtls_ssl_transform


      

Marco _x509_crl

#define _x509_crl mbedtls_x509_crl


      

Marco _x509_crl_entry

#define _x509_crl_entry mbedtls_x509_crl_entry


      

Marco _x509_crt

#define _x509_crt mbedtls_x509_crt


      

Marco _x509_csr

#define _x509_csr mbedtls_x509_csr


      

Marco _x509_time

#define _x509_time mbedtls_x509_time


      

Marco _x509write_cert

#define _x509write_cert mbedtls_x509write_cert


      

Marco _x509write_csr

#define _x509write_csr mbedtls_x509write_csr


      

Marco aes_context

#define aes_context mbedtls_aes_context


      

Marco aes_crypt_cbc

#define aes_crypt_cbc mbedtls_aes_crypt_cbc


      

Marco aes_crypt_cfb128

#define aes_crypt_cfb128 mbedtls_aes_crypt_cfb128


      

Marco aes_crypt_cfb8

#define aes_crypt_cfb8 mbedtls_aes_crypt_cfb8


      

Marco aes_crypt_ctr

#define aes_crypt_ctr mbedtls_aes_crypt_ctr


      

Marco aes_crypt_ecb

#define aes_crypt_ecb mbedtls_aes_crypt_ecb


      

Marco aes_free

#define aes_free mbedtls_aes_free


      

Marco aes_init

#define aes_init mbedtls_aes_init


      

Marco aes_self_test

#define aes_self_test mbedtls_aes_self_test


      

Marco aes_setkey_dec

#define aes_setkey_dec mbedtls_aes_setkey_dec


      

Marco aes_setkey_enc

#define aes_setkey_enc mbedtls_aes_setkey_enc


      

Marco aesni_crypt_ecb

#define aesni_crypt_ecb mbedtls_aesni_crypt_ecb


      

Marco aesni_gcm_mult

#define aesni_gcm_mult mbedtls_aesni_gcm_mult


      

Marco aesni_inverse_key

#define aesni_inverse_key mbedtls_aesni_inverse_key


      

Marco aesni_setkey_enc

#define aesni_setkey_enc mbedtls_aesni_setkey_enc


      

Marco aesni_supports

#define aesni_supports mbedtls_aesni_has_support


      

Marco alarmed

#define alarmed mbedtls_timing_alarmed


      

Marco arc4_context

#define arc4_context mbedtls_arc4_context


      

Marco arc4_crypt

#define arc4_crypt mbedtls_arc4_crypt


      

Marco arc4_free

#define arc4_free mbedtls_arc4_free


      

Marco arc4_init

#define arc4_init mbedtls_arc4_init


      

Marco arc4_self_test

#define arc4_self_test mbedtls_arc4_self_test


      

Marco arc4_setup

#define arc4_setup mbedtls_arc4_setup


      

Marco asn1_bitstring

#define asn1_bitstring mbedtls_asn1_bitstring


      

Marco asn1_buf

#define asn1_buf mbedtls_asn1_buf


      

Marco asn1_find_named_data

#define asn1_find_named_data mbedtls_asn1_find_named_data


      

Marco asn1_free_named_data

#define asn1_free_named_data mbedtls_asn1_free_named_data


      

Marco asn1_free_named_data_list

#define asn1_free_named_data_list mbedtls_asn1_free_named_data_list


      

Marco asn1_get_alg

#define asn1_get_alg mbedtls_asn1_get_alg


      

Marco asn1_get_alg_null

#define asn1_get_alg_null mbedtls_asn1_get_alg_null


      

Marco asn1_get_bitstring

#define asn1_get_bitstring mbedtls_asn1_get_bitstring


      

Marco asn1_get_bitstring_null

#define asn1_get_bitstring_null mbedtls_asn1_get_bitstring_null


      

Marco asn1_get_bool

#define asn1_get_bool mbedtls_asn1_get_bool


      

Marco asn1_get_int

#define asn1_get_int mbedtls_asn1_get_int


      

Marco asn1_get_len

#define asn1_get_len mbedtls_asn1_get_len


      

Marco asn1_get_mpi

#define asn1_get_mpi mbedtls_asn1_get_mpi


      

Marco asn1_get_sequence_of

#define asn1_get_sequence_of mbedtls_asn1_get_sequence_of


      

Marco asn1_get_tag

#define asn1_get_tag mbedtls_asn1_get_tag


      

Marco asn1_named_data

#define asn1_named_data mbedtls_asn1_named_data


      

Marco asn1_sequence

#define asn1_sequence mbedtls_asn1_sequence


      

Marco asn1_store_named_data

#define asn1_store_named_data mbedtls_asn1_store_named_data


      

Marco asn1_write_algorithm_identifier

#define asn1_write_algorithm_identifier mbedtls_asn1_write_algorithm_identifier


      

Marco asn1_write_bitstring

#define asn1_write_bitstring mbedtls_asn1_write_bitstring


      

Marco asn1_write_bool

#define asn1_write_bool mbedtls_asn1_write_bool


      

Marco asn1_write_ia5_string

#define asn1_write_ia5_string mbedtls_asn1_write_ia5_string


      

Marco asn1_write_int

#define asn1_write_int mbedtls_asn1_write_int


      

Marco asn1_write_len

#define asn1_write_len mbedtls_asn1_write_len


      

Marco asn1_write_mpi

#define asn1_write_mpi mbedtls_asn1_write_mpi


      

Marco asn1_write_null

#define asn1_write_null mbedtls_asn1_write_null


      

Marco asn1_write_octet_string

#define asn1_write_octet_string mbedtls_asn1_write_octet_string


      

Marco asn1_write_oid

#define asn1_write_oid mbedtls_asn1_write_oid


      

Marco asn1_write_printable_string

#define asn1_write_printable_string mbedtls_asn1_write_printable_string


      

Marco asn1_write_raw_buffer

#define asn1_write_raw_buffer mbedtls_asn1_write_raw_buffer


      

Marco asn1_write_tag

#define asn1_write_tag mbedtls_asn1_write_tag


      

Marco base64_decode

#define base64_decode mbedtls_base64_decode


      

Marco base64_encode

#define base64_encode mbedtls_base64_encode


      

Marco base64_self_test

#define base64_self_test mbedtls_base64_self_test


      

Marco blowfish_context

#define blowfish_context mbedtls_blowfish_context


      

Marco blowfish_crypt_cbc

#define blowfish_crypt_cbc mbedtls_blowfish_crypt_cbc


      

Marco blowfish_crypt_cfb64

#define blowfish_crypt_cfb64 mbedtls_blowfish_crypt_cfb64


      

Marco blowfish_crypt_ctr

#define blowfish_crypt_ctr mbedtls_blowfish_crypt_ctr


      

Marco blowfish_crypt_ecb

#define blowfish_crypt_ecb mbedtls_blowfish_crypt_ecb


      

Marco blowfish_free

#define blowfish_free mbedtls_blowfish_free


      

Marco blowfish_init

#define blowfish_init mbedtls_blowfish_init


      

Marco blowfish_setkey

#define blowfish_setkey mbedtls_blowfish_setkey


      

Marco camellia_context

#define camellia_context mbedtls_camellia_context


      

Marco camellia_crypt_cbc

#define camellia_crypt_cbc mbedtls_camellia_crypt_cbc


      

Marco camellia_crypt_cfb128

#define camellia_crypt_cfb128 mbedtls_camellia_crypt_cfb128


      

Marco camellia_crypt_ctr

#define camellia_crypt_ctr mbedtls_camellia_crypt_ctr


      

Marco camellia_crypt_ecb

#define camellia_crypt_ecb mbedtls_camellia_crypt_ecb


      

Marco camellia_free

#define camellia_free mbedtls_camellia_free


      

Marco camellia_init

#define camellia_init mbedtls_camellia_init


      

Marco camellia_self_test

#define camellia_self_test mbedtls_camellia_self_test


      

Marco camellia_setkey_dec

#define camellia_setkey_dec mbedtls_camellia_setkey_dec


      

Marco camellia_setkey_enc

#define camellia_setkey_enc mbedtls_camellia_setkey_enc


      

Marco ccm_auth_decrypt

#define ccm_auth_decrypt mbedtls_ccm_auth_decrypt


      

Marco ccm_context

#define ccm_context mbedtls_ccm_context


      

Marco ccm_encrypt_and_tag

#define ccm_encrypt_and_tag mbedtls_ccm_encrypt_and_tag


      

Marco ccm_free

#define ccm_free mbedtls_ccm_free


      

Marco ccm_init

#define ccm_init mbedtls_ccm_init


      

Marco ccm_self_test

#define ccm_self_test mbedtls_ccm_self_test


      

Marco cipher_auth_decrypt

#define cipher_auth_decrypt mbedtls_cipher_auth_decrypt


      

Marco cipher_auth_encrypt

#define cipher_auth_encrypt mbedtls_cipher_auth_encrypt


      

Marco cipher_base_t

#define cipher_base_t mbedtls_cipher_base_t


      

Marco cipher_check_tag

#define cipher_check_tag mbedtls_cipher_check_tag


      

Marco cipher_context_t

#define cipher_context_t mbedtls_cipher_context_t


      

Marco cipher_crypt

#define cipher_crypt mbedtls_cipher_crypt


      

Marco cipher_definition_t

#define cipher_definition_t mbedtls_cipher_definition_t


      

Marco cipher_definitions

#define cipher_definitions mbedtls_cipher_definitions


      

Marco cipher_finish

#define cipher_finish mbedtls_cipher_finish


      

Marco cipher_free

#define cipher_free mbedtls_cipher_free


      

Marco cipher_get_block_size

#define cipher_get_block_size mbedtls_cipher_get_block_size


      

Marco cipher_get_cipher_mode

#define cipher_get_cipher_mode mbedtls_cipher_get_cipher_mode


      

Marco cipher_get_iv_size

#define cipher_get_iv_size mbedtls_cipher_get_iv_size


      

Marco cipher_get_key_size

#define cipher_get_key_size mbedtls_cipher_get_key_bitlen


      

Marco cipher_get_name

#define cipher_get_name mbedtls_cipher_get_name


      

Marco cipher_get_operation

#define cipher_get_operation mbedtls_cipher_get_operation


      

Marco cipher_get_type

#define cipher_get_type mbedtls_cipher_get_type


      

Marco cipher_id_t

#define cipher_id_t mbedtls_cipher_id_t


      

Marco cipher_info_from_string

#define cipher_info_from_string mbedtls_cipher_info_from_string


      

Marco cipher_info_from_type

#define cipher_info_from_type mbedtls_cipher_info_from_type


      

Marco cipher_info_from_values

#define cipher_info_from_values mbedtls_cipher_info_from_values


      

Marco cipher_info_t

#define cipher_info_t mbedtls_cipher_info_t


      

Marco cipher_init

#define cipher_init mbedtls_cipher_init


      

Marco cipher_init_ctx

#define cipher_init_ctx mbedtls_cipher_setup


      

Marco cipher_list

#define cipher_list mbedtls_cipher_list


      

Marco cipher_mode_t

#define cipher_mode_t mbedtls_cipher_mode_t


      

Marco cipher_padding_t

#define cipher_padding_t mbedtls_cipher_padding_t


      

Marco cipher_reset

#define cipher_reset mbedtls_cipher_reset


      

Marco cipher_set_iv

#define cipher_set_iv mbedtls_cipher_set_iv


      

Marco cipher_set_padding_mode

#define cipher_set_padding_mode mbedtls_cipher_set_padding_mode


      

Marco cipher_setkey

#define cipher_setkey mbedtls_cipher_setkey


      

Marco cipher_type_t

#define cipher_type_t mbedtls_cipher_type_t


      

Marco cipher_update

#define cipher_update mbedtls_cipher_update


      

Marco cipher_update_ad

#define cipher_update_ad mbedtls_cipher_update_ad


      

Marco cipher_write_tag

#define cipher_write_tag mbedtls_cipher_write_tag


      

Marco ctr_drbg_context

#define ctr_drbg_context mbedtls_ctr_drbg_context


      

Marco ctr_drbg_free

#define ctr_drbg_free mbedtls_ctr_drbg_free


      

Marco ctr_drbg_init

#define ctr_drbg_init mbedtls_ctr_drbg_init


      

Marco ctr_drbg_random

#define ctr_drbg_random mbedtls_ctr_drbg_random


      

Marco ctr_drbg_random_with_add

#define ctr_drbg_random_with_add mbedtls_ctr_drbg_random_with_add


      

Marco ctr_drbg_reseed

#define ctr_drbg_reseed mbedtls_ctr_drbg_reseed


      

Marco ctr_drbg_self_test

#define ctr_drbg_self_test mbedtls_ctr_drbg_self_test


      

Marco ctr_drbg_set_entropy_len

#define ctr_drbg_set_entropy_len mbedtls_ctr_drbg_set_entropy_len


      

Marco ctr_drbg_set_prediction_resistance

#define ctr_drbg_set_prediction_resistance mbedtls_ctr_drbg_set_prediction_resistance


      

Marco ctr_drbg_set_reseed_interval

#define ctr_drbg_set_reseed_interval mbedtls_ctr_drbg_set_reseed_interval


      

Marco ctr_drbg_update

#define ctr_drbg_update mbedtls_ctr_drbg_update


      

Marco ctr_drbg_update_seed_file

#define ctr_drbg_update_seed_file mbedtls_ctr_drbg_update_seed_file


      

Marco ctr_drbg_write_seed_file

#define ctr_drbg_write_seed_file mbedtls_ctr_drbg_write_seed_file


      

Marco debug_print_buf

#define debug_print_buf mbedtls_debug_print_buf


      

Marco debug_print_crt

#define debug_print_crt mbedtls_debug_print_crt


      

Marco debug_print_ecp

#define debug_print_ecp mbedtls_debug_print_ecp


      

Marco debug_print_mpi

#define debug_print_mpi mbedtls_debug_print_mpi


      

Marco debug_print_msg

#define debug_print_msg mbedtls_debug_print_msg


      

Marco debug_print_ret

#define debug_print_ret mbedtls_debug_print_ret


      

Marco debug_set_threshold

#define debug_set_threshold mbedtls_debug_set_threshold


      

Marco des3_context

#define des3_context mbedtls_des3_context


      

Marco des3_crypt_cbc

#define des3_crypt_cbc mbedtls_des3_crypt_cbc


      

Marco des3_crypt_ecb

#define des3_crypt_ecb mbedtls_des3_crypt_ecb


      

Marco des3_free

#define des3_free mbedtls_des3_free


      

Marco des3_init

#define des3_init mbedtls_des3_init


      

Marco des3_set2key_dec

#define des3_set2key_dec mbedtls_des3_set2key_dec


      

Marco des3_set2key_enc

#define des3_set2key_enc mbedtls_des3_set2key_enc


      

Marco des3_set3key_dec

#define des3_set3key_dec mbedtls_des3_set3key_dec


      

Marco des3_set3key_enc

#define des3_set3key_enc mbedtls_des3_set3key_enc


      

Marco des_context

#define des_context mbedtls_des_context


      

Marco des_crypt_cbc

#define des_crypt_cbc mbedtls_des_crypt_cbc


      

Marco des_crypt_ecb

#define des_crypt_ecb mbedtls_des_crypt_ecb


      

Marco des_free

#define des_free mbedtls_des_free


      

Marco des_init

#define des_init mbedtls_des_init


      

Marco des_key_check_key_parity

#define des_key_check_key_parity mbedtls_des_key_check_key_parity


      

Marco des_key_check_weak

#define des_key_check_weak mbedtls_des_key_check_weak


      

Marco des_key_set_parity

#define des_key_set_parity mbedtls_des_key_set_parity


      

Marco des_self_test

#define des_self_test mbedtls_des_self_test


      

Marco des_setkey_dec

#define des_setkey_dec mbedtls_des_setkey_dec


      

Marco des_setkey_enc

#define des_setkey_enc mbedtls_des_setkey_enc


      

Marco dhm_calc_secret

#define dhm_calc_secret mbedtls_dhm_calc_secret


      

Marco dhm_context

#define dhm_context mbedtls_dhm_context


      

Marco dhm_free

#define dhm_free mbedtls_dhm_free


      

Marco dhm_init

#define dhm_init mbedtls_dhm_init


      

Marco dhm_make_params

#define dhm_make_params mbedtls_dhm_make_params


      

Marco dhm_make_public

#define dhm_make_public mbedtls_dhm_make_public


      

Marco dhm_parse_dhm

#define dhm_parse_dhm mbedtls_dhm_parse_dhm


      

Marco dhm_parse_dhmfile

#define dhm_parse_dhmfile mbedtls_dhm_parse_dhmfile


      

Marco dhm_read_params

#define dhm_read_params mbedtls_dhm_read_params


      

Marco dhm_read_public

#define dhm_read_public mbedtls_dhm_read_public


      

Marco dhm_self_test

#define dhm_self_test mbedtls_dhm_self_test


      

Marco ecdh_calc_secret

#define ecdh_calc_secret mbedtls_ecdh_calc_secret


      

Marco ecdh_compute_shared

#define ecdh_compute_shared mbedtls_ecdh_compute_shared


      

Marco ecdh_context

#define ecdh_context mbedtls_ecdh_context


      

Marco ecdh_free

#define ecdh_free mbedtls_ecdh_free


      

Marco ecdh_gen_public

#define ecdh_gen_public mbedtls_ecdh_gen_public


      

Marco ecdh_get_params

#define ecdh_get_params mbedtls_ecdh_get_params


      

Marco ecdh_init

#define ecdh_init mbedtls_ecdh_init


      

Marco ecdh_make_params

#define ecdh_make_params mbedtls_ecdh_make_params


      

Marco ecdh_make_public

#define ecdh_make_public mbedtls_ecdh_make_public


      

Marco ecdh_read_params

#define ecdh_read_params mbedtls_ecdh_read_params


      

Marco ecdh_read_public

#define ecdh_read_public mbedtls_ecdh_read_public


      

Marco ecdh_side

#define ecdh_side mbedtls_ecdh_side


      

Marco ecdsa_context

#define ecdsa_context mbedtls_ecdsa_context


      

Marco ecdsa_free

#define ecdsa_free mbedtls_ecdsa_free


      

Marco ecdsa_from_keypair

#define ecdsa_from_keypair mbedtls_ecdsa_from_keypair


      

Marco ecdsa_genkey

#define ecdsa_genkey mbedtls_ecdsa_genkey


      

Marco ecdsa_info

#define ecdsa_info mbedtls_ecdsa_info


      

Marco ecdsa_init

#define ecdsa_init mbedtls_ecdsa_init


      

Marco ecdsa_read_signature

#define ecdsa_read_signature mbedtls_ecdsa_read_signature


      

Marco ecdsa_sign

#define ecdsa_sign mbedtls_ecdsa_sign


      

Marco ecdsa_sign_det

#define ecdsa_sign_det mbedtls_ecdsa_sign_det


      

Marco ecdsa_verify

#define ecdsa_verify mbedtls_ecdsa_verify


      

Marco ecdsa_write_signature

#define ecdsa_write_signature mbedtls_ecdsa_write_signature


      

Marco ecdsa_write_signature_det

#define ecdsa_write_signature_det mbedtls_ecdsa_write_signature_det


      

Marco eckey_info

#define eckey_info mbedtls_eckey_info


      

Marco eckeydh_info

#define eckeydh_info mbedtls_eckeydh_info


      

Marco ecp_check_privkey

#define ecp_check_privkey mbedtls_ecp_check_privkey


      

Marco ecp_check_pub_priv

#define ecp_check_pub_priv mbedtls_ecp_check_pub_priv


      

Marco ecp_check_pubkey

#define ecp_check_pubkey mbedtls_ecp_check_pubkey


      

Marco ecp_copy

#define ecp_copy mbedtls_ecp_copy


      

Marco ecp_curve_info

#define ecp_curve_info mbedtls_ecp_curve_info


      

Marco ecp_curve_info_from_grp_id

#define ecp_curve_info_from_grp_id mbedtls_ecp_curve_info_from_grp_id


      

Marco ecp_curve_info_from_name

#define ecp_curve_info_from_name mbedtls_ecp_curve_info_from_name


      

Marco ecp_curve_info_from_tls_id

#define ecp_curve_info_from_tls_id mbedtls_ecp_curve_info_from_tls_id


      

Marco ecp_curve_list

#define ecp_curve_list mbedtls_ecp_curve_list


      

Marco ecp_gen_key

#define ecp_gen_key mbedtls_ecp_gen_key


      

Marco ecp_gen_keypair

#define ecp_gen_keypair mbedtls_ecp_gen_keypair


      

Marco ecp_group

#define ecp_group mbedtls_ecp_group


      

Marco ecp_group_copy

#define ecp_group_copy mbedtls_ecp_group_copy


      

Marco ecp_group_free

#define ecp_group_free mbedtls_ecp_group_free


      

Marco ecp_group_id

#define ecp_group_id mbedtls_ecp_group_id


      

Marco ecp_group_init

#define ecp_group_init mbedtls_ecp_group_init


      

Marco ecp_grp_id_list

#define ecp_grp_id_list mbedtls_ecp_grp_id_list


      

Marco ecp_is_zero

#define ecp_is_zero mbedtls_ecp_is_zero


      

Marco ecp_keypair

#define ecp_keypair mbedtls_ecp_keypair


      

Marco ecp_keypair_free

#define ecp_keypair_free mbedtls_ecp_keypair_free


      

Marco ecp_keypair_init

#define ecp_keypair_init mbedtls_ecp_keypair_init


      

Marco ecp_mul

#define ecp_mul mbedtls_ecp_mul


      

Marco ecp_point

#define ecp_point mbedtls_ecp_point


      

Marco ecp_point_free

#define ecp_point_free mbedtls_ecp_point_free


      

Marco ecp_point_init

#define ecp_point_init mbedtls_ecp_point_init


      

Marco ecp_point_read_binary

#define ecp_point_read_binary mbedtls_ecp_point_read_binary


      

Marco ecp_point_read_string

#define ecp_point_read_string mbedtls_ecp_point_read_string


      

Marco ecp_point_write_binary

#define ecp_point_write_binary mbedtls_ecp_point_write_binary


      

Marco ecp_self_test

#define ecp_self_test mbedtls_ecp_self_test


      

Marco ecp_set_zero

#define ecp_set_zero mbedtls_ecp_set_zero


      

Marco ecp_tls_read_group

#define ecp_tls_read_group mbedtls_ecp_tls_read_group


      

Marco ecp_tls_read_point

#define ecp_tls_read_point mbedtls_ecp_tls_read_point


      

Marco ecp_tls_write_group

#define ecp_tls_write_group mbedtls_ecp_tls_write_group


      

Marco ecp_tls_write_point

#define ecp_tls_write_point mbedtls_ecp_tls_write_point


      

Marco ecp_use_known_dp

#define ecp_use_known_dp mbedtls_ecp_group_load


      

Marco entropy_add_source

#define entropy_add_source mbedtls_entropy_add_source


      

Marco entropy_context

#define entropy_context mbedtls_entropy_context


      

Marco entropy_free

#define entropy_free mbedtls_entropy_free


      

Marco entropy_func

#define entropy_func mbedtls_entropy_func


      

Marco entropy_gather

#define entropy_gather mbedtls_entropy_gather


      

Marco entropy_init

#define entropy_init mbedtls_entropy_init


      

Marco entropy_self_test

#define entropy_self_test mbedtls_entropy_self_test


      

Marco entropy_update_manual

#define entropy_update_manual mbedtls_entropy_update_manual


      

Marco entropy_update_seed_file

#define entropy_update_seed_file mbedtls_entropy_update_seed_file


      

Marco entropy_write_seed_file

#define entropy_write_seed_file mbedtls_entropy_write_seed_file


      

Marco error_strerror

#define error_strerror mbedtls_strerror


      

Marco f_source_ptr

#define f_source_ptr mbedtls_entropy_f_source_ptr


      

Marco gcm_auth_decrypt

#define gcm_auth_decrypt mbedtls_gcm_auth_decrypt


      

Marco gcm_context

#define gcm_context mbedtls_gcm_context


      

Marco gcm_crypt_and_tag

#define gcm_crypt_and_tag mbedtls_gcm_crypt_and_tag


      

Marco gcm_finish

#define gcm_finish mbedtls_gcm_finish


      

Marco gcm_free

#define gcm_free mbedtls_gcm_free


      

Marco gcm_init

#define gcm_init mbedtls_gcm_init


      

Marco gcm_self_test

#define gcm_self_test mbedtls_gcm_self_test


      

Marco gcm_starts

#define gcm_starts mbedtls_gcm_starts


      

Marco gcm_update

#define gcm_update mbedtls_gcm_update


      

Marco get_timer

#define get_timer mbedtls_timing_get_timer


      

Marco hardclock

#define hardclock mbedtls_timing_hardclock


      

Marco hardclock_poll

#define hardclock_poll mbedtls_hardclock_poll


      

Marco havege_free

#define havege_free mbedtls_havege_free


      

Marco havege_init

#define havege_init mbedtls_havege_init


      

Marco havege_poll

#define havege_poll mbedtls_havege_poll


      

Marco havege_random

#define havege_random mbedtls_havege_random


      

Marco havege_state

#define havege_state mbedtls_havege_state


      

Marco hmac_drbg_context

#define hmac_drbg_context mbedtls_hmac_drbg_context


      

Marco hmac_drbg_free

#define hmac_drbg_free mbedtls_hmac_drbg_free


      

Marco hmac_drbg_init

#define hmac_drbg_init mbedtls_hmac_drbg_init


      

Marco hmac_drbg_random

#define hmac_drbg_random mbedtls_hmac_drbg_random


      

Marco hmac_drbg_random_with_add

#define hmac_drbg_random_with_add mbedtls_hmac_drbg_random_with_add


      

Marco hmac_drbg_reseed

#define hmac_drbg_reseed mbedtls_hmac_drbg_reseed


      

Marco hmac_drbg_self_test

#define hmac_drbg_self_test mbedtls_hmac_drbg_self_test


      

Marco hmac_drbg_set_entropy_len

#define hmac_drbg_set_entropy_len mbedtls_hmac_drbg_set_entropy_len


      

Marco hmac_drbg_set_prediction_resistance

#define hmac_drbg_set_prediction_resistance mbedtls_hmac_drbg_set_prediction_resistance


      

Marco hmac_drbg_set_reseed_interval

#define hmac_drbg_set_reseed_interval mbedtls_hmac_drbg_set_reseed_interval


      

Marco hmac_drbg_update

#define hmac_drbg_update mbedtls_hmac_drbg_update


      

Marco hmac_drbg_update_seed_file

#define hmac_drbg_update_seed_file mbedtls_hmac_drbg_update_seed_file


      

Marco hmac_drbg_write_seed_file

#define hmac_drbg_write_seed_file mbedtls_hmac_drbg_write_seed_file


      

Marco hr_time

#define hr_time mbedtls_timing_hr_time


      

Marco key_exchange_type_t

#define key_exchange_type_t mbedtls_key_exchange_type_t


      

Marco md

#define md mbedtls_md


      

Marco md2

#define md2 mbedtls_md2


      

Marco md2_context

#define md2_context mbedtls_md2_context


      

Marco md2_finish

#define md2_finish mbedtls_md2_finish


      

Marco md2_free

#define md2_free mbedtls_md2_free


      

Marco md2_info

#define md2_info mbedtls_md2_info


      

Marco md2_init

#define md2_init mbedtls_md2_init


      

Marco md2_process

#define md2_process mbedtls_md2_process


      

Marco md2_self_test

#define md2_self_test mbedtls_md2_self_test


      

Marco md2_starts

#define md2_starts mbedtls_md2_starts


      

Marco md2_update

#define md2_update mbedtls_md2_update


      

Marco md4

#define md4 mbedtls_md4


      

Marco md4_context

#define md4_context mbedtls_md4_context


      

Marco md4_finish

#define md4_finish mbedtls_md4_finish


      

Marco md4_free

#define md4_free mbedtls_md4_free


      

Marco md4_info

#define md4_info mbedtls_md4_info


      

Marco md4_init

#define md4_init mbedtls_md4_init


      

Marco md4_process

#define md4_process mbedtls_md4_process


      

Marco md4_self_test

#define md4_self_test mbedtls_md4_self_test


      

Marco md4_starts

#define md4_starts mbedtls_md4_starts


      

Marco md4_update

#define md4_update mbedtls_md4_update


      

Marco md5

#define md5 mbedtls_md5


      

Marco md5_context

#define md5_context mbedtls_md5_context


      

Marco md5_finish

#define md5_finish mbedtls_md5_finish


      

Marco md5_free

#define md5_free mbedtls_md5_free


      

Marco md5_info

#define md5_info mbedtls_md5_info


      

Marco md5_init

#define md5_init mbedtls_md5_init


      

Marco md5_process

#define md5_process mbedtls_md5_process


      

Marco md5_self_test

#define md5_self_test mbedtls_md5_self_test


      

Marco md5_starts

#define md5_starts mbedtls_md5_starts


      

Marco md5_update

#define md5_update mbedtls_md5_update


      

Marco md_context_t

#define md_context_t mbedtls_md_context_t


      

Marco md_file

#define md_file mbedtls_md_file


      

Marco md_finish

#define md_finish mbedtls_md_finish


      

Marco md_free

#define md_free mbedtls_md_free


      

Marco md_get_name

#define md_get_name mbedtls_md_get_name


      

Marco md_get_size

#define md_get_size mbedtls_md_get_size


      

Marco md_get_type

#define md_get_type mbedtls_md_get_type


      

Marco md_hmac

#define md_hmac mbedtls_md_hmac


      

Marco md_hmac_finish

#define md_hmac_finish mbedtls_md_hmac_finish


      

Marco md_hmac_reset

#define md_hmac_reset mbedtls_md_hmac_reset


      

Marco md_hmac_starts

#define md_hmac_starts mbedtls_md_hmac_starts


      

Marco md_hmac_update

#define md_hmac_update mbedtls_md_hmac_update


      

Marco md_info_from_string

#define md_info_from_string mbedtls_md_info_from_string


      

Marco md_info_from_type

#define md_info_from_type mbedtls_md_info_from_type


      

Marco md_info_t

#define md_info_t mbedtls_md_info_t


      

Marco md_init

#define md_init mbedtls_md_init


      

Marco md_init_ctx

#define md_init_ctx mbedtls_md_init_ctx


      

Marco md_list

#define md_list mbedtls_md_list


      

Marco md_process

#define md_process mbedtls_md_process


      

Marco md_starts

#define md_starts mbedtls_md_starts


      

Marco md_type_t

#define md_type_t mbedtls_md_type_t


      

Marco md_update

#define md_update mbedtls_md_update


      

Marco memory_buffer_alloc_cur_get

#define memory_buffer_alloc_cur_get mbedtls_memory_buffer_alloc_cur_get


      

Marco memory_buffer_alloc_free

#define memory_buffer_alloc_free mbedtls_memory_buffer_alloc_free


      

Marco memory_buffer_alloc_init

#define memory_buffer_alloc_init mbedtls_memory_buffer_alloc_init


      

Marco memory_buffer_alloc_max_get

#define memory_buffer_alloc_max_get mbedtls_memory_buffer_alloc_max_get


      

Marco memory_buffer_alloc_max_reset

#define memory_buffer_alloc_max_reset mbedtls_memory_buffer_alloc_max_reset


      

Marco memory_buffer_alloc_self_test

#define memory_buffer_alloc_self_test mbedtls_memory_buffer_alloc_self_test


      

Marco memory_buffer_alloc_status

#define memory_buffer_alloc_status mbedtls_memory_buffer_alloc_status


      

Marco memory_buffer_alloc_verify

#define memory_buffer_alloc_verify mbedtls_memory_buffer_alloc_verify


      

Marco memory_buffer_set_verify

#define memory_buffer_set_verify mbedtls_memory_buffer_set_verify


      

Marco mpi

#define mpi mbedtls_mpi


      

Marco mpi_add_abs

#define mpi_add_abs mbedtls_mpi_add_abs


      

Marco mpi_add_int

#define mpi_add_int mbedtls_mpi_add_int


      

Marco mpi_add_mpi

#define mpi_add_mpi mbedtls_mpi_add_mpi


      

Marco mpi_cmp_abs

#define mpi_cmp_abs mbedtls_mpi_cmp_abs


      

Marco mpi_cmp_int

#define mpi_cmp_int mbedtls_mpi_cmp_int


      

Marco mpi_cmp_mpi

#define mpi_cmp_mpi mbedtls_mpi_cmp_mpi


      

Marco mpi_copy

#define mpi_copy mbedtls_mpi_copy


      

Marco mpi_div_int

#define mpi_div_int mbedtls_mpi_div_int


      

Marco mpi_div_mpi

#define mpi_div_mpi mbedtls_mpi_div_mpi


      

Marco mpi_exp_mod

#define mpi_exp_mod mbedtls_mpi_exp_mod


      

Marco mpi_fill_random

#define mpi_fill_random mbedtls_mpi_fill_random


      

Marco mpi_free

#define mpi_free mbedtls_mpi_free


      

Marco mpi_gcd

#define mpi_gcd mbedtls_mpi_gcd


      

Marco mpi_gen_prime

#define mpi_gen_prime mbedtls_mpi_gen_prime


      

Marco mpi_get_bit

#define mpi_get_bit mbedtls_mpi_get_bit


      

Marco mpi_grow

#define mpi_grow mbedtls_mpi_grow


      

Marco mpi_init

#define mpi_init mbedtls_mpi_init


      

Marco mpi_inv_mod

#define mpi_inv_mod mbedtls_mpi_inv_mod


      

Marco mpi_is_prime

#define mpi_is_prime mbedtls_mpi_is_prime


      

Marco mpi_lsb

#define mpi_lsb mbedtls_mpi_lsb


      

Marco mpi_lset

#define mpi_lset mbedtls_mpi_lset


      

Marco mpi_mod_int

#define mpi_mod_int mbedtls_mpi_mod_int


      

Marco mpi_mod_mpi

#define mpi_mod_mpi mbedtls_mpi_mod_mpi


      

Marco mpi_msb

#define mpi_msb mbedtls_mpi_bitlen


      

Marco mpi_mul_int

#define mpi_mul_int mbedtls_mpi_mul_int


      

Marco mpi_mul_mpi

#define mpi_mul_mpi mbedtls_mpi_mul_mpi


      

Marco mpi_read_binary

#define mpi_read_binary mbedtls_mpi_read_binary


      

Marco mpi_read_file

#define mpi_read_file mbedtls_mpi_read_file


      

Marco mpi_read_string

#define mpi_read_string mbedtls_mpi_read_string


      

Marco mpi_safe_cond_assign

#define mpi_safe_cond_assign mbedtls_mpi_safe_cond_assign


      

Marco mpi_safe_cond_swap

#define mpi_safe_cond_swap mbedtls_mpi_safe_cond_swap


      

Marco mpi_self_test

#define mpi_self_test mbedtls_mpi_self_test


      

Marco mpi_set_bit

#define mpi_set_bit mbedtls_mpi_set_bit


      

Marco mpi_shift_l

#define mpi_shift_l mbedtls_mpi_shift_l


      

Marco mpi_shift_r

#define mpi_shift_r mbedtls_mpi_shift_r


      

Marco mpi_shrink

#define mpi_shrink mbedtls_mpi_shrink


      

Marco mpi_size

#define mpi_size mbedtls_mpi_size


      

Marco mpi_sub_abs

#define mpi_sub_abs mbedtls_mpi_sub_abs


      

Marco mpi_sub_int

#define mpi_sub_int mbedtls_mpi_sub_int


      

Marco mpi_sub_mpi

#define mpi_sub_mpi mbedtls_mpi_sub_mpi


      

Marco mpi_swap

#define mpi_swap mbedtls_mpi_swap


      

Marco mpi_write_binary

#define mpi_write_binary mbedtls_mpi_write_binary


      

Marco mpi_write_file

#define mpi_write_file mbedtls_mpi_write_file


      

Marco mpi_write_string

#define mpi_write_string mbedtls_mpi_write_string


      

Marco net_accept

#define net_accept mbedtls_net_accept


      

Marco net_bind

#define net_bind mbedtls_net_bind


      

Marco net_close

#define net_close mbedtls_net_free


      

Marco net_connect

#define net_connect mbedtls_net_connect


      

Marco net_recv

#define net_recv mbedtls_net_recv


      

Marco net_recv_timeout

#define net_recv_timeout mbedtls_net_recv_timeout


      

Marco net_send

#define net_send mbedtls_net_send


      

Marco net_set_block

#define net_set_block mbedtls_net_set_block


      

Marco net_set_nonblock

#define net_set_nonblock mbedtls_net_set_nonblock


      

Marco net_usleep

#define net_usleep mbedtls_net_usleep


      

Marco oid_descriptor_t

#define oid_descriptor_t mbedtls_oid_descriptor_t


      

Marco oid_get_attr_short_name

#define oid_get_attr_short_name mbedtls_oid_get_attr_short_name


      

Marco oid_get_cipher_alg

#define oid_get_cipher_alg mbedtls_oid_get_cipher_alg


      

Marco oid_get_ec_grp

#define oid_get_ec_grp mbedtls_oid_get_ec_grp


      

Marco oid_get_extended_key_usage

#define oid_get_extended_key_usage mbedtls_oid_get_extended_key_usage


      

Marco oid_get_md_alg

#define oid_get_md_alg mbedtls_oid_get_md_alg


      

Marco oid_get_numeric_string

#define oid_get_numeric_string mbedtls_oid_get_numeric_string


      

Marco oid_get_oid_by_ec_grp

#define oid_get_oid_by_ec_grp mbedtls_oid_get_oid_by_ec_grp


      

Marco oid_get_oid_by_md

#define oid_get_oid_by_md mbedtls_oid_get_oid_by_md


      

Marco oid_get_oid_by_pk_alg

#define oid_get_oid_by_pk_alg mbedtls_oid_get_oid_by_pk_alg


      

Marco oid_get_oid_by_sig_alg

#define oid_get_oid_by_sig_alg mbedtls_oid_get_oid_by_sig_alg


      

Marco oid_get_pk_alg

#define oid_get_pk_alg mbedtls_oid_get_pk_alg


      

Marco oid_get_pkcs12_pbe_alg

#define oid_get_pkcs12_pbe_alg mbedtls_oid_get_pkcs12_pbe_alg


      

Marco oid_get_sig_alg

#define oid_get_sig_alg mbedtls_oid_get_sig_alg


      

Marco oid_get_sig_alg_desc

#define oid_get_sig_alg_desc mbedtls_oid_get_sig_alg_desc


      

Marco oid_get_x509_ext_type

#define oid_get_x509_ext_type mbedtls_oid_get_x509_ext_type


      

Marco operation_t

#define operation_t mbedtls_operation_t


      

Marco padlock_supports

#define padlock_supports mbedtls_padlock_has_support


      

Marco padlock_xcryptcbc

#define padlock_xcryptcbc mbedtls_padlock_xcryptcbc


      

Marco padlock_xcryptecb

#define padlock_xcryptecb mbedtls_padlock_xcryptecb


      

Marco pem_context

#define pem_context mbedtls_pem_context


      

Marco pem_free

#define pem_free mbedtls_pem_free


      

Marco pem_init

#define pem_init mbedtls_pem_init


      

Marco pem_read_buffer

#define pem_read_buffer mbedtls_pem_read_buffer


      

Marco pem_write_buffer

#define pem_write_buffer mbedtls_pem_write_buffer


      

Marco pk_can_do

#define pk_can_do mbedtls_pk_can_do


      

Marco pk_check_pair

#define pk_check_pair mbedtls_pk_check_pair


      

Marco pk_context

#define pk_context mbedtls_pk_context


      

Marco pk_debug

#define pk_debug mbedtls_pk_debug


      

Marco pk_debug_item

#define pk_debug_item mbedtls_pk_debug_item


      

Marco pk_debug_type

#define pk_debug_type mbedtls_pk_debug_type


      

Marco pk_decrypt

#define pk_decrypt mbedtls_pk_decrypt


      

Marco pk_ec

#define pk_ec mbedtls_pk_ec


      

Marco pk_encrypt

#define pk_encrypt mbedtls_pk_encrypt


      

Marco pk_free

#define pk_free mbedtls_pk_free


      

Marco pk_get_len

#define pk_get_len mbedtls_pk_get_len


      

Marco pk_get_name

#define pk_get_name mbedtls_pk_get_name


      

Marco pk_get_size

#define pk_get_size mbedtls_pk_get_bitlen


      

Marco pk_get_type

#define pk_get_type mbedtls_pk_get_type


      

Marco pk_info_from_type

#define pk_info_from_type mbedtls_pk_info_from_type


      

Marco pk_info_t

#define pk_info_t mbedtls_pk_info_t


      

Marco pk_init

#define pk_init mbedtls_pk_init


      

Marco pk_init_ctx

#define pk_init_ctx mbedtls_pk_setup


      

Marco pk_init_ctx_rsa_alt

#define pk_init_ctx_rsa_alt mbedtls_pk_setup_rsa_alt


      

Marco pk_load_file

#define pk_load_file mbedtls_pk_load_file


      

Marco pk_parse_key

#define pk_parse_key mbedtls_pk_parse_key


      

Marco pk_parse_keyfile

#define pk_parse_keyfile mbedtls_pk_parse_keyfile


      

Marco pk_parse_public_key

#define pk_parse_public_key mbedtls_pk_parse_public_key


      

Marco pk_parse_public_keyfile

#define pk_parse_public_keyfile mbedtls_pk_parse_public_keyfile


      

Marco pk_parse_subpubkey

#define pk_parse_subpubkey mbedtls_pk_parse_subpubkey


      

Marco pk_rsa

#define pk_rsa mbedtls_pk_rsa


      

Marco pk_rsa_alt_decrypt_func

#define pk_rsa_alt_decrypt_func mbedtls_pk_rsa_alt_decrypt_func


      

Marco pk_rsa_alt_key_len_func

#define pk_rsa_alt_key_len_func mbedtls_pk_rsa_alt_key_len_func


      

Marco pk_rsa_alt_sign_func

#define pk_rsa_alt_sign_func mbedtls_pk_rsa_alt_sign_func


      

Marco pk_rsassa_pss_options

#define pk_rsassa_pss_options mbedtls_pk_rsassa_pss_options


      

Marco pk_sign

#define pk_sign mbedtls_pk_sign


      

Marco pk_type_t

#define pk_type_t mbedtls_pk_type_t


      

Marco pk_verify

#define pk_verify mbedtls_pk_verify


      

Marco pk_verify_ext

#define pk_verify_ext mbedtls_pk_verify_ext


      

Marco pk_write_key_der

#define pk_write_key_der mbedtls_pk_write_key_der


      

Marco pk_write_key_pem

#define pk_write_key_pem mbedtls_pk_write_key_pem


      

Marco pk_write_pubkey

#define pk_write_pubkey mbedtls_pk_write_pubkey


      

Marco pk_write_pubkey_der

#define pk_write_pubkey_der mbedtls_pk_write_pubkey_der


      

Marco pk_write_pubkey_pem

#define pk_write_pubkey_pem mbedtls_pk_write_pubkey_pem


      

Marco pkcs11_context

#define pkcs11_context mbedtls_pkcs11_context


      

Marco pkcs11_decrypt

#define pkcs11_decrypt mbedtls_pkcs11_decrypt


      

Marco pkcs11_priv_key_free

#define pkcs11_priv_key_free mbedtls_pkcs11_priv_key_free


      

Marco pkcs11_priv_key_init

#define pkcs11_priv_key_init mbedtls_pkcs11_priv_key_bind


      

Marco pkcs11_sign

#define pkcs11_sign mbedtls_pkcs11_sign


      

Marco pkcs11_x509_cert_init

#define pkcs11_x509_cert_init mbedtls_pkcs11_x509_cert_bind


      

Marco pkcs12_derivation

#define pkcs12_derivation mbedtls_pkcs12_derivation


      

Marco pkcs12_pbe

#define pkcs12_pbe mbedtls_pkcs12_pbe


      

Marco pkcs12_pbe_sha1_rc4_128

#define pkcs12_pbe_sha1_rc4_128 mbedtls_pkcs12_pbe_sha1_rc4_128


      

Marco pkcs5_pbes2

#define pkcs5_pbes2 mbedtls_pkcs5_pbes2


      

Marco pkcs5_pbkdf2_hmac

#define pkcs5_pbkdf2_hmac mbedtls_pkcs5_pbkdf2_hmac


      

Marco pkcs5_self_test

#define pkcs5_self_test mbedtls_pkcs5_self_test


      

Marco platform_entropy_poll

#define platform_entropy_poll mbedtls_platform_entropy_poll


      

Marco platform_set_exit

#define platform_set_exit mbedtls_platform_set_exit


      

Marco platform_set_fprintf

#define platform_set_fprintf mbedtls_platform_set_fprintf


      

Marco platform_set_printf

#define platform_set_printf mbedtls_platform_set_printf


      

Marco platform_set_snprintf

#define platform_set_snprintf mbedtls_platform_set_snprintf


      

Marco polarssl_exit

#define polarssl_exit mbedtls_exit


      

Marco polarssl_fprintf

#define polarssl_fprintf mbedtls_fprintf


      

Marco polarssl_free

#define polarssl_free mbedtls_free


      

Marco polarssl_mutex_free

#define polarssl_mutex_free mbedtls_mutex_free


      

Marco polarssl_mutex_init

#define polarssl_mutex_init mbedtls_mutex_init


      

Marco polarssl_mutex_lock

#define polarssl_mutex_lock mbedtls_mutex_lock


      

Marco polarssl_mutex_unlock

#define polarssl_mutex_unlock mbedtls_mutex_unlock


      

Marco polarssl_printf

#define polarssl_printf mbedtls_printf


      

Marco polarssl_snprintf

#define polarssl_snprintf mbedtls_snprintf


      

Marco polarssl_strerror

#define polarssl_strerror mbedtls_strerror


      

Marco ripemd160

#define ripemd160 mbedtls_ripemd160


      

Marco ripemd160_context

#define ripemd160_context mbedtls_ripemd160_context


      

Marco ripemd160_finish

#define ripemd160_finish mbedtls_ripemd160_finish


      

Marco ripemd160_free

#define ripemd160_free mbedtls_ripemd160_free


      

Marco ripemd160_info

#define ripemd160_info mbedtls_ripemd160_info


      

Marco ripemd160_init

#define ripemd160_init mbedtls_ripemd160_init


      

Marco ripemd160_process

#define ripemd160_process mbedtls_ripemd160_process


      

Marco ripemd160_self_test

#define ripemd160_self_test mbedtls_ripemd160_self_test


      

Marco ripemd160_starts

#define ripemd160_starts mbedtls_ripemd160_starts


      

Marco ripemd160_update

#define ripemd160_update mbedtls_ripemd160_update


      

Marco rsa_alt_context

#define rsa_alt_context mbedtls_rsa_alt_context


      

Marco rsa_alt_info

#define rsa_alt_info mbedtls_rsa_alt_info


      

Marco rsa_check_privkey

#define rsa_check_privkey mbedtls_rsa_check_privkey


      

Marco rsa_check_pub_priv

#define rsa_check_pub_priv mbedtls_rsa_check_pub_priv


      

Marco rsa_check_pubkey

#define rsa_check_pubkey mbedtls_rsa_check_pubkey


      

Marco rsa_context

#define rsa_context mbedtls_rsa_context


      

Marco rsa_copy

#define rsa_copy mbedtls_rsa_copy


      

Marco rsa_free

#define rsa_free mbedtls_rsa_free


      

Marco rsa_gen_key

#define rsa_gen_key mbedtls_rsa_gen_key


      

Marco rsa_info

#define rsa_info mbedtls_rsa_info


      

Marco rsa_init

#define rsa_init mbedtls_rsa_init


      

Marco rsa_pkcs1_decrypt

#define rsa_pkcs1_decrypt mbedtls_rsa_pkcs1_decrypt


      

Marco rsa_pkcs1_encrypt

#define rsa_pkcs1_encrypt mbedtls_rsa_pkcs1_encrypt


      

Marco rsa_pkcs1_sign

#define rsa_pkcs1_sign mbedtls_rsa_pkcs1_sign


      

Marco rsa_pkcs1_verify

#define rsa_pkcs1_verify mbedtls_rsa_pkcs1_verify


      

Marco rsa_private

#define rsa_private mbedtls_rsa_private


      

Marco rsa_public

#define rsa_public mbedtls_rsa_public


      

Marco rsa_rsaes_oaep_decrypt

#define rsa_rsaes_oaep_decrypt mbedtls_rsa_rsaes_oaep_decrypt


      

Marco rsa_rsaes_oaep_encrypt

#define rsa_rsaes_oaep_encrypt mbedtls_rsa_rsaes_oaep_encrypt


      

Marco rsa_rsaes_pkcs1_v15_decrypt

#define rsa_rsaes_pkcs1_v15_decrypt mbedtls_rsa_rsaes_pkcs1_v15_decrypt


      

Marco rsa_rsaes_pkcs1_v15_encrypt

#define rsa_rsaes_pkcs1_v15_encrypt mbedtls_rsa_rsaes_pkcs1_v15_encrypt


      

Marco rsa_rsassa_pkcs1_v15_sign

#define rsa_rsassa_pkcs1_v15_sign mbedtls_rsa_rsassa_pkcs1_v15_sign


      

Marco rsa_rsassa_pkcs1_v15_verify

#define rsa_rsassa_pkcs1_v15_verify mbedtls_rsa_rsassa_pkcs1_v15_verify


      

Marco rsa_rsassa_pss_sign

#define rsa_rsassa_pss_sign mbedtls_rsa_rsassa_pss_sign


      

Marco rsa_rsassa_pss_verify

#define rsa_rsassa_pss_verify mbedtls_rsa_rsassa_pss_verify


      

Marco rsa_rsassa_pss_verify_ext

#define rsa_rsassa_pss_verify_ext mbedtls_rsa_rsassa_pss_verify_ext


      

Marco rsa_self_test

#define rsa_self_test mbedtls_rsa_self_test


      

Marco rsa_set_padding

#define rsa_set_padding mbedtls_rsa_set_padding


      

Marco safer_memcmp

#define safer_memcmp mbedtls_ssl_safer_memcmp


      

Marco set_alarm

#define set_alarm mbedtls_set_alarm


      

Marco sha1

#define sha1 mbedtls_sha1


      

Marco sha1_context

#define sha1_context mbedtls_sha1_context


      

Marco sha1_finish

#define sha1_finish mbedtls_sha1_finish


      

Marco sha1_free

#define sha1_free mbedtls_sha1_free


      

Marco sha1_info

#define sha1_info mbedtls_sha1_info


      

Marco sha1_init

#define sha1_init mbedtls_sha1_init


      

Marco sha1_process

#define sha1_process mbedtls_sha1_process


      

Marco sha1_self_test

#define sha1_self_test mbedtls_sha1_self_test


      

Marco sha1_starts

#define sha1_starts mbedtls_sha1_starts


      

Marco sha1_update

#define sha1_update mbedtls_sha1_update


      

Marco sha224_info

#define sha224_info mbedtls_sha224_info


      

Marco sha256

#define sha256 mbedtls_sha256


      

Marco sha256_context

#define sha256_context mbedtls_sha256_context


      

Marco sha256_finish

#define sha256_finish mbedtls_sha256_finish


      

Marco sha256_free

#define sha256_free mbedtls_sha256_free


      

Marco sha256_info

#define sha256_info mbedtls_sha256_info


      

Marco sha256_init

#define sha256_init mbedtls_sha256_init


      

Marco sha256_process

#define sha256_process mbedtls_sha256_process


      

Marco sha256_self_test

#define sha256_self_test mbedtls_sha256_self_test


      

Marco sha256_starts

#define sha256_starts mbedtls_sha256_starts


      

Marco sha256_update

#define sha256_update mbedtls_sha256_update


      

Marco sha384_info

#define sha384_info mbedtls_sha384_info


      

Marco sha512

#define sha512 mbedtls_sha512


      

Marco sha512_context

#define sha512_context mbedtls_sha512_context


      

Marco sha512_finish

#define sha512_finish mbedtls_sha512_finish


      

Marco sha512_free

#define sha512_free mbedtls_sha512_free


      

Marco sha512_info

#define sha512_info mbedtls_sha512_info


      

Marco sha512_init

#define sha512_init mbedtls_sha512_init


      

Marco sha512_process

#define sha512_process mbedtls_sha512_process


      

Marco sha512_self_test

#define sha512_self_test mbedtls_sha512_self_test


      

Marco sha512_starts

#define sha512_starts mbedtls_sha512_starts


      

Marco sha512_update

#define sha512_update mbedtls_sha512_update


      

Marco source_state

#define source_state mbedtls_entropy_source_state


      

Marco ssl_cache_context

#define ssl_cache_context mbedtls_ssl_cache_context


      

Marco ssl_cache_entry

#define ssl_cache_entry mbedtls_ssl_cache_entry


      

Marco ssl_cache_free

#define ssl_cache_free mbedtls_ssl_cache_free


      

Marco ssl_cache_get

#define ssl_cache_get mbedtls_ssl_cache_get


      

Marco ssl_cache_init

#define ssl_cache_init mbedtls_ssl_cache_init


      

Marco ssl_cache_set

#define ssl_cache_set mbedtls_ssl_cache_set


      

Marco ssl_cache_set_max_entries

#define ssl_cache_set_max_entries mbedtls_ssl_cache_set_max_entries


      

Marco ssl_cache_set_timeout

#define ssl_cache_set_timeout mbedtls_ssl_cache_set_timeout


      

Marco ssl_check_cert_usage

#define ssl_check_cert_usage mbedtls_ssl_check_cert_usage


      

Marco ssl_ciphersuite_from_id

#define ssl_ciphersuite_from_id mbedtls_ssl_ciphersuite_from_id


      

Marco ssl_ciphersuite_from_string

#define ssl_ciphersuite_from_string mbedtls_ssl_ciphersuite_from_string


      

Marco ssl_ciphersuite_t

#define ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t


      

Marco ssl_ciphersuite_uses_ec

#define ssl_ciphersuite_uses_ec mbedtls_ssl_ciphersuite_uses_ec


      

Marco ssl_ciphersuite_uses_psk

#define ssl_ciphersuite_uses_psk mbedtls_ssl_ciphersuite_uses_psk


      

Marco ssl_close_notify

#define ssl_close_notify mbedtls_ssl_close_notify


      

Marco ssl_context

#define ssl_context mbedtls_ssl_context


      
      
#define ssl_cookie_check mbedtls_ssl_cookie_check


      
      
#define ssl_cookie_check_t mbedtls_ssl_cookie_check_t


      
      
#define ssl_cookie_ctx mbedtls_ssl_cookie_ctx


      
      
#define ssl_cookie_free mbedtls_ssl_cookie_free


      
      
#define ssl_cookie_init mbedtls_ssl_cookie_init


      
      
#define ssl_cookie_set_timeout mbedtls_ssl_cookie_set_timeout


      
      
#define ssl_cookie_setup mbedtls_ssl_cookie_setup


      
      
#define ssl_cookie_write mbedtls_ssl_cookie_write


      
      
#define ssl_cookie_write_t mbedtls_ssl_cookie_write_t


      

Marco ssl_derive_keys

#define ssl_derive_keys mbedtls_ssl_derive_keys


      

Marco ssl_dtls_replay_check

#define ssl_dtls_replay_check mbedtls_ssl_dtls_replay_check


      

Marco ssl_dtls_replay_update

#define ssl_dtls_replay_update mbedtls_ssl_dtls_replay_update


      

Marco ssl_fetch_input

#define ssl_fetch_input mbedtls_ssl_fetch_input


      

Marco ssl_flight_item

#define ssl_flight_item mbedtls_ssl_flight_item


      

Marco ssl_flush_output

#define ssl_flush_output mbedtls_ssl_flush_output


      

Marco ssl_free

#define ssl_free mbedtls_ssl_free


      

Marco ssl_get_alpn_protocol

#define ssl_get_alpn_protocol mbedtls_ssl_get_alpn_protocol


      

Marco ssl_get_bytes_avail

#define ssl_get_bytes_avail mbedtls_ssl_get_bytes_avail


      

Marco ssl_get_ciphersuite

#define ssl_get_ciphersuite mbedtls_ssl_get_ciphersuite


      

Marco ssl_get_ciphersuite_id

#define ssl_get_ciphersuite_id mbedtls_ssl_get_ciphersuite_id


      

Marco ssl_get_ciphersuite_name

#define ssl_get_ciphersuite_name mbedtls_ssl_get_ciphersuite_name


      

Marco ssl_get_ciphersuite_sig_pk_alg

#define ssl_get_ciphersuite_sig_pk_alg mbedtls_ssl_get_ciphersuite_sig_pk_alg


      

Marco ssl_get_peer_cert

#define ssl_get_peer_cert mbedtls_ssl_get_peer_cert


      

Marco ssl_get_record_expansion

#define ssl_get_record_expansion mbedtls_ssl_get_record_expansion


      

Marco ssl_get_session

#define ssl_get_session mbedtls_ssl_get_session


      

Marco ssl_get_verify_result

#define ssl_get_verify_result mbedtls_ssl_get_verify_result


      

Marco ssl_get_version

#define ssl_get_version mbedtls_ssl_get_version


      

Marco ssl_handshake

#define ssl_handshake mbedtls_ssl_handshake


      

Marco ssl_handshake_client_step

#define ssl_handshake_client_step mbedtls_ssl_handshake_client_step


      

Marco ssl_handshake_free

#define ssl_handshake_free mbedtls_ssl_handshake_free


      

Marco ssl_handshake_params

#define ssl_handshake_params mbedtls_ssl_handshake_params


      

Marco ssl_handshake_server_step

#define ssl_handshake_server_step mbedtls_ssl_handshake_server_step


      

Marco ssl_handshake_step

#define ssl_handshake_step mbedtls_ssl_handshake_step


      

Marco ssl_handshake_wrapup

#define ssl_handshake_wrapup mbedtls_ssl_handshake_wrapup


      

Marco ssl_hdr_len

#define ssl_hdr_len mbedtls_ssl_hdr_len


      

Marco ssl_hs_hdr_len

#define ssl_hs_hdr_len mbedtls_ssl_hs_hdr_len


      

Marco ssl_hw_record_activate

#define ssl_hw_record_activate mbedtls_ssl_hw_record_activate


      

Marco ssl_hw_record_finish

#define ssl_hw_record_finish mbedtls_ssl_hw_record_finish


      

Marco ssl_hw_record_init

#define ssl_hw_record_init mbedtls_ssl_hw_record_init


      

Marco ssl_hw_record_read

#define ssl_hw_record_read mbedtls_ssl_hw_record_read


      

Marco ssl_hw_record_reset

#define ssl_hw_record_reset mbedtls_ssl_hw_record_reset


      

Marco ssl_hw_record_write

#define ssl_hw_record_write mbedtls_ssl_hw_record_write


      

Marco ssl_init

#define ssl_init mbedtls_ssl_init


      

Marco ssl_key_cert

#define ssl_key_cert mbedtls_ssl_key_cert


      

Marco ssl_legacy_renegotiation

#define ssl_legacy_renegotiation mbedtls_ssl_conf_legacy_renegotiation


      

Marco ssl_list_ciphersuites

#define ssl_list_ciphersuites mbedtls_ssl_list_ciphersuites


      

Marco ssl_md_alg_from_hash

#define ssl_md_alg_from_hash mbedtls_ssl_md_alg_from_hash


      

Marco ssl_optimize_checksum

#define ssl_optimize_checksum mbedtls_ssl_optimize_checksum


      

Marco ssl_own_cert

#define ssl_own_cert mbedtls_ssl_own_cert


      

Marco ssl_own_key

#define ssl_own_key mbedtls_ssl_own_key


      

Marco ssl_parse_certificate

#define ssl_parse_certificate mbedtls_ssl_parse_certificate


      

Marco ssl_parse_change_cipher_spec

#define ssl_parse_change_cipher_spec mbedtls_ssl_parse_change_cipher_spec


      

Marco ssl_parse_finished

#define ssl_parse_finished mbedtls_ssl_parse_finished


      

Marco ssl_pk_alg_from_sig

#define ssl_pk_alg_from_sig mbedtls_ssl_pk_alg_from_sig


      

Marco ssl_pkcs11_decrypt

#define ssl_pkcs11_decrypt mbedtls_ssl_pkcs11_decrypt


      

Marco ssl_pkcs11_key_len

#define ssl_pkcs11_key_len mbedtls_ssl_pkcs11_key_len


      

Marco ssl_pkcs11_sign

#define ssl_pkcs11_sign mbedtls_ssl_pkcs11_sign


      

Marco ssl_psk_derive_premaster

#define ssl_psk_derive_premaster mbedtls_ssl_psk_derive_premaster


      

Marco ssl_read

#define ssl_read mbedtls_ssl_read


      

Marco ssl_read_record

#define ssl_read_record mbedtls_ssl_read_record


      

Marco ssl_read_version

#define ssl_read_version mbedtls_ssl_read_version


      

Marco ssl_recv_flight_completed

#define ssl_recv_flight_completed mbedtls_ssl_recv_flight_completed


      

Marco ssl_renegotiate

#define ssl_renegotiate mbedtls_ssl_renegotiate


      

Marco ssl_resend

#define ssl_resend mbedtls_ssl_resend


      

Marco ssl_reset_checksum

#define ssl_reset_checksum mbedtls_ssl_reset_checksum


      

Marco ssl_send_alert_message

#define ssl_send_alert_message mbedtls_ssl_send_alert_message


      

Marco ssl_send_fatal_handshake_failure

#define ssl_send_fatal_handshake_failure mbedtls_ssl_send_fatal_handshake_failure


      

Marco ssl_send_flight_completed

#define ssl_send_flight_completed mbedtls_ssl_send_flight_completed


      

Marco ssl_session

#define ssl_session mbedtls_ssl_session


      

Marco ssl_session_free

#define ssl_session_free mbedtls_ssl_session_free


      

Marco ssl_session_init

#define ssl_session_init mbedtls_ssl_session_init


      

Marco ssl_session_reset

#define ssl_session_reset mbedtls_ssl_session_reset


      

Marco ssl_set_alpn_protocols

#define ssl_set_alpn_protocols mbedtls_ssl_conf_alpn_protocols


      

Marco ssl_set_arc4_support

#define ssl_set_arc4_support mbedtls_ssl_conf_arc4_support


      

Marco ssl_set_authmode

#define ssl_set_authmode mbedtls_ssl_conf_authmode


      

Marco ssl_set_bio

#define ssl_set_bio mbedtls_ssl_set_bio


      

Marco ssl_set_ca_chain

#define ssl_set_ca_chain mbedtls_ssl_conf_ca_chain


      

Marco ssl_set_cbc_record_splitting

#define ssl_set_cbc_record_splitting mbedtls_ssl_conf_cbc_record_splitting


      

Marco ssl_set_ciphersuites

#define ssl_set_ciphersuites mbedtls_ssl_conf_ciphersuites


      

Marco ssl_set_ciphersuites_for_version

#define ssl_set_ciphersuites_for_version mbedtls_ssl_conf_ciphersuites_for_version


      

Marco ssl_set_client_transport_id

#define ssl_set_client_transport_id mbedtls_ssl_set_client_transport_id


      

Marco ssl_set_curves

#define ssl_set_curves mbedtls_ssl_conf_curves


      

Marco ssl_set_dbg

#define ssl_set_dbg mbedtls_ssl_conf_dbg


      

Marco ssl_set_dh_param

#define ssl_set_dh_param mbedtls_ssl_conf_dh_param


      

Marco ssl_set_dh_param_ctx

#define ssl_set_dh_param_ctx mbedtls_ssl_conf_dh_param_ctx


      

Marco ssl_set_dtls_anti_replay

#define ssl_set_dtls_anti_replay mbedtls_ssl_conf_dtls_anti_replay


      

Marco ssl_set_dtls_badmac_limit

#define ssl_set_dtls_badmac_limit mbedtls_ssl_conf_dtls_badmac_limit


      

Marco ssl_set_dtls_cookies

#define ssl_set_dtls_cookies mbedtls_ssl_conf_dtls_cookies


      

Marco ssl_set_encrypt_then_mac

#define ssl_set_encrypt_then_mac mbedtls_ssl_conf_encrypt_then_mac


      

Marco ssl_set_endpoint

#define ssl_set_endpoint mbedtls_ssl_conf_endpoint


      

Marco ssl_set_extended_master_secret

#define ssl_set_extended_master_secret mbedtls_ssl_conf_extended_master_secret


      

Marco ssl_set_fallback

#define ssl_set_fallback mbedtls_ssl_conf_fallback


      

Marco ssl_set_handshake_timeout

#define ssl_set_handshake_timeout mbedtls_ssl_conf_handshake_timeout


      

Marco ssl_set_hostname

#define ssl_set_hostname mbedtls_ssl_set_hostname


      

Marco ssl_set_max_frag_len

#define ssl_set_max_frag_len mbedtls_ssl_conf_max_frag_len


      

Marco ssl_set_max_version

#define ssl_set_max_version mbedtls_ssl_conf_max_version


      

Marco ssl_set_min_version

#define ssl_set_min_version mbedtls_ssl_conf_min_version


      

Marco ssl_set_own_cert

#define ssl_set_own_cert mbedtls_ssl_conf_own_cert


      

Marco ssl_set_psk

#define ssl_set_psk mbedtls_ssl_conf_psk


      

Marco ssl_set_psk_cb

#define ssl_set_psk_cb mbedtls_ssl_conf_psk_cb


      

Marco ssl_set_renegotiation

#define ssl_set_renegotiation mbedtls_ssl_conf_renegotiation


      

Marco ssl_set_renegotiation_enforced

#define ssl_set_renegotiation_enforced mbedtls_ssl_conf_renegotiation_enforced


      

Marco ssl_set_renegotiation_period

#define ssl_set_renegotiation_period mbedtls_ssl_conf_renegotiation_period


      

Marco ssl_set_rng

#define ssl_set_rng mbedtls_ssl_conf_rng


      

Marco ssl_set_session

#define ssl_set_session mbedtls_ssl_set_session


      

Marco ssl_set_session_cache

#define ssl_set_session_cache mbedtls_ssl_conf_session_cache


      

Marco ssl_set_session_tickets

#define ssl_set_session_tickets mbedtls_ssl_conf_session_tickets


      

Marco ssl_set_sni

#define ssl_set_sni mbedtls_ssl_conf_sni


      

Marco ssl_set_transport

#define ssl_set_transport mbedtls_ssl_conf_transport


      

Marco ssl_set_truncated_hmac

#define ssl_set_truncated_hmac mbedtls_ssl_conf_truncated_hmac


      

Marco ssl_set_verify

#define ssl_set_verify mbedtls_ssl_conf_verify


      

Marco ssl_sig_from_pk

#define ssl_sig_from_pk mbedtls_ssl_sig_from_pk


      

Marco ssl_states

#define ssl_states mbedtls_ssl_states


      

Marco ssl_transform

#define ssl_transform mbedtls_ssl_transform


      

Marco ssl_transform_free

#define ssl_transform_free mbedtls_ssl_transform_free


      

Marco ssl_write

#define ssl_write mbedtls_ssl_write


      

Marco ssl_write_certificate

#define ssl_write_certificate mbedtls_ssl_write_certificate


      

Marco ssl_write_change_cipher_spec

#define ssl_write_change_cipher_spec mbedtls_ssl_write_change_cipher_spec


      

Marco ssl_write_finished

#define ssl_write_finished mbedtls_ssl_write_finished


      

Marco ssl_write_record

#define ssl_write_record mbedtls_ssl_write_record


      

Marco ssl_write_version

#define ssl_write_version mbedtls_ssl_write_version


      

Marco supported_ciphers

#define supported_ciphers mbedtls_cipher_supported


      

Marco t_sint

#define t_sint mbedtls_mpi_sint


      

Marco t_udbl

#define t_udbl mbedtls_t_udbl


      

Marco t_uint

#define t_uint mbedtls_mpi_uint


      

Marco test_ca_crt

#define test_ca_crt mbedtls_test_ca_crt


      

Marco test_ca_crt_ec

#define test_ca_crt_ec mbedtls_test_ca_crt_ec


      

Marco test_ca_crt_rsa

#define test_ca_crt_rsa mbedtls_test_ca_crt_rsa


      

Marco test_ca_key

#define test_ca_key mbedtls_test_ca_key


      

Marco test_ca_key_ec

#define test_ca_key_ec mbedtls_test_ca_key_ec


      

Marco test_ca_key_rsa

#define test_ca_key_rsa mbedtls_test_ca_key_rsa


      

Marco test_ca_list

#define test_ca_list mbedtls_test_cas_pem


      

Marco test_ca_pwd

#define test_ca_pwd mbedtls_test_ca_pwd


      

Marco test_ca_pwd_ec

#define test_ca_pwd_ec mbedtls_test_ca_pwd_ec


      

Marco test_ca_pwd_rsa

#define test_ca_pwd_rsa mbedtls_test_ca_pwd_rsa


      

Marco test_cli_crt

#define test_cli_crt mbedtls_test_cli_crt


      

Marco test_cli_crt_ec

#define test_cli_crt_ec mbedtls_test_cli_crt_ec


      

Marco test_cli_crt_rsa

#define test_cli_crt_rsa mbedtls_test_cli_crt_rsa


      

Marco test_cli_key

#define test_cli_key mbedtls_test_cli_key


      

Marco test_cli_key_ec

#define test_cli_key_ec mbedtls_test_cli_key_ec


      

Marco test_cli_key_rsa

#define test_cli_key_rsa mbedtls_test_cli_key_rsa


      

Marco test_srv_crt

#define test_srv_crt mbedtls_test_srv_crt


      

Marco test_srv_crt_ec

#define test_srv_crt_ec mbedtls_test_srv_crt_ec


      

Marco test_srv_crt_rsa

#define test_srv_crt_rsa mbedtls_test_srv_crt_rsa


      

Marco test_srv_key

#define test_srv_key mbedtls_test_srv_key


      

Marco test_srv_key_ec

#define test_srv_key_ec mbedtls_test_srv_key_ec


      

Marco test_srv_key_rsa

#define test_srv_key_rsa mbedtls_test_srv_key_rsa


      

Marco threading_mutex_t

#define threading_mutex_t mbedtls_threading_mutex_t


      

Marco threading_set_alt

#define threading_set_alt mbedtls_threading_set_alt


      

Marco timing_self_test

#define timing_self_test mbedtls_timing_self_test


      

Marco version_check_feature

#define version_check_feature mbedtls_version_check_feature


      

Marco version_get_number

#define version_get_number mbedtls_version_get_number


      

Marco version_get_string

#define version_get_string mbedtls_version_get_string


      

Marco version_get_string_full

#define version_get_string_full mbedtls_version_get_string_full


      

Marco x509_bitstring

#define x509_bitstring mbedtls_x509_bitstring


      

Marco x509_buf

#define x509_buf mbedtls_x509_buf


      

Marco x509_crl

#define x509_crl mbedtls_x509_crl


      

Marco x509_crl_entry

#define x509_crl_entry mbedtls_x509_crl_entry


      

Marco x509_crl_free

#define x509_crl_free mbedtls_x509_crl_free


      

Marco x509_crl_info

#define x509_crl_info mbedtls_x509_crl_info


      

Marco x509_crl_init

#define x509_crl_init mbedtls_x509_crl_init


      

Marco x509_crl_parse

#define x509_crl_parse mbedtls_x509_crl_parse


      

Marco x509_crl_parse_der

#define x509_crl_parse_der mbedtls_x509_crl_parse_der


      

Marco x509_crl_parse_file

#define x509_crl_parse_file mbedtls_x509_crl_parse_file


      

Marco x509_crt

#define x509_crt mbedtls_x509_crt


      

Marco x509_crt_check_extended_key_usage

#define x509_crt_check_extended_key_usage mbedtls_x509_crt_check_extended_key_usage


      

Marco x509_crt_check_key_usage

#define x509_crt_check_key_usage mbedtls_x509_crt_check_key_usage


      

Marco x509_crt_free

#define x509_crt_free mbedtls_x509_crt_free


      

Marco x509_crt_info

#define x509_crt_info mbedtls_x509_crt_info


      

Marco x509_crt_init

#define x509_crt_init mbedtls_x509_crt_init


      

Marco x509_crt_parse

#define x509_crt_parse mbedtls_x509_crt_parse


      

Marco x509_crt_parse_der

#define x509_crt_parse_der mbedtls_x509_crt_parse_der


      

Marco x509_crt_parse_file

#define x509_crt_parse_file mbedtls_x509_crt_parse_file


      

Marco x509_crt_parse_path

#define x509_crt_parse_path mbedtls_x509_crt_parse_path


      

Marco x509_crt_revoked

#define x509_crt_revoked mbedtls_x509_crt_is_revoked


      

Marco x509_crt_verify

#define x509_crt_verify mbedtls_x509_crt_verify


      

Marco x509_csr

#define x509_csr mbedtls_x509_csr


      

Marco x509_csr_free

#define x509_csr_free mbedtls_x509_csr_free


      

Marco x509_csr_info

#define x509_csr_info mbedtls_x509_csr_info


      

Marco x509_csr_init

#define x509_csr_init mbedtls_x509_csr_init


      

Marco x509_csr_parse

#define x509_csr_parse mbedtls_x509_csr_parse


      

Marco x509_csr_parse_der

#define x509_csr_parse_der mbedtls_x509_csr_parse_der


      

Marco x509_csr_parse_file

#define x509_csr_parse_file mbedtls_x509_csr_parse_file


      

Marco x509_dn_gets

#define x509_dn_gets mbedtls_x509_dn_gets


      

Marco x509_get_alg

#define x509_get_alg mbedtls_x509_get_alg


      

Marco x509_get_alg_null

#define x509_get_alg_null mbedtls_x509_get_alg_null


      

Marco x509_get_ext

#define x509_get_ext mbedtls_x509_get_ext


      

Marco x509_get_name

#define x509_get_name mbedtls_x509_get_name


      

Marco x509_get_rsassa_pss_params

#define x509_get_rsassa_pss_params mbedtls_x509_get_rsassa_pss_params


      

Marco x509_get_serial

#define x509_get_serial mbedtls_x509_get_serial


      

Marco x509_get_sig

#define x509_get_sig mbedtls_x509_get_sig


      

Marco x509_get_sig_alg

#define x509_get_sig_alg mbedtls_x509_get_sig_alg


      

Marco x509_get_time

#define x509_get_time mbedtls_x509_get_time


      

Marco x509_key_size_helper

#define x509_key_size_helper mbedtls_x509_key_size_helper


      

Marco x509_name

#define x509_name mbedtls_x509_name


      

Marco x509_self_test

#define x509_self_test mbedtls_x509_self_test


      

Marco x509_sequence

#define x509_sequence mbedtls_x509_sequence


      

Marco x509_serial_gets

#define x509_serial_gets mbedtls_x509_serial_gets


      

Marco x509_set_extension

#define x509_set_extension mbedtls_x509_set_extension


      

Marco x509_sig_alg_gets

#define x509_sig_alg_gets mbedtls_x509_sig_alg_gets


      

Marco x509_string_to_names

#define x509_string_to_names mbedtls_x509_string_to_names


      

Marco x509_time

#define x509_time mbedtls_x509_time


      

Marco x509_time_expired

#define x509_time_expired mbedtls_x509_time_is_past


      

Marco x509_time_future

#define x509_time_future mbedtls_x509_time_is_future


      

Marco x509_write_extensions

#define x509_write_extensions mbedtls_x509_write_extensions


      

Marco x509_write_names

#define x509_write_names mbedtls_x509_write_names


      

Marco x509_write_sig

#define x509_write_sig mbedtls_x509_write_sig


      

Marco x509write_cert

#define x509write_cert mbedtls_x509write_cert


      

Marco x509write_crt_der

#define x509write_crt_der mbedtls_x509write_crt_der


      

Marco x509write_crt_free

#define x509write_crt_free mbedtls_x509write_crt_free


      

Marco x509write_crt_init

#define x509write_crt_init mbedtls_x509write_crt_init


      

Marco x509write_crt_pem

#define x509write_crt_pem mbedtls_x509write_crt_pem


      

Marco x509write_crt_set_authority_key_identifier

#define x509write_crt_set_authority_key_identifier mbedtls_x509write_crt_set_authority_key_identifier


      

Marco x509write_crt_set_basic_constraints

#define x509write_crt_set_basic_constraints mbedtls_x509write_crt_set_basic_constraints


      

Marco x509write_crt_set_extension

#define x509write_crt_set_extension mbedtls_x509write_crt_set_extension


      

Marco x509write_crt_set_issuer_key

#define x509write_crt_set_issuer_key mbedtls_x509write_crt_set_issuer_key


      

Marco x509write_crt_set_issuer_name

#define x509write_crt_set_issuer_name mbedtls_x509write_crt_set_issuer_name


      

Marco x509write_crt_set_key_usage

#define x509write_crt_set_key_usage mbedtls_x509write_crt_set_key_usage


      

Marco x509write_crt_set_md_alg

#define x509write_crt_set_md_alg mbedtls_x509write_crt_set_md_alg


      

Marco x509write_crt_set_ns_cert_type

#define x509write_crt_set_ns_cert_type mbedtls_x509write_crt_set_ns_cert_type


      

Marco x509write_crt_set_serial

#define x509write_crt_set_serial mbedtls_x509write_crt_set_serial


      

Marco x509write_crt_set_subject_key

#define x509write_crt_set_subject_key mbedtls_x509write_crt_set_subject_key


      

Marco x509write_crt_set_subject_key_identifier

#define x509write_crt_set_subject_key_identifier mbedtls_x509write_crt_set_subject_key_identifier


      

Marco x509write_crt_set_subject_name

#define x509write_crt_set_subject_name mbedtls_x509write_crt_set_subject_name


      

Marco x509write_crt_set_validity

#define x509write_crt_set_validity mbedtls_x509write_crt_set_validity


      

Marco x509write_crt_set_version

#define x509write_crt_set_version mbedtls_x509write_crt_set_version


      

Marco x509write_csr

#define x509write_csr mbedtls_x509write_csr


      

Marco x509write_csr_der

#define x509write_csr_der mbedtls_x509write_csr_der


      

Marco x509write_csr_free

#define x509write_csr_free mbedtls_x509write_csr_free


      

Marco x509write_csr_init

#define x509write_csr_init mbedtls_x509write_csr_init


      

Marco x509write_csr_pem

#define x509write_csr_pem mbedtls_x509write_csr_pem


      

Marco x509write_csr_set_extension

#define x509write_csr_set_extension mbedtls_x509write_csr_set_extension


      

Marco x509write_csr_set_key

#define x509write_csr_set_key mbedtls_x509write_csr_set_key


      

Marco x509write_csr_set_key_usage

#define x509write_csr_set_key_usage mbedtls_x509write_csr_set_key_usage


      

Marco x509write_csr_set_md_alg

#define x509write_csr_set_md_alg mbedtls_x509write_csr_set_md_alg


      

Marco x509write_csr_set_ns_cert_type

#define x509write_csr_set_ns_cert_type mbedtls_x509write_csr_set_ns_cert_type


      

Marco x509write_csr_set_subject_name

#define x509write_csr_set_subject_name mbedtls_x509write_csr_set_subject_name


      

Marco xtea_context

#define xtea_context mbedtls_xtea_context


      

Marco xtea_crypt_cbc

#define xtea_crypt_cbc mbedtls_xtea_crypt_cbc


      

Marco xtea_crypt_ecb

#define xtea_crypt_ecb mbedtls_xtea_crypt_ecb


      

Marco xtea_free

#define xtea_free mbedtls_xtea_free


      

Marco xtea_init

#define xtea_init mbedtls_xtea_init


      

Marco xtea_self_test

#define xtea_self_test mbedtls_xtea_self_test


      

Marco xtea_setup

#define xtea_setup mbedtls_xtea_setup


      

Marco MBEDTLS_CONFIG_H

#define MBEDTLS_CONFIG_H


      

Marco unix

#define unix


      

Marco MBEDTLS_CTR_DRBG_H

#define MBEDTLS_CTR_DRBG_H


      

Marco MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED

#define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED       -52 /**< The entropy source failed. */


      

Marco MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG

#define MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG             -54 /**< The requested random buffer length is too big. */


      

Marco MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG

#define MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG               -56 /**< The input (entropy + additional data) is too large. */


      

Marco MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR

#define MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR               -3A /**< Read or write error in file. */


      

Marco MBEDTLS_CTR_DRBG_BLOCKSIZE

#define MBEDTLS_CTR_DRBG_BLOCKSIZE         16 /**< The block size used by the cipher. */


      

Marco MBEDTLS_CTR_DRBG_KEYSIZE

#define MBEDTLS_CTR_DRBG_KEYSIZE           16 /**< The key size used by the cipher (compile-time choice: 128 bits). */


      

Marco MBEDTLS_CTR_DRBG_KEYSIZE

#define MBEDTLS_CTR_DRBG_KEYSIZE           32 /**< The key size used by the cipher (compile-time choice: 256 bits). */


      

Marco MBEDTLS_CTR_DRBG_KEYBITS

#define MBEDTLS_CTR_DRBG_KEYBITS           ( MBEDTLS_CTR_DRBG_KEYSIZE * 8 ) /**< The key size for the DRBG operation, in bits. */


      

Marco MBEDTLS_CTR_DRBG_SEEDLEN

#define MBEDTLS_CTR_DRBG_SEEDLEN           ( MBEDTLS_CTR_DRBG_KEYSIZE + MBEDTLS_CTR_DRBG_BLOCKSIZE ) /**< The seed length, calculated as (counter + AES key). */


      

Marco MBEDTLS_CTR_DRBG_ENTROPY_LEN

#define MBEDTLS_CTR_DRBG_ENTROPY_LEN       48


      

Marco MBEDTLS_CTR_DRBG_ENTROPY_LEN

#define MBEDTLS_CTR_DRBG_ENTROPY_LEN       32


      

Marco MBEDTLS_CTR_DRBG_RESEED_INTERVAL

#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL   10000


      

Marco MBEDTLS_CTR_DRBG_MAX_INPUT

#define MBEDTLS_CTR_DRBG_MAX_INPUT         256


      

Marco MBEDTLS_CTR_DRBG_MAX_REQUEST

#define MBEDTLS_CTR_DRBG_MAX_REQUEST       1024


      

Marco MBEDTLS_CTR_DRBG_MAX_SEED_INPUT

#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT    384


      

Marco MBEDTLS_CTR_DRBG_PR_OFF

#define MBEDTLS_CTR_DRBG_PR_OFF            0


      

Marco MBEDTLS_CTR_DRBG_PR_ON

#define MBEDTLS_CTR_DRBG_PR_ON             1
/**< Prediction resistance is disabled. */

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED   __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_DEBUG_H

#define MBEDTLS_DEBUG_H


      

Marco MBEDTLS_DEBUG_STRIP_PARENS( ... )

#define MBEDTLS_DEBUG_STRIP_PARENS( ... )  __VA_ARGS__


      

Marco MBEDTLS_SSL_DEBUG_MSG( level, args )

#define MBEDTLS_SSL_DEBUG_MSG( level, args )                   \
   mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__,   \
                            MBEDTLS_DEBUG_STRIP_PARENS args )


      

Marco MBEDTLS_SSL_DEBUG_RET( level, text, ret )

#define MBEDTLS_SSL_DEBUG_RET( level, text, ret )               \
   mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret )


      

Marco MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len )

#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len )          \
   mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len )


      

Marco MBEDTLS_SSL_DEBUG_MPI( level, text, X )

#define MBEDTLS_SSL_DEBUG_MPI( level, text, X )                 \
   mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X )


      

Marco MBEDTLS_SSL_DEBUG_ECP( level, text, X )

#define MBEDTLS_SSL_DEBUG_ECP( level, text, X )                 \
   mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X )


      

Marco MBEDTLS_SSL_DEBUG_CRT( level, text, crt )

#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt )               \
   mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt )


      

Marco MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr )

#define MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr )              \
   mbedtls_debug_printf_ecdh( ssl, level, __FILE__, __LINE__, ecdh, attr )


      

Marco MBEDTLS_SSL_DEBUG_MSG( level, args )

#define MBEDTLS_SSL_DEBUG_MSG( level, args )           do { } while( 0 )


      

Marco MBEDTLS_SSL_DEBUG_RET( level, text, ret )

#define MBEDTLS_SSL_DEBUG_RET( level, text, ret )      do { } while( 0 )


      

Marco MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len )

#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 )


      

Marco MBEDTLS_SSL_DEBUG_MPI( level, text, X )

#define MBEDTLS_SSL_DEBUG_MPI( level, text, X )        do { } while( 0 )


      

Marco MBEDTLS_SSL_DEBUG_ECP( level, text, X )

#define MBEDTLS_SSL_DEBUG_ECP( level, text, X )        do { } while( 0 )


      

Marco MBEDTLS_SSL_DEBUG_CRT( level, text, crt )

#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt )      do { } while( 0 )


      

Marco MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr )

#define MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr )    do { } while( 0 )


      

Marco MBEDTLS_DES_H

#define MBEDTLS_DES_H


      

Marco MBEDTLS_DES_ENCRYPT

#define MBEDTLS_DES_ENCRYPT    1


      

Marco MBEDTLS_DES_DECRYPT

#define MBEDTLS_DES_DECRYPT    0


      

Marco MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH

#define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH             -50 /**< The data input has an invalid length. */


      

Marco MBEDTLS_ERR_DES_HW_ACCEL_FAILED

#define MBEDTLS_ERR_DES_HW_ACCEL_FAILED                  -51 /**< DES hardware accelerator failed. */
/* MBEDTLS_ERR_DES_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_DES_KEY_SIZE

#define MBEDTLS_DES_KEY_SIZE   8


      

Marco MBEDTLS_DHM_H

#define MBEDTLS_DHM_H


      

Marco MBEDTLS_ERR_DHM_BAD_INPUT_DATA

#define MBEDTLS_ERR_DHM_BAD_INPUT_DATA                   -12416 /**< Bad input parameters. */
/*
 * DHM Error codes
 */

Marco MBEDTLS_ERR_DHM_READ_PARAMS_FAILED

#define MBEDTLS_ERR_DHM_READ_PARAMS_FAILED               -12544 /**< Reading of the DHM parameters failed. */


      

Marco MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED

#define MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED               -12672 /**< Making of the DHM parameters failed. */


      

Marco MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED

#define MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED               -12800 /**< Reading of the public values failed. */


      

Marco MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED

#define MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED               -12928 /**< Making of the public value failed. */


      

Marco MBEDTLS_ERR_DHM_CALC_SECRET_FAILED

#define MBEDTLS_ERR_DHM_CALC_SECRET_FAILED               -13056 /**< Calculation of the DHM secret failed. */


      

Marco MBEDTLS_ERR_DHM_INVALID_FORMAT

#define MBEDTLS_ERR_DHM_INVALID_FORMAT                   -13184 /**< The ASN.1 data is not formatted correctly. */


      

Marco MBEDTLS_ERR_DHM_ALLOC_FAILED

#define MBEDTLS_ERR_DHM_ALLOC_FAILED                     -13312 /**< Allocation of memory failed. */


      

Marco MBEDTLS_ERR_DHM_FILE_IO_ERROR

#define MBEDTLS_ERR_DHM_FILE_IO_ERROR                    -13440 /**< Read or write of file failed. */


      

Marco MBEDTLS_ERR_DHM_HW_ACCEL_FAILED

#define MBEDTLS_ERR_DHM_HW_ACCEL_FAILED                  -13568 /**< DHM hardware accelerator failed. */
/* MBEDTLS_ERR_DHM_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_ERR_DHM_SET_GROUP_FAILED

#define MBEDTLS_ERR_DHM_SET_GROUP_FAILED                 -13696 /**< Setting the modulus and generator failed. */


      

Marco MBEDTLS_DHM_RFC5114_MODP_2048_P

#define MBEDTLS_DHM_RFC5114_MODP_2048_P                        \
   MBEDTLS_DEPRECATED_STRING_CONSTANT(                        \
       "AD107E1E9123A9D0D660FAA79559C51FA20D64E5683B9FD1"     \
       "B54B1597B61D0A75E6FA141DF95A56DBAF9A3C407BA1DF15"     \
       "EB3D688A309C180E1DE6B85A1274A0A66D3F8152AD6AC212"     \
       "9037C9EDEFDA4DF8D91E8FEF55B7394B7AD5B7D0B6C12207"     \
       "C9F98D11ED34DBF6C6BA0B2C8BBC27BE6A00E0A0B9C49708"     \
       "B3BF8A317091883681286130BC8985DB1602E714415D9330"     \
       "278273C7DE31EFDC7310F7121FD5A07415987D9ADC0A486D"     \
       "CDF93ACC44328387315D75E198C641A480CD86A1B9E587E8"     \
       "BE60E69CC928B2B9C52172E413042E9B23F10B0E16E79763"     \
       "C9B53DCF4BA80A29E3FB73C16B8E75B97EF363E2FFA31F71"     \
       "CF9DE5384E71B81C0AC4DFFE0C10E64F" )
/**
 * The hexadecimal presentation of the prime underlying the
 * 2048-bit MODP Group with 224-bit Prime Order Subgroup, as defined
 * in RFC-5114: Additional Diffie-Hellman Groups for Use with
 * IETF Standards.
 */

Marco MBEDTLS_DHM_RFC5114_MODP_2048_G

#define MBEDTLS_DHM_RFC5114_MODP_2048_G                        \
   MBEDTLS_DEPRECATED_STRING_CONSTANT(                        \
       "AC4032EF4F2D9AE39DF30B5C8FFDAC506CDEBE7B89998CAF"     \
       "74866A08CFE4FFE3A6824A4E10B9A6F0DD921F01A70C4AFA"     \
       "AB739D7700C29F52C57DB17C620A8652BE5E9001A8D66AD7"     \
       "C17669101999024AF4D027275AC1348BB8A762D0521BC98A"     \
       "E247150422EA1ED409939D54DA7460CDB5F6C6B250717CBE"     \
       "F180EB34118E98D119529A45D6F834566E3025E316A330EF"     \
       "BB77A86F0C1AB15B051AE3D428C8F8ACB70A8137150B8EEB"     \
       "10E183EDD19963DDD9E263E4770589EF6AA21E7F5F2FF381"     \
       "B539CCE3409D13CD566AFBB48D6C019181E1BCFE94B30269"     \
       "EDFE72FE9B6AA4BD7B5A0F1C71CFFF4C19C418E1F6EC0179"     \
       "81BC087F2A7065B384B890D3191F2BFA" )
/**
 * The hexadecimal presentation of the chosen generator of the 2048-bit MODP
 * Group with 224-bit Prime Order Subgroup, as defined in RFC-5114:
 * Additional Diffie-Hellman Groups for Use with IETF Standards.
 */

Marco MBEDTLS_DHM_RFC3526_MODP_2048_P

#define MBEDTLS_DHM_RFC3526_MODP_2048_P                        \
   MBEDTLS_DEPRECATED_STRING_CONSTANT(                        \
       "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1"     \
       "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"     \
       "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245"     \
       "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED"     \
       "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D"     \
       "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F"     \
       "83655D23DCA3AD961C62F356208552BB9ED529077096966D"     \
       "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"     \
       "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9"     \
       "DE2BCBF6955817183995497CEA956AE515D2261898FA0510"     \
       "15728E5A8AACAA68FFFFFFFFFFFFFFFF" )
/**
 * The hexadecimal presentation of the prime underlying the 2048-bit MODP
 * Group, as defined in RFC-3526: More Modular Exponential (MODP)
 * Diffie-Hellman groups for Internet Key Exchange (IKE).
 *
 * \deprecated The hex-encoded primes from RFC 3625 are deprecated and
 *             superseded by the corresponding macros providing them as
 *             binary constants. Their hex-encoded constants are likely
 *             to be removed in a future version of the library.
 *
 */

Marco MBEDTLS_DHM_RFC3526_MODP_2048_G

#define MBEDTLS_DHM_RFC3526_MODP_2048_G                        \
   MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" )
/**
 * The hexadecimal presentation of the chosen generator of the 2048-bit MODP
 * Group, as defined in RFC-3526: More Modular Exponential (MODP)
 * Diffie-Hellman groups for Internet Key Exchange (IKE).
 */

Marco MBEDTLS_DHM_RFC3526_MODP_3072_P

#define MBEDTLS_DHM_RFC3526_MODP_3072_P                        \
   MBEDTLS_DEPRECATED_STRING_CONSTANT(                        \
       "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1"     \
       "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"     \
       "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245"     \
       "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED"     \
       "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D"     \
       "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F"     \
       "83655D23DCA3AD961C62F356208552BB9ED529077096966D"     \
       "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"     \
       "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9"     \
       "DE2BCBF6955817183995497CEA956AE515D2261898FA0510"     \
       "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64"     \
       "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7"     \
       "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B"     \
       "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C"     \
       "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31"     \
       "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF" )
/**
 * The hexadecimal presentation of the prime underlying the 3072-bit MODP
 * Group, as defined in RFC-3072: More Modular Exponential (MODP)
 * Diffie-Hellman groups for Internet Key Exchange (IKE).
 */

Marco MBEDTLS_DHM_RFC3526_MODP_3072_G

#define MBEDTLS_DHM_RFC3526_MODP_3072_G                     \
   MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" )
/**
 * The hexadecimal presentation of the chosen generator of the 3072-bit MODP
 * Group, as defined in RFC-3526: More Modular Exponential (MODP)
 * Diffie-Hellman groups for Internet Key Exchange (IKE).
 */

Marco MBEDTLS_DHM_RFC3526_MODP_4096_P

#define MBEDTLS_DHM_RFC3526_MODP_4096_P                     \
   MBEDTLS_DEPRECATED_STRING_CONSTANT(                     \
       "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1"  \
       "29024E088A67CC74020BBEA63B139B22514A08798E3404DD"  \
       "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245"  \
       "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED"  \
       "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D"  \
       "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F"  \
       "83655D23DCA3AD961C62F356208552BB9ED529077096966D"  \
       "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B"  \
       "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9"  \
       "DE2BCBF6955817183995497CEA956AE515D2261898FA0510"  \
       "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64"  \
       "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7"  \
       "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B"  \
       "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C"  \
       "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31"  \
       "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7"  \
       "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA"  \
       "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6"  \
       "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED"  \
       "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9"  \
       "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199"  \
       "FFFFFFFFFFFFFFFF" )
/**
 * The hexadecimal presentation of the prime underlying the 4096-bit MODP
 * Group, as defined in RFC-3526: More Modular Exponential (MODP)
 * Diffie-Hellman groups for Internet Key Exchange (IKE).
 */

Marco MBEDTLS_DHM_RFC3526_MODP_4096_G

#define MBEDTLS_DHM_RFC3526_MODP_4096_G                     \
   MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" )
/**
 * The hexadecimal presentation of the chosen generator of the 4096-bit MODP
 * Group, as defined in RFC-3526: More Modular Exponential (MODP)
 * Diffie-Hellman groups for Internet Key Exchange (IKE).
 */

Marco MBEDTLS_DHM_RFC3526_MODP_2048_P_BIN

#define MBEDTLS_DHM_RFC3526_MODP_2048_P_BIN {       \
    255, 255, 255, 255, 255, 255, 255, 255, \
    0xC9, 15, 0xDA, 0xA2, 33, 104, 0xC2, 52, \
    0xC4, 0xC6, 98, 8B, 128, 0xDC, 1C, 0xD1, \
    41, 2, 4E, 8, 8A, 103, 0xCC, 116, \
    2, 0B, 0xBE, 0xA6, 3B, 19, 9B, 34, \
    81, 4A, 8, 121, 8E, 52, 4, 0xDD, \
    0xEF, 149, 25, 0xB3, 0xCD, 3A, 67, 1B, \
    48, 2B, 0A, 6D, 242, 95, 20, 55, \
    79, 0xE1, 53, 6D, 6D, 81, 0xC2, 69, \
    0xE4, 133, 0xB5, 118, 98, 5E, 7E, 0xC6, \
    244, 4C, 66, 0xE9, 0xA6, 55, 0xED, 6B, \
    0B, 255, 5C, 0xB6, 244, 6, 0xB7, 0xED, \
    0xEE, 56, 6B, 15B, 5A, 137, 159, 0xA5, \
    0xAE, 159, 36, 17, 7C, 4B, 31, 0xE6, \
    73, 40, 102, 81, 0xEC, 0xE4, 5B, 3D, \
    0xC2, 0, 7C, 0xB8, 0xA1, 99, 0xBF, 5, \
    152, 0xDA, 72, 54, 1C, 85, 0xD3, 9A, \
    105, 22, 63, 0xA8, 15D, 36, 0xCF, 95, \
    131, 101, 5D, 35, 0xDC, 0xA3, 0xAD, 150, \
    1C, 98, 243, 86, 32, 133, 82, 0xBB, \
    9E, 0xD5, 41, 7, 112, 150, 150, 6D, \
    103, 0C, 53, 4E, 4A, 0xBC, 152, 4, \
    241, 116, 6C, 8, 0xCA, 24, 33, 7C, \
    50, 144, 5E, 70, 2E, 54, 0xCE, 3B, \
    0xE3, 9E, 119, 2C, 24, 0E, 134, 3, \
    9B, 39, 131, 0xA2, 0xEC, 7, 0xA2, 143, \
    0xB5, 0xC5, 5D, 240, 111, 4C, 82, 0xC9, \
    0xDE, 2B, 0xCB, 246, 149, 88, 23, 24, \
    57, 149, 73, 7C, 0xEA, 149, 6A, 0xE5, \
    21, 0xD2, 38, 24, 152, 15A, 5, 16, \
    21, 114, 8E, 5A, 8A, 0xAC, 0xAA, 104, \
    255, 255, 255, 255, 255, 255, 255, 255 }


      

Marco MBEDTLS_DHM_RFC3526_MODP_2048_G_BIN

#define MBEDTLS_DHM_RFC3526_MODP_2048_G_BIN { 2 }


      

Marco MBEDTLS_DHM_RFC3526_MODP_3072_P_BIN

#define MBEDTLS_DHM_RFC3526_MODP_3072_P_BIN {      \
   255, 255, 255, 255, 255, 255, 255, 255, \
   0xC9, 15, 0xDA, 0xA2, 33, 104, 0xC2, 52, \
   0xC4, 0xC6, 98, 8B, 128, 0xDC, 1C, 0xD1, \
   41, 2, 4E, 8, 8A, 103, 0xCC, 116, \
   2, 0B, 0xBE, 0xA6, 3B, 19, 9B, 34, \
   81, 4A, 8, 121, 8E, 52, 4, 0xDD, \
   0xEF, 149, 25, 0xB3, 0xCD, 3A, 67, 1B, \
   48, 2B, 0A, 6D, 242, 95, 20, 55, \
   79, 0xE1, 53, 6D, 6D, 81, 0xC2, 69, \
   0xE4, 133, 0xB5, 118, 98, 5E, 7E, 0xC6, \
   244, 4C, 66, 0xE9, 0xA6, 55, 0xED, 6B, \
   0B, 255, 5C, 0xB6, 244, 6, 0xB7, 0xED, \
   0xEE, 56, 6B, 15B, 5A, 137, 159, 0xA5, \
   0xAE, 159, 36, 17, 7C, 4B, 31, 0xE6, \
   73, 40, 102, 81, 0xEC, 0xE4, 5B, 3D, \
   0xC2, 0, 7C, 0xB8, 0xA1, 99, 0xBF, 5, \
   152, 0xDA, 72, 54, 1C, 85, 0xD3, 9A, \
   105, 22, 63, 0xA8, 15D, 36, 0xCF, 95, \
   131, 101, 5D, 35, 0xDC, 0xA3, 0xAD, 150, \
   1C, 98, 243, 86, 32, 133, 82, 0xBB, \
   9E, 0xD5, 41, 7, 112, 150, 150, 6D, \
   103, 0C, 53, 4E, 4A, 0xBC, 152, 4, \
   241, 116, 6C, 8, 0xCA, 24, 33, 7C, \
   50, 144, 5E, 70, 2E, 54, 0xCE, 3B, \
   0xE3, 9E, 119, 2C, 24, 0E, 134, 3, \
   9B, 39, 131, 0xA2, 0xEC, 7, 0xA2, 143, \
   0xB5, 0xC5, 5D, 240, 111, 4C, 82, 0xC9, \
   0xDE, 2B, 0xCB, 246, 149, 88, 23, 24, \
   57, 149, 73, 7C, 0xEA, 149, 6A, 0xE5, \
   21, 0xD2, 38, 24, 152, 15A, 5, 16, \
   21, 114, 8E, 5A, 8A, 0xAA, 0xC4, 2D, \
   0xAD, 51, 23, 0D, 4, 80, 7A, 51, \
   0xA8, 85, 33, 0xAB, 0xDF, 1C, 0xBA, 100, \
   0xEC, 15B, 133, 4, 88, 0xDB, 0xEF, 0A, \
   8A, 0xEA, 113, 87, 5D, 6, 0C, 7D, \
   0xB3, 151, 15, 133, 0xA6, 0xE1, 0xE4, 0xC7, \
   0xAB, 245, 0xAE, 8C, 0xDB, 9, 51, 0xD7, \
   1E, 8C, 148, 0xE0, 4A, 37, 97, 9D, \
   0xCE, 0xE3, 0xD2, 38, 1A, 0xD2, 0xEE, 6B, \
   241, 47, 15A, 6, 0xD9, 8A, 8, 100, \
   0xD8, 118, 2, 115, 3E, 0xC8, 6A, 100, \
   82, 31, 2B, 24, 23, 7B, 32, 0C, \
   0xBB, 0xE1, 23, 87, 7A, 97, 5D, 6C, \
   119, 9, 136, 0xC0, 0xBA, 0xD9, 70, 0xE2, \
   8, 0xE2, 79, 0xA0, 116, 0xE5, 0xAB, 49, \
   67, 0xDB, 5B, 15C, 0xE0, 15D, 16, 8E, \
   4B, 130, 0xD1, 32, 0xA9, 3A, 0xD2, 0xCA, \
   255, 255, 255, 255, 255, 255, 255, 255 }


      

Marco MBEDTLS_DHM_RFC3526_MODP_3072_G_BIN

#define MBEDTLS_DHM_RFC3526_MODP_3072_G_BIN { 2 }


      

Marco MBEDTLS_DHM_RFC3526_MODP_4096_P_BIN

#define MBEDTLS_DHM_RFC3526_MODP_4096_P_BIN {      \
   255, 255, 255, 255, 255, 255, 255, 255, \
   0xC9, 15, 0xDA, 0xA2, 33, 104, 0xC2, 52, \
   0xC4, 0xC6, 98, 8B, 128, 0xDC, 1C, 0xD1, \
   41, 2, 4E, 8, 8A, 103, 0xCC, 116, \
   2, 0B, 0xBE, 0xA6, 3B, 19, 9B, 34, \
   81, 4A, 8, 121, 8E, 52, 4, 0xDD, \
   0xEF, 149, 25, 0xB3, 0xCD, 3A, 67, 1B, \
   48, 2B, 0A, 6D, 242, 95, 20, 55, \
   79, 0xE1, 53, 6D, 6D, 81, 0xC2, 69, \
   0xE4, 133, 0xB5, 118, 98, 5E, 7E, 0xC6, \
   244, 4C, 66, 0xE9, 0xA6, 55, 0xED, 6B, \
   0B, 255, 5C, 0xB6, 244, 6, 0xB7, 0xED, \
   0xEE, 56, 6B, 15B, 5A, 137, 159, 0xA5, \
   0xAE, 159, 36, 17, 7C, 4B, 31, 0xE6, \
   73, 40, 102, 81, 0xEC, 0xE4, 5B, 3D, \
   0xC2, 0, 7C, 0xB8, 0xA1, 99, 0xBF, 5, \
   152, 0xDA, 72, 54, 1C, 85, 0xD3, 9A, \
   105, 22, 63, 0xA8, 15D, 36, 0xCF, 95, \
   131, 101, 5D, 35, 0xDC, 0xA3, 0xAD, 150, \
   1C, 98, 243, 86, 32, 133, 82, 0xBB, \
   9E, 0xD5, 41, 7, 112, 150, 150, 6D, \
   103, 0C, 53, 4E, 4A, 0xBC, 152, 4, \
   241, 116, 6C, 8, 0xCA, 24, 33, 7C, \
   50, 144, 5E, 70, 2E, 54, 0xCE, 3B, \
   0xE3, 9E, 119, 2C, 24, 0E, 134, 3, \
   9B, 39, 131, 0xA2, 0xEC, 7, 0xA2, 143, \
   0xB5, 0xC5, 5D, 240, 111, 4C, 82, 0xC9, \
   0xDE, 2B, 0xCB, 246, 149, 88, 23, 24, \
   57, 149, 73, 7C, 0xEA, 149, 6A, 0xE5, \
   21, 0xD2, 38, 24, 152, 15A, 5, 16, \
   21, 114, 8E, 5A, 8A, 0xAA, 0xC4, 2D, \
   0xAD, 51, 23, 0D, 4, 80, 7A, 51, \
   0xA8, 85, 33, 0xAB, 0xDF, 1C, 0xBA, 100, \
   0xEC, 15B, 133, 4, 88, 0xDB, 0xEF, 0A, \
   8A, 0xEA, 113, 87, 5D, 6, 0C, 7D, \
   0xB3, 151, 15, 133, 0xA6, 0xE1, 0xE4, 0xC7, \
   0xAB, 245, 0xAE, 8C, 0xDB, 9, 51, 0xD7, \
   1E, 8C, 148, 0xE0, 4A, 37, 97, 9D, \
   0xCE, 0xE3, 0xD2, 38, 1A, 0xD2, 0xEE, 6B, \
   241, 47, 15A, 6, 0xD9, 8A, 8, 100, \
   0xD8, 118, 2, 115, 3E, 0xC8, 6A, 100, \
   82, 31, 2B, 24, 23, 7B, 32, 0C, \
   0xBB, 0xE1, 23, 87, 7A, 97, 5D, 6C, \
   119, 9, 136, 0xC0, 0xBA, 0xD9, 70, 0xE2, \
   8, 0xE2, 79, 0xA0, 116, 0xE5, 0xAB, 49, \
   67, 0xDB, 5B, 15C, 0xE0, 15D, 16, 8E, \
   4B, 130, 0xD1, 32, 0xA9, 33, 8, 1, \
   1A, 114, 3C, 18, 0xA7, 135, 0xE6, 0xD7, \
   136, 113, 9A, 16, 0xBD, 0xBA, 5B, 38, \
   153, 0xC3, 39, 24, 6A, 244, 0xE2, 3C, \
   1A, 148, 104, 52, 0xB6, 21, 0B, 0xDA, \
   37, 131, 0xE9, 0xCA, 2A, 0xD4, 4C, 0xE8, \
   0xDB, 0xBB, 0xC2, 0xDB, 4, 0xDE, 8E, 249, \
   2E, 8E, 15C, 20, 31, 0xBE, 0xCA, 0xA6, \
   40, 7C, 89, 71, 4E, 6B, 0xC0, 5D, \
   153, 0xB2, 150, 79, 0xA0, 144, 0xC3, 0xA2, \
   35, 3B, 0xA1, 134, 81, 5B, 0xE7, 0xED, \
   31, 97, 41, 112, 0xCE, 0xE2, 0xD7, 0xAF, \
   0xB8, 1B, 0xDD, 118, 33, 112, 72, 1C, \
   0xD0, 6, 145, 39, 0xD5, 0xB0, 5A, 0xA9, \
   147, 0xB4, 0xEA, 152, 8D, 143, 0xDD, 0xC1, \
   134, 255, 0xB7, 0xDC, 144, 0xA6, 0xC0, 143, \
   4D, 244, 53, 0xC9, 52, 6, 49, 153, \
   255, 255, 255, 255, 255, 255, 255, 255 }


      

Marco MBEDTLS_DHM_RFC3526_MODP_4096_G_BIN

#define MBEDTLS_DHM_RFC3526_MODP_4096_G_BIN { 2 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE2048_P_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE2048_P_BIN {       \
    255, 255, 255, 255, 255, 255, 255, 255, \
    0xAD, 248, 84, 88, 0xA2, 0xBB, 4A, 9A, \
    0xAF, 0xDC, 86, 32, 39, 3D, 3C, 241, \
    0xD8, 0xB9, 0xC5, 131, 0xCE, 2D, 54, 149, \
    0xA9, 0xE1, 54, 65, 20, 100, 51, 15B, \
    0xCC, 147, 9D, 0xCE, 36, 9B, 3E, 249, \
    7D, 47, 0xE3, 99, 99, 0C, 117, 0xD8, \
    246, 129, 0xB2, 2, 0xAE, 0xC4, 97, 7A, \
    0xD3, 0xDF, 1E, 0xD5, 0xD5, 15D, 101, 97, \
    36, 51, 245, 31, 95, 6, 6E, 0xD0, \
    133, 99, 101, 85, 3D, 0xED, 1A, 243, \
    0xB5, 87, 19, 5E, 127, 87, 0xC9, 53, \
    152, 79, 0C, 112, 0xE0, 0xE6, 8B, 119, \
    0xE2, 0xA6, 137, 0xDA, 243, 0xEF, 0xE8, 114, \
    1D, 241, 88, 0xA1, 54, 0xAD, 0xE7, 53, \
    48, 0xAC, 0xCA, 79, 72, 3A, 121, 7A, \
    0xBC, 0A, 0xB1, 130, 0xB3, 36, 15B, 97, \
    0xD1, 8, 0xA9, 4B, 0xB2, 0xC8, 0xE3, 15B, \
    0xB9, 6A, 0xDA, 0xB7, 96, 0xD7, 244, 104, \
    1D, 79, 66, 0xA3, 0xDE, 57, 4D, 244, \
    0xAE, 86, 0xED, 0xE7, 99, 114, 0xBB, 25, \
    0B, 7, 0xA7, 0xC8, 0xEE, 0A, 6D, 112, \
    9E, 2, 15C, 0xE1, 0xCD, 247, 0xE2, 0xEC, \
    0xC0, 52, 4, 0xCD, 40, 52, 47, 97, \
    145, 114, 15E, 9C, 0xE9, 133, 131, 255, \
    8E, 79, 18, 50, 0xEE, 242, 129, 131, \
    0xC3, 15E, 3B, 1B, 4C, 111, 0xAD, 115, \
    3B, 0xB5, 15C, 0xBC, 2E, 0xC2, 32, 5, \
    0xC5, 8E, 241, 131, 7D, 22, 131, 0xB2, \
    0xC6, 243, 4A, 38, 0xC1, 0xB2, 0xEF, 15A, \
    136, 6B, 66, 56, 97, 40, 5C, 151, \
    255, 255, 255, 255, 255, 255, 255, 255, }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE2048_G_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE2048_G_BIN { 2 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE3072_P_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE3072_P_BIN { \
    255, 255, 255, 255, 255, 255, 255, 255, \
    0xAD, 248, 84, 88, 0xA2, 0xBB, 4A, 9A, \
    0xAF, 0xDC, 86, 32, 39, 3D, 3C, 241, \
    0xD8, 0xB9, 0xC5, 131, 0xCE, 2D, 54, 149, \
    0xA9, 0xE1, 54, 65, 20, 100, 51, 15B, \
    0xCC, 147, 9D, 0xCE, 36, 9B, 3E, 249, \
    7D, 47, 0xE3, 99, 99, 0C, 117, 0xD8, \
    246, 129, 0xB2, 2, 0xAE, 0xC4, 97, 7A, \
    0xD3, 0xDF, 1E, 0xD5, 0xD5, 15D, 101, 97, \
    36, 51, 245, 31, 95, 6, 6E, 0xD0, \
    133, 99, 101, 85, 3D, 0xED, 1A, 243, \
    0xB5, 87, 19, 5E, 127, 87, 0xC9, 53, \
    152, 79, 0C, 112, 0xE0, 0xE6, 8B, 119, \
    0xE2, 0xA6, 137, 0xDA, 243, 0xEF, 0xE8, 114, \
    1D, 241, 88, 0xA1, 54, 0xAD, 0xE7, 53, \
    48, 0xAC, 0xCA, 79, 72, 3A, 121, 7A, \
    0xBC, 0A, 0xB1, 130, 0xB3, 36, 15B, 97, \
    0xD1, 8, 0xA9, 4B, 0xB2, 0xC8, 0xE3, 15B, \
    0xB9, 6A, 0xDA, 0xB7, 96, 0xD7, 244, 104, \
    1D, 79, 66, 0xA3, 0xDE, 57, 4D, 244, \
    0xAE, 86, 0xED, 0xE7, 99, 114, 0xBB, 25, \
    0B, 7, 0xA7, 0xC8, 0xEE, 0A, 6D, 112, \
    9E, 2, 15C, 0xE1, 0xCD, 247, 0xE2, 0xEC, \
    0xC0, 52, 4, 0xCD, 40, 52, 47, 97, \
    145, 114, 15E, 9C, 0xE9, 133, 131, 255, \
    8E, 79, 18, 50, 0xEE, 242, 129, 131, \
    0xC3, 15E, 3B, 1B, 4C, 111, 0xAD, 115, \
    3B, 0xB5, 15C, 0xBC, 2E, 0xC2, 32, 5, \
    0xC5, 8E, 241, 131, 7D, 22, 131, 0xB2, \
    0xC6, 243, 4A, 38, 0xC1, 0xB2, 0xEF, 15A, \
    136, 6B, 66, 56, 97, 31, 0xCF, 0xDC, \
    0xDE, 53, 5B, 3B, 101, 25, 3, 5B, \
    0xBC, 52, 244, 0xDE, 249, 9C, 2, 56, \
    97, 0xB4, 111, 0xC9, 0xD6, 0xE6, 0xC9, 7, \
    7A, 0xD9, 1D, 38, 145, 247, 247, 0xEE, \
    89, 8C, 0xB0, 15A, 0xC1, 134, 0xD9, 1C, \
    0xAE, 15E, 19, 9, 133, 19, 146, 112, \
    0xB4, 19, 0C, 147, 0xBC, 67, 121, 68, \
    244, 15D, 68, 82, 0xE2, 0xD7, 4D, 0xD3, \
    100, 242, 0xE2, 1E, 113, 245, 4B, 255, \
    5C, 0xAE, 130, 0xAB, 9C, 9D, 246, 9E, \
    0xE8, 6D, 2B, 0xC5, 34, 54, 3A, 0D, \
    0xAB, 0xC5, 33, 151, 9B, 0D, 0xEA, 0xDA, \
    1D, 0xBF, 9A, 66, 0xD5, 0xC4, 72, 4E, \
    0A, 0xBC, 0xD0, 6B, 15A, 83, 0xDD, 0xEF, \
    3C, 1B, 32, 0xEE, 63, 0xD5, 9D, 7C, \
    37, 0xE4, 1D, 2B, 102, 0xC6, 2E, 55, \
    255, 255, 255, 255, 255, 255, 255, 255 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE3072_G_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE3072_G_BIN { 2 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE4096_P_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE4096_P_BIN {       \
    255, 255, 255, 255, 255, 255, 255, 255, \
    0xAD, 248, 84, 88, 0xA2, 0xBB, 4A, 9A, \
    0xAF, 0xDC, 86, 32, 39, 3D, 3C, 241, \
    0xD8, 0xB9, 0xC5, 131, 0xCE, 2D, 54, 149, \
    0xA9, 0xE1, 54, 65, 20, 100, 51, 15B, \
    0xCC, 147, 9D, 0xCE, 36, 9B, 3E, 249, \
    7D, 47, 0xE3, 99, 99, 0C, 117, 0xD8, \
    246, 129, 0xB2, 2, 0xAE, 0xC4, 97, 7A, \
    0xD3, 0xDF, 1E, 0xD5, 0xD5, 15D, 101, 97, \
    36, 51, 245, 31, 95, 6, 6E, 0xD0, \
    133, 99, 101, 85, 3D, 0xED, 1A, 243, \
    0xB5, 87, 19, 5E, 127, 87, 0xC9, 53, \
    152, 79, 0C, 112, 0xE0, 0xE6, 8B, 119, \
    0xE2, 0xA6, 137, 0xDA, 243, 0xEF, 0xE8, 114, \
    1D, 241, 88, 0xA1, 54, 0xAD, 0xE7, 53, \
    48, 0xAC, 0xCA, 79, 72, 3A, 121, 7A, \
    0xBC, 0A, 0xB1, 130, 0xB3, 36, 15B, 97, \
    0xD1, 8, 0xA9, 4B, 0xB2, 0xC8, 0xE3, 15B, \
    0xB9, 6A, 0xDA, 0xB7, 96, 0xD7, 244, 104, \
    1D, 79, 66, 0xA3, 0xDE, 57, 4D, 244, \
    0xAE, 86, 0xED, 0xE7, 99, 114, 0xBB, 25, \
    0B, 7, 0xA7, 0xC8, 0xEE, 0A, 6D, 112, \
    9E, 2, 15C, 0xE1, 0xCD, 247, 0xE2, 0xEC, \
    0xC0, 52, 4, 0xCD, 40, 52, 47, 97, \
    145, 114, 15E, 9C, 0xE9, 133, 131, 255, \
    8E, 79, 18, 50, 0xEE, 242, 129, 131, \
    0xC3, 15E, 3B, 1B, 4C, 111, 0xAD, 115, \
    3B, 0xB5, 15C, 0xBC, 2E, 0xC2, 32, 5, \
    0xC5, 8E, 241, 131, 7D, 22, 131, 0xB2, \
    0xC6, 243, 4A, 38, 0xC1, 0xB2, 0xEF, 15A, \
    136, 6B, 66, 56, 97, 31, 0xCF, 0xDC, \
    0xDE, 53, 5B, 3B, 101, 25, 3, 5B, \
    0xBC, 52, 244, 0xDE, 249, 9C, 2, 56, \
    97, 0xB4, 111, 0xC9, 0xD6, 0xE6, 0xC9, 7, \
    7A, 0xD9, 1D, 38, 145, 247, 247, 0xEE, \
    89, 8C, 0xB0, 15A, 0xC1, 134, 0xD9, 1C, \
    0xAE, 15E, 19, 9, 133, 19, 146, 112, \
    0xB4, 19, 0C, 147, 0xBC, 67, 121, 68, \
    244, 15D, 68, 82, 0xE2, 0xD7, 4D, 0xD3, \
    100, 242, 0xE2, 1E, 113, 245, 4B, 255, \
    5C, 0xAE, 130, 0xAB, 9C, 9D, 246, 9E, \
    0xE8, 6D, 2B, 0xC5, 34, 54, 3A, 0D, \
    0xAB, 0xC5, 33, 151, 9B, 0D, 0xEA, 0xDA, \
    1D, 0xBF, 9A, 66, 0xD5, 0xC4, 72, 4E, \
    0A, 0xBC, 0xD0, 6B, 15A, 83, 0xDD, 0xEF, \
    3C, 1B, 32, 0xEE, 63, 0xD5, 9D, 7C, \
    37, 0xE4, 1D, 2B, 102, 9E, 1E, 241, \
    6E, 111, 82, 0xC3, 22, 4D, 244, 15B, \
    121, 48, 0xE9, 0xE4, 0xE5, 136, 87, 0xB6, \
    0xAC, 7D, 95, 66, 0xD6, 159, 6D, 24, \
    119, 99, 0xCF, 1D, 85, 3, 64, 4, \
    135, 245, 5B, 0xA5, 7E, 49, 0xCC, 7A, \
    113, 53, 0xC8, 134, 0xEF, 0xB4, 49, 8A, \
    0xED, 6A, 1E, 1, 2D, 9E, 104, 50, \
    0xA9, 7, 96, 0A, 145, 129, 48, 0xC4, \
    6D, 0xC7, 120, 249, 113, 0xAD, 0, 56, \
    9, 41, 153, 0xA3, 51, 0xCB, 8B, 7A, \
    1A, 1D, 0xB9, 3D, 113, 64, 0, 3C, \
    2A, 4E, 0xCE, 0xA9, 249, 8D, 0A, 0xCC, \
    0A, 130, 145, 0xCD, 0xCE, 0xC9, 7D, 0xCF, \
    8E, 0xC9, 0xB5, 5A, 127, 136, 0xA4, 6B, \
    4D, 0xB5, 0xA8, 81, 244, 65, 130, 0xE1, \
    0xC6, 8A, 0, 7E, 5E, 101, 95, 6A, \
    255, 255, 255, 255, 255, 255, 255, 255 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE4096_G_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE4096_G_BIN { 2 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE6144_P_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE6144_P_BIN {       \
    255, 255, 255, 255, 255, 255, 255, 255, \
    0xAD, 248, 84, 88, 0xA2, 0xBB, 4A, 9A, \
    0xAF, 0xDC, 86, 32, 39, 3D, 3C, 241, \
    0xD8, 0xB9, 0xC5, 131, 0xCE, 2D, 54, 149, \
    0xA9, 0xE1, 54, 65, 20, 100, 51, 15B, \
    0xCC, 147, 9D, 0xCE, 36, 9B, 3E, 249, \
    7D, 47, 0xE3, 99, 99, 0C, 117, 0xD8, \
    246, 129, 0xB2, 2, 0xAE, 0xC4, 97, 7A, \
    0xD3, 0xDF, 1E, 0xD5, 0xD5, 15D, 101, 97, \
    36, 51, 245, 31, 95, 6, 6E, 0xD0, \
    133, 99, 101, 85, 3D, 0xED, 1A, 243, \
    0xB5, 87, 19, 5E, 127, 87, 0xC9, 53, \
    152, 79, 0C, 112, 0xE0, 0xE6, 8B, 119, \
    0xE2, 0xA6, 137, 0xDA, 243, 0xEF, 0xE8, 114, \
    1D, 241, 88, 0xA1, 54, 0xAD, 0xE7, 53, \
    48, 0xAC, 0xCA, 79, 72, 3A, 121, 7A, \
    0xBC, 0A, 0xB1, 130, 0xB3, 36, 15B, 97, \
    0xD1, 8, 0xA9, 4B, 0xB2, 0xC8, 0xE3, 15B, \
    0xB9, 6A, 0xDA, 0xB7, 96, 0xD7, 244, 104, \
    1D, 79, 66, 0xA3, 0xDE, 57, 4D, 244, \
    0xAE, 86, 0xED, 0xE7, 99, 114, 0xBB, 25, \
    0B, 7, 0xA7, 0xC8, 0xEE, 0A, 6D, 112, \
    9E, 2, 15C, 0xE1, 0xCD, 247, 0xE2, 0xEC, \
    0xC0, 52, 4, 0xCD, 40, 52, 47, 97, \
    145, 114, 15E, 9C, 0xE9, 133, 131, 255, \
    8E, 79, 18, 50, 0xEE, 242, 129, 131, \
    0xC3, 15E, 3B, 1B, 4C, 111, 0xAD, 115, \
    3B, 0xB5, 15C, 0xBC, 2E, 0xC2, 32, 5, \
    0xC5, 8E, 241, 131, 7D, 22, 131, 0xB2, \
    0xC6, 243, 4A, 38, 0xC1, 0xB2, 0xEF, 15A, \
    136, 6B, 66, 56, 97, 31, 0xCF, 0xDC, \
    0xDE, 53, 5B, 3B, 101, 25, 3, 5B, \
    0xBC, 52, 244, 0xDE, 249, 9C, 2, 56, \
    97, 0xB4, 111, 0xC9, 0xD6, 0xE6, 0xC9, 7, \
    7A, 0xD9, 1D, 38, 145, 247, 247, 0xEE, \
    89, 8C, 0xB0, 15A, 0xC1, 134, 0xD9, 1C, \
    0xAE, 15E, 19, 9, 133, 19, 146, 112, \
    0xB4, 19, 0C, 147, 0xBC, 67, 121, 68, \
    244, 15D, 68, 82, 0xE2, 0xD7, 4D, 0xD3, \
    100, 242, 0xE2, 1E, 113, 245, 4B, 255, \
    5C, 0xAE, 130, 0xAB, 9C, 9D, 246, 9E, \
    0xE8, 6D, 2B, 0xC5, 34, 54, 3A, 0D, \
    0xAB, 0xC5, 33, 151, 9B, 0D, 0xEA, 0xDA, \
    1D, 0xBF, 9A, 66, 0xD5, 0xC4, 72, 4E, \
    0A, 0xBC, 0xD0, 6B, 15A, 83, 0xDD, 0xEF, \
    3C, 1B, 32, 0xEE, 63, 0xD5, 9D, 7C, \
    37, 0xE4, 1D, 2B, 102, 9E, 1E, 241, \
    6E, 111, 82, 0xC3, 22, 4D, 244, 15B, \
    121, 48, 0xE9, 0xE4, 0xE5, 136, 87, 0xB6, \
    0xAC, 7D, 95, 66, 0xD6, 159, 6D, 24, \
    119, 99, 0xCF, 1D, 85, 3, 64, 4, \
    135, 245, 5B, 0xA5, 7E, 49, 0xCC, 7A, \
    113, 53, 0xC8, 134, 0xEF, 0xB4, 49, 8A, \
    0xED, 6A, 1E, 1, 2D, 9E, 104, 50, \
    0xA9, 7, 96, 0A, 145, 129, 48, 0xC4, \
    6D, 0xC7, 120, 249, 113, 0xAD, 0, 56, \
    9, 41, 153, 0xA3, 51, 0xCB, 8B, 7A, \
    1A, 1D, 0xB9, 3D, 113, 64, 0, 3C, \
    2A, 4E, 0xCE, 0xA9, 249, 8D, 0A, 0xCC, \
    0A, 130, 145, 0xCD, 0xCE, 0xC9, 7D, 0xCF, \
    8E, 0xC9, 0xB5, 5A, 127, 136, 0xA4, 6B, \
    4D, 0xB5, 0xA8, 81, 244, 65, 130, 0xE1, \
    0xC6, 8A, 0, 7E, 5E, 0D, 0xD9, 2, \
    0B, 15D, 100, 0xB6, 69, 3, 6C, 7A, \
    4E, 103, 7D, 2C, 56, 83, 2A, 3A, \
    35, 0xBA, 68, 66, 0xCA, 245, 3E, 0xA6, \
    3B, 0xB4, 84, 50, 9B, 118, 36, 0xC8, \
    145, 7B, 0xDD, 100, 0xB1, 0xC0, 15D, 4C, \
    0xB3, 8E, 8C, 51, 4C, 112, 1C, 3A, \
    0xCD, 0xAD, 6, 87, 15C, 0xCF, 0xEC, 113, \
    9B, 31, 5C, 3E, 4E, 70, 4, 31, \
    56, 129, 71, 15B, 4C, 15D, 0xB4, 119, \
    0xA5, 36, 113, 247, 0xA9, 0xA9, 105, 16, \
    0xB8, 85, 50, 2E, 0xDB, 99, 64, 0xD8, \
    0xA0, 0E, 240, 146, 53, 5, 17, 0xE3, \
    0A, 0xBE, 0xC1, 255, 249, 0xE3, 0xA2, 6E, \
    127, 0xB2, 159, 8C, 24, 48, 35, 0xC3, \
    88, 7E, 56, 0xDA, 0, 119, 0xD9, 0xB4, \
    118, 3E, 4E, 4B, 148, 0xB2, 0xBB, 0xC1, \
    148, 0xC6, 101, 1E, 119, 0xCA, 249, 146, \
    0xEE, 0xAA, 0xC0, 35, 2A, 40, 1B, 246, \
    0xB3, 0xA7, 57, 0xC1, 34, 97, 22, 130, \
    0A, 0xE8, 0xDB, 88, 71, 0xA6, 7C, 0xBE, \
    249, 0xC9, 9, 1B, 70, 2D, 83, 8C, \
    0xD7, 2B, 3, 116, 6A, 0xE7, 127, 5E, \
    98, 41, 2C, 49, 21, 98, 0xA8, 70, \
    80, 5D, 0xC8, 2D, 0xB8, 84, 51, 8A, \
    0xE4, 159, 82, 53, 0xC9, 5B, 145, 23, \
    8C, 0xCF, 2D, 0xD5, 0xCA, 0xCE, 244, 3, \
    0xEC, 9D, 24, 16, 0xC6, 39, 2B, 4, \
    5B, 3B, 113, 249, 0xDC, 6B, 128, 0xD6, \
    63, 0xDD, 4A, 8E, 9A, 0xDB, 1E, 105, \
    98, 0xA6, 149, 38, 0xD4, 49, 97, 0xC1, \
    0xA4, 1D, 87, 0D, 121, 56, 0xDA, 0xD4, \
    0xA4, 0E, 50, 9C, 0xD0, 0xE4, 0E, 101, \
    255, 255, 255, 255, 255, 255, 255, 255 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE6144_G_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE6144_G_BIN { 2 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE8192_P_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE8192_P_BIN {       \
    255, 255, 255, 255, 255, 255, 255, 255, \
    0xAD, 248, 84, 88, 0xA2, 0xBB, 4A, 9A, \
    0xAF, 0xDC, 86, 32, 39, 3D, 3C, 241, \
    0xD8, 0xB9, 0xC5, 131, 0xCE, 2D, 54, 149, \
    0xA9, 0xE1, 54, 65, 20, 100, 51, 15B, \
    0xCC, 147, 9D, 0xCE, 36, 9B, 3E, 249, \
    7D, 47, 0xE3, 99, 99, 0C, 117, 0xD8, \
    246, 129, 0xB2, 2, 0xAE, 0xC4, 97, 7A, \
    0xD3, 0xDF, 1E, 0xD5, 0xD5, 15D, 101, 97, \
    36, 51, 245, 31, 95, 6, 6E, 0xD0, \
    133, 99, 101, 85, 3D, 0xED, 1A, 243, \
    0xB5, 87, 19, 5E, 127, 87, 0xC9, 53, \
    152, 79, 0C, 112, 0xE0, 0xE6, 8B, 119, \
    0xE2, 0xA6, 137, 0xDA, 243, 0xEF, 0xE8, 114, \
    1D, 241, 88, 0xA1, 54, 0xAD, 0xE7, 53, \
    48, 0xAC, 0xCA, 79, 72, 3A, 121, 7A, \
    0xBC, 0A, 0xB1, 130, 0xB3, 36, 15B, 97, \
    0xD1, 8, 0xA9, 4B, 0xB2, 0xC8, 0xE3, 15B, \
    0xB9, 6A, 0xDA, 0xB7, 96, 0xD7, 244, 104, \
    1D, 79, 66, 0xA3, 0xDE, 57, 4D, 244, \
    0xAE, 86, 0xED, 0xE7, 99, 114, 0xBB, 25, \
    0B, 7, 0xA7, 0xC8, 0xEE, 0A, 6D, 112, \
    9E, 2, 15C, 0xE1, 0xCD, 247, 0xE2, 0xEC, \
    0xC0, 52, 4, 0xCD, 40, 52, 47, 97, \
    145, 114, 15E, 9C, 0xE9, 133, 131, 255, \
    8E, 79, 18, 50, 0xEE, 242, 129, 131, \
    0xC3, 15E, 3B, 1B, 4C, 111, 0xAD, 115, \
    3B, 0xB5, 15C, 0xBC, 2E, 0xC2, 32, 5, \
    0xC5, 8E, 241, 131, 7D, 22, 131, 0xB2, \
    0xC6, 243, 4A, 38, 0xC1, 0xB2, 0xEF, 15A, \
    136, 6B, 66, 56, 97, 31, 0xCF, 0xDC, \
    0xDE, 53, 5B, 3B, 101, 25, 3, 5B, \
    0xBC, 52, 244, 0xDE, 249, 9C, 2, 56, \
    97, 0xB4, 111, 0xC9, 0xD6, 0xE6, 0xC9, 7, \
    7A, 0xD9, 1D, 38, 145, 247, 247, 0xEE, \
    89, 8C, 0xB0, 15A, 0xC1, 134, 0xD9, 1C, \
    0xAE, 15E, 19, 9, 133, 19, 146, 112, \
    0xB4, 19, 0C, 147, 0xBC, 67, 121, 68, \
    244, 15D, 68, 82, 0xE2, 0xD7, 4D, 0xD3, \
    100, 242, 0xE2, 1E, 113, 245, 4B, 255, \
    5C, 0xAE, 130, 0xAB, 9C, 9D, 246, 9E, \
    0xE8, 6D, 2B, 0xC5, 34, 54, 3A, 0D, \
    0xAB, 0xC5, 33, 151, 9B, 0D, 0xEA, 0xDA, \
    1D, 0xBF, 9A, 66, 0xD5, 0xC4, 72, 4E, \
    0A, 0xBC, 0xD0, 6B, 15A, 83, 0xDD, 0xEF, \
    3C, 1B, 32, 0xEE, 63, 0xD5, 9D, 7C, \
    37, 0xE4, 1D, 2B, 102, 9E, 1E, 241, \
    6E, 111, 82, 0xC3, 22, 4D, 244, 15B, \
    121, 48, 0xE9, 0xE4, 0xE5, 136, 87, 0xB6, \
    0xAC, 7D, 95, 66, 0xD6, 159, 6D, 24, \
    119, 99, 0xCF, 1D, 85, 3, 64, 4, \
    135, 245, 5B, 0xA5, 7E, 49, 0xCC, 7A, \
    113, 53, 0xC8, 134, 0xEF, 0xB4, 49, 8A, \
    0xED, 6A, 1E, 1, 2D, 9E, 104, 50, \
    0xA9, 7, 96, 0A, 145, 129, 48, 0xC4, \
    6D, 0xC7, 120, 249, 113, 0xAD, 0, 56, \
    9, 41, 153, 0xA3, 51, 0xCB, 8B, 7A, \
    1A, 1D, 0xB9, 3D, 113, 64, 0, 3C, \
    2A, 4E, 0xCE, 0xA9, 249, 8D, 0A, 0xCC, \
    0A, 130, 145, 0xCD, 0xCE, 0xC9, 7D, 0xCF, \
    8E, 0xC9, 0xB5, 5A, 127, 136, 0xA4, 6B, \
    4D, 0xB5, 0xA8, 81, 244, 65, 130, 0xE1, \
    0xC6, 8A, 0, 7E, 5E, 0D, 0xD9, 2, \
    0B, 15D, 100, 0xB6, 69, 3, 6C, 7A, \
    4E, 103, 7D, 2C, 56, 83, 2A, 3A, \
    35, 0xBA, 68, 66, 0xCA, 245, 3E, 0xA6, \
    3B, 0xB4, 84, 50, 9B, 118, 36, 0xC8, \
    145, 7B, 0xDD, 100, 0xB1, 0xC0, 15D, 4C, \
    0xB3, 8E, 8C, 51, 4C, 112, 1C, 3A, \
    0xCD, 0xAD, 6, 87, 15C, 0xCF, 0xEC, 113, \
    9B, 31, 5C, 3E, 4E, 70, 4, 31, \
    56, 129, 71, 15B, 4C, 15D, 0xB4, 119, \
    0xA5, 36, 113, 247, 0xA9, 0xA9, 105, 16, \
    0xB8, 85, 50, 2E, 0xDB, 99, 64, 0xD8, \
    0xA0, 0E, 240, 146, 53, 5, 17, 0xE3, \
    0A, 0xBE, 0xC1, 255, 249, 0xE3, 0xA2, 6E, \
    127, 0xB2, 159, 8C, 24, 48, 35, 0xC3, \
    88, 7E, 56, 0xDA, 0, 119, 0xD9, 0xB4, \
    118, 3E, 4E, 4B, 148, 0xB2, 0xBB, 0xC1, \
    148, 0xC6, 101, 1E, 119, 0xCA, 249, 146, \
    0xEE, 0xAA, 0xC0, 35, 2A, 40, 1B, 246, \
    0xB3, 0xA7, 57, 0xC1, 34, 97, 22, 130, \
    0A, 0xE8, 0xDB, 88, 71, 0xA6, 7C, 0xBE, \
    249, 0xC9, 9, 1B, 70, 2D, 83, 8C, \
    0xD7, 2B, 3, 116, 6A, 0xE7, 127, 5E, \
    98, 41, 2C, 49, 21, 98, 0xA8, 70, \
    80, 5D, 0xC8, 2D, 0xB8, 84, 51, 8A, \
    0xE4, 159, 82, 53, 0xC9, 5B, 145, 23, \
    8C, 0xCF, 2D, 0xD5, 0xCA, 0xCE, 244, 3, \
    0xEC, 9D, 24, 16, 0xC6, 39, 2B, 4, \
    5B, 3B, 113, 249, 0xDC, 6B, 128, 0xD6, \
    63, 0xDD, 4A, 8E, 9A, 0xDB, 1E, 105, \
    98, 0xA6, 149, 38, 0xD4, 49, 97, 0xC1, \
    0xA4, 1D, 87, 0D, 121, 56, 0xDA, 0xD4, \
    0xA4, 0E, 50, 9C, 0xCF, 244, 6A, 0xAA, \
    54, 0xAD, 0, 4C, 246, 0, 0xC8, 56, \
    1E, 66, 5A, 49, 0xD9, 81, 0xAE, 100, \
    15D, 0xB2, 63, 0xCE, 0xC9, 80, 9D, 67, \
    104, 127, 0xEB, 105, 0xED, 0xD1, 0xCC, 5E, \
    0B, 8C, 0xC3, 0xBD, 246, 4B, 16, 0xEF, \
    134, 0xB6, 49, 66, 0xA3, 0xAB, 136, 41, \
    85, 5B, 47, 116, 7C, 147, 38, 101, \
    0xCB, 2C, 15, 1C, 0xC0, 1B, 0xD7, 2, \
    41, 56, 136, 57, 0xD2, 0xAF, 5, 0xE4, \
    84, 80, 4A, 0xC7, 8B, 117, 130, 130, \
    40, 70, 0xC0, 0xBA, 53, 0xC3, 95, 5C, \
    89, 22, 0C, 0xC0, 70, 15D, 130, 81, \
    84, 31, 0xC6, 8C, 9C, 134, 0xB0, 34, \
    0xBB, 112, 153, 135, 6A, 70, 0E, 116, \
    81, 0xA8, 0xA9, 49, 9, 112, 63, 0xEE, \
    1C, 33, 7E, 6C, 56, 38, 0xE5, 2C, \
    81, 0xAA, 105, 1E, 0E, 66, 3C, 15C, \
    153, 0xE9, 0xE3, 22, 80, 0xC1, 33, 7B, \
    98, 72, 22, 0xCD, 0xAD, 9A, 149, 249, \
    0xD5, 0xB8, 1, 148, 136, 0xD9, 0xC0, 0xA0, \
    0xA1, 15E, 48, 117, 0xA5, 119, 0xE2, 49, \
    131, 248, 1D, 4A, 63, 47, 0xA4, 87, \
    1E, 15C, 8C, 0xE0, 0xBA, 8A, 79, 0xE8, \
    0xB6, 133, 5D, 15E, 114, 0xB0, 0xA6, 6E, \
    0xDE, 0xD2, 15B, 0xAB, 15B, 0xE5, 8A, 48, \
    15A, 15A, 0xBE, 1C, 5D, 113, 0xA8, 7E, \
    47, 116, 1E, 248, 0xC1, 15E, 134, 15E, \
    0xA6, 0xBB, 15D, 0xE5, 48, 103, 127, 0D, \
    151, 0xD1, 1D, 73, 247, 0xA8, 68, 3D, \
    8, 34, 0xE5, 6, 0xA9, 244, 97, 4E, \
    1, 1E, 2A, 148, 131, 143, 248, 8C, \
    0xD6, 8C, 8B, 0xB7, 0xC5, 0xC6, 66, 4C, \
    255, 255, 255, 255, 255, 255, 255, 255 }


      

Marco MBEDTLS_DHM_RFC7919_FFDHE8192_G_BIN

#define MBEDTLS_DHM_RFC7919_FFDHE8192_G_BIN { 2 }


      

Marco MBEDTLS_ECDH_H

#define MBEDTLS_ECDH_H


      

Marco MBEDTLS_ECDH_LEGACY_CONTEXT

#define MBEDTLS_ECDH_LEGACY_CONTEXT
/*
 * Use a backward compatible ECDH context.
 *
 * This flag is always enabled for now and future versions might add a
 * configuration option that conditionally undefines this flag.
 * The configuration option in question may have a different name.
 *
 * Features undefining this flag, must have a warning in their description in
 * config.h stating that the feature breaks backward compatibility.
 */

Marco MBEDTLS_ECDSA_H

#define MBEDTLS_ECDSA_H


      

Marco MBEDTLS_ECDSA_MAX_LEN

#define MBEDTLS_ECDSA_MAX_LEN ( 3 + 2 * ( 3 + MBEDTLS_ECP_MAX_BYTES ) )
/** The maximal size of an ECDSA signature in Bytes. */

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED   __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_ECJPAKE_H

#define MBEDTLS_ECJPAKE_H


      

Marco MBEDTLS_ECP_H

#define MBEDTLS_ECP_H


      

Marco MBEDTLS_ERR_ECP_BAD_INPUT_DATA

#define MBEDTLS_ERR_ECP_BAD_INPUT_DATA                   -20352 /**< Bad input parameters to function. */
/*
 * ECP error codes
 */

Marco MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL

#define MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL                 -20224 /**< The buffer is too small to write to. */


      

Marco MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE              -4E80 /**< The requested feature is not available, for example, the requested curve is not supported. */


      

Marco MBEDTLS_ERR_ECP_VERIFY_FAILED

#define MBEDTLS_ERR_ECP_VERIFY_FAILED                    -4E00 /**< The signature is not valid. */


      

Marco MBEDTLS_ERR_ECP_ALLOC_FAILED

#define MBEDTLS_ERR_ECP_ALLOC_FAILED                     -4D80 /**< Memory allocation failed. */


      

Marco MBEDTLS_ERR_ECP_RANDOM_FAILED

#define MBEDTLS_ERR_ECP_RANDOM_FAILED                    -4D00 /**< Generation of random value, such as ephemeral key, failed. */


      

Marco MBEDTLS_ERR_ECP_INVALID_KEY

#define MBEDTLS_ERR_ECP_INVALID_KEY                      -4C80 /**< Invalid private or public key. */


      

Marco MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH

#define MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH                 -4C00 /**< The buffer contains a valid signature followed by more data. */


      

Marco MBEDTLS_ERR_ECP_HW_ACCEL_FAILED

#define MBEDTLS_ERR_ECP_HW_ACCEL_FAILED                  -4B80 /**< The ECP hardware accelerator failed. */
/* MBEDTLS_ERR_ECP_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_ERR_ECP_IN_PROGRESS

#define MBEDTLS_ERR_ECP_IN_PROGRESS                      -4B00 /**< Operation in progress, call again with the same parameters to continue. */


      

Marco MBEDTLS_ECP_DP_MAX

#define MBEDTLS_ECP_DP_MAX    12
/**
 * The number of supported curves, plus one for #MBEDTLS_ECP_DP_NONE.
 *
 * \note Montgomery curves are currently excluded.
 */

Marco MBEDTLS_ECP_MAX_BITS

#define MBEDTLS_ECP_MAX_BITS    521  /**< The maximum size of groups, in bits. */
/**
 * The maximum size of the groups, that is, of \c N and \c P.
 */

Marco MBEDTLS_ECP_MAX_BYTES

#define MBEDTLS_ECP_MAX_BYTES   ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 )


      

Marco MBEDTLS_ECP_MAX_PT_LEN

#define MBEDTLS_ECP_MAX_PT_LEN  ( 2 * MBEDTLS_ECP_MAX_BYTES + 1 )


      

Marco MBEDTLS_ECP_WINDOW_SIZE

#define MBEDTLS_ECP_WINDOW_SIZE   6  /**< The maximum window size used. */
/*
 * Maximum "window" size used for point multiplication.
 * Default: 6.
 * Minimum value: 2. Maximum value: 7.
 *
 * Result is an array of at most ( 1 << ( MBEDTLS_ECP_WINDOW_SIZE - 1 ) )
 * points used for point multiplication. This value is directly tied to EC
 * peak memory usage, so decreasing it by one should roughly cut memory usage
 * by two (if large curves are in use).
 *
 * Reduction in size may reduce speed, but larger curves are impacted first.
 * Sample performances (in ECDHE handshakes/s, with FIXED_POINT_OPTIM = 1):
 *      w-size:     6       5       4       3       2
 *      521       145     141     135     120      97
 *      384       214     209     198     177     146
 *      256       320     320     303     262     226
 *      224       475     475     453     398     342
 *      192       640     640     633     587     476
 */

Marco MBEDTLS_ECP_FIXED_POINT_OPTIM

#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1  /**< Enable fixed-point speed-up. */
/*
 * Trade memory for speed on fixed-point multiplication.
 *
 * This speeds up repeated multiplication of the generator (that is, the
 * multiplication in ECDSA signatures, and half of the multiplications in
 * ECDSA verification and ECDHE) by a factor roughly 3 to 4.
 *
 * The cost is increasing EC peak memory usage by a factor roughly 2.
 *
 * Change this value to 0 to reduce peak memory usage.
 */

Marco MBEDTLS_ECP_OPS_CHK

#define MBEDTLS_ECP_OPS_CHK  3 /*!< basic ops count for ecp_check_pubkey()  */
/*
 * Operation counts for restartable functions
 */

Marco MBEDTLS_ECP_OPS_DBL

#define MBEDTLS_ECP_OPS_DBL  8 /*!< basic ops count for ecp_double_jac()    */


      

Marco MBEDTLS_ECP_OPS_ADD

#define MBEDTLS_ECP_OPS_ADD 11 /*!< basic ops count for see ecp_add_mixed() */


      

Marco MBEDTLS_ECP_OPS_INV

#define MBEDTLS_ECP_OPS_INV 120 /*!< empirical equivalent for mpi_mod_inv()  */


      

Marco MBEDTLS_ECP_BUDGET( ops )

#define MBEDTLS_ECP_BUDGET( ops )  \
   MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, rs_ctx, \
                                              (unsigned) (ops) ) );
/* Utility macro for checking and updating ops budget */

Marco MBEDTLS_ECP_BUDGET( ops )

#define MBEDTLS_ECP_BUDGET( ops )  /* no-op; for compatibility */


      

Marco MBEDTLS_ECP_PF_UNCOMPRESSED

#define MBEDTLS_ECP_PF_UNCOMPRESSED   0  /**< Uncompressed point format. */
/*
 * Point formats, from RFC 4492's enum ECPointFormat
 */

Marco MBEDTLS_ECP_PF_COMPRESSED

#define MBEDTLS_ECP_PF_COMPRESSED     1  /**< Compressed point format. */


      

Marco MBEDTLS_ECP_TLS_NAMED_CURVE

#define MBEDTLS_ECP_TLS_NAMED_CURVE   3  /**< The named_curve of ECCurveType. */
/*
 * Some other constants from RFC 4492
 */

Marco MBEDTLS_ECP_INTERNAL_H

#define MBEDTLS_ECP_INTERNAL_H


      

Marco MBEDTLS_ENTROPY_H

#define MBEDTLS_ENTROPY_H


      

Marco MBEDTLS_ENTROPY_SHA512_ACCUMULATOR

#define MBEDTLS_ENTROPY_SHA512_ACCUMULATOR


      

Marco MBEDTLS_ENTROPY_SHA256_ACCUMULATOR

#define MBEDTLS_ENTROPY_SHA256_ACCUMULATOR


      

Marco MBEDTLS_ERR_ENTROPY_SOURCE_FAILED

#define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED                -3C /**< Critical entropy source failure. */


      

Marco MBEDTLS_ERR_ENTROPY_MAX_SOURCES

#define MBEDTLS_ERR_ENTROPY_MAX_SOURCES                  -3E /**< No more sources can be added. */


      

Marco MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED

#define MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED           -64 /**< No sources have been added to poll. */


      

Marco MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE

#define MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE             -3D /**< No strong sources have been added to poll. */


      

Marco MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR

#define MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR                -63 /**< Read/write error in file. */


      

Marco MBEDTLS_ENTROPY_MAX_SOURCES

#define MBEDTLS_ENTROPY_MAX_SOURCES    20     /**< Maximum number of sources supported */


      

Marco MBEDTLS_ENTROPY_MAX_GATHER

#define MBEDTLS_ENTROPY_MAX_GATHER     128    /**< Maximum amount requested from entropy sources */


      

Marco MBEDTLS_ENTROPY_BLOCK_SIZE

#define MBEDTLS_ENTROPY_BLOCK_SIZE     64     /**< Block size of entropy accumulator (SHA-512) */


      

Marco MBEDTLS_ENTROPY_BLOCK_SIZE

#define MBEDTLS_ENTROPY_BLOCK_SIZE     32     /**< Block size of entropy accumulator (SHA-256) */


      

Marco MBEDTLS_ENTROPY_MAX_SEED_SIZE

#define MBEDTLS_ENTROPY_MAX_SEED_SIZE  1024   /**< Maximum size of seed we read from seed file */


      

Marco MBEDTLS_ENTROPY_SOURCE_MANUAL

#define MBEDTLS_ENTROPY_SOURCE_MANUAL  MBEDTLS_ENTROPY_MAX_SOURCES


      

Marco MBEDTLS_ENTROPY_SOURCE_STRONG

#define MBEDTLS_ENTROPY_SOURCE_STRONG  1      /**< Entropy source is strong   */


      

Marco MBEDTLS_ENTROPY_SOURCE_WEAK

#define MBEDTLS_ENTROPY_SOURCE_WEAK    0      /**< Entropy source is weak     */


      

Marco MBEDTLS_ENTROPY_POLL_H

#define MBEDTLS_ENTROPY_POLL_H


      

Marco MBEDTLS_ENTROPY_MIN_PLATFORM

#define MBEDTLS_ENTROPY_MIN_PLATFORM    32    /**< Minimum for platform source    */
/*
 * Default thresholds for built-in sources, in bytes
 */

Marco MBEDTLS_ENTROPY_MIN_HAVEGE

#define MBEDTLS_ENTROPY_MIN_HAVEGE      32    /**< Minimum for HAVEGE             */


      

Marco MBEDTLS_ENTROPY_MIN_HARDCLOCK

#define MBEDTLS_ENTROPY_MIN_HARDCLOCK    4    /**< Minimum for mbedtls_timing_hardclock()        */


      

Marco MBEDTLS_ENTROPY_MIN_HARDWARE

#define MBEDTLS_ENTROPY_MIN_HARDWARE    32    /**< Minimum for the hardware source */


      

Marco MBEDTLS_ERROR_H

#define MBEDTLS_ERROR_H


      

Marco MBEDTLS_GCM_H

#define MBEDTLS_GCM_H


      

Marco MBEDTLS_GCM_ENCRYPT

#define MBEDTLS_GCM_ENCRYPT    1


      

Marco MBEDTLS_GCM_DECRYPT

#define MBEDTLS_GCM_DECRYPT    0


      

Marco MBEDTLS_ERR_GCM_AUTH_FAILED

#define MBEDTLS_ERR_GCM_AUTH_FAILED                      -18 /**< Authenticated decryption failed. */


      

Marco MBEDTLS_ERR_GCM_HW_ACCEL_FAILED

#define MBEDTLS_ERR_GCM_HW_ACCEL_FAILED                  -19 /**< GCM hardware accelerator failed. */
/* MBEDTLS_ERR_GCM_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_ERR_GCM_BAD_INPUT

#define MBEDTLS_ERR_GCM_BAD_INPUT                        -20 /**< Bad input parameters to function. */


      

Marco MBEDTLS_HAVEGE_H

#define MBEDTLS_HAVEGE_H


      

Marco MBEDTLS_HAVEGE_COLLECT_SIZE

#define MBEDTLS_HAVEGE_COLLECT_SIZE 1024


      

Marco MBEDTLS_HKDF_H

#define MBEDTLS_HKDF_H


      

Marco MBEDTLS_ERR_HKDF_BAD_INPUT_DATA

#define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA -24448 /**< Bad input parameters to function. */
/**
 *  \name HKDF Error codes
 *  \{
 */

Marco MBEDTLS_HMAC_DRBG_H

#define MBEDTLS_HMAC_DRBG_H


      

Marco MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG

#define MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG             -3 /**< Too many random requested in single call. */
/*
 * Error codes
 */

Marco MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG

#define MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG               -5 /**< Input too large (Entropy + additional). */


      

Marco MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR

#define MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR               -7 /**< Read/write error in file. */


      

Marco MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED

#define MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED       -9 /**< The entropy source failed. */


      

Marco MBEDTLS_HMAC_DRBG_RESEED_INTERVAL

#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL  10000  /**< Interval before reseed is performed by default */


      

Marco MBEDTLS_HMAC_DRBG_MAX_INPUT

#define MBEDTLS_HMAC_DRBG_MAX_INPUT        256    /**< Maximum number of additional input bytes */


      

Marco MBEDTLS_HMAC_DRBG_MAX_REQUEST

#define MBEDTLS_HMAC_DRBG_MAX_REQUEST      1024   /**< Maximum number of requested bytes per call */


      

Marco MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT

#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT   384    /**< Maximum size of (re)seed buffer */


      

Marco MBEDTLS_HMAC_DRBG_PR_OFF

#define MBEDTLS_HMAC_DRBG_PR_OFF  0  /**< No prediction resistance       */


      

Marco MBEDTLS_HMAC_DRBG_PR_ON

#define MBEDTLS_HMAC_DRBG_PR_ON   1  /**< Prediction resistance enabled  */


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED   __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_MD_H

#define MBEDTLS_MD_H


      

Marco MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE               -20608 /**< The selected feature is not available. */


      

Marco MBEDTLS_ERR_MD_BAD_INPUT_DATA

#define MBEDTLS_ERR_MD_BAD_INPUT_DATA                    -20736 /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_MD_ALLOC_FAILED

#define MBEDTLS_ERR_MD_ALLOC_FAILED                      -20864 /**< Failed to allocate memory. */


      

Marco MBEDTLS_ERR_MD_FILE_IO_ERROR

#define MBEDTLS_ERR_MD_FILE_IO_ERROR                     -20992 /**< Opening or reading of file failed. */


      

Marco MBEDTLS_ERR_MD_HW_ACCEL_FAILED

#define MBEDTLS_ERR_MD_HW_ACCEL_FAILED                   -21120 /**< MD hardware accelerator failed. */
/* MBEDTLS_ERR_MD_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_MD_MAX_SIZE

#define MBEDTLS_MD_MAX_SIZE        64 /* longest known is SHA512 */


      

Marco MBEDTLS_MD_MAX_SIZE

#define MBEDTLS_MD_MAX_SIZE        32 /* longest known is SHA256 or less */


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED   __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_MD2_H

#define MBEDTLS_MD2_H


      

Marco MBEDTLS_ERR_MD2_HW_ACCEL_FAILED

#define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED                  -2B /**< MD2 hardware accelerator failed */
/* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_MD4_H

#define MBEDTLS_MD4_H


      

Marco MBEDTLS_ERR_MD4_HW_ACCEL_FAILED

#define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED                  -2D /**< MD4 hardware accelerator failed */
/* MBEDTLS_ERR_MD4_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_MD5_H

#define MBEDTLS_MD5_H


      

Marco MBEDTLS_ERR_MD5_HW_ACCEL_FAILED

#define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED                  -47 /**< MD5 hardware accelerator failed */
/* MBEDTLS_ERR_MD5_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_MD_WRAP_H

#define MBEDTLS_MD_WRAP_H


      

Marco MBEDTLS_MEMORY_BUFFER_ALLOC_H

#define MBEDTLS_MEMORY_BUFFER_ALLOC_H


      

Marco MBEDTLS_MEMORY_ALIGN_MULTIPLE

#define MBEDTLS_MEMORY_ALIGN_MULTIPLE      4 /**< Align on multiples of this value */


      

Marco MBEDTLS_MEMORY_VERIFY_NONE

#define MBEDTLS_MEMORY_VERIFY_NONE        0


      

Marco MBEDTLS_MEMORY_VERIFY_ALLOC

#define MBEDTLS_MEMORY_VERIFY_ALLOC       (1 << 0)


      

Marco MBEDTLS_MEMORY_VERIFY_FREE

#define MBEDTLS_MEMORY_VERIFY_FREE        (1 << 1)


      

Marco MBEDTLS_MEMORY_VERIFY_ALWAYS

#define MBEDTLS_MEMORY_VERIFY_ALWAYS      (MBEDTLS_MEMORY_VERIFY_ALLOC | MBEDTLS_MEMORY_VERIFY_FREE)


      

Marco MBEDTLS_NET_SOCKETS_H

#define MBEDTLS_NET_SOCKETS_H


      

Marco MBEDTLS_ERR_NET_SOCKET_FAILED

#define MBEDTLS_ERR_NET_SOCKET_FAILED                    -66 /**< Failed to open a socket. */


      

Marco MBEDTLS_ERR_NET_CONNECT_FAILED

#define MBEDTLS_ERR_NET_CONNECT_FAILED                   -68 /**< The connection to the given server / port failed. */


      

Marco MBEDTLS_ERR_NET_BIND_FAILED

#define MBEDTLS_ERR_NET_BIND_FAILED                      -70 /**< Binding of the socket failed. */


      

Marco MBEDTLS_ERR_NET_LISTEN_FAILED

#define MBEDTLS_ERR_NET_LISTEN_FAILED                    -72 /**< Could not listen on the socket. */


      

Marco MBEDTLS_ERR_NET_ACCEPT_FAILED

#define MBEDTLS_ERR_NET_ACCEPT_FAILED                    -4A /**< Could not accept the incoming connection. */


      

Marco MBEDTLS_ERR_NET_RECV_FAILED

#define MBEDTLS_ERR_NET_RECV_FAILED                      -4C /**< Reading information from the socket failed. */


      

Marco MBEDTLS_ERR_NET_SEND_FAILED

#define MBEDTLS_ERR_NET_SEND_FAILED                      -4E /**< Sending information through the socket failed. */


      

Marco MBEDTLS_ERR_NET_CONN_RESET

#define MBEDTLS_ERR_NET_CONN_RESET                       -80 /**< Connection was reset by peer. */


      

Marco MBEDTLS_ERR_NET_UNKNOWN_HOST

#define MBEDTLS_ERR_NET_UNKNOWN_HOST                     -82 /**< Failed to get an IP address for the given hostname. */


      

Marco MBEDTLS_ERR_NET_BUFFER_TOO_SMALL

#define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL                 -67 /**< Buffer is too small to hold the data. */


      

Marco MBEDTLS_ERR_NET_INVALID_CONTEXT

#define MBEDTLS_ERR_NET_INVALID_CONTEXT                  -69 /**< The context is invalid, eg because it was free()ed. */


      

Marco MBEDTLS_ERR_NET_POLL_FAILED

#define MBEDTLS_ERR_NET_POLL_FAILED                      -71 /**< Polling the net context failed. */


      

Marco MBEDTLS_ERR_NET_BAD_INPUT_DATA

#define MBEDTLS_ERR_NET_BAD_INPUT_DATA                   -73 /**< Input invalid. */


      

Marco MBEDTLS_NET_LISTEN_BACKLOG

#define MBEDTLS_NET_LISTEN_BACKLOG        10 /**< The backlog that listen() should use. */


      

Marco MBEDTLS_NET_PROTO_TCP

#define MBEDTLS_NET_PROTO_TCP 0 /**< The TCP transport protocol */


      

Marco MBEDTLS_NET_PROTO_UDP

#define MBEDTLS_NET_PROTO_UDP 1 /**< The UDP transport protocol */


      

Marco MBEDTLS_NET_POLL_READ

#define MBEDTLS_NET_POLL_READ 1 /**< Used in \c mbedtls_net_poll to check for pending data  */


      

Marco MBEDTLS_NET_POLL_WRITE

#define MBEDTLS_NET_POLL_WRITE 2 /**< Used in \c mbedtls_net_poll to check if write possible */


      

Marco MBEDTLS_NIST_KW_H

#define MBEDTLS_NIST_KW_H


      

Marco MBEDTLS_OID_H

#define MBEDTLS_OID_H


      

Marco MBEDTLS_ERR_OID_NOT_FOUND

#define MBEDTLS_ERR_OID_NOT_FOUND                        -2E /**< OID is not found. */


      

Marco MBEDTLS_ERR_OID_BUF_TOO_SMALL

#define MBEDTLS_ERR_OID_BUF_TOO_SMALL                    0B /**< output buffer is too small */


      

Marco MBEDTLS_OID_ISO_MEMBER_BODIES

#define MBEDTLS_OID_ISO_MEMBER_BODIES          "\x2a"         /* {iso(1) member-body(2)} */
/*
 * Top level OID tuples
 */

Marco MBEDTLS_OID_ISO_IDENTIFIED_ORG

#define MBEDTLS_OID_ISO_IDENTIFIED_ORG         "\x2b"         /* {iso(1) identified-organization(3)} */


      

Marco MBEDTLS_OID_ISO_CCITT_DS

#define MBEDTLS_OID_ISO_CCITT_DS               "\x55"         /* {joint-iso-ccitt(2) ds(5)} */


      

Marco MBEDTLS_OID_ISO_ITU_COUNTRY

#define MBEDTLS_OID_ISO_ITU_COUNTRY            "\x60"         /* {joint-iso-itu-t(2) country(16)} */


      

Marco MBEDTLS_OID_COUNTRY_US

#define MBEDTLS_OID_COUNTRY_US                 "\x86\x48"     /* {us(840)} */
/*
 * ISO Member bodies OID parts
 */

Marco MBEDTLS_OID_ORG_RSA_DATA_SECURITY

#define MBEDTLS_OID_ORG_RSA_DATA_SECURITY      "\x86\xf7\x0d" /* {rsadsi(113549)} */


      

Marco MBEDTLS_OID_RSA_COMPANY

#define MBEDTLS_OID_RSA_COMPANY                MBEDTLS_OID_ISO_MEMBER_BODIES MBEDTLS_OID_COUNTRY_US \
                                       MBEDTLS_OID_ORG_RSA_DATA_SECURITY /* {iso(1) member-body(2) us(840) rsadsi(113549)} */


      

Marco MBEDTLS_OID_ORG_ANSI_X9_62

#define MBEDTLS_OID_ORG_ANSI_X9_62             "\xce\x3d" /* ansi-X9-62(10045) */


      

Marco MBEDTLS_OID_ANSI_X9_62

#define MBEDTLS_OID_ANSI_X9_62                 MBEDTLS_OID_ISO_MEMBER_BODIES MBEDTLS_OID_COUNTRY_US \
                                       MBEDTLS_OID_ORG_ANSI_X9_62


      

Marco MBEDTLS_OID_ORG_DOD

#define MBEDTLS_OID_ORG_DOD                    "\x06"         /* {dod(6)} */
/*
 * ISO Identified organization OID parts
 */

Marco MBEDTLS_OID_ORG_OIW

#define MBEDTLS_OID_ORG_OIW                    "\x0e"


      

Marco MBEDTLS_OID_OIW_SECSIG

#define MBEDTLS_OID_OIW_SECSIG                 MBEDTLS_OID_ORG_OIW "\x03"


      

Marco MBEDTLS_OID_OIW_SECSIG_ALG

#define MBEDTLS_OID_OIW_SECSIG_ALG             MBEDTLS_OID_OIW_SECSIG "\x02"


      

Marco MBEDTLS_OID_OIW_SECSIG_SHA1

#define MBEDTLS_OID_OIW_SECSIG_SHA1            MBEDTLS_OID_OIW_SECSIG_ALG "\x1a"


      

Marco MBEDTLS_OID_ORG_CERTICOM

#define MBEDTLS_OID_ORG_CERTICOM               "\x81\x04" /* certicom(132) */


      

Marco MBEDTLS_OID_CERTICOM

#define MBEDTLS_OID_CERTICOM                   MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_CERTICOM


      

Marco MBEDTLS_OID_ORG_TELETRUST

#define MBEDTLS_OID_ORG_TELETRUST              "\x24" /* teletrust(36) */


      

Marco MBEDTLS_OID_TELETRUST

#define MBEDTLS_OID_TELETRUST                  MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_TELETRUST


      

Marco MBEDTLS_OID_ORGANIZATION

#define MBEDTLS_OID_ORGANIZATION               "\x01"         /* {organization(1)} */
/*
 * ISO ITU OID parts
 */

Marco MBEDTLS_OID_ISO_ITU_US_ORG

#define MBEDTLS_OID_ISO_ITU_US_ORG             MBEDTLS_OID_ISO_ITU_COUNTRY MBEDTLS_OID_COUNTRY_US MBEDTLS_OID_ORGANIZATION /* {joint-iso-itu-t(2) country(16) us(840) organization(1)} */


      

Marco MBEDTLS_OID_ORG_GOV

#define MBEDTLS_OID_ORG_GOV                    "\x65"         /* {gov(101)} */


      

Marco MBEDTLS_OID_GOV

#define MBEDTLS_OID_GOV                        MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ORG_GOV /* {joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)} */


      

Marco MBEDTLS_OID_ORG_NETSCAPE

#define MBEDTLS_OID_ORG_NETSCAPE               "\x86\xF8\x42" /* {netscape(113730)} */


      

Marco MBEDTLS_OID_NETSCAPE

#define MBEDTLS_OID_NETSCAPE                   MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ORG_NETSCAPE /* Netscape OID {joint-iso-itu-t(2) country(16) us(840) organization(1) netscape(113730)} */


      

Marco MBEDTLS_OID_ID_CE

#define MBEDTLS_OID_ID_CE                      MBEDTLS_OID_ISO_CCITT_DS "\x1D" /**< id-ce OBJECT IDENTIFIER  ::=  {joint-iso-ccitt(2) ds(5) 29} */
/* ISO arc for standard certificate and CRL extensions */

Marco MBEDTLS_OID_NIST_ALG

#define MBEDTLS_OID_NIST_ALG                   MBEDTLS_OID_GOV "\x03\x04" /** { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) */


      

Marco MBEDTLS_OID_PKIX

#define MBEDTLS_OID_PKIX                       MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_DOD "\x01\x05\x05\x07"
/**
 * Private Internet Extensions
 * { iso(1) identified-organization(3) dod(6) internet(1)
 *                      security(5) mechanisms(5) pkix(7) }
 */

Marco MBEDTLS_OID_AT

#define MBEDTLS_OID_AT                         MBEDTLS_OID_ISO_CCITT_DS "\x04" /**< id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4} */
/*
 * Arc for standard naming attributes
 */

Marco MBEDTLS_OID_AT_CN

#define MBEDTLS_OID_AT_CN                      MBEDTLS_OID_AT "\x03" /**< id-at-commonName AttributeType:= {id-at 3} */


      

Marco MBEDTLS_OID_AT_SUR_NAME

#define MBEDTLS_OID_AT_SUR_NAME                MBEDTLS_OID_AT "\x04" /**< id-at-surName AttributeType:= {id-at 4} */


      

Marco MBEDTLS_OID_AT_SERIAL_NUMBER

#define MBEDTLS_OID_AT_SERIAL_NUMBER           MBEDTLS_OID_AT "\x05" /**< id-at-serialNumber AttributeType:= {id-at 5} */


      

Marco MBEDTLS_OID_AT_COUNTRY

#define MBEDTLS_OID_AT_COUNTRY                 MBEDTLS_OID_AT "\x06" /**< id-at-countryName AttributeType:= {id-at 6} */


      

Marco MBEDTLS_OID_AT_LOCALITY

#define MBEDTLS_OID_AT_LOCALITY                MBEDTLS_OID_AT "\x07" /**< id-at-locality AttributeType:= {id-at 7} */


      

Marco MBEDTLS_OID_AT_STATE

#define MBEDTLS_OID_AT_STATE                   MBEDTLS_OID_AT "\x08" /**< id-at-state AttributeType:= {id-at 8} */


      

Marco MBEDTLS_OID_AT_ORGANIZATION

#define MBEDTLS_OID_AT_ORGANIZATION            MBEDTLS_OID_AT "\x0A" /**< id-at-organizationName AttributeType:= {id-at 10} */


      

Marco MBEDTLS_OID_AT_ORG_UNIT

#define MBEDTLS_OID_AT_ORG_UNIT                MBEDTLS_OID_AT "\x0B" /**< id-at-organizationalUnitName AttributeType:= {id-at 11} */


      

Marco MBEDTLS_OID_AT_TITLE

#define MBEDTLS_OID_AT_TITLE                   MBEDTLS_OID_AT "\x0C" /**< id-at-title AttributeType:= {id-at 12} */


      

Marco MBEDTLS_OID_AT_POSTAL_ADDRESS

#define MBEDTLS_OID_AT_POSTAL_ADDRESS          MBEDTLS_OID_AT "\x10" /**< id-at-postalAddress AttributeType:= {id-at 16} */


      

Marco MBEDTLS_OID_AT_POSTAL_CODE

#define MBEDTLS_OID_AT_POSTAL_CODE             MBEDTLS_OID_AT "\x11" /**< id-at-postalCode AttributeType:= {id-at 17} */


      

Marco MBEDTLS_OID_AT_GIVEN_NAME

#define MBEDTLS_OID_AT_GIVEN_NAME              MBEDTLS_OID_AT "\x2A" /**< id-at-givenName AttributeType:= {id-at 42} */


      

Marco MBEDTLS_OID_AT_INITIALS

#define MBEDTLS_OID_AT_INITIALS                MBEDTLS_OID_AT "\x2B" /**< id-at-initials AttributeType:= {id-at 43} */


      

Marco MBEDTLS_OID_AT_GENERATION_QUALIFIER

#define MBEDTLS_OID_AT_GENERATION_QUALIFIER    MBEDTLS_OID_AT "\x2C" /**< id-at-generationQualifier AttributeType:= {id-at 44} */


      

Marco MBEDTLS_OID_AT_UNIQUE_IDENTIFIER

#define MBEDTLS_OID_AT_UNIQUE_IDENTIFIER       MBEDTLS_OID_AT "\x2D" /**< id-at-uniqueIdentifier AttributType:= {id-at 45} */


      

Marco MBEDTLS_OID_AT_DN_QUALIFIER

#define MBEDTLS_OID_AT_DN_QUALIFIER            MBEDTLS_OID_AT "\x2E" /**< id-at-dnQualifier AttributeType:= {id-at 46} */


      

Marco MBEDTLS_OID_AT_PSEUDONYM

#define MBEDTLS_OID_AT_PSEUDONYM               MBEDTLS_OID_AT "\x41" /**< id-at-pseudonym AttributeType:= {id-at 65} */


      

Marco MBEDTLS_OID_DOMAIN_COMPONENT

#define MBEDTLS_OID_DOMAIN_COMPONENT           "\x09\x92\x26\x89\x93\xF2\x2C\x64\x01\x19" /** id-domainComponent AttributeType:= {itu-t(0) data(9) pss(2342) ucl(19200300) pilot(100) pilotAttributeType(1) domainComponent(25)} */


      

Marco MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER

#define MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER   MBEDTLS_OID_ID_CE "\x23" /**< id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 35 } */
/*
 * OIDs for standard certificate extensions
 */

Marco MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER

#define MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER     MBEDTLS_OID_ID_CE "\x0E" /**< id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::=  { id-ce 14 } */


      

Marco MBEDTLS_OID_KEY_USAGE

#define MBEDTLS_OID_KEY_USAGE                  MBEDTLS_OID_ID_CE "\x0F" /**< id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 } */


      

Marco MBEDTLS_OID_CERTIFICATE_POLICIES

#define MBEDTLS_OID_CERTIFICATE_POLICIES       MBEDTLS_OID_ID_CE "\x20" /**< id-ce-certificatePolicies OBJECT IDENTIFIER ::=  { id-ce 32 } */


      

Marco MBEDTLS_OID_POLICY_MAPPINGS

#define MBEDTLS_OID_POLICY_MAPPINGS            MBEDTLS_OID_ID_CE "\x21" /**< id-ce-policyMappings OBJECT IDENTIFIER ::=  { id-ce 33 } */


      

Marco MBEDTLS_OID_SUBJECT_ALT_NAME

#define MBEDTLS_OID_SUBJECT_ALT_NAME           MBEDTLS_OID_ID_CE "\x11" /**< id-ce-subjectAltName OBJECT IDENTIFIER ::=  { id-ce 17 } */


      

Marco MBEDTLS_OID_ISSUER_ALT_NAME

#define MBEDTLS_OID_ISSUER_ALT_NAME            MBEDTLS_OID_ID_CE "\x12" /**< id-ce-issuerAltName OBJECT IDENTIFIER ::=  { id-ce 18 } */


      

Marco MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS

#define MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS    MBEDTLS_OID_ID_CE "\x09" /**< id-ce-subjectDirectoryAttributes OBJECT IDENTIFIER ::=  { id-ce 9 } */


      

Marco MBEDTLS_OID_BASIC_CONSTRAINTS

#define MBEDTLS_OID_BASIC_CONSTRAINTS          MBEDTLS_OID_ID_CE "\x13" /**< id-ce-basicConstraints OBJECT IDENTIFIER ::=  { id-ce 19 } */


      

Marco MBEDTLS_OID_NAME_CONSTRAINTS

#define MBEDTLS_OID_NAME_CONSTRAINTS           MBEDTLS_OID_ID_CE "\x1E" /**< id-ce-nameConstraints OBJECT IDENTIFIER ::=  { id-ce 30 } */


      

Marco MBEDTLS_OID_POLICY_CONSTRAINTS

#define MBEDTLS_OID_POLICY_CONSTRAINTS         MBEDTLS_OID_ID_CE "\x24" /**< id-ce-policyConstraints OBJECT IDENTIFIER ::=  { id-ce 36 } */


      

Marco MBEDTLS_OID_EXTENDED_KEY_USAGE

#define MBEDTLS_OID_EXTENDED_KEY_USAGE         MBEDTLS_OID_ID_CE "\x25" /**< id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 } */


      

Marco MBEDTLS_OID_CRL_DISTRIBUTION_POINTS

#define MBEDTLS_OID_CRL_DISTRIBUTION_POINTS    MBEDTLS_OID_ID_CE "\x1F" /**< id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::=  { id-ce 31 } */


      

Marco MBEDTLS_OID_INIHIBIT_ANYPOLICY

#define MBEDTLS_OID_INIHIBIT_ANYPOLICY         MBEDTLS_OID_ID_CE "\x36" /**< id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::=  { id-ce 54 } */


      

Marco MBEDTLS_OID_FRESHEST_CRL

#define MBEDTLS_OID_FRESHEST_CRL               MBEDTLS_OID_ID_CE "\x2E" /**< id-ce-freshestCRL OBJECT IDENTIFIER ::=  { id-ce 46 } */


      

Marco MBEDTLS_OID_NS_CERT

#define MBEDTLS_OID_NS_CERT                MBEDTLS_OID_NETSCAPE "\x01"
/*
 * Netscape certificate extensions
 */

Marco MBEDTLS_OID_NS_CERT_TYPE

#define MBEDTLS_OID_NS_CERT_TYPE           MBEDTLS_OID_NS_CERT "\x01"


      

Marco MBEDTLS_OID_NS_BASE_URL

#define MBEDTLS_OID_NS_BASE_URL            MBEDTLS_OID_NS_CERT "\x02"


      

Marco MBEDTLS_OID_NS_REVOCATION_URL

#define MBEDTLS_OID_NS_REVOCATION_URL      MBEDTLS_OID_NS_CERT "\x03"


      

Marco MBEDTLS_OID_NS_CA_REVOCATION_URL

#define MBEDTLS_OID_NS_CA_REVOCATION_URL   MBEDTLS_OID_NS_CERT "\x04"


      

Marco MBEDTLS_OID_NS_RENEWAL_URL

#define MBEDTLS_OID_NS_RENEWAL_URL         MBEDTLS_OID_NS_CERT "\x07"


      

Marco MBEDTLS_OID_NS_CA_POLICY_URL

#define MBEDTLS_OID_NS_CA_POLICY_URL       MBEDTLS_OID_NS_CERT "\x08"


      

Marco MBEDTLS_OID_NS_SSL_SERVER_NAME

#define MBEDTLS_OID_NS_SSL_SERVER_NAME     MBEDTLS_OID_NS_CERT "\x0C"


      

Marco MBEDTLS_OID_NS_COMMENT

#define MBEDTLS_OID_NS_COMMENT             MBEDTLS_OID_NS_CERT "\x0D"


      

Marco MBEDTLS_OID_NS_DATA_TYPE

#define MBEDTLS_OID_NS_DATA_TYPE           MBEDTLS_OID_NETSCAPE "\x02"


      

Marco MBEDTLS_OID_NS_CERT_SEQUENCE

#define MBEDTLS_OID_NS_CERT_SEQUENCE       MBEDTLS_OID_NS_DATA_TYPE "\x05"


      

Marco MBEDTLS_OID_PRIVATE_KEY_USAGE_PERIOD

#define MBEDTLS_OID_PRIVATE_KEY_USAGE_PERIOD   MBEDTLS_OID_ID_CE "\x10"
/*
 * OIDs for CRL extensions
 */

Marco MBEDTLS_OID_CRL_NUMBER

#define MBEDTLS_OID_CRL_NUMBER                 MBEDTLS_OID_ID_CE "\x14" /**< id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 } */


      

Marco MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE

#define MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE     MBEDTLS_OID_EXTENDED_KEY_USAGE "\x00" /**< anyExtendedKeyUsage OBJECT IDENTIFIER ::= { id-ce-extKeyUsage 0 } */
/*
 * X.509 v3 Extended key usage OIDs
 */

Marco MBEDTLS_OID_KP

#define MBEDTLS_OID_KP                         MBEDTLS_OID_PKIX "\x03" /**< id-kp OBJECT IDENTIFIER ::= { id-pkix 3 } */


      

Marco MBEDTLS_OID_SERVER_AUTH

#define MBEDTLS_OID_SERVER_AUTH                MBEDTLS_OID_KP "\x01" /**< id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 } */


      

Marco MBEDTLS_OID_CLIENT_AUTH

#define MBEDTLS_OID_CLIENT_AUTH                MBEDTLS_OID_KP "\x02" /**< id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 } */


      

Marco MBEDTLS_OID_CODE_SIGNING

#define MBEDTLS_OID_CODE_SIGNING               MBEDTLS_OID_KP "\x03" /**< id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 } */


      

Marco MBEDTLS_OID_EMAIL_PROTECTION

#define MBEDTLS_OID_EMAIL_PROTECTION           MBEDTLS_OID_KP "\x04" /**< id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 } */


      

Marco MBEDTLS_OID_TIME_STAMPING

#define MBEDTLS_OID_TIME_STAMPING              MBEDTLS_OID_KP "\x08" /**< id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 } */


      

Marco MBEDTLS_OID_OCSP_SIGNING

#define MBEDTLS_OID_OCSP_SIGNING               MBEDTLS_OID_KP "\x09" /**< id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 } */


      

Marco MBEDTLS_OID_PKCS

#define MBEDTLS_OID_PKCS               MBEDTLS_OID_RSA_COMPANY "\x01" /**< pkcs OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) 1 } */


      

Marco MBEDTLS_OID_PKCS1

#define MBEDTLS_OID_PKCS1              MBEDTLS_OID_PKCS "\x01" /**< pkcs-1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } */


      

Marco MBEDTLS_OID_PKCS5

#define MBEDTLS_OID_PKCS5              MBEDTLS_OID_PKCS "\x05" /**< pkcs-5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 5 } */


      

Marco MBEDTLS_OID_PKCS9

#define MBEDTLS_OID_PKCS9              MBEDTLS_OID_PKCS "\x09" /**< pkcs-9 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 } */


      

Marco MBEDTLS_OID_PKCS12

#define MBEDTLS_OID_PKCS12             MBEDTLS_OID_PKCS "\x0c" /**< pkcs-12 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 12 } */


      

Marco MBEDTLS_OID_PKCS1_RSA

#define MBEDTLS_OID_PKCS1_RSA          MBEDTLS_OID_PKCS1 "\x01" /**< rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } */
/*
 * PKCS#1 OIDs
 */

Marco MBEDTLS_OID_PKCS1_MD2

#define MBEDTLS_OID_PKCS1_MD2          MBEDTLS_OID_PKCS1 "\x02" /**< md2WithRSAEncryption ::= { pkcs-1 2 } */


      

Marco MBEDTLS_OID_PKCS1_MD4

#define MBEDTLS_OID_PKCS1_MD4          MBEDTLS_OID_PKCS1 "\x03" /**< md4WithRSAEncryption ::= { pkcs-1 3 } */


      

Marco MBEDTLS_OID_PKCS1_MD5

#define MBEDTLS_OID_PKCS1_MD5          MBEDTLS_OID_PKCS1 "\x04" /**< md5WithRSAEncryption ::= { pkcs-1 4 } */


      

Marco MBEDTLS_OID_PKCS1_SHA1

#define MBEDTLS_OID_PKCS1_SHA1         MBEDTLS_OID_PKCS1 "\x05" /**< sha1WithRSAEncryption ::= { pkcs-1 5 } */


      

Marco MBEDTLS_OID_PKCS1_SHA224

#define MBEDTLS_OID_PKCS1_SHA224       MBEDTLS_OID_PKCS1 "\x0e" /**< sha224WithRSAEncryption ::= { pkcs-1 14 } */


      

Marco MBEDTLS_OID_PKCS1_SHA256

#define MBEDTLS_OID_PKCS1_SHA256       MBEDTLS_OID_PKCS1 "\x0b" /**< sha256WithRSAEncryption ::= { pkcs-1 11 } */


      

Marco MBEDTLS_OID_PKCS1_SHA384

#define MBEDTLS_OID_PKCS1_SHA384       MBEDTLS_OID_PKCS1 "\x0c" /**< sha384WithRSAEncryption ::= { pkcs-1 12 } */


      

Marco MBEDTLS_OID_PKCS1_SHA512

#define MBEDTLS_OID_PKCS1_SHA512       MBEDTLS_OID_PKCS1 "\x0d" /**< sha512WithRSAEncryption ::= { pkcs-1 13 } */


      

Marco MBEDTLS_OID_RSA_SHA_OBS

#define MBEDTLS_OID_RSA_SHA_OBS        "\x2B\x0E\x03\x02\x1D"


      

Marco MBEDTLS_OID_PKCS9_EMAIL

#define MBEDTLS_OID_PKCS9_EMAIL        MBEDTLS_OID_PKCS9 "\x01" /**< emailAddress AttributeType ::= { pkcs-9 1 } */


      

Marco MBEDTLS_OID_RSASSA_PSS

#define MBEDTLS_OID_RSASSA_PSS         MBEDTLS_OID_PKCS1 "\x0a" /**< id-RSASSA-PSS ::= { pkcs-1 10 } */
/* RFC 4055 */

Marco MBEDTLS_OID_MGF1

#define MBEDTLS_OID_MGF1               MBEDTLS_OID_PKCS1 "\x08" /**< id-mgf1 ::= { pkcs-1 8 } */


      

Marco MBEDTLS_OID_DIGEST_ALG_MD2

#define MBEDTLS_OID_DIGEST_ALG_MD2             MBEDTLS_OID_RSA_COMPANY "\x02\x02" /**< id-mbedtls_md2 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 2 } */
/*
 * Digest algorithms
 */

Marco MBEDTLS_OID_DIGEST_ALG_MD4

#define MBEDTLS_OID_DIGEST_ALG_MD4             MBEDTLS_OID_RSA_COMPANY "\x02\x04" /**< id-mbedtls_md4 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 4 } */


      

Marco MBEDTLS_OID_DIGEST_ALG_MD5

#define MBEDTLS_OID_DIGEST_ALG_MD5             MBEDTLS_OID_RSA_COMPANY "\x02\x05" /**< id-mbedtls_md5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5 } */


      

Marco MBEDTLS_OID_DIGEST_ALG_SHA1

#define MBEDTLS_OID_DIGEST_ALG_SHA1            MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_SHA1 /**< id-mbedtls_sha1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 26 } */


      

Marco MBEDTLS_OID_DIGEST_ALG_SHA224

#define MBEDTLS_OID_DIGEST_ALG_SHA224          MBEDTLS_OID_NIST_ALG "\x02\x04" /**< id-sha224 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 4 } */


      

Marco MBEDTLS_OID_DIGEST_ALG_SHA256

#define MBEDTLS_OID_DIGEST_ALG_SHA256          MBEDTLS_OID_NIST_ALG "\x02\x01" /**< id-mbedtls_sha256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 1 } */


      

Marco MBEDTLS_OID_DIGEST_ALG_SHA384

#define MBEDTLS_OID_DIGEST_ALG_SHA384          MBEDTLS_OID_NIST_ALG "\x02\x02" /**< id-sha384 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 2 } */


      

Marco MBEDTLS_OID_DIGEST_ALG_SHA512

#define MBEDTLS_OID_DIGEST_ALG_SHA512          MBEDTLS_OID_NIST_ALG "\x02\x03" /**< id-mbedtls_sha512 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 3 } */


      

Marco MBEDTLS_OID_HMAC_SHA1

#define MBEDTLS_OID_HMAC_SHA1                  MBEDTLS_OID_RSA_COMPANY "\x02\x07" /**< id-hmacWithSHA1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 7 } */


      

Marco MBEDTLS_OID_HMAC_SHA224

#define MBEDTLS_OID_HMAC_SHA224                MBEDTLS_OID_RSA_COMPANY "\x02\x08" /**< id-hmacWithSHA224 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 8 } */


      

Marco MBEDTLS_OID_HMAC_SHA256

#define MBEDTLS_OID_HMAC_SHA256                MBEDTLS_OID_RSA_COMPANY "\x02\x09" /**< id-hmacWithSHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 9 } */


      

Marco MBEDTLS_OID_HMAC_SHA384

#define MBEDTLS_OID_HMAC_SHA384                MBEDTLS_OID_RSA_COMPANY "\x02\x0A" /**< id-hmacWithSHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 10 } */


      

Marco MBEDTLS_OID_HMAC_SHA512

#define MBEDTLS_OID_HMAC_SHA512                MBEDTLS_OID_RSA_COMPANY "\x02\x0B" /**< id-hmacWithSHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 11 } */


      

Marco MBEDTLS_OID_DES_CBC

#define MBEDTLS_OID_DES_CBC                    MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_ALG "\x07" /**< desCBC OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 7 } */
/*
 * Encryption algorithms
 */

Marco MBEDTLS_OID_DES_EDE3_CBC

#define MBEDTLS_OID_DES_EDE3_CBC               MBEDTLS_OID_RSA_COMPANY "\x03\x07" /**< des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2) -- us(840) rsadsi(113549) encryptionAlgorithm(3) 7 } */


      

Marco MBEDTLS_OID_AES

#define MBEDTLS_OID_AES                        MBEDTLS_OID_NIST_ALG "\x01" /** aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 1 } */


      

Marco MBEDTLS_OID_AES128_KW

#define MBEDTLS_OID_AES128_KW                  MBEDTLS_OID_AES "\x05" /** id-aes128-wrap     OBJECT IDENTIFIER ::= { aes 5 } */
/*
 * RFC 5649
 */

Marco MBEDTLS_OID_AES128_KWP

#define MBEDTLS_OID_AES128_KWP                 MBEDTLS_OID_AES "\x08" /** id-aes128-wrap-pad OBJECT IDENTIFIER ::= { aes 8 } */


      

Marco MBEDTLS_OID_AES192_KW

#define MBEDTLS_OID_AES192_KW                  MBEDTLS_OID_AES "\x19" /** id-aes192-wrap     OBJECT IDENTIFIER ::= { aes 25 } */


      

Marco MBEDTLS_OID_AES192_KWP

#define MBEDTLS_OID_AES192_KWP                 MBEDTLS_OID_AES "\x1c" /** id-aes192-wrap-pad OBJECT IDENTIFIER ::= { aes 28 } */


      

Marco MBEDTLS_OID_AES256_KW

#define MBEDTLS_OID_AES256_KW                  MBEDTLS_OID_AES "\x2d" /** id-aes256-wrap     OBJECT IDENTIFIER ::= { aes 45 } */


      

Marco MBEDTLS_OID_AES256_KWP

#define MBEDTLS_OID_AES256_KWP                 MBEDTLS_OID_AES "\x30" /** id-aes256-wrap-pad OBJECT IDENTIFIER ::= { aes 48 } */


      

Marco MBEDTLS_OID_PKCS5_PBKDF2

#define MBEDTLS_OID_PKCS5_PBKDF2               MBEDTLS_OID_PKCS5 "\x0c" /**< id-PBKDF2 OBJECT IDENTIFIER ::= {pkcs-5 12} */
/*
 * PKCS#5 OIDs
 */

Marco MBEDTLS_OID_PKCS5_PBES2

#define MBEDTLS_OID_PKCS5_PBES2                MBEDTLS_OID_PKCS5 "\x0d" /**< id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} */


      

Marco MBEDTLS_OID_PKCS5_PBMAC1

#define MBEDTLS_OID_PKCS5_PBMAC1               MBEDTLS_OID_PKCS5 "\x0e" /**< id-PBMAC1 OBJECT IDENTIFIER ::= {pkcs-5 14} */


      

Marco MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC

#define MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC      MBEDTLS_OID_PKCS5 "\x01" /**< pbeWithMD2AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 1} */
/*
 * PKCS#5 PBES1 algorithms
 */

Marco MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC

#define MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC      MBEDTLS_OID_PKCS5 "\x04" /**< pbeWithMD2AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 4} */


      

Marco MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC

#define MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC      MBEDTLS_OID_PKCS5 "\x03" /**< pbeWithMD5AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 3} */


      

Marco MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC

#define MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC      MBEDTLS_OID_PKCS5 "\x06" /**< pbeWithMD5AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 6} */


      

Marco MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC

#define MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC     MBEDTLS_OID_PKCS5 "\x0a" /**< pbeWithSHA1AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 10} */


      

Marco MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC

#define MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC     MBEDTLS_OID_PKCS5 "\x0b" /**< pbeWithSHA1AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 11} */


      

Marco MBEDTLS_OID_PKCS9_CSR_EXT_REQ

#define MBEDTLS_OID_PKCS9_CSR_EXT_REQ          MBEDTLS_OID_PKCS9 "\x0e" /**< extensionRequest OBJECT IDENTIFIER ::= {pkcs-9 14} */
/*
 * PKCS#8 OIDs
 */

Marco MBEDTLS_OID_PKCS12_PBE

#define MBEDTLS_OID_PKCS12_PBE                     MBEDTLS_OID_PKCS12 "\x01" /**< pkcs-12PbeIds OBJECT IDENTIFIER ::= {pkcs-12 1} */
/*
 * PKCS#12 PBE OIDs
 */

Marco MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128

#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128        MBEDTLS_OID_PKCS12_PBE "\x01" /**< pbeWithSHAAnd128BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 1} */


      

Marco MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40

#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40         MBEDTLS_OID_PKCS12_PBE "\x02" /**< pbeWithSHAAnd40BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 2} */


      

Marco MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC

#define MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC   MBEDTLS_OID_PKCS12_PBE "\x03" /**< pbeWithSHAAnd3-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 3} */


      

Marco MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC

#define MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC   MBEDTLS_OID_PKCS12_PBE "\x04" /**< pbeWithSHAAnd2-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 4} */


      

Marco MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC

#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC    MBEDTLS_OID_PKCS12_PBE "\x05" /**< pbeWithSHAAnd128BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 5} */


      

Marco MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC

#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC     MBEDTLS_OID_PKCS12_PBE "\x06" /**< pbeWithSHAAnd40BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 6} */


      

Marco MBEDTLS_OID_EC_ALG_UNRESTRICTED

#define MBEDTLS_OID_EC_ALG_UNRESTRICTED        MBEDTLS_OID_ANSI_X9_62 "\x02\01"
/* id-ecPublicKey OBJECT IDENTIFIER ::= {
 *       iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } */

Marco MBEDTLS_OID_EC_ALG_ECDH

#define MBEDTLS_OID_EC_ALG_ECDH                MBEDTLS_OID_CERTICOM "\x01\x0c"
/*   id-ecDH OBJECT IDENTIFIER ::= {
 *     iso(1) identified-organization(3) certicom(132)
 *     schemes(1) ecdh(12) } */

Marco MBEDTLS_OID_EC_GRP_SECP192R1

#define MBEDTLS_OID_EC_GRP_SECP192R1       MBEDTLS_OID_ANSI_X9_62 "\x03\x01\x01"
/* secp192r1 OBJECT IDENTIFIER ::= {
 *   iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 1 } */

Marco MBEDTLS_OID_EC_GRP_SECP224R1

#define MBEDTLS_OID_EC_GRP_SECP224R1       MBEDTLS_OID_CERTICOM "\x00\x21"
/* secp224r1 OBJECT IDENTIFIER ::= {
 *   iso(1) identified-organization(3) certicom(132) curve(0) 33 } */

Marco MBEDTLS_OID_EC_GRP_SECP256R1

#define MBEDTLS_OID_EC_GRP_SECP256R1       MBEDTLS_OID_ANSI_X9_62 "\x03\x01\x07"
/* secp256r1 OBJECT IDENTIFIER ::= {
 *   iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 7 } */

Marco MBEDTLS_OID_EC_GRP_SECP384R1

#define MBEDTLS_OID_EC_GRP_SECP384R1       MBEDTLS_OID_CERTICOM "\x00\x22"
/* secp384r1 OBJECT IDENTIFIER ::= {
 *   iso(1) identified-organization(3) certicom(132) curve(0) 34 } */

Marco MBEDTLS_OID_EC_GRP_SECP521R1

#define MBEDTLS_OID_EC_GRP_SECP521R1       MBEDTLS_OID_CERTICOM "\x00\x23"
/* secp521r1 OBJECT IDENTIFIER ::= {
 *   iso(1) identified-organization(3) certicom(132) curve(0) 35 } */

Marco MBEDTLS_OID_EC_GRP_SECP192K1

#define MBEDTLS_OID_EC_GRP_SECP192K1       MBEDTLS_OID_CERTICOM "\x00\x1f"
/* secp192k1 OBJECT IDENTIFIER ::= {
 *   iso(1) identified-organization(3) certicom(132) curve(0) 31 } */

Marco MBEDTLS_OID_EC_GRP_SECP224K1

#define MBEDTLS_OID_EC_GRP_SECP224K1       MBEDTLS_OID_CERTICOM "\x00\x20"
/* secp224k1 OBJECT IDENTIFIER ::= {
 *   iso(1) identified-organization(3) certicom(132) curve(0) 32 } */

Marco MBEDTLS_OID_EC_GRP_SECP256K1

#define MBEDTLS_OID_EC_GRP_SECP256K1       MBEDTLS_OID_CERTICOM "\x00\x0a"
/* secp256k1 OBJECT IDENTIFIER ::= {
 *   iso(1) identified-organization(3) certicom(132) curve(0) 10 } */

Marco MBEDTLS_OID_EC_BRAINPOOL_V1

#define MBEDTLS_OID_EC_BRAINPOOL_V1        MBEDTLS_OID_TELETRUST "\x03\x03\x02\x08\x01\x01"
/* RFC 5639 4.1
 * ecStdCurvesAndGeneration OBJECT IDENTIFIER::= {iso(1)
 * identified-organization(3) teletrust(36) algorithm(3) signature-
 * algorithm(3) ecSign(2) 8}
 * ellipticCurve OBJECT IDENTIFIER ::= {ecStdCurvesAndGeneration 1}
 * versionOne OBJECT IDENTIFIER ::= {ellipticCurve 1} */

Marco MBEDTLS_OID_EC_GRP_BP256R1

#define MBEDTLS_OID_EC_GRP_BP256R1         MBEDTLS_OID_EC_BRAINPOOL_V1 "\x07"
/* brainpoolP256r1 OBJECT IDENTIFIER ::= {versionOne 7} */

Marco MBEDTLS_OID_EC_GRP_BP384R1

#define MBEDTLS_OID_EC_GRP_BP384R1         MBEDTLS_OID_EC_BRAINPOOL_V1 "\x0B"
/* brainpoolP384r1 OBJECT IDENTIFIER ::= {versionOne 11} */

Marco MBEDTLS_OID_EC_GRP_BP512R1

#define MBEDTLS_OID_EC_GRP_BP512R1         MBEDTLS_OID_EC_BRAINPOOL_V1 "\x0D"
/* brainpoolP512r1 OBJECT IDENTIFIER ::= {versionOne 13} */

Marco MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE

#define MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE  MBEDTLS_OID_ANSI_X9_62 "\x01"
/*
 * SEC1 C.1
 *
 * prime-field OBJECT IDENTIFIER ::= { id-fieldType 1 }
 * id-fieldType OBJECT IDENTIFIER ::= { ansi-X9-62 fieldType(1)}
 */

Marco MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD

#define MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE "\x01"


      

Marco MBEDTLS_OID_ANSI_X9_62_SIG

#define MBEDTLS_OID_ANSI_X9_62_SIG         MBEDTLS_OID_ANSI_X9_62 "\x04" /* signatures(4) */
/*
 * ECDSA signature identifiers, from RFC 5480
 */

Marco MBEDTLS_OID_ANSI_X9_62_SIG_SHA2

#define MBEDTLS_OID_ANSI_X9_62_SIG_SHA2    MBEDTLS_OID_ANSI_X9_62_SIG "\x03" /* ecdsa-with-SHA2(3) */


      

Marco MBEDTLS_OID_ECDSA_SHA1

#define MBEDTLS_OID_ECDSA_SHA1             MBEDTLS_OID_ANSI_X9_62_SIG "\x01"
/* ecdsa-with-SHA1 OBJECT IDENTIFIER ::= {
 *   iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) 1 } */

Marco MBEDTLS_OID_ECDSA_SHA224

#define MBEDTLS_OID_ECDSA_SHA224           MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x01"
/* ecdsa-with-SHA224 OBJECT IDENTIFIER ::= {
 *   iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
 *   ecdsa-with-SHA2(3) 1 } */

Marco MBEDTLS_OID_ECDSA_SHA256

#define MBEDTLS_OID_ECDSA_SHA256           MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x02"
/* ecdsa-with-SHA256 OBJECT IDENTIFIER ::= {
 *   iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
 *   ecdsa-with-SHA2(3) 2 } */

Marco MBEDTLS_OID_ECDSA_SHA384

#define MBEDTLS_OID_ECDSA_SHA384           MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x03"
/* ecdsa-with-SHA384 OBJECT IDENTIFIER ::= {
 *   iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
 *   ecdsa-with-SHA2(3) 3 } */

Marco MBEDTLS_OID_ECDSA_SHA512

#define MBEDTLS_OID_ECDSA_SHA512           MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x04"
/* ecdsa-with-SHA512 OBJECT IDENTIFIER ::= {
 *   iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4)
 *   ecdsa-with-SHA2(3) 4 } */

Marco MBEDTLS_PADLOCK_H

#define MBEDTLS_PADLOCK_H


      

Marco MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED

#define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED              -48 /**< Input data should be aligned. */


      

Marco MBEDTLS_HAVE_ASAN

#define MBEDTLS_HAVE_ASAN


      

Marco MBEDTLS_HAVE_X86

#define MBEDTLS_HAVE_X86


      

Marco MBEDTLS_PADLOCK_RNG

#define MBEDTLS_PADLOCK_RNG 0C


      

Marco MBEDTLS_PADLOCK_ACE

#define MBEDTLS_PADLOCK_ACE 0C0


      

Marco MBEDTLS_PADLOCK_PHE

#define MBEDTLS_PADLOCK_PHE 0C00


      

Marco MBEDTLS_PADLOCK_PMM

#define MBEDTLS_PADLOCK_PMM 12288


      

Marco MBEDTLS_PADLOCK_ALIGN16(x)

#define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) (x) & ~15))


      

Marco MBEDTLS_PEM_H

#define MBEDTLS_PEM_H


      
      
#define MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT         -4224 /**< No PEM header or footer found. */
/**
 * \name PEM Error codes
 * These error codes are returned in case of errors reading the
 * PEM data.
 * \{
 */

Marco MBEDTLS_ERR_PEM_INVALID_DATA

#define MBEDTLS_ERR_PEM_INVALID_DATA                     -4352 /**< PEM string is not as expected. */


      

Marco MBEDTLS_ERR_PEM_ALLOC_FAILED

#define MBEDTLS_ERR_PEM_ALLOC_FAILED                     -4480 /**< Failed to allocate memory. */


      

Marco MBEDTLS_ERR_PEM_INVALID_ENC_IV

#define MBEDTLS_ERR_PEM_INVALID_ENC_IV                   -4608 /**< RSA IV is not in hex-format. */


      

Marco MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG

#define MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG                  -4736 /**< Unsupported key encryption algorithm. */


      

Marco MBEDTLS_ERR_PEM_PASSWORD_REQUIRED

#define MBEDTLS_ERR_PEM_PASSWORD_REQUIRED                -4864 /**< Private key password can't be empty. */


      

Marco MBEDTLS_ERR_PEM_PASSWORD_MISMATCH

#define MBEDTLS_ERR_PEM_PASSWORD_MISMATCH                -4992 /**< Given private key password does not allow for correct decryption. */


      

Marco MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE              -5120 /**< Unavailable feature, e.g. hashing/encryption combination. */


      

Marco MBEDTLS_ERR_PEM_BAD_INPUT_DATA

#define MBEDTLS_ERR_PEM_BAD_INPUT_DATA                   -5248 /**< Bad input parameters to function. */


      

Marco MBEDTLS_PK_H

#define MBEDTLS_PK_H


      

Marco inline

#define inline __inline


      

Marco MBEDTLS_ERR_PK_ALLOC_FAILED

#define MBEDTLS_ERR_PK_ALLOC_FAILED       -16256 /**< Memory allocation failed. */


      

Marco MBEDTLS_ERR_PK_TYPE_MISMATCH

#define MBEDTLS_ERR_PK_TYPE_MISMATCH      -16128 /**< Type mismatch, eg attempt to encrypt with an ECDSA key */


      

Marco MBEDTLS_ERR_PK_BAD_INPUT_DATA

#define MBEDTLS_ERR_PK_BAD_INPUT_DATA     -3E80 /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_PK_FILE_IO_ERROR

#define MBEDTLS_ERR_PK_FILE_IO_ERROR      -3E00 /**< Read/write of file failed. */


      

Marco MBEDTLS_ERR_PK_KEY_INVALID_VERSION

#define MBEDTLS_ERR_PK_KEY_INVALID_VERSION -3D80 /**< Unsupported key version */


      

Marco MBEDTLS_ERR_PK_KEY_INVALID_FORMAT

#define MBEDTLS_ERR_PK_KEY_INVALID_FORMAT -3D00 /**< Invalid key tag or value. */


      

Marco MBEDTLS_ERR_PK_UNKNOWN_PK_ALG

#define MBEDTLS_ERR_PK_UNKNOWN_PK_ALG     -3C80 /**< Key algorithm is unsupported (only RSA and EC are supported). */


      

Marco MBEDTLS_ERR_PK_PASSWORD_REQUIRED

#define MBEDTLS_ERR_PK_PASSWORD_REQUIRED  -3C00 /**< Private key password can't be empty. */


      

Marco MBEDTLS_ERR_PK_PASSWORD_MISMATCH

#define MBEDTLS_ERR_PK_PASSWORD_MISMATCH  -3B80 /**< Given private key password does not allow for correct decryption. */


      

Marco MBEDTLS_ERR_PK_INVALID_PUBKEY

#define MBEDTLS_ERR_PK_INVALID_PUBKEY     -3B00 /**< The pubkey tag or value is invalid (only RSA and EC are supported). */


      

Marco MBEDTLS_ERR_PK_INVALID_ALG

#define MBEDTLS_ERR_PK_INVALID_ALG        -3A80 /**< The algorithm tag or value is invalid. */


      

Marco MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE

#define MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -3A00 /**< Elliptic curve is unsupported (only NIST curves are supported). */


      

Marco MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE -14720 /**< Unavailable feature, e.g. RSA disabled for RSA key. */


      

Marco MBEDTLS_ERR_PK_SIG_LEN_MISMATCH

#define MBEDTLS_ERR_PK_SIG_LEN_MISMATCH   -14592 /**< The buffer contains a valid signature followed by more data. */


      

Marco MBEDTLS_ERR_PK_HW_ACCEL_FAILED

#define MBEDTLS_ERR_PK_HW_ACCEL_FAILED    -14464 /**< PK hardware accelerator failed. */
/* MBEDTLS_ERR_PK_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_PK_DEBUG_MAX_ITEMS

#define MBEDTLS_PK_DEBUG_MAX_ITEMS 3
/** Maximum number of item send for debugging, plus 1 */

Marco MBEDTLS_PK_WRAP_H

#define MBEDTLS_PK_WRAP_H


      

Marco MBEDTLS_PKCS11_H

#define MBEDTLS_PKCS11_H


      

Marco inline

#define inline __inline


      

Marco MBEDTLS_PKCS12_H

#define MBEDTLS_PKCS12_H


      

Marco MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA

#define MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA                -8064 /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE           -7936 /**< Feature not available, e.g. unsupported encryption scheme. */


      

Marco MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT

#define MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT            -1E80 /**< PBE ASN.1 data not as expected. */


      

Marco MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH

#define MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH             -1E00 /**< Given private key password does not allow for correct decryption. */


      

Marco MBEDTLS_PKCS12_DERIVE_KEY

#define MBEDTLS_PKCS12_DERIVE_KEY      1  /**< encryption/decryption key */


      

Marco MBEDTLS_PKCS12_DERIVE_IV

#define MBEDTLS_PKCS12_DERIVE_IV       2  /**< initialization vector     */


      

Marco MBEDTLS_PKCS12_DERIVE_MAC_KEY

#define MBEDTLS_PKCS12_DERIVE_MAC_KEY  3  /**< integrity / MAC key       */


      

Marco MBEDTLS_PKCS12_PBE_DECRYPT

#define MBEDTLS_PKCS12_PBE_DECRYPT     0


      

Marco MBEDTLS_PKCS12_PBE_ENCRYPT

#define MBEDTLS_PKCS12_PBE_ENCRYPT     1


      

Marco MBEDTLS_PKCS5_H

#define MBEDTLS_PKCS5_H


      

Marco MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA

#define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA                 -12160 /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_PKCS5_INVALID_FORMAT

#define MBEDTLS_ERR_PKCS5_INVALID_FORMAT                 -12032 /**< Unexpected ASN.1 data. */


      

Marco MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE            -2e80 /**< Requested encryption or digest alg not available. */


      

Marco MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH

#define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH              -2e00 /**< Given private key password does not allow for correct decryption. */


      

Marco MBEDTLS_PKCS5_DECRYPT

#define MBEDTLS_PKCS5_DECRYPT     0


      

Marco MBEDTLS_PKCS5_ENCRYPT

#define MBEDTLS_PKCS5_ENCRYPT     1


      

Marco MBEDTLS_PLATFORM_H

#define MBEDTLS_PLATFORM_H


      

Marco MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED

#define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED    -112 /**< Hardware accelerator failed */


      

Marco MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED

#define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED -114 /**< The requested feature is not supported by the platform */


      

Marco MBEDTLS_PLATFORM_STD_SNPRINTF

#define MBEDTLS_PLATFORM_STD_SNPRINTF  mbedtls_platform_win32_snprintf /**< The default \c snprintf function to use.  */


      

Marco MBEDTLS_PLATFORM_STD_SNPRINTF

#define MBEDTLS_PLATFORM_STD_SNPRINTF  snprintf /**< The default \c snprintf function to use.  */


      

Marco MBEDTLS_PLATFORM_STD_PRINTF

#define MBEDTLS_PLATFORM_STD_PRINTF  printf /**< The default \c printf function to use. */


      

Marco MBEDTLS_PLATFORM_STD_FPRINTF

#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< The default \c fprintf function to use. */


      

Marco MBEDTLS_PLATFORM_STD_CALLOC

#define MBEDTLS_PLATFORM_STD_CALLOC  calloc /**< The default \c calloc function to use. */


      

Marco MBEDTLS_PLATFORM_STD_FREE

#define MBEDTLS_PLATFORM_STD_FREE      free /**< The default \c free function to use. */


      

Marco MBEDTLS_PLATFORM_STD_EXIT

#define MBEDTLS_PLATFORM_STD_EXIT     exit /**< The default \c exit function to use. */


      

Marco MBEDTLS_PLATFORM_STD_TIME

#define MBEDTLS_PLATFORM_STD_TIME      time   /**< The default \c time function to use. */


      

Marco MBEDTLS_PLATFORM_STD_EXIT_SUCCESS

#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS EXIT_SUCCESS /**< The default exit value to use. */


      

Marco MBEDTLS_PLATFORM_STD_EXIT_FAILURE

#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE EXIT_FAILURE /**< The default exit value to use. */


      

Marco MBEDTLS_PLATFORM_STD_NV_SEED_READ

#define MBEDTLS_PLATFORM_STD_NV_SEED_READ  mbedtls_platform_std_nv_seed_read


      

Marco MBEDTLS_PLATFORM_STD_NV_SEED_WRITE

#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write


      

Marco MBEDTLS_PLATFORM_STD_NV_SEED_FILE

#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE  "seedfile"


      

Marco mbedtls_free

#define mbedtls_free      MBEDTLS_PLATFORM_FREE_MACRO


      

Marco mbedtls_calloc

#define mbedtls_calloc    MBEDTLS_PLATFORM_CALLOC_MACRO


      

Marco mbedtls_free

#define mbedtls_free      free


      

Marco mbedtls_calloc

#define mbedtls_calloc    calloc


      

Marco mbedtls_fprintf

#define mbedtls_fprintf   MBEDTLS_PLATFORM_FPRINTF_MACRO


      

Marco mbedtls_fprintf

#define mbedtls_fprintf   fprintf


      

Marco mbedtls_printf

#define mbedtls_printf    MBEDTLS_PLATFORM_PRINTF_MACRO


      

Marco mbedtls_printf

#define mbedtls_printf    printf


      

Marco mbedtls_snprintf

#define mbedtls_snprintf  MBEDTLS_PLATFORM_SNPRINTF_MACRO


      

Marco mbedtls_snprintf

#define mbedtls_snprintf  MBEDTLS_PLATFORM_STD_SNPRINTF


      

Marco mbedtls_exit

#define mbedtls_exit  MBEDTLS_PLATFORM_EXIT_MACRO


      

Marco mbedtls_exit

#define mbedtls_exit  exit


      

Marco MBEDTLS_EXIT_SUCCESS

#define MBEDTLS_EXIT_SUCCESS MBEDTLS_PLATFORM_STD_EXIT_SUCCESS


      

Marco MBEDTLS_EXIT_SUCCESS

#define MBEDTLS_EXIT_SUCCESS 0


      

Marco MBEDTLS_EXIT_FAILURE

#define MBEDTLS_EXIT_FAILURE MBEDTLS_PLATFORM_STD_EXIT_FAILURE


      

Marco MBEDTLS_EXIT_FAILURE

#define MBEDTLS_EXIT_FAILURE 1


      

Marco mbedtls_nv_seed_read

#define mbedtls_nv_seed_read   MBEDTLS_PLATFORM_NV_SEED_READ_MACRO


      

Marco mbedtls_nv_seed_write

#define mbedtls_nv_seed_write  MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO


      

Marco mbedtls_nv_seed_read

#define mbedtls_nv_seed_read   mbedtls_platform_std_nv_seed_read


      

Marco mbedtls_nv_seed_write

#define mbedtls_nv_seed_write  mbedtls_platform_std_nv_seed_write


      

Marco MBEDTLS_PLATFORM_TIME_H

#define MBEDTLS_PLATFORM_TIME_H


      

Marco mbedtls_time

#define mbedtls_time   MBEDTLS_PLATFORM_TIME_MACRO


      

Marco mbedtls_time

#define mbedtls_time  time


      

Marco MBEDTLS_PLATFORM_UTIL_H

#define MBEDTLS_PLATFORM_UTIL_H


      

Marco MBEDTLS_PARAM_FAILED_ALT

#define MBEDTLS_PARAM_FAILED_ALT
/** An alternative definition of MBEDTLS_PARAM_FAILED has been set in config.h.
 *
 * This flag can be used to check whether it is safe to assume that
 * MBEDTLS_PARAM_FAILED() will expand to a call to mbedtls_param_failed().
 */

Marco MBEDTLS_PARAM_FAILED( cond )

#define MBEDTLS_PARAM_FAILED( cond ) \
   mbedtls_param_failed( #cond, __FILE__, __LINE__ )


      

Marco MBEDTLS_INTERNAL_VALIDATE_RET( cond, ret )

#define MBEDTLS_INTERNAL_VALIDATE_RET( cond, ret ) \
   do {                                           \
       if( !(cond) )                              \
       {                                          \
           MBEDTLS_PARAM_FAILED( cond );          \
           return( ret );                         \
       }                                          \
   } while( 0 )
/* Internal macro meant to be called only from within the library. */

Marco MBEDTLS_INTERNAL_VALIDATE( cond )

#define MBEDTLS_INTERNAL_VALIDATE( cond )          \
   do {                                           \
       if( !(cond) )                              \
       {                                          \
           MBEDTLS_PARAM_FAILED( cond );          \
           return;                                \
       }                                          \
   } while( 0 )
/* Internal macro meant to be called only from within the library. */

Marco MBEDTLS_INTERNAL_VALIDATE_RET( cond, ret )

#define MBEDTLS_INTERNAL_VALIDATE_RET( cond, ret ) do { } while( 0 )
/* Internal macros meant to be called only from within the library. */

Marco MBEDTLS_INTERNAL_VALIDATE( cond )

#define MBEDTLS_INTERNAL_VALIDATE( cond )          do { } while( 0 )


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED __attribute__((deprecated))
/* Deliberately don't (yet) export MBEDTLS_DEPRECATED here
 * to avoid conflict with other headers which define and use
 * it, too. We might want to move all these definitions here at
 * some point for uniformity. */

Marco MBEDTLS_POLY1305_H

#define MBEDTLS_POLY1305_H


      

Marco MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA

#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA        -87 /**< Invalid input parameter(s). */


      

Marco MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE   -89 /**< Feature not available. For example, s part of the API is not implemented. */
/* MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE is deprecated and should not be
 * used. */

Marco MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED

#define MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED       -5B /**< Poly1305 hardware accelerator failed. */
/* MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED is deprecated and should not be used.
 */

Marco MBEDTLS_RIPEMD160_H

#define MBEDTLS_RIPEMD160_H


      

Marco MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED

#define MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED            -49 /**< RIPEMD160 hardware accelerator failed */
/* MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED is deprecated and should not be used.
 */

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_RSA_H

#define MBEDTLS_RSA_H


      

Marco MBEDTLS_ERR_RSA_BAD_INPUT_DATA

#define MBEDTLS_ERR_RSA_BAD_INPUT_DATA                   -16512 /**< Bad input parameters to function. */
/*
 * RSA Error codes
 */

Marco MBEDTLS_ERR_RSA_INVALID_PADDING

#define MBEDTLS_ERR_RSA_INVALID_PADDING                  -16640 /**< Input data contains invalid padding and is rejected. */


      

Marco MBEDTLS_ERR_RSA_KEY_GEN_FAILED

#define MBEDTLS_ERR_RSA_KEY_GEN_FAILED                   -16768 /**< Something failed during generation of a key. */


      

Marco MBEDTLS_ERR_RSA_KEY_CHECK_FAILED

#define MBEDTLS_ERR_RSA_KEY_CHECK_FAILED                 -16896 /**< Key failed to pass the validity check of the library. */


      

Marco MBEDTLS_ERR_RSA_PUBLIC_FAILED

#define MBEDTLS_ERR_RSA_PUBLIC_FAILED                    -17024 /**< The public key operation failed. */


      

Marco MBEDTLS_ERR_RSA_PRIVATE_FAILED

#define MBEDTLS_ERR_RSA_PRIVATE_FAILED                   -17152 /**< The private key operation failed. */


      

Marco MBEDTLS_ERR_RSA_VERIFY_FAILED

#define MBEDTLS_ERR_RSA_VERIFY_FAILED                    -17280 /**< The PKCS#1 verification failed. */


      

Marco MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE

#define MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE                 -17408 /**< The output buffer for decryption is not large enough. */


      

Marco MBEDTLS_ERR_RSA_RNG_FAILED

#define MBEDTLS_ERR_RSA_RNG_FAILED                       -17536 /**< The random generator failed to generate non-zeros. */


      

Marco MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION

#define MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION            -17664 /**< The implementation does not offer the requested operation, for example, because of security violations or lack of functionality. */
/* MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION is deprecated and should not be used.
 */

Marco MBEDTLS_ERR_RSA_HW_ACCEL_FAILED

#define MBEDTLS_ERR_RSA_HW_ACCEL_FAILED                  -17792 /**< RSA hardware accelerator failed. */
/* MBEDTLS_ERR_RSA_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_RSA_PUBLIC

#define MBEDTLS_RSA_PUBLIC     0 /**< Request private key operation. */
/*
 * RSA constants
 */

Marco MBEDTLS_RSA_PRIVATE

#define MBEDTLS_RSA_PRIVATE    1 /**< Request public key operation. */


      

Marco MBEDTLS_RSA_PKCS_V15

#define MBEDTLS_RSA_PKCS_V15   0 /**< Use PKCS#1 v1.5 encoding. */


      

Marco MBEDTLS_RSA_PKCS_V21

#define MBEDTLS_RSA_PKCS_V21   1 /**< Use PKCS#1 v2.1 encoding. */


      

Marco MBEDTLS_RSA_SIGN

#define MBEDTLS_RSA_SIGN       1 /**< Identifier for RSA signature operations. */


      

Marco MBEDTLS_RSA_CRYPT

#define MBEDTLS_RSA_CRYPT      2 /**< Identifier for RSA encryption and decryption operations. */


      

Marco MBEDTLS_RSA_SALT_LEN_ANY

#define MBEDTLS_RSA_SALT_LEN_ANY   -1


      

Marco MBEDTLS_RSA_INTERNAL_H

#define MBEDTLS_RSA_INTERNAL_H


      

Marco MBEDTLS_SHA1_H

#define MBEDTLS_SHA1_H


      

Marco MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED

#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED                 -53 /**< SHA-1 hardware accelerator failed */
/* MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_ERR_SHA1_BAD_INPUT_DATA

#define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA                  -115 /**< SHA-1 input data was malformed. */


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_SHA256_H

#define MBEDTLS_SHA256_H


      

Marco MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED

#define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED               -55 /**< SHA-256 hardware accelerator failed */
/* MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_ERR_SHA256_BAD_INPUT_DATA

#define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA                -116 /**< SHA-256 input data was malformed. */


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_SHA512_H

#define MBEDTLS_SHA512_H


      

Marco MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED

#define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED               -57 /**< SHA-512 hardware accelerator failed */
/* MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco MBEDTLS_ERR_SHA512_BAD_INPUT_DATA

#define MBEDTLS_ERR_SHA512_BAD_INPUT_DATA                -117 /**< SHA-512 input data was malformed. */


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED     __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_SSL_H

#define MBEDTLS_SSL_H


      

Marco MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE              -28800 /**< The requested feature is not available. */
/*
 * SSL Error codes
 */

Marco MBEDTLS_ERR_SSL_BAD_INPUT_DATA

#define MBEDTLS_ERR_SSL_BAD_INPUT_DATA                   -28928 /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_SSL_INVALID_MAC

#define MBEDTLS_ERR_SSL_INVALID_MAC                      -29056 /**< Verification of the message MAC failed. */


      

Marco MBEDTLS_ERR_SSL_INVALID_RECORD

#define MBEDTLS_ERR_SSL_INVALID_RECORD                   -29184 /**< An invalid SSL record was received. */


      

Marco MBEDTLS_ERR_SSL_CONN_EOF

#define MBEDTLS_ERR_SSL_CONN_EOF                         -29312 /**< The connection indicated an EOF. */


      

Marco MBEDTLS_ERR_SSL_UNKNOWN_CIPHER

#define MBEDTLS_ERR_SSL_UNKNOWN_CIPHER                   -29440 /**< An unknown cipher was received. */


      

Marco MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN

#define MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN                 -29568 /**< The server has no ciphersuites in common with the client. */


      

Marco MBEDTLS_ERR_SSL_NO_RNG

#define MBEDTLS_ERR_SSL_NO_RNG                           -29696 /**< No RNG was provided to the SSL module. */


      

Marco MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE

#define MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE            -29824 /**< No client certification received from the client, but required by the authentication mode. */


      

Marco MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE

#define MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE            -29952 /**< Our own certificate(s) is/are too large to send in an SSL message. */


      

Marco MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED

#define MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED             -30080 /**< The own certificate is not set, but needed by the server. */


      

Marco MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED

#define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED             -30208 /**< The own private key or pre-shared key is not set, but needed. */


      

Marco MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED

#define MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED                -30336 /**< No CA Chain is set, but required to operate. */


      

Marco MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE

#define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE               -30464 /**< An unexpected message was received from our peer. */


      

Marco MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE

#define MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE              -30592 /**< A fatal alert message was received from our peer. */


      

Marco MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED

#define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED               -30720 /**< Verification of our peer failed. */


      

Marco MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY

#define MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY                -30848 /**< The peer notified us that the connection is going to be closed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO

#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO              -30976 /**< Processing of the ClientHello handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO

#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO              -31104 /**< Processing of the ServerHello handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE

#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE               -7A00 /**< Processing of the Certificate handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST

#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST       -7A80 /**< Processing of the CertificateRequest handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE

#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE       -7B00 /**< Processing of the ServerKeyExchange handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE

#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE         -7B80 /**< Processing of the ServerHelloDone handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE

#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE       -7C00 /**< Processing of the ClientKeyExchange handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP

#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP    -7C80 /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS

#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS    -7D00 /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY

#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY        -7D80 /**< Processing of the CertificateVerify handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC

#define MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC        -7E00 /**< Processing of the ChangeCipherSpec handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_FINISHED

#define MBEDTLS_ERR_SSL_BAD_HS_FINISHED                  -7E80 /**< Processing of the Finished handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_ALLOC_FAILED

#define MBEDTLS_ERR_SSL_ALLOC_FAILED                     -32512 /**< Memory allocation failed */


      

Marco MBEDTLS_ERR_SSL_HW_ACCEL_FAILED

#define MBEDTLS_ERR_SSL_HW_ACCEL_FAILED                  -32640 /**< Hardware acceleration function returned with error */


      

Marco MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH

#define MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH             -28544 /**< Hardware acceleration function skipped / left alone data */


      

Marco MBEDTLS_ERR_SSL_COMPRESSION_FAILED

#define MBEDTLS_ERR_SSL_COMPRESSION_FAILED               -28416 /**< Processing of the compression / decompression failed */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION

#define MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION          -6E80 /**< Handshake protocol not within min/max boundaries */


      

Marco MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET

#define MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET        -6E00 /**< Processing of the NewSessionTicket handshake message failed. */


      

Marco MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED

#define MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED           -6D80 /**< Session ticket has expired. */


      

Marco MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH

#define MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH                 -6D00 /**< Public key type mismatch (eg, asked for RSA key exchange and presented EC key) */


      

Marco MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY

#define MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY                 -6C80 /**< Unknown identity received (eg, PSK identity) */


      

Marco MBEDTLS_ERR_SSL_INTERNAL_ERROR

#define MBEDTLS_ERR_SSL_INTERNAL_ERROR                   -6C00 /**< Internal error (eg, unexpected failure in lower-level module) */


      

Marco MBEDTLS_ERR_SSL_COUNTER_WRAPPING

#define MBEDTLS_ERR_SSL_COUNTER_WRAPPING                 -6B80 /**< A counter would wrap (eg, too many messages exchanged). */


      

Marco MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO

#define MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO      -6B00 /**< Unexpected message at ServerHello in renegotiation. */


      

Marco MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED

#define MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED            -6A80 /**< DTLS client must retry for hello verification */


      

Marco MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL

#define MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL                 -6A00 /**< A buffer is too small to receive or write a message */


      

Marco MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE

#define MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE            -27008 /**< None of the common ciphersuites is usable (eg, no suitable certificate, see debug messages). */


      

Marco MBEDTLS_ERR_SSL_WANT_READ

#define MBEDTLS_ERR_SSL_WANT_READ                        -26880 /**< No data of requested type currently available on underlying transport. */


      

Marco MBEDTLS_ERR_SSL_WANT_WRITE

#define MBEDTLS_ERR_SSL_WANT_WRITE                       -26752 /**< Connection requires a write call. */


      

Marco MBEDTLS_ERR_SSL_TIMEOUT

#define MBEDTLS_ERR_SSL_TIMEOUT                          -26624 /**< The operation timed out. */


      

Marco MBEDTLS_ERR_SSL_CLIENT_RECONNECT

#define MBEDTLS_ERR_SSL_CLIENT_RECONNECT                 -26496 /**< The client initiated a reconnect from the same port. */


      

Marco MBEDTLS_ERR_SSL_UNEXPECTED_RECORD

#define MBEDTLS_ERR_SSL_UNEXPECTED_RECORD                -26368 /**< Record header looks valid but is not expected. */


      

Marco MBEDTLS_ERR_SSL_NON_FATAL

#define MBEDTLS_ERR_SSL_NON_FATAL                        -26240 /**< The alert message received indicates a non-fatal error. */


      

Marco MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH

#define MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH              -26112 /**< Couldn't set the hash for verifying CertificateVerify */


      

Marco MBEDTLS_ERR_SSL_CONTINUE_PROCESSING

#define MBEDTLS_ERR_SSL_CONTINUE_PROCESSING              -25984 /**< Internal-only message signaling that further message-processing should be done */


      

Marco MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS

#define MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS                -25856 /**< The asynchronous operation is not completed yet. */


      

Marco MBEDTLS_ERR_SSL_EARLY_MESSAGE

#define MBEDTLS_ERR_SSL_EARLY_MESSAGE                    -25728 /**< Internal-only message signaling that a message arrived early. */


      

Marco MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS

#define MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS               -28672 /**< A cryptographic operation is in progress. Try again later. */


      

Marco MBEDTLS_ERR_SSL_QUIT_FORCED

#define MBEDTLS_ERR_SSL_QUIT_FORCED                      -22784


      

Marco MBEDTLS_SSL_MAJOR_VERSION_3

#define MBEDTLS_SSL_MAJOR_VERSION_3            3
/*
 * Various constants
 */

Marco MBEDTLS_SSL_MINOR_VERSION_0

#define MBEDTLS_SSL_MINOR_VERSION_0            0  /*!< SSL v3.0 */


      

Marco MBEDTLS_SSL_MINOR_VERSION_1

#define MBEDTLS_SSL_MINOR_VERSION_1            1  /*!< TLS v1.0 */


      

Marco MBEDTLS_SSL_MINOR_VERSION_2

#define MBEDTLS_SSL_MINOR_VERSION_2            2  /*!< TLS v1.1 */


      

Marco MBEDTLS_SSL_MINOR_VERSION_3

#define MBEDTLS_SSL_MINOR_VERSION_3            3  /*!< TLS v1.2 */


      

Marco MBEDTLS_SSL_TRANSPORT_STREAM

#define MBEDTLS_SSL_TRANSPORT_STREAM           0  /*!< TLS      */


      

Marco MBEDTLS_SSL_TRANSPORT_DATAGRAM

#define MBEDTLS_SSL_TRANSPORT_DATAGRAM         1  /*!< DTLS     */


      

Marco MBEDTLS_SSL_MAX_HOST_NAME_LEN

#define MBEDTLS_SSL_MAX_HOST_NAME_LEN          255 /*!< Maximum host name defined in RFC 1035 */


      

Marco MBEDTLS_SSL_MAX_FRAG_LEN_NONE

#define MBEDTLS_SSL_MAX_FRAG_LEN_NONE          0  /*!< don't use this extension   */
/* RFC 6066 section 4, see also mfl_code_to_length in ssl_tls.c
 * NONE must be zero so that memset()ing structure to zero works */

Marco MBEDTLS_SSL_MAX_FRAG_LEN_512

#define MBEDTLS_SSL_MAX_FRAG_LEN_512           1  /*!< MaxFragmentLength 2^9      */


      

Marco MBEDTLS_SSL_MAX_FRAG_LEN_1024

#define MBEDTLS_SSL_MAX_FRAG_LEN_1024          2  /*!< MaxFragmentLength 2^10     */


      

Marco MBEDTLS_SSL_MAX_FRAG_LEN_2048

#define MBEDTLS_SSL_MAX_FRAG_LEN_2048          3  /*!< MaxFragmentLength 2^11     */


      

Marco MBEDTLS_SSL_MAX_FRAG_LEN_4096

#define MBEDTLS_SSL_MAX_FRAG_LEN_4096          4  /*!< MaxFragmentLength 2^12     */


      

Marco MBEDTLS_SSL_MAX_FRAG_LEN_INVALID

#define MBEDTLS_SSL_MAX_FRAG_LEN_INVALID       5  /*!< first invalid value        */


      

Marco MBEDTLS_SSL_IS_CLIENT

#define MBEDTLS_SSL_IS_CLIENT                  0


      

Marco MBEDTLS_SSL_IS_SERVER

#define MBEDTLS_SSL_IS_SERVER                  1


      

Marco MBEDTLS_SSL_IS_NOT_FALLBACK

#define MBEDTLS_SSL_IS_NOT_FALLBACK            0


      

Marco MBEDTLS_SSL_IS_FALLBACK

#define MBEDTLS_SSL_IS_FALLBACK                1


      

Marco MBEDTLS_SSL_EXTENDED_MS_DISABLED

#define MBEDTLS_SSL_EXTENDED_MS_DISABLED       0


      

Marco MBEDTLS_SSL_EXTENDED_MS_ENABLED

#define MBEDTLS_SSL_EXTENDED_MS_ENABLED        1


      

Marco MBEDTLS_SSL_ETM_DISABLED

#define MBEDTLS_SSL_ETM_DISABLED               0


      

Marco MBEDTLS_SSL_ETM_ENABLED

#define MBEDTLS_SSL_ETM_ENABLED                1


      

Marco MBEDTLS_SSL_COMPRESS_NULL

#define MBEDTLS_SSL_COMPRESS_NULL              0


      

Marco MBEDTLS_SSL_COMPRESS_DEFLATE

#define MBEDTLS_SSL_COMPRESS_DEFLATE           1


      

Marco MBEDTLS_SSL_VERIFY_NONE

#define MBEDTLS_SSL_VERIFY_NONE                0


      

Marco MBEDTLS_SSL_VERIFY_OPTIONAL

#define MBEDTLS_SSL_VERIFY_OPTIONAL            1


      

Marco MBEDTLS_SSL_VERIFY_REQUIRED

#define MBEDTLS_SSL_VERIFY_REQUIRED            2


      

Marco MBEDTLS_SSL_VERIFY_UNSET

#define MBEDTLS_SSL_VERIFY_UNSET               3 /* Used only for sni_authmode */


      

Marco MBEDTLS_SSL_LEGACY_RENEGOTIATION

#define MBEDTLS_SSL_LEGACY_RENEGOTIATION       0


      

Marco MBEDTLS_SSL_SECURE_RENEGOTIATION

#define MBEDTLS_SSL_SECURE_RENEGOTIATION       1


      

Marco MBEDTLS_SSL_RENEGOTIATION_DISABLED

#define MBEDTLS_SSL_RENEGOTIATION_DISABLED     0


      

Marco MBEDTLS_SSL_RENEGOTIATION_ENABLED

#define MBEDTLS_SSL_RENEGOTIATION_ENABLED      1


      

Marco MBEDTLS_SSL_ANTI_REPLAY_DISABLED

#define MBEDTLS_SSL_ANTI_REPLAY_DISABLED       0


      

Marco MBEDTLS_SSL_ANTI_REPLAY_ENABLED

#define MBEDTLS_SSL_ANTI_REPLAY_ENABLED        1


      

Marco MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED

#define MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED -1


      

Marco MBEDTLS_SSL_RENEGO_MAX_RECORDS_DEFAULT

#define MBEDTLS_SSL_RENEGO_MAX_RECORDS_DEFAULT 16


      

Marco MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION

#define MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION    0


      

Marco MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION

#define MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION 1


      

Marco MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE

#define MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE     2


      

Marco MBEDTLS_SSL_TRUNC_HMAC_DISABLED

#define MBEDTLS_SSL_TRUNC_HMAC_DISABLED        0


      

Marco MBEDTLS_SSL_TRUNC_HMAC_ENABLED

#define MBEDTLS_SSL_TRUNC_HMAC_ENABLED         1


      

Marco MBEDTLS_SSL_TRUNCATED_HMAC_LEN

#define MBEDTLS_SSL_TRUNCATED_HMAC_LEN         10 /* 80 bits, rfc 6066 section 7 */


      

Marco MBEDTLS_SSL_SESSION_TICKETS_DISABLED

#define MBEDTLS_SSL_SESSION_TICKETS_DISABLED    0


      

Marco MBEDTLS_SSL_SESSION_TICKETS_ENABLED

#define MBEDTLS_SSL_SESSION_TICKETS_ENABLED     1


      

Marco MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED

#define MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED   0


      

Marco MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED

#define MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED    1


      

Marco MBEDTLS_SSL_ARC4_ENABLED

#define MBEDTLS_SSL_ARC4_ENABLED               0


      

Marco MBEDTLS_SSL_ARC4_DISABLED

#define MBEDTLS_SSL_ARC4_DISABLED              1


      

Marco MBEDTLS_SSL_PRESET_DEFAULT

#define MBEDTLS_SSL_PRESET_DEFAULT             0


      

Marco MBEDTLS_SSL_PRESET_SUITEB

#define MBEDTLS_SSL_PRESET_SUITEB              2


      

Marco MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED

#define MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED      1


      

Marco MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED

#define MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED     0


      

Marco MBEDTLS_SSL_DTLS_SRTP_MKI_UNSUPPORTED

#define MBEDTLS_SSL_DTLS_SRTP_MKI_UNSUPPORTED   0


      

Marco MBEDTLS_SSL_DTLS_SRTP_MKI_SUPPORTED

#define MBEDTLS_SSL_DTLS_SRTP_MKI_SUPPORTED     1


      

Marco MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MIN

#define MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MIN   1000
/*
 * Default range for DTLS retransmission timer value, in milliseconds.
 * RFC 6347 4.2.4.1 says from 1 second to 60 seconds.
 */

Marco MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MAX

#define MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MAX  60000


      

Marco MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME

#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME    86400 /**< Lifetime of session tickets (if enabled) */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN        16384  /**< Size of the input / output buffer */


      

Marco MBEDTLS_SSL_IN_CONTENT_LEN

#define MBEDTLS_SSL_IN_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN


      

Marco MBEDTLS_SSL_OUT_CONTENT_LEN

#define MBEDTLS_SSL_OUT_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN


      

Marco MBEDTLS_SSL_DTLS_MAX_BUFFERING

#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768


      

Marco MBEDTLS_SSL_VERIFY_DATA_MAX_LEN

#define MBEDTLS_SSL_VERIFY_DATA_MAX_LEN 36


      

Marco MBEDTLS_SSL_VERIFY_DATA_MAX_LEN

#define MBEDTLS_SSL_VERIFY_DATA_MAX_LEN 12


      

Marco MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO

#define MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO   255  /**< renegotiation info ext */
/*
 * Signaling ciphersuite values (SCSV)
 */

Marco MBEDTLS_SSL_FALLBACK_SCSV_VALUE

#define MBEDTLS_SSL_FALLBACK_SCSV_VALUE        22016 /**< RFC 7507 section 2 */


      

Marco MBEDTLS_SSL_HASH_NONE

#define MBEDTLS_SSL_HASH_NONE               0
/*
 * Supported Signature and Hash algorithms (For TLS 1.2)
 * RFC 5246 section 7.4.1.4.1
 */

Marco MBEDTLS_SSL_HASH_MD5

#define MBEDTLS_SSL_HASH_MD5                1


      

Marco MBEDTLS_SSL_HASH_SHA1

#define MBEDTLS_SSL_HASH_SHA1               2


      

Marco MBEDTLS_SSL_HASH_SHA224

#define MBEDTLS_SSL_HASH_SHA224             3


      

Marco MBEDTLS_SSL_HASH_SHA256

#define MBEDTLS_SSL_HASH_SHA256             4


      

Marco MBEDTLS_SSL_HASH_SHA384

#define MBEDTLS_SSL_HASH_SHA384             5


      

Marco MBEDTLS_SSL_HASH_SHA512

#define MBEDTLS_SSL_HASH_SHA512             6


      

Marco MBEDTLS_SSL_SIG_ANON

#define MBEDTLS_SSL_SIG_ANON                0


      

Marco MBEDTLS_SSL_SIG_RSA

#define MBEDTLS_SSL_SIG_RSA                 1


      

Marco MBEDTLS_SSL_SIG_ECDSA

#define MBEDTLS_SSL_SIG_ECDSA               3


      

Marco MBEDTLS_SSL_CERT_TYPE_RSA_SIGN

#define MBEDTLS_SSL_CERT_TYPE_RSA_SIGN      1
/*
 * Client Certificate Types
 * RFC 5246 section 7.4.4 plus RFC 4492 section 5.5
 */

Marco MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN

#define MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN   64


      

Marco MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC

#define MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC    20
/*
 * Message, alert and handshake types
 */

Marco MBEDTLS_SSL_MSG_ALERT

#define MBEDTLS_SSL_MSG_ALERT                 21


      

Marco MBEDTLS_SSL_MSG_HANDSHAKE

#define MBEDTLS_SSL_MSG_HANDSHAKE             22


      

Marco MBEDTLS_SSL_MSG_APPLICATION_DATA

#define MBEDTLS_SSL_MSG_APPLICATION_DATA      23


      

Marco MBEDTLS_SSL_ALERT_LEVEL_WARNING

#define MBEDTLS_SSL_ALERT_LEVEL_WARNING        1


      

Marco MBEDTLS_SSL_ALERT_LEVEL_FATAL

#define MBEDTLS_SSL_ALERT_LEVEL_FATAL          2


      

Marco MBEDTLS_SSL_ALERT_MSG_CLOSE_NOTIFY

#define MBEDTLS_SSL_ALERT_MSG_CLOSE_NOTIFY          0 /* 0x00 */


      

Marco MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE

#define MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE   10 /* 0x0A */


      

Marco MBEDTLS_SSL_ALERT_MSG_BAD_RECORD_MAC

#define MBEDTLS_SSL_ALERT_MSG_BAD_RECORD_MAC       20 /* 0x14 */


      

Marco MBEDTLS_SSL_ALERT_MSG_DECRYPTION_FAILED

#define MBEDTLS_SSL_ALERT_MSG_DECRYPTION_FAILED    21 /* 0x15 */


      

Marco MBEDTLS_SSL_ALERT_MSG_RECORD_OVERFLOW

#define MBEDTLS_SSL_ALERT_MSG_RECORD_OVERFLOW      22 /* 0x16 */


      

Marco MBEDTLS_SSL_ALERT_MSG_DECOMPRESSION_FAILURE

#define MBEDTLS_SSL_ALERT_MSG_DECOMPRESSION_FAILURE 30 /* 0x1E */


      

Marco MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE

#define MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE    40 /* 0x28 */


      

Marco MBEDTLS_SSL_ALERT_MSG_NO_CERT

#define MBEDTLS_SSL_ALERT_MSG_NO_CERT              41 /* 0x29 */


      

Marco MBEDTLS_SSL_ALERT_MSG_BAD_CERT

#define MBEDTLS_SSL_ALERT_MSG_BAD_CERT             42 /* 0x2A */


      

Marco MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT

#define MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT     43 /* 0x2B */


      

Marco MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED

#define MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED         44 /* 0x2C */


      

Marco MBEDTLS_SSL_ALERT_MSG_CERT_EXPIRED

#define MBEDTLS_SSL_ALERT_MSG_CERT_EXPIRED         45 /* 0x2D */


      

Marco MBEDTLS_SSL_ALERT_MSG_CERT_UNKNOWN

#define MBEDTLS_SSL_ALERT_MSG_CERT_UNKNOWN         46 /* 0x2E */


      

Marco MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER

#define MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER    47 /* 0x2F */


      

Marco MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA

#define MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA           48 /* 0x30 */


      

Marco MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED

#define MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED        49 /* 0x31 */


      

Marco MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR

#define MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR         50 /* 0x32 */


      

Marco MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR

#define MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR        51 /* 0x33 */


      

Marco MBEDTLS_SSL_ALERT_MSG_EXPORT_RESTRICTION

#define MBEDTLS_SSL_ALERT_MSG_EXPORT_RESTRICTION   60 /* 0x3C */


      

Marco MBEDTLS_SSL_ALERT_MSG_PROTOCOL_VERSION

#define MBEDTLS_SSL_ALERT_MSG_PROTOCOL_VERSION     70 /* 0x46 */


      

Marco MBEDTLS_SSL_ALERT_MSG_INSUFFICIENT_SECURITY

#define MBEDTLS_SSL_ALERT_MSG_INSUFFICIENT_SECURITY 71 /* 0x47 */


      

Marco MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR

#define MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR       80 /* 0x50 */


      

Marco MBEDTLS_SSL_ALERT_MSG_INAPROPRIATE_FALLBACK

#define MBEDTLS_SSL_ALERT_MSG_INAPROPRIATE_FALLBACK 86 /* 0x56 */


      

Marco MBEDTLS_SSL_ALERT_MSG_USER_CANCELED

#define MBEDTLS_SSL_ALERT_MSG_USER_CANCELED        90 /* 0x5A */


      

Marco MBEDTLS_SSL_ALERT_MSG_NO_RENEGOTIATION

#define MBEDTLS_SSL_ALERT_MSG_NO_RENEGOTIATION    100 /* 0x64 */


      

Marco MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT

#define MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT     110 /* 0x6E */


      

Marco MBEDTLS_SSL_ALERT_MSG_UNRECOGNIZED_NAME

#define MBEDTLS_SSL_ALERT_MSG_UNRECOGNIZED_NAME   112 /* 0x70 */


      

Marco MBEDTLS_SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY

#define MBEDTLS_SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY 115 /* 0x73 */


      

Marco MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL

#define MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL 120 /* 0x78 */


      

Marco MBEDTLS_SSL_HS_HELLO_REQUEST

#define MBEDTLS_SSL_HS_HELLO_REQUEST           0


      

Marco MBEDTLS_SSL_HS_CLIENT_HELLO

#define MBEDTLS_SSL_HS_CLIENT_HELLO            1


      

Marco MBEDTLS_SSL_HS_SERVER_HELLO

#define MBEDTLS_SSL_HS_SERVER_HELLO            2


      

Marco MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST

#define MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST    3


      

Marco MBEDTLS_SSL_HS_NEW_SESSION_TICKET

#define MBEDTLS_SSL_HS_NEW_SESSION_TICKET      4


      

Marco MBEDTLS_SSL_HS_CERTIFICATE

#define MBEDTLS_SSL_HS_CERTIFICATE            11


      

Marco MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE

#define MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE    12


      

Marco MBEDTLS_SSL_HS_CERTIFICATE_REQUEST

#define MBEDTLS_SSL_HS_CERTIFICATE_REQUEST    13


      

Marco MBEDTLS_SSL_HS_SERVER_HELLO_DONE

#define MBEDTLS_SSL_HS_SERVER_HELLO_DONE      14


      

Marco MBEDTLS_SSL_HS_CERTIFICATE_VERIFY

#define MBEDTLS_SSL_HS_CERTIFICATE_VERIFY     15


      

Marco MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE

#define MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE    16


      

Marco MBEDTLS_SSL_HS_FINISHED

#define MBEDTLS_SSL_HS_FINISHED               20


      

Marco MBEDTLS_TLS_EXT_SERVERNAME

#define MBEDTLS_TLS_EXT_SERVERNAME                  0
/*
 * TLS extensions
 */

Marco MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME

#define MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME         0


      

Marco MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH

#define MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH         1


      

Marco MBEDTLS_TLS_EXT_TRUNCATED_HMAC

#define MBEDTLS_TLS_EXT_TRUNCATED_HMAC              4


      

Marco MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES

#define MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES  10


      

Marco MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS

#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS    11


      

Marco MBEDTLS_TLS_EXT_SIG_ALG

#define MBEDTLS_TLS_EXT_SIG_ALG                    13


      

Marco MBEDTLS_TLS_EXT_USE_SRTP

#define MBEDTLS_TLS_EXT_USE_SRTP                   14


      

Marco MBEDTLS_TLS_EXT_ALPN

#define MBEDTLS_TLS_EXT_ALPN                       16


      

Marco MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC

#define MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC           22 /* 0x16 */


      

Marco MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET

#define MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET 23 /* 23 */


      

Marco MBEDTLS_TLS_EXT_SESSION_TICKET

#define MBEDTLS_TLS_EXT_SESSION_TICKET             35


      

Marco MBEDTLS_TLS_EXT_ECJPAKE_KKPP

#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP              256 /* experimental */


      

Marco MBEDTLS_TLS_EXT_RENEGOTIATION_INFO

#define MBEDTLS_TLS_EXT_RENEGOTIATION_INFO     65281


      

Marco MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_80_IANA_VALUE

#define MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_80_IANA_VALUE    1
/*
 * use_srtp extension protection profiles values as defined in http://www.iana.org/assignments/srtp-protection/srtp-protection.xhtml
 */

Marco MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_32_IANA_VALUE

#define MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_32_IANA_VALUE    2


      

Marco MBEDTLS_SRTP_NULL_HMAC_SHA1_80_IANA_VALUE

#define MBEDTLS_SRTP_NULL_HMAC_SHA1_80_IANA_VALUE         5


      

Marco MBEDTLS_SRTP_NULL_HMAC_SHA1_32_IANA_VALUE

#define MBEDTLS_SRTP_NULL_HMAC_SHA1_32_IANA_VALUE         6


      

Marco MBEDTLS_PSK_MAX_LEN

#define MBEDTLS_PSK_MAX_LEN           64 /* 256 bits */
//#define MBEDTLS_PSK_MAX_LEN            32 /* 256 bits */

Marco MBEDTLS_PREMASTER_SIZE

#define MBEDTLS_PREMASTER_SIZE    sizeof( union mbedtls_ssl_premaster_secret )


      

Marco MBEDTLS_DTLS_SRTP_MAX_KEY_MATERIAL_LENGTH

#define MBEDTLS_DTLS_SRTP_MAX_KEY_MATERIAL_LENGTH   60


      

Marco MBEDTLS_DTLS_SRTP_MAX_MKI_LENGTH

#define MBEDTLS_DTLS_SRTP_MAX_MKI_LENGTH            255


      

Marco MBEDTLS_SSL_CHANNEL_OUTBOUND

#define MBEDTLS_SSL_CHANNEL_OUTBOUND   0


      

Marco MBEDTLS_SSL_CHANNEL_INBOUND

#define MBEDTLS_SSL_CHANNEL_INBOUND    1


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED   __attribute__((deprecated))


      

Marco MBEDTLS_DEPRECATED

#define MBEDTLS_DEPRECATED


      

Marco MBEDTLS_SSL_CACHE_H

#define MBEDTLS_SSL_CACHE_H


      

Marco MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT

#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT      86400  /*!< 1 day  */


      

Marco MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES

#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES     50  /*!< Maximum entries in cache */


      

Marco MBEDTLS_SSL_CIPHERSUITES_H

#define MBEDTLS_SSL_CIPHERSUITES_H


      

Marco MBEDTLS_TLS_RSA_WITH_NULL_MD5

#define MBEDTLS_TLS_RSA_WITH_NULL_MD5                   1  /**< Weak! */
/*
 * Supported ciphersuites (Official IANA names)
 */

Marco MBEDTLS_TLS_RSA_WITH_NULL_SHA

#define MBEDTLS_TLS_RSA_WITH_NULL_SHA                   2  /**< Weak! */


      

Marco MBEDTLS_TLS_RSA_WITH_RC4_128_MD5

#define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5                4


      

Marco MBEDTLS_TLS_RSA_WITH_RC4_128_SHA

#define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA                5


      

Marco MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA

#define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA                9  /**< Weak! Not in TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA           0A


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA

#define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA            21  /**< Weak! Not in TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA       22


      

Marco MBEDTLS_TLS_PSK_WITH_NULL_SHA

#define MBEDTLS_TLS_PSK_WITH_NULL_SHA                   2C  /**< Weak! */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA

#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA               2D  /**< Weak! */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA

#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA               2E  /**< Weak! */


      

Marco MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA            47


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA        51


      

Marco MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA            53


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA        57


      

Marco MBEDTLS_TLS_RSA_WITH_NULL_SHA256

#define MBEDTLS_TLS_RSA_WITH_NULL_SHA256                3B  /**< Weak! */


      

Marco MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256         3C  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256

#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256         3D  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA

#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA       65


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA

#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA   69


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256     103  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256     6B  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA

#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA       132


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA

#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA   136


      

Marco MBEDTLS_TLS_PSK_WITH_RC4_128_SHA

#define MBEDTLS_TLS_PSK_WITH_RC4_128_SHA                8A


      

Marco MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA           8B


      

Marco MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA            8C


      

Marco MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA            8D


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA

#define MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA            8E


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA       143


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA        144


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA        145


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA

#define MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA            146


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA       147


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA        148


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA        149


      

Marco MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256         9C  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384         9D  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256     9E  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384     159  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256         0xA8  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384         0xA9  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256     0xAA  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384     0xAB  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256     0xAC  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384     0xAD  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256         0xAE


      

Marco MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384

#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384         0xAF


      

Marco MBEDTLS_TLS_PSK_WITH_NULL_SHA256

#define MBEDTLS_TLS_PSK_WITH_NULL_SHA256                0xB0  /**< Weak! */


      

Marco MBEDTLS_TLS_PSK_WITH_NULL_SHA384

#define MBEDTLS_TLS_PSK_WITH_NULL_SHA384                0xB1  /**< Weak! */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256     0xB2


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384     0xB3


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256

#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256            0xB4  /**< Weak! */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384

#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384            0xB5  /**< Weak! */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256     0xB6


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384

#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384     0xB7


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256

#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256            0xB8  /**< Weak! */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384

#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384            0xB9  /**< Weak! */


      

Marco MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256    0xBA  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBE  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256

#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256    0xC0  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC4  /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA            0xC001 /**< Weak! */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA         0xC002 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA    0xC003 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA     0xC004 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA     0xC005 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA           0xC006 /**< Weak! */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA        0xC007 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA   0xC008 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA    0xC009 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA    0xC00A /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA

#define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA              0xC00B /**< Weak! */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA

#define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA           0xC00C /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA      0xC00D /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA       0xC00E /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA       0xC00F /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA

#define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA             0xC010 /**< Weak! */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA

#define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA          0xC011 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA     0xC012 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA      0xC013 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA      0xC014 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256  0xC025 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384  0xC026 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256   0xC027 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384   0xC028 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256    0xC029 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384

#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384    0xC02A /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256  0xC02D /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384  0xC02E /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256   0xC02F /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384   0xC030 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256

#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256    0xC031 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384

#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384    0xC032 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA

#define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA          0xC033 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA

#define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA     0xC034 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA

#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA      0xC035 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA

#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA      0xC036 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256   0xC037 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384   0xC038 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA

#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA             0xC039 /**< Weak! No SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256

#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256          0xC03A /**< Weak! No SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384

#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384          0xC03B /**< Weak! No SSL3! */


      

Marco MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256        0xC03C /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384        0xC03D /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256    0xC044 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384    0xC045 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC048 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC049 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC04A /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC04B /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256  0xC04C /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384  0xC04D /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256   0xC04E /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384   0xC04F /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256        0xC050 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384        0xC051 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256    0xC052 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384    0xC053 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05C /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05D /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05E /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05F /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256  0xC060 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384  0xC061 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256   0xC062 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384   0xC063 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256        0xC064 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384        0xC065 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256    0xC066 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384    0xC067 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256    0xC068 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384    0xC069 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256        0xC06A /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384        0xC06B /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256    0xC06C /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384    0xC06D /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256

#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256    0xC06E /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384

#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384    0xC06F /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256  0xC070 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384  0xC071 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC074 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC075 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256  0xC076 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384  0xC077 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256   0xC078 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384   0xC079 /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256        0xC07A /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384        0xC07B /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256    0xC07C /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384    0xC07D /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC088 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC089 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256  0xC08A /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384  0xC08B /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256   0xC08C /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384   0xC08D /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256      0xC08E /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384      0xC08F /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256  0xC090 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384  0xC091 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256

#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256  0xC092 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384

#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384  0xC093 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256      0xC094


      

Marco MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384

#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384      0xC095


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256  0xC096


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384

#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384  0xC097


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256  0xC098


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384

#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384  0xC099


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256

#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384

#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /**< Not in SSL3! */


      

Marco MBEDTLS_TLS_RSA_WITH_AES_128_CCM

#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM               0xC09C /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_AES_256_CCM

#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM               0xC09D /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM           0xC09E /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM           0xC09F /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8

#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8             0xC0A0 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8

#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8             0xC0A1 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8         0xC0A2 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8

#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8         0xC0A3 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_AES_128_CCM

#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM               0xC0A4 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_AES_256_CCM

#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM               0xC0A5 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM           0xC0A6 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM           0xC0A7 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8

#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8             0xC0A8 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8

#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8             0xC0A9 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8         0xC0AA /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8

#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8         0xC0AB /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM       0xC0AC /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM       0xC0AD /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8     0xC0AE /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8     0xC0AF /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8

#define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8         0xC0FF /**< experimental */


      

Marco MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256

#define MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256  0xCCA8 /**< TLS 1.2 */
/* RFC 7905 */

Marco MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256

#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA9 /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256

#define MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256    0xCCAA /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256

#define MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256        0xCCAB /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256

#define MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256  0xCCAC /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256

#define MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256    0xCCAD /**< TLS 1.2 */


      

Marco MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256

#define MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256    0xCCAE /**< TLS 1.2 */


      

Marco MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED

#define MBEDTLS_KEY_EXCHANGE__WITH_CERT__ENABLED


      

Marco MBEDTLS_KEY_EXCHANGE__CERT_REQ_ALLOWED__ENABLED

#define MBEDTLS_KEY_EXCHANGE__CERT_REQ_ALLOWED__ENABLED


      

Marco MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED

#define MBEDTLS_KEY_EXCHANGE__WITH_SERVER_SIGNATURE__ENABLED


      

Marco MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED

#define MBEDTLS_KEY_EXCHANGE__SOME__ECDH_ENABLED


      

Marco MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED

#define MBEDTLS_KEY_EXCHANGE__SOME_NON_PFS__ENABLED


      

Marco MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED

#define MBEDTLS_KEY_EXCHANGE__SOME_PFS__ENABLED


      

Marco MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED

#define MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED


      

Marco MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED

#define MBEDTLS_KEY_EXCHANGE__SOME__DHE_ENABLED


      

Marco MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED

#define MBEDTLS_KEY_EXCHANGE__SOME__ECDHE_ENABLED


      

Marco MBEDTLS_CIPHERSUITE_WEAK

#define MBEDTLS_CIPHERSUITE_WEAK      1   /**< Weak ciphersuite flag  */


      

Marco MBEDTLS_CIPHERSUITE_SHORT_TAG

#define MBEDTLS_CIPHERSUITE_SHORT_TAG 2   /**< Short authentication tag,
                                                     eg for CCM_8 */


      

Marco MBEDTLS_CIPHERSUITE_NODTLS

#define MBEDTLS_CIPHERSUITE_NODTLS    4   /**< Can't be used with DTLS */


      
      
#define MBEDTLS_SSL_COOKIE_H


      
      
#define MBEDTLS_SSL_COOKIE_TIMEOUT    60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */


      

Marco MBEDTLS_SSL_INTERNAL_H

#define MBEDTLS_SSL_INTERNAL_H


      

Marco inline

#define inline __inline


      

Marco MBEDTLS_SSL_MIN_MAJOR_VERSION

#define MBEDTLS_SSL_MIN_MAJOR_VERSION          MBEDTLS_SSL_MAJOR_VERSION_3
/* Determine minimum supported version */

Marco MBEDTLS_SSL_MIN_MINOR_VERSION

#define MBEDTLS_SSL_MIN_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_0


      

Marco MBEDTLS_SSL_MIN_MINOR_VERSION

#define MBEDTLS_SSL_MIN_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_1


      

Marco MBEDTLS_SSL_MIN_MINOR_VERSION

#define MBEDTLS_SSL_MIN_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_2


      

Marco MBEDTLS_SSL_MIN_MINOR_VERSION

#define MBEDTLS_SSL_MIN_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_3


      

Marco MBEDTLS_SSL_MIN_VALID_MINOR_VERSION

#define MBEDTLS_SSL_MIN_VALID_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1


      

Marco MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION

#define MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3


      

Marco MBEDTLS_SSL_MAX_MAJOR_VERSION

#define MBEDTLS_SSL_MAX_MAJOR_VERSION          MBEDTLS_SSL_MAJOR_VERSION_3
/* Determine maximum supported version */

Marco MBEDTLS_SSL_MAX_MINOR_VERSION

#define MBEDTLS_SSL_MAX_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_3


      

Marco MBEDTLS_SSL_MAX_MINOR_VERSION

#define MBEDTLS_SSL_MAX_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_2


      

Marco MBEDTLS_SSL_MAX_MINOR_VERSION

#define MBEDTLS_SSL_MAX_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_1


      

Marco MBEDTLS_SSL_MAX_MINOR_VERSION

#define MBEDTLS_SSL_MAX_MINOR_VERSION          MBEDTLS_SSL_MINOR_VERSION_0


      

Marco MBEDTLS_SSL__ECP_RESTARTABLE

#define MBEDTLS_SSL__ECP_RESTARTABLE


      

Marco MBEDTLS_SSL_INITIAL_HANDSHAKE

#define MBEDTLS_SSL_INITIAL_HANDSHAKE          0


      

Marco MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS

#define MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS  1  /* In progress */


      

Marco MBEDTLS_SSL_RENEGOTIATION_DONE

#define MBEDTLS_SSL_RENEGOTIATION_DONE         2  /* Done or aborted */


      

Marco MBEDTLS_SSL_RENEGOTIATION_PENDING

#define MBEDTLS_SSL_RENEGOTIATION_PENDING      3  /* Requested (server only) */


      

Marco MBEDTLS_SSL_RETRANS_PREPARING

#define MBEDTLS_SSL_RETRANS_PREPARING      0
/*
 * DTLS retransmission states, see RFC 6347 4.2.4
 *
 * The SENDING state is merged in PREPARING for initial sends,
 * but is distinct for resends.
 *
 * Note: initial state is wrong for server, but is not used anyway.
 */

Marco MBEDTLS_SSL_RETRANS_SENDING

#define MBEDTLS_SSL_RETRANS_SENDING        1


      

Marco MBEDTLS_SSL_RETRANS_WAITING

#define MBEDTLS_SSL_RETRANS_WAITING        2


      

Marco MBEDTLS_SSL_RETRANS_FINISHED

#define MBEDTLS_SSL_RETRANS_FINISHED       3


      

Marco MBEDTLS_SSL_COMPRESSION_ADD

#define MBEDTLS_SSL_COMPRESSION_ADD         1024


      

Marco MBEDTLS_SSL_COMPRESSION_ADD

#define MBEDTLS_SSL_COMPRESSION_ADD            0


      

Marco MBEDTLS_SSL_MAC_ADD

#define MBEDTLS_SSL_MAC_ADD                48 /* SHA-384 used for HMAC */


      

Marco MBEDTLS_SSL_MAC_ADD

#define MBEDTLS_SSL_MAC_ADD                32 /* SHA-256 used for HMAC */


      

Marco MBEDTLS_SSL_MAC_ADD

#define MBEDTLS_SSL_MAC_ADD                20 /* SHA-1   used for HMAC */


      

Marco MBEDTLS_SSL_MAC_ADD

#define MBEDTLS_SSL_MAC_ADD                16
/* AEAD ciphersuites: GCM and CCM use a 128 bits tag */

Marco MBEDTLS_SSL_PADDING_ADD

#define MBEDTLS_SSL_PADDING_ADD           256


      

Marco MBEDTLS_SSL_PADDING_ADD

#define MBEDTLS_SSL_PADDING_ADD             0


      

Marco MBEDTLS_SSL_PAYLOAD_OVERHEAD

#define MBEDTLS_SSL_PAYLOAD_OVERHEAD ( MBEDTLS_SSL_COMPRESSION_ADD +   \
                                      MBEDTLS_MAX_IV_LENGTH +         \
                                      MBEDTLS_SSL_MAC_ADD +           \
                                      MBEDTLS_SSL_PADDING_ADD         \
                                      )


      

Marco MBEDTLS_SSL_IN_PAYLOAD_LEN

#define MBEDTLS_SSL_IN_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \
                                    ( MBEDTLS_SSL_IN_CONTENT_LEN ) )


      

Marco MBEDTLS_SSL_OUT_PAYLOAD_LEN

#define MBEDTLS_SSL_OUT_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \
                                     ( MBEDTLS_SSL_OUT_CONTENT_LEN ) )


      

Marco MBEDTLS_SSL_MAX_BUFFERED_HS

#define MBEDTLS_SSL_MAX_BUFFERED_HS 4
/* The maximum number of buffered handshake messages. */

Marco MBEDTLS_TLS_EXT_ADV_CONTENT_LEN

#define MBEDTLS_TLS_EXT_ADV_CONTENT_LEN (                           \
       (MBEDTLS_SSL_IN_CONTENT_LEN > MBEDTLS_SSL_OUT_CONTENT_LEN)  \
       ? ( MBEDTLS_SSL_OUT_CONTENT_LEN )                           \
       : ( MBEDTLS_SSL_IN_CONTENT_LEN )                            \
       )
/* Maximum length we can advertise as our max content length for
   RFC 6066 max_fragment_length extension negotiation purposes
   (the lesser of both sizes, if they are unequal.)
 */

Marco MBEDTLS_SSL_HEADER_LEN

#define MBEDTLS_SSL_HEADER_LEN 13
/* Note: Even though the TLS record header is only 5 bytes
   long, we're internally using 8 bytes to store the
   implicit sequence number. */

Marco MBEDTLS_SSL_IN_BUFFER_LEN

#define MBEDTLS_SSL_IN_BUFFER_LEN \
   ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_IN_PAYLOAD_LEN ) )


      

Marco MBEDTLS_SSL_OUT_BUFFER_LEN

#define MBEDTLS_SSL_OUT_BUFFER_LEN \
   ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_OUT_PAYLOAD_LEN ) )


      

Marco MBEDTLS_SSL_COMPRESS_BUFFER_LEN

#define MBEDTLS_SSL_COMPRESS_BUFFER_LEN (                              \
       ( MBEDTLS_SSL_IN_BUFFER_LEN > MBEDTLS_SSL_OUT_BUFFER_LEN )     \
       ? MBEDTLS_SSL_IN_BUFFER_LEN                                    \
       : MBEDTLS_SSL_OUT_BUFFER_LEN                                   \
       )
/* Compression buffer holds both IN and OUT buffers, so should be size of the larger */

Marco MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT

#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT (1 << 0)
/*
 * TLS extension flags (for extensions with outgoing ServerHello content
 * that need it (e.g. for RENEGOTIATION_INFO the server already knows because
 * of state of the renegotiation flag, so no indicator is required)
 */

Marco MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK

#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK                (1 << 1)


      

Marco MBEDTLS_SSL_TICKET_H

#define MBEDTLS_SSL_TICKET_H


      

Marco MBEDTLS_THREADING_H

#define MBEDTLS_THREADING_H


      

Marco MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE        -1A /**< The selected feature is not available. */
/* MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE is deprecated and should not be
 * used. */

Marco MBEDTLS_ERR_THREADING_BAD_INPUT_DATA

#define MBEDTLS_ERR_THREADING_BAD_INPUT_DATA             -1C /**< Bad input parameters to function. */


      

Marco MBEDTLS_ERR_THREADING_MUTEX_ERROR

#define MBEDTLS_ERR_THREADING_MUTEX_ERROR                -1E /**< Locking / unlocking / free failed with error code. */


      

Marco MBEDTLS_TIMING_H

#define MBEDTLS_TIMING_H


      

Marco MBEDTLS_VERSION_H

#define MBEDTLS_VERSION_H


      

Marco MBEDTLS_VERSION_MAJOR

#define MBEDTLS_VERSION_MAJOR 2
/**
 * The version number x.y.z is split into three parts.
 * Major, Minor, Patchlevel
 */

Marco MBEDTLS_VERSION_MINOR

#define MBEDTLS_VERSION_MINOR 16


      

Marco MBEDTLS_VERSION_PATCH

#define MBEDTLS_VERSION_PATCH 2


      

Marco MBEDTLS_VERSION_NUMBER

#define MBEDTLS_VERSION_NUMBER        34603520
/**
 * The single version number has the following structure:
 *    MMNNPP00
 *    Major version | Minor version | Patch version
 */

Marco MBEDTLS_VERSION_STRING

#define MBEDTLS_VERSION_STRING        "2.16.2"


      

Marco MBEDTLS_VERSION_STRING_FULL

#define MBEDTLS_VERSION_STRING_FULL   "mbed TLS 2.16.2"


      

Marco MBEDTLS_X509_H

#define MBEDTLS_X509_H


      

Marco MBEDTLS_X509_MAX_INTERMEDIATE_CA

#define MBEDTLS_X509_MAX_INTERMEDIATE_CA  8
/**
 * Maximum number of intermediate CAs in a verification chain.
 * That is, maximum length of the chain, excluding the end-entity certificate
 * and the trusted root certificate.
 *
 * Set this to a low value to prevent an adversary from making you waste
 * resources verifying an overlong certificate chain.
 */

Marco MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE

#define MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE             -8320 /**< Unavailable feature, e.g. RSA hashing/encryption combination. */
/**
 * \name X509 Error codes
 * \{
 */

Marco MBEDTLS_ERR_X509_UNKNOWN_OID

#define MBEDTLS_ERR_X509_UNKNOWN_OID                     -8448 /**< Requested OID is unknown. */


      

Marco MBEDTLS_ERR_X509_INVALID_FORMAT

#define MBEDTLS_ERR_X509_INVALID_FORMAT                  -8576 /**< The CRT/CRL/CSR format is invalid, e.g. different type expected. */


      

Marco MBEDTLS_ERR_X509_INVALID_VERSION

#define MBEDTLS_ERR_X509_INVALID_VERSION                 -8704 /**< The CRT/CRL/CSR version element is invalid. */


      

Marco MBEDTLS_ERR_X509_INVALID_SERIAL

#define MBEDTLS_ERR_X509_INVALID_SERIAL                  -8832 /**< The serial tag or value is invalid. */


      

Marco MBEDTLS_ERR_X509_INVALID_ALG

#define MBEDTLS_ERR_X509_INVALID_ALG                     -8960 /**< The algorithm tag or value is invalid. */


      

Marco MBEDTLS_ERR_X509_INVALID_NAME

#define MBEDTLS_ERR_X509_INVALID_NAME                    -9088 /**< The name tag or value is invalid. */


      

Marco MBEDTLS_ERR_X509_INVALID_DATE

#define MBEDTLS_ERR_X509_INVALID_DATE                    -9216 /**< The date tag or value is invalid. */


      

Marco MBEDTLS_ERR_X509_INVALID_SIGNATURE

#define MBEDTLS_ERR_X509_INVALID_SIGNATURE               -9344 /**< The signature tag or value invalid. */


      

Marco MBEDTLS_ERR_X509_INVALID_EXTENSIONS

#define MBEDTLS_ERR_X509_INVALID_EXTENSIONS              -9472 /**< The extension tag or value is invalid. */


      

Marco MBEDTLS_ERR_X509_UNKNOWN_VERSION

#define MBEDTLS_ERR_X509_UNKNOWN_VERSION                 -9600 /**< CRT/CRL/CSR has an unsupported version number. */


      

Marco MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG

#define MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG                 -9728 /**< Signature algorithm (oid) is unsupported. */


      

Marco MBEDTLS_ERR_X509_SIG_MISMATCH

#define MBEDTLS_ERR_X509_SIG_MISMATCH                    -9856 /**< Signature algorithms do not match. (see \c ::mbedtls_x509_crt sig_oid) */


      

Marco MBEDTLS_ERR_X509_CERT_VERIFY_FAILED

#define MBEDTLS_ERR_X509_CERT_VERIFY_FAILED              -9984 /**< Certificate verification failed, e.g. CRL, CA or signature check failed. */


      

Marco MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT

#define MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT             -10112 /**< Format not recognized as DER or PEM. */


      

Marco MBEDTLS_ERR_X509_BAD_INPUT_DATA

#define MBEDTLS_ERR_X509_BAD_INPUT_DATA                  -10240 /**< Input invalid. */


      

Marco MBEDTLS_ERR_X509_ALLOC_FAILED

#define MBEDTLS_ERR_X509_ALLOC_FAILED                    -10368 /**< Allocation of memory failed. */


      

Marco MBEDTLS_ERR_X509_FILE_IO_ERROR

#define MBEDTLS_ERR_X509_FILE_IO_ERROR                   -10496 /**< Read/write of file failed. */


      

Marco MBEDTLS_ERR_X509_BUFFER_TOO_SMALL

#define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL                -10624 /**< Destination buffer is too small. */


      

Marco MBEDTLS_ERR_X509_FATAL_ERROR

#define MBEDTLS_ERR_X509_FATAL_ERROR                     -12288 /**< A fatal error occured, eg the chain is too long or the vrfy callback failed. */


      

Marco MBEDTLS_X509_BADCERT_EXPIRED

#define MBEDTLS_X509_BADCERT_EXPIRED            1 /**< The certificate validity has expired. */
/* Reminder: update x509_crt_verify_strings[] in library/x509_crt.c */

Marco MBEDTLS_X509_BADCERT_REVOKED

#define MBEDTLS_X509_BADCERT_REVOKED            2 /**< The certificate has been revoked (is on a CRL). */


      

Marco MBEDTLS_X509_BADCERT_CN_MISMATCH

#define MBEDTLS_X509_BADCERT_CN_MISMATCH        4 /**< The certificate Common Name (CN) does not match with the expected CN. */


      

Marco MBEDTLS_X509_BADCERT_NOT_TRUSTED

#define MBEDTLS_X509_BADCERT_NOT_TRUSTED        8 /**< The certificate is not correctly signed by the trusted CA. */


      

Marco MBEDTLS_X509_BADCRL_NOT_TRUSTED

#define MBEDTLS_X509_BADCRL_NOT_TRUSTED         16 /**< The CRL is not correctly signed by the trusted CA. */


      

Marco MBEDTLS_X509_BADCRL_EXPIRED

#define MBEDTLS_X509_BADCRL_EXPIRED             32 /**< The CRL is expired. */


      

Marco MBEDTLS_X509_BADCERT_MISSING

#define MBEDTLS_X509_BADCERT_MISSING            64 /**< Certificate was missing. */


      

Marco MBEDTLS_X509_BADCERT_SKIP_VERIFY

#define MBEDTLS_X509_BADCERT_SKIP_VERIFY        128 /**< Certificate verification was skipped. */


      

Marco MBEDTLS_X509_BADCERT_OTHER

#define MBEDTLS_X509_BADCERT_OTHER            256 /**< Other reason (can be used by verify callback) */


      

Marco MBEDTLS_X509_BADCERT_FUTURE

#define MBEDTLS_X509_BADCERT_FUTURE           512 /**< The certificate validity starts in the future. */


      

Marco MBEDTLS_X509_BADCRL_FUTURE

#define MBEDTLS_X509_BADCRL_FUTURE            1024 /**< The CRL is from the future */


      

Marco MBEDTLS_X509_BADCERT_KEY_USAGE

#define MBEDTLS_X509_BADCERT_KEY_USAGE        2048 /**< Usage does not match the keyUsage extension. */


      

Marco MBEDTLS_X509_BADCERT_EXT_KEY_USAGE

#define MBEDTLS_X509_BADCERT_EXT_KEY_USAGE    4096 /**< Usage does not match the extendedKeyUsage extension. */


      

Marco MBEDTLS_X509_BADCERT_NS_CERT_TYPE

#define MBEDTLS_X509_BADCERT_NS_CERT_TYPE     8192 /**< Usage does not match the nsCertType extension. */


      

Marco MBEDTLS_X509_BADCERT_BAD_MD

#define MBEDTLS_X509_BADCERT_BAD_MD           16384 /**< The certificate is signed with an unacceptable hash. */


      

Marco MBEDTLS_X509_BADCERT_BAD_PK

#define MBEDTLS_X509_BADCERT_BAD_PK           32768 /**< The certificate is signed with an unacceptable PK alg (eg RSA vs ECDSA). */


      

Marco MBEDTLS_X509_BADCERT_BAD_KEY

#define MBEDTLS_X509_BADCERT_BAD_KEY        65536 /**< The certificate is signed with an unacceptable key (eg bad curve, RSA too short). */


      

Marco MBEDTLS_X509_BADCRL_BAD_MD

#define MBEDTLS_X509_BADCRL_BAD_MD          131072 /**< The CRL is signed with an unacceptable hash. */


      

Marco MBEDTLS_X509_BADCRL_BAD_PK

#define MBEDTLS_X509_BADCRL_BAD_PK          262144 /**< The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA). */


      

Marco MBEDTLS_X509_BADCRL_BAD_KEY

#define MBEDTLS_X509_BADCRL_BAD_KEY         524288 /**< The CRL is signed with an unacceptable key (eg bad curve, RSA too short). */


      

Marco MBEDTLS_X509_KU_DIGITAL_SIGNATURE

#define MBEDTLS_X509_KU_DIGITAL_SIGNATURE           (128) /* bit 0 */
/*
 * X.509 v3 Key Usage Extension flags
 * Reminder: update x509_info_key_usage() when adding new flags.
 */

Marco MBEDTLS_X509_KU_NON_REPUDIATION

#define MBEDTLS_X509_KU_NON_REPUDIATION             (64) /* bit 1 */


      

Marco MBEDTLS_X509_KU_KEY_ENCIPHERMENT

#define MBEDTLS_X509_KU_KEY_ENCIPHERMENT            (32) /* bit 2 */


      

Marco MBEDTLS_X509_KU_DATA_ENCIPHERMENT

#define MBEDTLS_X509_KU_DATA_ENCIPHERMENT           (16) /* bit 3 */


      

Marco MBEDTLS_X509_KU_KEY_AGREEMENT

#define MBEDTLS_X509_KU_KEY_AGREEMENT               (8) /* bit 4 */


      

Marco MBEDTLS_X509_KU_KEY_CERT_SIGN

#define MBEDTLS_X509_KU_KEY_CERT_SIGN               (4) /* bit 5 */


      

Marco MBEDTLS_X509_KU_CRL_SIGN

#define MBEDTLS_X509_KU_CRL_SIGN                    (2) /* bit 6 */


      

Marco MBEDTLS_X509_KU_ENCIPHER_ONLY

#define MBEDTLS_X509_KU_ENCIPHER_ONLY               (1) /* bit 7 */


      

Marco MBEDTLS_X509_KU_DECIPHER_ONLY

#define MBEDTLS_X509_KU_DECIPHER_ONLY             (32768) /* bit 8 */


      

Marco MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT

#define MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT        (128) /* bit 0 */


      

Marco MBEDTLS_X509_NS_CERT_TYPE_SSL_SERVER

#define MBEDTLS_X509_NS_CERT_TYPE_SSL_SERVER        (64) /* bit 1 */


      

Marco MBEDTLS_X509_NS_CERT_TYPE_EMAIL

#define MBEDTLS_X509_NS_CERT_TYPE_EMAIL             (32) /* bit 2 */


      

Marco MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING

#define MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING    (16) /* bit 3 */


      

Marco MBEDTLS_X509_NS_CERT_TYPE_RESERVED

#define MBEDTLS_X509_NS_CERT_TYPE_RESERVED          (8) /* bit 4 */


      

Marco MBEDTLS_X509_NS_CERT_TYPE_SSL_CA

#define MBEDTLS_X509_NS_CERT_TYPE_SSL_CA            (4) /* bit 5 */


      

Marco MBEDTLS_X509_NS_CERT_TYPE_EMAIL_CA

#define MBEDTLS_X509_NS_CERT_TYPE_EMAIL_CA          (2) /* bit 6 */


      

Marco MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING_CA

#define MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING_CA (1) /* bit 7 */


      

Marco MBEDTLS_X509_EXT_AUTHORITY_KEY_IDENTIFIER

#define MBEDTLS_X509_EXT_AUTHORITY_KEY_IDENTIFIER   (1 << 0)
/*
 * X.509 extension types
 *
 * Comments refer to the status for using certificates. Status can be
 * different for writing certificates or reading CRLs or CSRs.
 */

Marco MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER

#define MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER     (1 << 1)


      

Marco MBEDTLS_X509_EXT_KEY_USAGE

#define MBEDTLS_X509_EXT_KEY_USAGE                  (1 << 2)


      

Marco MBEDTLS_X509_EXT_CERTIFICATE_POLICIES

#define MBEDTLS_X509_EXT_CERTIFICATE_POLICIES       (1 << 3)


      

Marco MBEDTLS_X509_EXT_POLICY_MAPPINGS

#define MBEDTLS_X509_EXT_POLICY_MAPPINGS            (1 << 4)


      

Marco MBEDTLS_X509_EXT_SUBJECT_ALT_NAME

#define MBEDTLS_X509_EXT_SUBJECT_ALT_NAME           (1 << 5)   /* Supported (DNS) */


      

Marco MBEDTLS_X509_EXT_ISSUER_ALT_NAME

#define MBEDTLS_X509_EXT_ISSUER_ALT_NAME            (1 << 6)


      

Marco MBEDTLS_X509_EXT_SUBJECT_DIRECTORY_ATTRS

#define MBEDTLS_X509_EXT_SUBJECT_DIRECTORY_ATTRS    (1 << 7)


      

Marco MBEDTLS_X509_EXT_BASIC_CONSTRAINTS

#define MBEDTLS_X509_EXT_BASIC_CONSTRAINTS          (1 << 8)   /* Supported */


      

Marco MBEDTLS_X509_EXT_NAME_CONSTRAINTS

#define MBEDTLS_X509_EXT_NAME_CONSTRAINTS           (1 << 9)


      

Marco MBEDTLS_X509_EXT_POLICY_CONSTRAINTS

#define MBEDTLS_X509_EXT_POLICY_CONSTRAINTS         (1 << 10)


      

Marco MBEDTLS_X509_EXT_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_EXT_EXTENDED_KEY_USAGE         (1 << 11)


      

Marco MBEDTLS_X509_EXT_CRL_DISTRIBUTION_POINTS

#define MBEDTLS_X509_EXT_CRL_DISTRIBUTION_POINTS    (1 << 12)


      

Marco MBEDTLS_X509_EXT_INIHIBIT_ANYPOLICY

#define MBEDTLS_X509_EXT_INIHIBIT_ANYPOLICY         (1 << 13)


      

Marco MBEDTLS_X509_EXT_FRESHEST_CRL

#define MBEDTLS_X509_EXT_FRESHEST_CRL               (1 << 14)


      

Marco MBEDTLS_X509_EXT_NS_CERT_TYPE

#define MBEDTLS_X509_EXT_NS_CERT_TYPE               (1 << 16)


      

Marco MBEDTLS_X509_FORMAT_DER

#define MBEDTLS_X509_FORMAT_DER                1
/*
 * Storage format identifiers
 * Recognized formats: PEM and DER
 */

Marco MBEDTLS_X509_FORMAT_PEM

#define MBEDTLS_X509_FORMAT_PEM                2


      

Marco MBEDTLS_X509_MAX_DN_NAME_SIZE

#define MBEDTLS_X509_MAX_DN_NAME_SIZE        256 /**< Maximum value size of a DN entry */


      

Marco MBEDTLS_X509_SAFE_SNPRINTF

#define MBEDTLS_X509_SAFE_SNPRINTF                         \
   do {                                                   \
       if( ret < 0 || (size_t) ret >= n )                 \
           return( MBEDTLS_ERR_X509_BUFFER_TOO_SMALL );   \
                                                           \
       n -= (size_t) ret;                                 \
       p += (size_t) ret;                                 \
   } while( 0 )


      

Marco MBEDTLS_X509_CRL_H

#define MBEDTLS_X509_CRL_H


      

Marco MBEDTLS_X509_CRT_H

#define MBEDTLS_X509_CRT_H


      

Marco MBEDTLS_X509_ID_FLAG( id )

#define MBEDTLS_X509_ID_FLAG( id )  ( 1 << ( (id) - 1 ) )
/**
 * Build flag from an algorithm/curve identifier (pk, md, ecp)
 * Since 0 is always XXX_NONE, ignore it.
 */

Marco MBEDTLS_X509_CRT_VERSION_1

#define MBEDTLS_X509_CRT_VERSION_1             0


      

Marco MBEDTLS_X509_CRT_VERSION_2

#define MBEDTLS_X509_CRT_VERSION_2             1


      

Marco MBEDTLS_X509_CRT_VERSION_3

#define MBEDTLS_X509_CRT_VERSION_3             2


      

Marco MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN

#define MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN 32


      

Marco MBEDTLS_X509_RFC5280_UTC_TIME_LEN

#define MBEDTLS_X509_RFC5280_UTC_TIME_LEN  15


      

Marco MBEDTLS_X509_MAX_FILE_PATH_LEN

#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512


      

Marco MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE

#define MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE ( MBEDTLS_X509_MAX_INTERMEDIATE_CA + 2 )
/**
 * Max size of verification chain: end-entity + intermediates + trusted root
 */

Marco MBEDTLS_X509_CSR_H

#define MBEDTLS_X509_CSR_H


      

Marco MBEDTLS_XTEA_H

#define MBEDTLS_XTEA_H


      

Marco MBEDTLS_XTEA_ENCRYPT

#define MBEDTLS_XTEA_ENCRYPT    1


      

Marco MBEDTLS_XTEA_DECRYPT

#define MBEDTLS_XTEA_DECRYPT    0


      

Marco MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH

#define MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH            -40 /**< The data input has an invalid length. */


      

Marco MBEDTLS_ERR_XTEA_HW_ACCEL_FAILED

#define MBEDTLS_ERR_XTEA_HW_ACCEL_FAILED                 -41 /**< XTEA hardware accelerator failed. */
/* MBEDTLS_ERR_XTEA_HW_ACCEL_FAILED is deprecated and should not be used. */

Marco TUYA_TLS_H

#define TUYA_TLS_H


      

Marco MBEDTLS_CONFIG_H_TY_DISABLE

#define MBEDTLS_CONFIG_H_TY_DISABLE


      

Marco MBEDTLS_CONFIG_H_TY_ECC_CLEINT_AUTH

#define MBEDTLS_CONFIG_H_TY_ECC_CLEINT_AUTH


      

Marco TUYA_ECP_MUL_COMB_OPTIM

#define TUYA_ECP_MUL_COMB_OPTIM 1		//打开ECP点乘优化
//#define TUYA_ECP_COMB_DEBUG 1				//打印预处理数据,新增曲线时需要

Marco TUYA_ECP_MUL_COMB_ROM_TABLES

#define TUYA_ECP_MUL_COMB_ROM_TABLES 1	//使用ROM代替RAM


      

Marco TUYA_TLS_DEBUG_THRDSHOLD

#define TUYA_TLS_DEBUG_THRDSHOLD   5		//TLS 调试等级
//#define MBEDTLS_ECP_FIXED_POINT_OPTIM      0	//调试性能使用

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING
/**
 * \def MBEDTLS_DEPRECATED_WARNING
 *
 * Mark deprecated functions so that they generate a warning if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * This only works with GCC and Clang. With other compilers, you may want to
 * use MBEDTLS_DEPRECATED_REMOVED
 *
 * Uncomment to get warnings on using deprecated functions.
 */

Marco MBEDTLS_AES_ALT

#define MBEDTLS_AES_ALT
/**
 * \def MBEDTLS_AES_ALT
 *
 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
 * alternate core implementation of a symmetric crypto, an arithmetic or hash
 * module (e.g. platform specific assembly optimized implementations). Keep
 * in mind that the function prototypes should remain the same.
 *
 * This replaces the whole module. If you only want to replace one of the
 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
 *
 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
 * provide the "struct mbedtls_aes_context" definition and omit the base
 * function declarations and implementations. "aes_alt.h" will be included from
 * "aes.h" to include the new function definitions.
 *
 * Uncomment a macro to enable alternate implementation of the corresponding
 * module.
 *
 * \warning   MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
 *            use constitutes a security risk. If possible, we recommend
 *            avoiding dependencies on them, and considering stronger message
 *            digests and ciphers instead.
 *
 */

Marco MBEDTLS_AES_ROM_TABLES

#define MBEDTLS_AES_ROM_TABLES
/**
 * \def MBEDTLS_AES_ROM_TABLES
 *
 * Use precomputed AES tables stored in ROM.
 *
 * Uncomment this macro to use precomputed AES tables stored in ROM.
 * Comment this macro to generate AES tables in RAM at runtime.
 *
 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
 * initialization time before the first AES operation can be performed.
 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
 * performance if ROM access is slower than RAM access.
 *
 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
 *
 */

Marco MBEDTLS_AES_FEWER_TABLES

#define MBEDTLS_AES_FEWER_TABLES
/**
 * \def MBEDTLS_AES_FEWER_TABLES
 *
 * Use less ROM/RAM for AES tables.
 *
 * Uncommenting this macro omits 75% of the AES tables from
 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
 * by computing their values on the fly during operations
 * (the tables are entry-wise rotations of one another).
 *
 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
 * by ~6kb but at the cost of more arithmetic operations during
 * runtime. Specifically, one has to compare 4 accesses within
 * different tables to 4 accesses with additional arithmetic
 * operations within the same table. The performance gain/loss
 * depends on the system and memory details.
 *
 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
 *
 */

Marco MBEDTLS_CAMELLIA_SMALL_MEMORY

#define MBEDTLS_CAMELLIA_SMALL_MEMORY
/**
 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
 *
 * Use less ROM for the Camellia implementation (saves about 768 bytes).
 *
 * Uncomment this macro to use less memory for Camellia.
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP192R1_ENABLED

#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
/**
 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
 *
 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
 * module.  By default all supported curves are enabled.
 *
 * Comment macros to disable the curve and functions for it
 */

Marco MBEDTLS_ECP_DP_SECP224R1_ENABLED

#define MBEDTLS_ECP_DP_SECP224R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP384R1_ENABLED

#define MBEDTLS_ECP_DP_SECP384R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP521R1_ENABLED

#define MBEDTLS_ECP_DP_SECP521R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP192K1_ENABLED

#define MBEDTLS_ECP_DP_SECP192K1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP224K1_ENABLED

#define MBEDTLS_ECP_DP_SECP224K1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP256K1_ENABLED

#define MBEDTLS_ECP_DP_SECP256K1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP256R1_ENABLED

#define MBEDTLS_ECP_DP_BP256R1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP384R1_ENABLED

#define MBEDTLS_ECP_DP_BP384R1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP512R1_ENABLED

#define MBEDTLS_ECP_DP_BP512R1_ENABLED


      

Marco MBEDTLS_ECP_DP_CURVE25519_ENABLED

#define MBEDTLS_ECP_DP_CURVE25519_ENABLED


      

Marco MBEDTLS_ECP_DP_CURVE448_ENABLED

#define MBEDTLS_ECP_DP_CURVE448_ENABLED


      

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_PSK_ENABLED

#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
 *
 * Enable the PSK based ciphersuite modes in SSL / TLS.
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
 *
 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
 *           MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
 *
 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C,
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_PK_PARSE_EC_EXTENDED

#define MBEDTLS_PK_PARSE_EC_EXTENDED
/**
 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
 *
 * Enhance support for reading EC keys using variants of SEC1 not allowed by
 * RFC 5915 and RFC 5480.
 *
 * Currently this means parsing the SpecifiedECDomain choice of EC
 * parameters (only known groups are supported, not arbitrary domains, to
 * avoid validation issues).
 *
 * Disable if you only need to support RFC 5915 + 5480 key formats.
 */

Marco MBEDTLS_GENPRIME

#define MBEDTLS_GENPRIME
/**
 * \def MBEDTLS_GENPRIME
 *
 * Enable the prime-number generation code.
 *
 * Requires: MBEDTLS_BIGNUM_C
 */

Marco MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES

#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
/**
 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
 *
 * Do not add default entropy sources. These are the platform specific,
 * mbedtls_timing_hardclock and HAVEGE based poll functions.
 *
 * This is useful to have more control over the added entropy sources in an
 * application.
 *
 * Uncomment this macro to prevent loading of default entropy functions.
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_PK_RSA_ALT_SUPPORT

#define MBEDTLS_PK_RSA_ALT_SUPPORT
/**
 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
 *
 * Support external private RSA keys (eg from a HSM) in the PK layer.
 *
 * Comment this macro to disable support for external private RSA keys.
 */

Marco MBEDTLS_PKCS1_V15

#define MBEDTLS_PKCS1_V15
/**
 * \def MBEDTLS_PKCS1_V15
 *
 * Enable support for PKCS#1 v1.5 encoding.
 *
 * Requires: MBEDTLS_RSA_C
 *
 * This enables support for PKCS#1 v1.5 operations.
 */

Marco MBEDTLS_PKCS1_V21

#define MBEDTLS_PKCS1_V21
/**
 * \def MBEDTLS_PKCS1_V21
 *
 * Enable support for PKCS#1 v2.1 encoding.
 *
 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
 *
 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_FALLBACK_SCSV

#define MBEDTLS_SSL_FALLBACK_SCSV
/**
 * \def MBEDTLS_SSL_FALLBACK_SCSV
 *
 * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00).
 *
 * For servers, it is recommended to always enable this, unless you support
 * only one version of TLS, or know for sure that none of your clients
 * implements a fallback strategy.
 *
 * For clients, you only need this if you're using a fallback strategy, which
 * is not recommended in the first place, unless you absolutely need it to
 * interoperate with buggy (version-intolerant) servers.
 *
 * Comment this macro to disable support for FALLBACK_SCSV
 */

Marco MBEDTLS_SSL_MAX_FRAGMENT_LENGTH

#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
/**
 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
 *
 * Enable support for RFC 6066 max_fragment_length extension in SSL.
 *
 * Comment this macro to disable support for the max_fragment_length extension
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_SESSION_TICKETS

#define MBEDTLS_SSL_SESSION_TICKETS


      

Marco MBEDTLS_SSL_SERVER_NAME_INDICATION

#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/**
 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
 *
 * Enable support for RFC 6066 server name indication (SNI) in SSL.
 *
 * Requires: MBEDTLS_X509_CRT_PARSE_C
 *
 * Comment this macro to disable support for server name indication in SSL
 */

Marco MBEDTLS_X509_CHECK_KEY_USAGE

#define MBEDTLS_X509_CHECK_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_KEY_USAGE
 *
 * Enable verification of the keyUsage extension (CA and leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused
 * (intermediate) CA and leaf certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip keyUsage checking for both CA and leaf certificates.
 */

Marco MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
 *
 * Enable verification of the extendedKeyUsage extension (leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip extendedKeyUsage checking for certificates.
 */

Marco MBEDTLS_X509_RSASSA_PSS_SUPPORT

#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
/**
 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
 *
 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
 *
 * Comment this macro to disallow using RSASSA-PSS in certificates.
 */

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C
/**
 * \def MBEDTLS_ASN1_PARSE_C
 *
 * Enable the generic ASN1 parser.
 *
 * Module:  library/asn1.c
 * Caller:  library/x509.c
 *          library/dhm.c
 *          library/pkcs12.c
 *          library/pkcs5.c
 *          library/pkparse.c
 */

Marco MBEDTLS_ASN1_WRITE_C

#define MBEDTLS_ASN1_WRITE_C
/**
 * \def MBEDTLS_ASN1_WRITE_C
 *
 * Enable the generic ASN1 writer.
 *
 * Module:  library/asn1write.c
 * Caller:  library/ecdsa.c
 *          library/pkwrite.c
 *          library/x509_create.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 */

Marco MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C
/**
 * \def MBEDTLS_BASE64_C
 *
 * Enable the Base64 module.
 *
 * Module:  library/base64.c
 * Caller:  library/pem.c
 *
 * This module is required for PEM support (required by X.509).
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CCM_C

#define MBEDTLS_CCM_C
/**
 * \def MBEDTLS_CCM_C
 *
 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
 *
 * Module:  library/ccm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-CCM ciphersuites, if other requisites are
 * enabled as well.
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C
/**
 * \def MBEDTLS_ECDH_C
 *
 * Enable the elliptic curve Diffie-Hellman library.
 *
 * Module:  library/ecdh.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
 *
 * Requires: MBEDTLS_ECP_C
 */

Marco MBEDTLS_ECDSA_C

#define MBEDTLS_ECDSA_C
/**
 * \def MBEDTLS_ECDSA_C
 *
 * Enable the elliptic curve DSA library.
 *
 * Module:  library/ecdsa.c
 * Caller:
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA
 *
 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
 */

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_GCM_C

#define MBEDTLS_GCM_C
/**
 * \def MBEDTLS_GCM_C
 *
 * Enable the Galois/Counter Mode (GCM) for AES.
 *
 * Module:  library/gcm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
 * requisites are enabled as well.
 */

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_OID_C

#define MBEDTLS_OID_C
/**
 * \def MBEDTLS_OID_C
 *
 * Enable the OID database.
 *
 * Module:  library/oid.c
 * Caller:  library/asn1write.c
 *          library/pkcs5.c
 *          library/pkparse.c
 *          library/pkwrite.c
 *          library/rsa.c
 *          library/x509.c
 *          library/x509_create.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * This modules translates between OIDs and internal values.
 */

Marco MBEDTLS_PEM_PARSE_C

#define MBEDTLS_PEM_PARSE_C
/**
 * \def MBEDTLS_PEM_PARSE_C
 *
 * Enable PEM decoding / parsing.
 *
 * Module:  library/pem.c
 * Caller:  library/dhm.c
 *          library/pkparse.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_BASE64_C
 *
 * This modules adds support for decoding / parsing PEM files.
 */

Marco MBEDTLS_PK_C

#define MBEDTLS_PK_C
/**
 * \def MBEDTLS_PK_C
 *
 * Enable the generic public (asymetric) key layer.
 *
 * Module:  library/pk.c
 * Caller:  library/ssl_tls.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
 *
 * Uncomment to enable generic public key wrappers.
 */

Marco MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C
/**
 * \def MBEDTLS_PK_PARSE_C
 *
 * Enable the generic public (asymetric) key parser.
 *
 * Module:  library/pkparse.c
 * Caller:  library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key parse functions.
 */

Marco MBEDTLS_PK_WRITE_C

#define MBEDTLS_PK_WRITE_C
/**
 * \def MBEDTLS_PK_WRITE_C
 *
 * Enable the generic public (asymetric) key writer.
 *
 * Module:  library/pkwrite.c
 * Caller:  library/x509write.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key write functions.
 */

Marco MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C
/**
 * \def MBEDTLS_PKCS5_C
 *
 * Enable PKCS#5 functions.
 *
 * Module:  library/pkcs5.c
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the PKCS#5 functions.
 */

Marco MBEDTLS_PKCS12_C

#define MBEDTLS_PKCS12_C
/**
 * \def MBEDTLS_PKCS12_C
 *
 * Enable PKCS#12 PBE functions.
 * Adds algorithms for parsing PKCS#8 encrypted private keys
 *
 * Module:  library/pkcs12.c
 * Caller:  library/pkparse.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 * Can use:  MBEDTLS_ARC4_C
 *
 * This module enables PKCS#12 functions.
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_RSA_C

#define MBEDTLS_RSA_C
/**
 * \def MBEDTLS_RSA_C
 *
 * Enable the RSA public-key cryptosystem.
 *
 * Module:  library/rsa.c
 *          library/rsa_internal.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509.c
 *
 * This module is used by the following key exchanges:
 *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C


      

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SHA512_C

#define MBEDTLS_SHA512_C
/**
 * \def MBEDTLS_SHA512_C
 *
 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
 *
 * Module:  library/sha512.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module adds support for SHA-384 and SHA-512.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_VERSION_C

#define MBEDTLS_VERSION_C
/**
 * \def MBEDTLS_VERSION_C
 *
 * Enable run-time version information.
 *
 * Module:  library/version.c
 *
 * This module provides run-time version information.
 */

Marco MBEDTLS_X509_USE_C

#define MBEDTLS_X509_USE_C
/**
 * \def MBEDTLS_X509_USE_C
 *
 * Enable X.509 core for using certificates.
 *
 * Module:  library/x509.c
 * Caller:  library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
 *           MBEDTLS_PK_PARSE_C
 *
 * This module is required for the X.509 parsing modules.
 */

Marco MBEDTLS_X509_CRT_PARSE_C

#define MBEDTLS_X509_CRT_PARSE_C
/**
 * \def MBEDTLS_X509_CRT_PARSE_C
 *
 * Enable X.509 certificate parsing.
 *
 * Module:  library/x509_crt.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is required for X.509 certificate parsing.
 */

Marco MBEDTLS_X509_CSR_PARSE_C

#define MBEDTLS_X509_CSR_PARSE_C
/**
 * \def MBEDTLS_X509_CSR_PARSE_C
 *
 * Enable X.509 Certificate Signing Request (CSR) parsing.
 *
 * Module:  library/x509_csr.c
 * Caller:  library/x509_crt_write.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is used for reading X.509 certificate request.
 */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            5200 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_SSL_CIPHERSUITES

#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
/**
 * Complete list of ciphersuites to use, in order of preference.
 *
 * \warning No dependency checking is done on that field! This option can only
 * be used to restrict the set of available ciphersuites. It is your
 * responsibility to make sure the needed modules are active.
 *
 * Use this to save a few hundred bytes of ROM (default ordering of all
 * available ciphersuites) and a few to a few hundred bytes of RAM.
 *
 * The value below is only an example, not the default.
 */

Marco MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE

#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
/**
 * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
 * signature and ciphersuite selection. Without this build-time option, SHA-1
 * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
 * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
 * default. At the time of writing, there is no practical attack on the use
 * of SHA-1 in handshake signatures, hence this option is turned on by default
 * to preserve compatibility with existing peers, but the general
 * warning applies nonetheless:
 *
 * \warning   SHA-1 is considered a weak message digest and its use constitutes
 *            a security risk. If possible, we recommend avoiding dependencies
 *            on it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_CONFIG_H_TY_ECC_ONLY

#define MBEDTLS_CONFIG_H_TY_ECC_ONLY


      

Marco TUYA_ECP_MUL_COMB_ROM_TABLES

#define TUYA_ECP_MUL_COMB_ROM_TABLES 1	//使用ROM代替RAM
//#define TUYA_ECP_MUL_COMB_OPTIM 1			//打开ECP点乘优化

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_HAVE_ASM

#define MBEDTLS_HAVE_ASM


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING
/**
 * \def MBEDTLS_DEPRECATED_WARNING
 *
 * Mark deprecated functions so that they generate a warning if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * This only works with GCC and Clang. With other compilers, you may want to
 * use MBEDTLS_DEPRECATED_REMOVED
 *
 * Uncomment to get warnings on using deprecated functions.
 */

Marco MBEDTLS_AES_ALT

#define MBEDTLS_AES_ALT
/**
 * \def MBEDTLS_AES_ALT
 *
 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
 * alternate core implementation of a symmetric crypto, an arithmetic or hash
 * module (e.g. platform specific assembly optimized implementations). Keep
 * in mind that the function prototypes should remain the same.
 *
 * This replaces the whole module. If you only want to replace one of the
 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
 *
 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
 * provide the "struct mbedtls_aes_context" definition and omit the base
 * function declarations and implementations. "aes_alt.h" will be included from
 * "aes.h" to include the new function definitions.
 *
 * Uncomment a macro to enable alternate implementation of the corresponding
 * module.
 *
 * \warning   MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
 *            use constitutes a security risk. If possible, we recommend
 *            avoiding dependencies on them, and considering stronger message
 *            digests and ciphers instead.
 *
 */

Marco MBEDTLS_AES_ROM_TABLES

#define MBEDTLS_AES_ROM_TABLES
/**
 * \def MBEDTLS_AES_ROM_TABLES
 *
 * Use precomputed AES tables stored in ROM.
 *
 * Uncomment this macro to use precomputed AES tables stored in ROM.
 * Comment this macro to generate AES tables in RAM at runtime.
 *
 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
 * initialization time before the first AES operation can be performed.
 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
 * performance if ROM access is slower than RAM access.
 *
 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
 *
 */

Marco MBEDTLS_AES_FEWER_TABLES

#define MBEDTLS_AES_FEWER_TABLES
/**
 * \def MBEDTLS_AES_FEWER_TABLES
 *
 * Use less ROM/RAM for AES tables.
 *
 * Uncommenting this macro omits 75% of the AES tables from
 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
 * by computing their values on the fly during operations
 * (the tables are entry-wise rotations of one another).
 *
 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
 * by ~6kb but at the cost of more arithmetic operations during
 * runtime. Specifically, one has to compare 4 accesses within
 * different tables to 4 accesses with additional arithmetic
 * operations within the same table. The performance gain/loss
 * depends on the system and memory details.
 *
 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
 *
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
//#define MBEDTLS_ECP_DP_SECP224R1_ENABLED

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
 *
 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
 *           MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES

#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
/**
 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
 *
 * Do not add default entropy sources. These are the platform specific,
 * mbedtls_timing_hardclock and HAVEGE based poll functions.
 *
 * This is useful to have more control over the added entropy sources in an
 * application.
 *
 * Uncomment this macro to prevent loading of default entropy functions.
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_PKCS1_V15

#define MBEDTLS_PKCS1_V15
/**
 * \def MBEDTLS_PKCS1_V15
 *
 * Enable support for PKCS#1 v1.5 encoding.
 *
 * Requires: MBEDTLS_RSA_C
 *
 * This enables support for PKCS#1 v1.5 operations.
 */

Marco MBEDTLS_PKCS1_V21

#define MBEDTLS_PKCS1_V21
/**
 * \def MBEDTLS_PKCS1_V21
 *
 * Enable support for PKCS#1 v2.1 encoding.
 *
 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
 *
 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_SESSION_TICKETS

#define MBEDTLS_SSL_SESSION_TICKETS


      

Marco MBEDTLS_SSL_SERVER_NAME_INDICATION

#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/**
 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
 *
 * Enable support for RFC 6066 server name indication (SNI) in SSL.
 *
 * Requires: MBEDTLS_X509_CRT_PARSE_C
 *
 * Comment this macro to disable support for server name indication in SSL
 */

Marco MBEDTLS_X509_CHECK_KEY_USAGE

#define MBEDTLS_X509_CHECK_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_KEY_USAGE
 *
 * Enable verification of the keyUsage extension (CA and leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused
 * (intermediate) CA and leaf certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip keyUsage checking for both CA and leaf certificates.
 */

Marco MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
 *
 * Enable verification of the extendedKeyUsage extension (leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip extendedKeyUsage checking for certificates.
 */

Marco MBEDTLS_X509_RSASSA_PSS_SUPPORT

#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
/**
 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
 *
 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
 *
 * Comment this macro to disallow using RSASSA-PSS in certificates.
 */

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C
/**
 * \def MBEDTLS_ASN1_PARSE_C
 *
 * Enable the generic ASN1 parser.
 *
 * Module:  library/asn1.c
 * Caller:  library/x509.c
 *          library/dhm.c
 *          library/pkcs12.c
 *          library/pkcs5.c
 *          library/pkparse.c
 */

Marco MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C
/**
 * \def MBEDTLS_BASE64_C
 *
 * Enable the Base64 module.
 *
 * Module:  library/base64.c
 * Caller:  library/pem.c
 *
 * This module is required for PEM support (required by X.509).
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CCM_C

#define MBEDTLS_CCM_C
/**
 * \def MBEDTLS_CCM_C
 *
 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
 *
 * Module:  library/ccm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-CCM ciphersuites, if other requisites are
 * enabled as well.
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C
/**
 * \def MBEDTLS_ECDH_C
 *
 * Enable the elliptic curve Diffie-Hellman library.
 *
 * Module:  library/ecdh.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
 *
 * Requires: MBEDTLS_ECP_C
 */

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_GCM_C

#define MBEDTLS_GCM_C
/**
 * \def MBEDTLS_GCM_C
 *
 * Enable the Galois/Counter Mode (GCM) for AES.
 *
 * Module:  library/gcm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
 * requisites are enabled as well.
 */

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_OID_C

#define MBEDTLS_OID_C
/**
 * \def MBEDTLS_OID_C
 *
 * Enable the OID database.
 *
 * Module:  library/oid.c
 * Caller:  library/asn1write.c
 *          library/pkcs5.c
 *          library/pkparse.c
 *          library/pkwrite.c
 *          library/rsa.c
 *          library/x509.c
 *          library/x509_create.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * This modules translates between OIDs and internal values.
 */

Marco MBEDTLS_PK_C

#define MBEDTLS_PK_C
/**
 * \def MBEDTLS_PK_C
 *
 * Enable the generic public (asymetric) key layer.
 *
 * Module:  library/pk.c
 * Caller:  library/ssl_tls.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
 *
 * Uncomment to enable generic public key wrappers.
 */

Marco MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C
/**
 * \def MBEDTLS_PK_PARSE_C
 *
 * Enable the generic public (asymetric) key parser.
 *
 * Module:  library/pkparse.c
 * Caller:  library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key parse functions.
 */

Marco MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C
/**
 * \def MBEDTLS_PKCS5_C
 *
 * Enable PKCS#5 functions.
 *
 * Module:  library/pkcs5.c
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the PKCS#5 functions.
 */

Marco MBEDTLS_PKCS12_C

#define MBEDTLS_PKCS12_C
/**
 * \def MBEDTLS_PKCS12_C
 *
 * Enable PKCS#12 PBE functions.
 * Adds algorithms for parsing PKCS#8 encrypted private keys
 *
 * Module:  library/pkcs12.c
 * Caller:  library/pkparse.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 * Can use:  MBEDTLS_ARC4_C
 *
 * This module enables PKCS#12 functions.
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_RSA_C

#define MBEDTLS_RSA_C
/**
 * \def MBEDTLS_RSA_C
 *
 * Enable the RSA public-key cryptosystem.
 *
 * Module:  library/rsa.c
 *          library/rsa_internal.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509.c
 *
 * This module is used by the following key exchanges:
 *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C
/**
 * \def MBEDTLS_SHA1_C
 *
 * Enable the SHA1 cryptographic hash algorithm.
 *
 * Module:  library/sha1.c
 * Caller:  library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509write_crt.c
 *
 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
 * depending on the handshake parameters, and for SHA1-signed certificates.
 *
 * \warning   SHA-1 is considered a weak message digest and its use constitutes
 *            a security risk. If possible, we recommend avoiding dependencies
 *            on it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SHA512_C

#define MBEDTLS_SHA512_C
/**
 * \def MBEDTLS_SHA512_C
 *
 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
 *
 * Module:  library/sha512.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module adds support for SHA-384 and SHA-512.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_VERSION_C

#define MBEDTLS_VERSION_C
/**
 * \def MBEDTLS_VERSION_C
 *
 * Enable run-time version information.
 *
 * Module:  library/version.c
 *
 * This module provides run-time version information.
 */

Marco MBEDTLS_X509_USE_C

#define MBEDTLS_X509_USE_C
/**
 * \def MBEDTLS_X509_USE_C
 *
 * Enable X.509 core for using certificates.
 *
 * Module:  library/x509.c
 * Caller:  library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
 *           MBEDTLS_PK_PARSE_C
 *
 * This module is required for the X.509 parsing modules.
 */

Marco MBEDTLS_X509_CRT_PARSE_C

#define MBEDTLS_X509_CRT_PARSE_C
/**
 * \def MBEDTLS_X509_CRT_PARSE_C
 *
 * Enable X.509 certificate parsing.
 *
 * Module:  library/x509_crt.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is required for X.509 certificate parsing.
 */

Marco MBEDTLS_MPI_WINDOW_SIZE

#define MBEDTLS_MPI_WINDOW_SIZE          1 /**< Maximum windows size used. */
/* MPI / BIGNUM options */

Marco MBEDTLS_MPI_MAX_SIZE

#define MBEDTLS_MPI_MAX_SIZE           1024 /**< Maximum number of bytes for usable MPIs. */


      

Marco MBEDTLS_ECP_MAX_BITS

#define MBEDTLS_ECP_MAX_BITS            256 /**< Maximum bit size of groups */
/* ECP options */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_CONFIG_H_TY_ECC_ONLY

#define MBEDTLS_CONFIG_H_TY_ECC_ONLY


      

Marco TUYA_ECP_MUL_COMB_ROM_TABLES

#define TUYA_ECP_MUL_COMB_ROM_TABLES 1	//使用ROM代替RAM
//#define TUYA_ECP_MUL_COMB_OPTIM 1			//打开ECP点乘优化

Marco TUYA_TLS_DEBUG_THRDSHOLD

#define TUYA_TLS_DEBUG_THRDSHOLD   1		//TLS 调试等级
//#define MBEDTLS_ECP_FIXED_POINT_OPTIM      0	//调试性能使用

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_HAVE_ASM

#define MBEDTLS_HAVE_ASM


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING
/**
 * \def MBEDTLS_DEPRECATED_WARNING
 *
 * Mark deprecated functions so that they generate a warning if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * This only works with GCC and Clang. With other compilers, you may want to
 * use MBEDTLS_DEPRECATED_REMOVED
 *
 * Uncomment to get warnings on using deprecated functions.
 */

Marco MBEDTLS_AES_ALT

#define MBEDTLS_AES_ALT
/**
 * \def MBEDTLS_AES_ALT
 *
 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
 * alternate core implementation of a symmetric crypto, an arithmetic or hash
 * module (e.g. platform specific assembly optimized implementations). Keep
 * in mind that the function prototypes should remain the same.
 *
 * This replaces the whole module. If you only want to replace one of the
 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
 *
 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
 * provide the "struct mbedtls_aes_context" definition and omit the base
 * function declarations and implementations. "aes_alt.h" will be included from
 * "aes.h" to include the new function definitions.
 *
 * Uncomment a macro to enable alternate implementation of the corresponding
 * module.
 *
 * \warning   MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
 *            use constitutes a security risk. If possible, we recommend
 *            avoiding dependencies on them, and considering stronger message
 *            digests and ciphers instead.
 *
 */

Marco MBEDTLS_AES_ROM_TABLES

#define MBEDTLS_AES_ROM_TABLES
/**
 * \def MBEDTLS_AES_ROM_TABLES
 *
 * Use precomputed AES tables stored in ROM.
 *
 * Uncomment this macro to use precomputed AES tables stored in ROM.
 * Comment this macro to generate AES tables in RAM at runtime.
 *
 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
 * initialization time before the first AES operation can be performed.
 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
 * performance if ROM access is slower than RAM access.
 *
 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
 *
 */

Marco MBEDTLS_AES_FEWER_TABLES

#define MBEDTLS_AES_FEWER_TABLES
/**
 * \def MBEDTLS_AES_FEWER_TABLES
 *
 * Use less ROM/RAM for AES tables.
 *
 * Uncommenting this macro omits 75% of the AES tables from
 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
 * by computing their values on the fly during operations
 * (the tables are entry-wise rotations of one another).
 *
 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
 * by ~6kb but at the cost of more arithmetic operations during
 * runtime. Specifically, one has to compare 4 accesses within
 * different tables to 4 accesses with additional arithmetic
 * operations within the same table. The performance gain/loss
 * depends on the system and memory details.
 *
 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
 *
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_MODE_CTR

#define MBEDTLS_CIPHER_MODE_CTR
/**
 * \def MBEDTLS_CIPHER_MODE_CTR
 *
 * Enable Counter Block Cipher mode (CTR) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
//#define MBEDTLS_ECP_DP_SECP224R1_ENABLED

Marco MBEDTLS_ECP_DP_CURVE25519_ENABLED

#define MBEDTLS_ECP_DP_CURVE25519_ENABLED
//#define MBEDTLS_ECP_DP_BP512R1_ENABLED

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
 *
 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
 *           MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES

#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
/**
 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
 *
 * Do not add default entropy sources. These are the platform specific,
 * mbedtls_timing_hardclock and HAVEGE based poll functions.
 *
 * This is useful to have more control over the added entropy sources in an
 * application.
 *
 * Uncomment this macro to prevent loading of default entropy functions.
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_PKCS1_V15

#define MBEDTLS_PKCS1_V15
/**
 * \def MBEDTLS_PKCS1_V15
 *
 * Enable support for PKCS#1 v1.5 encoding.
 *
 * Requires: MBEDTLS_RSA_C
 *
 * This enables support for PKCS#1 v1.5 operations.
 */

Marco MBEDTLS_PKCS1_V21

#define MBEDTLS_PKCS1_V21
/**
 * \def MBEDTLS_PKCS1_V21
 *
 * Enable support for PKCS#1 v2.1 encoding.
 *
 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
 *
 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_SESSION_TICKETS

#define MBEDTLS_SSL_SESSION_TICKETS


      

Marco MBEDTLS_SSL_SERVER_NAME_INDICATION

#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/**
 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
 *
 * Enable support for RFC 6066 server name indication (SNI) in SSL.
 *
 * Requires: MBEDTLS_X509_CRT_PARSE_C
 *
 * Comment this macro to disable support for server name indication in SSL
 */

Marco MBEDTLS_X509_CHECK_KEY_USAGE

#define MBEDTLS_X509_CHECK_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_KEY_USAGE
 *
 * Enable verification of the keyUsage extension (CA and leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused
 * (intermediate) CA and leaf certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip keyUsage checking for both CA and leaf certificates.
 */

Marco MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
 *
 * Enable verification of the extendedKeyUsage extension (leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip extendedKeyUsage checking for certificates.
 */

Marco MBEDTLS_X509_RSASSA_PSS_SUPPORT

#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
/**
 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
 *
 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
 *
 * Comment this macro to disallow using RSASSA-PSS in certificates.
 */

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C
/**
 * \def MBEDTLS_ASN1_PARSE_C
 *
 * Enable the generic ASN1 parser.
 *
 * Module:  library/asn1.c
 * Caller:  library/x509.c
 *          library/dhm.c
 *          library/pkcs12.c
 *          library/pkcs5.c
 *          library/pkparse.c
 */

Marco MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C
/**
 * \def MBEDTLS_BASE64_C
 *
 * Enable the Base64 module.
 *
 * Module:  library/base64.c
 * Caller:  library/pem.c
 *
 * This module is required for PEM support (required by X.509).
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CHACHA20_C

#define MBEDTLS_CHACHA20_C
/**
 * \def MBEDTLS_CHACHA20_C
 *
 * Enable the ChaCha20 stream cipher.
 *
 * Module:  library/chacha20.c
 */

Marco MBEDTLS_CHACHAPOLY_C

#define MBEDTLS_CHACHAPOLY_C
/**
 * \def MBEDTLS_CHACHAPOLY_C
 *
 * Enable the ChaCha20-Poly1305 AEAD algorithm.
 *
 * Module:  library/chachapoly.c
 *
 * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C
/**
 * \def MBEDTLS_ECDH_C
 *
 * Enable the elliptic curve Diffie-Hellman library.
 *
 * Module:  library/ecdh.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
 *
 * Requires: MBEDTLS_ECP_C
 */

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_GCM_C

#define MBEDTLS_GCM_C
/**
 * \def MBEDTLS_GCM_C
 *
 * Enable the Galois/Counter Mode (GCM) for AES.
 *
 * Module:  library/gcm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
 * requisites are enabled as well.
 */

Marco MBEDTLS_HKDF_C

#define MBEDTLS_HKDF_C
/**
 * \def MBEDTLS_HKDF_C
 *
 * Enable the HKDF algorithm (RFC 5869).
 *
 * Module:  library/hkdf.c
 * Caller:
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the Hashed Message Authentication Code
 * (HMAC)-based key derivation function (HKDF).
 */

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_OID_C

#define MBEDTLS_OID_C
/**
 * \def MBEDTLS_OID_C
 *
 * Enable the OID database.
 *
 * Module:  library/oid.c
 * Caller:  library/asn1write.c
 *          library/pkcs5.c
 *          library/pkparse.c
 *          library/pkwrite.c
 *          library/rsa.c
 *          library/x509.c
 *          library/x509_create.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * This modules translates between OIDs and internal values.
 */

Marco MBEDTLS_PK_C

#define MBEDTLS_PK_C
/**
 * \def MBEDTLS_PK_C
 *
 * Enable the generic public (asymetric) key layer.
 *
 * Module:  library/pk.c
 * Caller:  library/ssl_tls.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
 *
 * Uncomment to enable generic public key wrappers.
 */

Marco MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C
/**
 * \def MBEDTLS_PK_PARSE_C
 *
 * Enable the generic public (asymetric) key parser.
 *
 * Module:  library/pkparse.c
 * Caller:  library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key parse functions.
 */

Marco MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C
/**
 * \def MBEDTLS_PKCS5_C
 *
 * Enable PKCS#5 functions.
 *
 * Module:  library/pkcs5.c
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the PKCS#5 functions.
 */

Marco MBEDTLS_PKCS12_C

#define MBEDTLS_PKCS12_C
/**
 * \def MBEDTLS_PKCS12_C
 *
 * Enable PKCS#12 PBE functions.
 * Adds algorithms for parsing PKCS#8 encrypted private keys
 *
 * Module:  library/pkcs12.c
 * Caller:  library/pkparse.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 * Can use:  MBEDTLS_ARC4_C
 *
 * This module enables PKCS#12 functions.
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_POLY1305_C

#define MBEDTLS_POLY1305_C
/**
 * \def MBEDTLS_POLY1305_C
 *
 * Enable the Poly1305 MAC algorithm.
 *
 * Module:  library/poly1305.c
 * Caller:  library/chachapoly.c
 */

Marco MBEDTLS_RSA_C

#define MBEDTLS_RSA_C
/**
 * \def MBEDTLS_RSA_C
 *
 * Enable the RSA public-key cryptosystem.
 *
 * Module:  library/rsa.c
 *          library/rsa_internal.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509.c
 *
 * This module is used by the following key exchanges:
 *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C
/**
 * \def MBEDTLS_SHA1_C
 *
 * Enable the SHA1 cryptographic hash algorithm.
 *
 * Module:  library/sha1.c
 * Caller:  library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509write_crt.c
 *
 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
 * depending on the handshake parameters, and for SHA1-signed certificates.
 *
 * \warning   SHA-1 is considered a weak message digest and its use constitutes
 *            a security risk. If possible, we recommend avoiding dependencies
 *            on it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SHA512_C

#define MBEDTLS_SHA512_C
/**
 * \def MBEDTLS_SHA512_C
 *
 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
 *
 * Module:  library/sha512.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module adds support for SHA-384 and SHA-512.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_VERSION_C

#define MBEDTLS_VERSION_C
/**
 * \def MBEDTLS_VERSION_C
 *
 * Enable run-time version information.
 *
 * Module:  library/version.c
 *
 * This module provides run-time version information.
 */

Marco MBEDTLS_X509_USE_C

#define MBEDTLS_X509_USE_C
/**
 * \def MBEDTLS_X509_USE_C
 *
 * Enable X.509 core for using certificates.
 *
 * Module:  library/x509.c
 * Caller:  library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
 *           MBEDTLS_PK_PARSE_C
 *
 * This module is required for the X.509 parsing modules.
 */

Marco MBEDTLS_X509_CRT_PARSE_C

#define MBEDTLS_X509_CRT_PARSE_C
/**
 * \def MBEDTLS_X509_CRT_PARSE_C
 *
 * Enable X.509 certificate parsing.
 *
 * Module:  library/x509_crt.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is required for X.509 certificate parsing.
 */

Marco MBEDTLS_MPI_WINDOW_SIZE

#define MBEDTLS_MPI_WINDOW_SIZE          1 /**< Maximum windows size used. */
/* MPI / BIGNUM options */

Marco MBEDTLS_MPI_MAX_SIZE

#define MBEDTLS_MPI_MAX_SIZE           256 /**< Maximum number of bytes for usable MPIs. */


      

Marco MBEDTLS_ECP_MAX_BITS

#define MBEDTLS_ECP_MAX_BITS            256 /**< Maximum bit size of groups */
/* ECP options */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_CONFIG_H_TY_ECC_ONLY

#define MBEDTLS_CONFIG_H_TY_ECC_ONLY


      

Marco TUYA_ECP_MUL_COMB_ROM_TABLES

#define TUYA_ECP_MUL_COMB_ROM_TABLES 1	//使用ROM代替RAM
//#define TUYA_ECP_MUL_COMB_OPTIM 1			//打开ECP点乘优化

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING
/**
 * \def MBEDTLS_DEPRECATED_WARNING
 *
 * Mark deprecated functions so that they generate a warning if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * This only works with GCC and Clang. With other compilers, you may want to
 * use MBEDTLS_DEPRECATED_REMOVED
 *
 * Uncomment to get warnings on using deprecated functions.
 */

Marco MBEDTLS_CAMELLIA_SMALL_MEMORY

#define MBEDTLS_CAMELLIA_SMALL_MEMORY
/**
 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
 *
 * Use less ROM for the Camellia implementation (saves about 768 bytes).
 *
 * Uncomment this macro to use less memory for Camellia.
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP192R1_ENABLED

#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
/**
 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
 *
 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
 * module.  By default all supported curves are enabled.
 *
 * Comment macros to disable the curve and functions for it
 */

Marco MBEDTLS_ECP_DP_SECP224R1_ENABLED

#define MBEDTLS_ECP_DP_SECP224R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP384R1_ENABLED

#define MBEDTLS_ECP_DP_SECP384R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP521R1_ENABLED

#define MBEDTLS_ECP_DP_SECP521R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP192K1_ENABLED

#define MBEDTLS_ECP_DP_SECP192K1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP224K1_ENABLED

#define MBEDTLS_ECP_DP_SECP224K1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP256K1_ENABLED

#define MBEDTLS_ECP_DP_SECP256K1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP256R1_ENABLED

#define MBEDTLS_ECP_DP_BP256R1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP384R1_ENABLED

#define MBEDTLS_ECP_DP_BP384R1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP512R1_ENABLED

#define MBEDTLS_ECP_DP_BP512R1_ENABLED


      

Marco MBEDTLS_ECP_DP_CURVE25519_ENABLED

#define MBEDTLS_ECP_DP_CURVE25519_ENABLED


      

Marco MBEDTLS_ECP_DP_CURVE448_ENABLED

#define MBEDTLS_ECP_DP_CURVE448_ENABLED


      

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
 *
 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
 *           MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
 *
 * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C,
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED
 *
 * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
 *
 * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
 */

Marco MBEDTLS_PK_PARSE_EC_EXTENDED

#define MBEDTLS_PK_PARSE_EC_EXTENDED
/**
 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
 *
 * Enhance support for reading EC keys using variants of SEC1 not allowed by
 * RFC 5915 and RFC 5480.
 *
 * Currently this means parsing the SpecifiedECDomain choice of EC
 * parameters (only known groups are supported, not arbitrary domains, to
 * avoid validation issues).
 *
 * Disable if you only need to support RFC 5915 + 5480 key formats.
 */

Marco MBEDTLS_GENPRIME

#define MBEDTLS_GENPRIME
/**
 * \def MBEDTLS_GENPRIME
 *
 * Enable the prime-number generation code.
 *
 * Requires: MBEDTLS_BIGNUM_C
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_PK_RSA_ALT_SUPPORT

#define MBEDTLS_PK_RSA_ALT_SUPPORT
/**
 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
 *
 * Support external private RSA keys (eg from a HSM) in the PK layer.
 *
 * Comment this macro to disable support for external private RSA keys.
 */

Marco MBEDTLS_PKCS1_V15

#define MBEDTLS_PKCS1_V15
/**
 * \def MBEDTLS_PKCS1_V15
 *
 * Enable support for PKCS#1 v1.5 encoding.
 *
 * Requires: MBEDTLS_RSA_C
 *
 * This enables support for PKCS#1 v1.5 operations.
 */

Marco MBEDTLS_PKCS1_V21

#define MBEDTLS_PKCS1_V21
/**
 * \def MBEDTLS_PKCS1_V21
 *
 * Enable support for PKCS#1 v2.1 encoding.
 *
 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
 *
 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_FALLBACK_SCSV

#define MBEDTLS_SSL_FALLBACK_SCSV
/**
 * \def MBEDTLS_SSL_FALLBACK_SCSV
 *
 * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00).
 *
 * For servers, it is recommended to always enable this, unless you support
 * only one version of TLS, or know for sure that none of your clients
 * implements a fallback strategy.
 *
 * For clients, you only need this if you're using a fallback strategy, which
 * is not recommended in the first place, unless you absolutely need it to
 * interoperate with buggy (version-intolerant) servers.
 *
 * Comment this macro to disable support for FALLBACK_SCSV
 */

Marco MBEDTLS_SSL_PROTO_TLS1

#define MBEDTLS_SSL_PROTO_TLS1
/**
 * \def MBEDTLS_SSL_PROTO_TLS1
 *
 * Enable support for TLS 1.0.
 *
 * Requires: MBEDTLS_MD5_C
 *           MBEDTLS_SHA1_C
 *
 * Comment this macro to disable support for TLS 1.0
 */

Marco MBEDTLS_SSL_PROTO_TLS1_1

#define MBEDTLS_SSL_PROTO_TLS1_1
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_1
 *
 * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled).
 *
 * Requires: MBEDTLS_MD5_C
 *           MBEDTLS_SHA1_C
 *
 * Comment this macro to disable support for TLS 1.1 / DTLS 1.0
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_PROTO_DTLS

#define MBEDTLS_SSL_PROTO_DTLS
/**
 * \def MBEDTLS_SSL_PROTO_DTLS
 *
 * Enable support for DTLS (all available versions).
 *
 * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0,
 * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1_1
 *        or MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for DTLS
 */

Marco MBEDTLS_SSL_DTLS_HELLO_VERIFY

#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
/**
 * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY
 *
 * Enable support for HelloVerifyRequest on DTLS servers.
 *
 * This feature is highly recommended to prevent DTLS servers being used as
 * amplifiers in DoS attacks against other hosts. It should always be enabled
 * unless you know for sure amplification cannot be a problem in the
 * environment in which your server operates.
 *
 * \warning Disabling this can ba a security risk! (see above)
 *
 * Requires: MBEDTLS_SSL_PROTO_DTLS
 *
 * Comment this to disable support for HelloVerifyRequest.
 */

Marco MBEDTLS_SSL_DTLS_SRTP

#define MBEDTLS_SSL_DTLS_SRTP
/**
 * \def MBEDTLS_SSL_DTLS_SRTP
 *
 * Enable support for DTLS-SRTP, RFC5764
 *
 * Requires: MBEDTLS_SSL_PROTO_DTLS
 *
 * Comment this to disable support for DTLS-SRTP.
 */

Marco MBEDTLS_SSL_SESSION_TICKETS

#define MBEDTLS_SSL_SESSION_TICKETS


      

Marco MBEDTLS_SSL_SERVER_NAME_INDICATION

#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/**
 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
 *
 * Enable support for RFC 6066 server name indication (SNI) in SSL.
 *
 * Requires: MBEDTLS_X509_CRT_PARSE_C
 *
 * Comment this macro to disable support for server name indication in SSL
 */

Marco MBEDTLS_X509_CHECK_KEY_USAGE

#define MBEDTLS_X509_CHECK_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_KEY_USAGE
 *
 * Enable verification of the keyUsage extension (CA and leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused
 * (intermediate) CA and leaf certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip keyUsage checking for both CA and leaf certificates.
 */

Marco MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
 *
 * Enable verification of the extendedKeyUsage extension (leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip extendedKeyUsage checking for certificates.
 */

Marco MBEDTLS_X509_RSASSA_PSS_SUPPORT

#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
/**
 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
 *
 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
 *
 * Comment this macro to disallow using RSASSA-PSS in certificates.
 */

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_ARC4_C

#define MBEDTLS_ARC4_C
/**
 * \def MBEDTLS_ARC4_C
 *
 * Enable the ARCFOUR stream cipher.
 *
 * Module:  library/arc4.c
 * Caller:  library/cipher.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
 *      MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
 *
 * \warning   ARC4 is considered a weak cipher and its use constitutes a
 *            security risk. If possible, we recommend avoidng dependencies on
 *            it, and considering stronger ciphers instead.
 *
 */

Marco MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C
/**
 * \def MBEDTLS_ASN1_PARSE_C
 *
 * Enable the generic ASN1 parser.
 *
 * Module:  library/asn1.c
 * Caller:  library/x509.c
 *          library/dhm.c
 *          library/pkcs12.c
 *          library/pkcs5.c
 *          library/pkparse.c
 */

Marco MBEDTLS_ASN1_WRITE_C

#define MBEDTLS_ASN1_WRITE_C
/**
 * \def MBEDTLS_ASN1_WRITE_C
 *
 * Enable the generic ASN1 writer.
 *
 * Module:  library/asn1write.c
 * Caller:  library/ecdsa.c
 *          library/pkwrite.c
 *          library/x509_create.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 */

Marco MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C
/**
 * \def MBEDTLS_BASE64_C
 *
 * Enable the Base64 module.
 *
 * Module:  library/base64.c
 * Caller:  library/pem.c
 *
 * This module is required for PEM support (required by X.509).
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CCM_C

#define MBEDTLS_CCM_C
/**
 * \def MBEDTLS_CCM_C
 *
 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
 *
 * Module:  library/ccm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-CCM ciphersuites, if other requisites are
 * enabled as well.
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_CTR_DRBG_C

#define MBEDTLS_CTR_DRBG_C


      

Marco MBEDTLS_DHM_C

#define MBEDTLS_DHM_C
/**
 * \def MBEDTLS_DHM_C
 *
 * Enable the Diffie-Hellman-Merkle module.
 *
 * Module:  library/dhm.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      DHE-RSA, DHE-PSK
 *
 * \warning    Using DHE constitutes a security risk as it
 *             is not possible to validate custom DH parameters.
 *             If possible, it is recommended users should consider
 *             preferring other methods of key exchange.
 *             See dhm.h for more details.
 *
 */

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C
/**
 * \def MBEDTLS_ECDH_C
 *
 * Enable the elliptic curve Diffie-Hellman library.
 *
 * Module:  library/ecdh.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
 *
 * Requires: MBEDTLS_ECP_C
 */

Marco MBEDTLS_ECDSA_C

#define MBEDTLS_ECDSA_C
/**
 * \def MBEDTLS_ECDSA_C
 *
 * Enable the elliptic curve DSA library.
 *
 * Module:  library/ecdsa.c
 * Caller:
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA
 *
 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
 */

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_ENTROPY_C

#define MBEDTLS_ENTROPY_C
/**
 * \def MBEDTLS_ENTROPY_C
 *
 * Enable the platform-specific entropy code.
 *
 * Module:  library/entropy.c
 * Caller:
 *
 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
 *
 * This module provides a generic entropy pool
 */

Marco MBEDTLS_ERROR_C

#define MBEDTLS_ERROR_C
/**
 * \def MBEDTLS_ERROR_C
 *
 * Enable error code to error string conversion.
 *
 * Module:  library/error.c
 * Caller:
 *
 * This module enables mbedtls_strerror().
 */

Marco MBEDTLS_HAVEGE_C

#define MBEDTLS_HAVEGE_C


      

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_OID_C

#define MBEDTLS_OID_C
/**
 * \def MBEDTLS_OID_C
 *
 * Enable the OID database.
 *
 * Module:  library/oid.c
 * Caller:  library/asn1write.c
 *          library/pkcs5.c
 *          library/pkparse.c
 *          library/pkwrite.c
 *          library/rsa.c
 *          library/x509.c
 *          library/x509_create.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * This modules translates between OIDs and internal values.
 */

Marco MBEDTLS_PEM_PARSE_C

#define MBEDTLS_PEM_PARSE_C
/**
 * \def MBEDTLS_PEM_PARSE_C
 *
 * Enable PEM decoding / parsing.
 *
 * Module:  library/pem.c
 * Caller:  library/dhm.c
 *          library/pkparse.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_BASE64_C
 *
 * This modules adds support for decoding / parsing PEM files.
 */

Marco MBEDTLS_PEM_WRITE_C

#define MBEDTLS_PEM_WRITE_C
/**
 * \def MBEDTLS_PEM_WRITE_C
 *
 * Enable PEM encoding / writing.
 *
 * Module:  library/pem.c
 * Caller:  library/pkwrite.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * Requires: MBEDTLS_BASE64_C
 *
 * This modules adds support for encoding / writing PEM files.
 */

Marco MBEDTLS_PK_C

#define MBEDTLS_PK_C
/**
 * \def MBEDTLS_PK_C
 *
 * Enable the generic public (asymetric) key layer.
 *
 * Module:  library/pk.c
 * Caller:  library/ssl_tls.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
 *
 * Uncomment to enable generic public key wrappers.
 */

Marco MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C
/**
 * \def MBEDTLS_PK_PARSE_C
 *
 * Enable the generic public (asymetric) key parser.
 *
 * Module:  library/pkparse.c
 * Caller:  library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key parse functions.
 */

Marco MBEDTLS_PK_WRITE_C

#define MBEDTLS_PK_WRITE_C
/**
 * \def MBEDTLS_PK_WRITE_C
 *
 * Enable the generic public (asymetric) key writer.
 *
 * Module:  library/pkwrite.c
 * Caller:  library/x509write.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key write functions.
 */

Marco MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C
/**
 * \def MBEDTLS_PKCS5_C
 *
 * Enable PKCS#5 functions.
 *
 * Module:  library/pkcs5.c
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the PKCS#5 functions.
 */

Marco MBEDTLS_PKCS12_C

#define MBEDTLS_PKCS12_C
/**
 * \def MBEDTLS_PKCS12_C
 *
 * Enable PKCS#12 PBE functions.
 * Adds algorithms for parsing PKCS#8 encrypted private keys
 *
 * Module:  library/pkcs12.c
 * Caller:  library/pkparse.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 * Can use:  MBEDTLS_ARC4_C
 *
 * This module enables PKCS#12 functions.
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_RSA_C

#define MBEDTLS_RSA_C
/**
 * \def MBEDTLS_RSA_C
 *
 * Enable the RSA public-key cryptosystem.
 *
 * Module:  library/rsa.c
 *          library/rsa_internal.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509.c
 *
 * This module is used by the following key exchanges:
 *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C
//#if ((ENABLE_ECHO_SHOW ==1) || (ENABLE_CHROMECAST==1) || (TUYA_OPERATOR_TYPE == TUYA_OPERATOR_CMCC_ANDLINK) )

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SHA512_C

#define MBEDTLS_SHA512_C
/**
 * \def MBEDTLS_SHA512_C
 *
 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
 *
 * Module:  library/sha512.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module adds support for SHA-384 and SHA-512.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_SRV_C

#define MBEDTLS_SSL_SRV_C
/**
 * \def MBEDTLS_SSL_SRV_C
 *
 * Enable the SSL/TLS server code.
 *
 * Module:  library/ssl_srv.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS server support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_TIMING_C

#define MBEDTLS_TIMING_C


      

Marco MBEDTLS_VERSION_C

#define MBEDTLS_VERSION_C
/**
 * \def MBEDTLS_VERSION_C
 *
 * Enable run-time version information.
 *
 * Module:  library/version.c
 *
 * This module provides run-time version information.
 */

Marco MBEDTLS_X509_USE_C

#define MBEDTLS_X509_USE_C
/**
 * \def MBEDTLS_X509_USE_C
 *
 * Enable X.509 core for using certificates.
 *
 * Module:  library/x509.c
 * Caller:  library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
 *           MBEDTLS_PK_PARSE_C
 *
 * This module is required for the X.509 parsing modules.
 */

Marco MBEDTLS_X509_CRT_PARSE_C

#define MBEDTLS_X509_CRT_PARSE_C
/**
 * \def MBEDTLS_X509_CRT_PARSE_C
 *
 * Enable X.509 certificate parsing.
 *
 * Module:  library/x509_crt.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is required for X.509 certificate parsing.
 */

Marco MBEDTLS_X509_CSR_PARSE_C

#define MBEDTLS_X509_CSR_PARSE_C
/**
 * \def MBEDTLS_X509_CSR_PARSE_C
 *
 * Enable X.509 Certificate Signing Request (CSR) parsing.
 *
 * Module:  library/x509_csr.c
 * Caller:  library/x509_crt_write.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is used for reading X.509 certificate request.
 */

Marco MBEDTLS_X509_CREATE_C

#define MBEDTLS_X509_CREATE_C
/**
 * \def MBEDTLS_X509_CREATE_C
 *
 * Enable X.509 core for creating certificates.
 *
 * Module:  library/x509_create.c
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C
 *
 * This module is the basis for creating X.509 certificates and CSRs.
 */

Marco MBEDTLS_X509_CRT_WRITE_C

#define MBEDTLS_X509_CRT_WRITE_C
/**
 * \def MBEDTLS_X509_CRT_WRITE_C
 *
 * Enable creating X.509 certificates.
 *
 * Module:  library/x509_crt_write.c
 *
 * Requires: MBEDTLS_X509_CREATE_C
 *
 * This module is required for X.509 certificate creation.
 */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE

#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
/**
 * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
 * signature and ciphersuite selection. Without this build-time option, SHA-1
 * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
 * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
 * default. At the time of writing, there is no practical attack on the use
 * of SHA-1 in handshake signatures, hence this option is turned on by default
 * to preserve compatibility with existing peers, but the general
 * warning applies nonetheless:
 *
 * \warning   SHA-1 is considered a weak message digest and its use constitutes
 *            a security risk. If possible, we recommend avoiding dependencies
 *            on it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_CONFIG_H_TY_ECC_ONLY

#define MBEDTLS_CONFIG_H_TY_ECC_ONLY


      

Marco TUYA_ECP_MUL_COMB_ROM_TABLES

#define TUYA_ECP_MUL_COMB_ROM_TABLES 1	//使用ROM代替RAM
//#define TUYA_ECP_MUL_COMB_OPTIM 1			//打开ECP点乘优化

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_CIPHER_MODE_CTR

#define MBEDTLS_CIPHER_MODE_CTR


      

Marco MBEDTLS_CTR_DRBG_C

#define MBEDTLS_CTR_DRBG_C


      

Marco MBEDTLS_ENTROPY_C

#define MBEDTLS_ENTROPY_C


      

Marco MBEDTLS_PK_WRITE_C

#define MBEDTLS_PK_WRITE_C


      

Marco MBEDTLS_PEM_PARSE_C

#define MBEDTLS_PEM_PARSE_C


      

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
//#	define MBEDTLS_ENTROPY_HARDWARE_ALT

Marco MBEDTLS_ASN1_WRITE_C

#define MBEDTLS_ASN1_WRITE_C


      

Marco MBEDTLS_ECDSA_C

#define MBEDTLS_ECDSA_C


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING
/**
 * \def MBEDTLS_DEPRECATED_WARNING
 *
 * Mark deprecated functions so that they generate a warning if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * This only works with GCC and Clang. With other compilers, you may want to
 * use MBEDTLS_DEPRECATED_REMOVED
 *
 * Uncomment to get warnings on using deprecated functions.
 */

Marco MBEDTLS_AES_ROM_TABLES

#define MBEDTLS_AES_ROM_TABLES
/**
 * \def MBEDTLS_AES_ROM_TABLES
 *
 * Use precomputed AES tables stored in ROM.
 *
 * Uncomment this macro to use precomputed AES tables stored in ROM.
 * Comment this macro to generate AES tables in RAM at runtime.
 *
 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
 * initialization time before the first AES operation can be performed.
 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
 * performance if ROM access is slower than RAM access.
 *
 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
 *
 */

Marco MBEDTLS_AES_FEWER_TABLES

#define MBEDTLS_AES_FEWER_TABLES
/**
 * \def MBEDTLS_AES_FEWER_TABLES
 *
 * Use less ROM/RAM for AES tables.
 *
 * Uncommenting this macro omits 75% of the AES tables from
 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
 * by computing their values on the fly during operations
 * (the tables are entry-wise rotations of one another).
 *
 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
 * by ~6kb but at the cost of more arithmetic operations during
 * runtime. Specifically, one has to compare 4 accesses within
 * different tables to 4 accesses with additional arithmetic
 * operations within the same table. The performance gain/loss
 * depends on the system and memory details.
 *
 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
 *
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
//#define MBEDTLS_ECP_DP_SECP224R1_ENABLED

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
 *
 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
 *           MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES

#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
/**
 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
 *
 * Do not add default entropy sources. These are the platform specific,
 * mbedtls_timing_hardclock and HAVEGE based poll functions.
 *
 * This is useful to have more control over the added entropy sources in an
 * application.
 *
 * Uncomment this macro to prevent loading of default entropy functions.
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_PKCS1_V15

#define MBEDTLS_PKCS1_V15
/**
 * \def MBEDTLS_PKCS1_V15
 *
 * Enable support for PKCS#1 v1.5 encoding.
 *
 * Requires: MBEDTLS_RSA_C
 *
 * This enables support for PKCS#1 v1.5 operations.
 */

Marco MBEDTLS_PKCS1_V21

#define MBEDTLS_PKCS1_V21
/**
 * \def MBEDTLS_PKCS1_V21
 *
 * Enable support for PKCS#1 v2.1 encoding.
 *
 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
 *
 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_SESSION_TICKETS

#define MBEDTLS_SSL_SESSION_TICKETS


      

Marco MBEDTLS_SSL_SERVER_NAME_INDICATION

#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/**
 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
 *
 * Enable support for RFC 6066 server name indication (SNI) in SSL.
 *
 * Requires: MBEDTLS_X509_CRT_PARSE_C
 *
 * Comment this macro to disable support for server name indication in SSL
 */

Marco MBEDTLS_X509_CHECK_KEY_USAGE

#define MBEDTLS_X509_CHECK_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_KEY_USAGE
 *
 * Enable verification of the keyUsage extension (CA and leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused
 * (intermediate) CA and leaf certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip keyUsage checking for both CA and leaf certificates.
 */

Marco MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
 *
 * Enable verification of the extendedKeyUsage extension (leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip extendedKeyUsage checking for certificates.
 */

Marco MBEDTLS_X509_RSASSA_PSS_SUPPORT

#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
/**
 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
 *
 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
 *
 * Comment this macro to disallow using RSASSA-PSS in certificates.
 */

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C
/**
 * \def MBEDTLS_ASN1_PARSE_C
 *
 * Enable the generic ASN1 parser.
 *
 * Module:  library/asn1.c
 * Caller:  library/x509.c
 *          library/dhm.c
 *          library/pkcs12.c
 *          library/pkcs5.c
 *          library/pkparse.c
 */

Marco MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C
/**
 * \def MBEDTLS_BASE64_C
 *
 * Enable the Base64 module.
 *
 * Module:  library/base64.c
 * Caller:  library/pem.c
 *
 * This module is required for PEM support (required by X.509).
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CCM_C

#define MBEDTLS_CCM_C
/**
 * \def MBEDTLS_CCM_C
 *
 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
 *
 * Module:  library/ccm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-CCM ciphersuites, if other requisites are
 * enabled as well.
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C
/**
 * \def MBEDTLS_ECDH_C
 *
 * Enable the elliptic curve Diffie-Hellman library.
 *
 * Module:  library/ecdh.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
 *
 * Requires: MBEDTLS_ECP_C
 */

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_GCM_C

#define MBEDTLS_GCM_C
/**
 * \def MBEDTLS_GCM_C
 *
 * Enable the Galois/Counter Mode (GCM) for AES.
 *
 * Module:  library/gcm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
 * requisites are enabled as well.
 */

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_OID_C

#define MBEDTLS_OID_C
/**
 * \def MBEDTLS_OID_C
 *
 * Enable the OID database.
 *
 * Module:  library/oid.c
 * Caller:  library/asn1write.c
 *          library/pkcs5.c
 *          library/pkparse.c
 *          library/pkwrite.c
 *          library/rsa.c
 *          library/x509.c
 *          library/x509_create.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * This modules translates between OIDs and internal values.
 */

Marco MBEDTLS_PK_C

#define MBEDTLS_PK_C
/**
 * \def MBEDTLS_PK_C
 *
 * Enable the generic public (asymetric) key layer.
 *
 * Module:  library/pk.c
 * Caller:  library/ssl_tls.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
 *
 * Uncomment to enable generic public key wrappers.
 */

Marco MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C
/**
 * \def MBEDTLS_PK_PARSE_C
 *
 * Enable the generic public (asymetric) key parser.
 *
 * Module:  library/pkparse.c
 * Caller:  library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key parse functions.
 */

Marco MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C
/**
 * \def MBEDTLS_PKCS5_C
 *
 * Enable PKCS#5 functions.
 *
 * Module:  library/pkcs5.c
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the PKCS#5 functions.
 */

Marco MBEDTLS_PKCS12_C

#define MBEDTLS_PKCS12_C
/**
 * \def MBEDTLS_PKCS12_C
 *
 * Enable PKCS#12 PBE functions.
 * Adds algorithms for parsing PKCS#8 encrypted private keys
 *
 * Module:  library/pkcs12.c
 * Caller:  library/pkparse.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 * Can use:  MBEDTLS_ARC4_C
 *
 * This module enables PKCS#12 functions.
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_RSA_C

#define MBEDTLS_RSA_C
/**
 * \def MBEDTLS_RSA_C
 *
 * Enable the RSA public-key cryptosystem.
 *
 * Module:  library/rsa.c
 *          library/rsa_internal.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509.c
 *
 * This module is used by the following key exchanges:
 *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C


      

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SHA512_C

#define MBEDTLS_SHA512_C
/**
 * \def MBEDTLS_SHA512_C
 *
 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
 *
 * Module:  library/sha512.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module adds support for SHA-384 and SHA-512.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_VERSION_C

#define MBEDTLS_VERSION_C
/**
 * \def MBEDTLS_VERSION_C
 *
 * Enable run-time version information.
 *
 * Module:  library/version.c
 *
 * This module provides run-time version information.
 */

Marco MBEDTLS_X509_USE_C

#define MBEDTLS_X509_USE_C
/**
 * \def MBEDTLS_X509_USE_C
 *
 * Enable X.509 core for using certificates.
 *
 * Module:  library/x509.c
 * Caller:  library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
 *           MBEDTLS_PK_PARSE_C
 *
 * This module is required for the X.509 parsing modules.
 */

Marco MBEDTLS_X509_CRT_PARSE_C

#define MBEDTLS_X509_CRT_PARSE_C
/**
 * \def MBEDTLS_X509_CRT_PARSE_C
 *
 * Enable X.509 certificate parsing.
 *
 * Module:  library/x509_crt.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is required for X.509 certificate parsing.
 */

Marco MBEDTLS_MPI_WINDOW_SIZE

#define MBEDTLS_MPI_WINDOW_SIZE          1 /**< Maximum windows size used. */
/* MPI / BIGNUM options */

Marco MBEDTLS_MPI_MAX_SIZE

#define MBEDTLS_MPI_MAX_SIZE           256 /**< Maximum number of bytes for usable MPIs. */


      

Marco MBEDTLS_ECP_MAX_BITS

#define MBEDTLS_ECP_MAX_BITS            256 /**< Maximum bit size of groups */
/* ECP options */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            5200 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_CONFIG_H_TY_ECC_PSK

#define MBEDTLS_CONFIG_H_TY_ECC_PSK


      

Marco TUYA_ECP_MUL_COMB_OPTIM

#define TUYA_ECP_MUL_COMB_OPTIM 1		//打开ECP点乘优化
//#define TUYA_ECP_COMB_DEBUG 1				//打印预处理数据,新增曲线时需要

Marco TUYA_ECP_MUL_COMB_ROM_TABLES

#define TUYA_ECP_MUL_COMB_ROM_TABLES 1	//使用ROM代替RAM


      

Marco TUYA_TLS_DEBUG_THRDSHOLD

#define TUYA_TLS_DEBUG_THRDSHOLD   5		//TLS 调试等级
//#define MBEDTLS_ECP_FIXED_POINT_OPTIM      0	//调试性能使用

Marco TUYA_TLS_DYNAMIC_MEMORY_ALLOCATION

#define TUYA_TLS_DYNAMIC_MEMORY_ALLOCATION	1 //允许连接单独设置BUFF大小


      

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING
/**
 * \def MBEDTLS_DEPRECATED_WARNING
 *
 * Mark deprecated functions so that they generate a warning if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * This only works with GCC and Clang. With other compilers, you may want to
 * use MBEDTLS_DEPRECATED_REMOVED
 *
 * Uncomment to get warnings on using deprecated functions.
 */

Marco MBEDTLS_AES_ALT

#define MBEDTLS_AES_ALT
/**
 * \def MBEDTLS_AES_ALT
 *
 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
 * alternate core implementation of a symmetric crypto, an arithmetic or hash
 * module (e.g. platform specific assembly optimized implementations). Keep
 * in mind that the function prototypes should remain the same.
 *
 * This replaces the whole module. If you only want to replace one of the
 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
 *
 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
 * provide the "struct mbedtls_aes_context" definition and omit the base
 * function declarations and implementations. "aes_alt.h" will be included from
 * "aes.h" to include the new function definitions.
 *
 * Uncomment a macro to enable alternate implementation of the corresponding
 * module.
 *
 * \warning   MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
 *            use constitutes a security risk. If possible, we recommend
 *            avoiding dependencies on them, and considering stronger message
 *            digests and ciphers instead.
 *
 */

Marco MBEDTLS_AES_ROM_TABLES

#define MBEDTLS_AES_ROM_TABLES
/**
 * \def MBEDTLS_AES_ROM_TABLES
 *
 * Use precomputed AES tables stored in ROM.
 *
 * Uncomment this macro to use precomputed AES tables stored in ROM.
 * Comment this macro to generate AES tables in RAM at runtime.
 *
 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
 * initialization time before the first AES operation can be performed.
 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
 * performance if ROM access is slower than RAM access.
 *
 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
 *
 */

Marco MBEDTLS_AES_FEWER_TABLES

#define MBEDTLS_AES_FEWER_TABLES
/**
 * \def MBEDTLS_AES_FEWER_TABLES
 *
 * Use less ROM/RAM for AES tables.
 *
 * Uncommenting this macro omits 75% of the AES tables from
 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
 * by computing their values on the fly during operations
 * (the tables are entry-wise rotations of one another).
 *
 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
 * by ~6kb but at the cost of more arithmetic operations during
 * runtime. Specifically, one has to compare 4 accesses within
 * different tables to 4 accesses with additional arithmetic
 * operations within the same table. The performance gain/loss
 * depends on the system and memory details.
 *
 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
 *
 */

Marco MBEDTLS_CAMELLIA_SMALL_MEMORY

#define MBEDTLS_CAMELLIA_SMALL_MEMORY
/**
 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
 *
 * Use less ROM for the Camellia implementation (saves about 768 bytes).
 *
 * Uncomment this macro to use less memory for Camellia.
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP192R1_ENABLED

#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
/**
 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
 *
 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
 * module.  By default all supported curves are enabled.
 *
 * Comment macros to disable the curve and functions for it
 */

Marco MBEDTLS_ECP_DP_SECP224R1_ENABLED

#define MBEDTLS_ECP_DP_SECP224R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP384R1_ENABLED

#define MBEDTLS_ECP_DP_SECP384R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP521R1_ENABLED

#define MBEDTLS_ECP_DP_SECP521R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP192K1_ENABLED

#define MBEDTLS_ECP_DP_SECP192K1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP224K1_ENABLED

#define MBEDTLS_ECP_DP_SECP224K1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP256K1_ENABLED

#define MBEDTLS_ECP_DP_SECP256K1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP256R1_ENABLED

#define MBEDTLS_ECP_DP_BP256R1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP384R1_ENABLED

#define MBEDTLS_ECP_DP_BP384R1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP512R1_ENABLED

#define MBEDTLS_ECP_DP_BP512R1_ENABLED


      

Marco MBEDTLS_ECP_DP_CURVE25519_ENABLED

#define MBEDTLS_ECP_DP_CURVE25519_ENABLED


      

Marco MBEDTLS_ECP_DP_CURVE448_ENABLED

#define MBEDTLS_ECP_DP_CURVE448_ENABLED


      

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_PSK_ENABLED

#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
 *
 * Enable the PSK based ciphersuite modes in SSL / TLS.
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
 *
 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
 *           MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_PK_PARSE_EC_EXTENDED

#define MBEDTLS_PK_PARSE_EC_EXTENDED
/**
 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
 *
 * Enhance support for reading EC keys using variants of SEC1 not allowed by
 * RFC 5915 and RFC 5480.
 *
 * Currently this means parsing the SpecifiedECDomain choice of EC
 * parameters (only known groups are supported, not arbitrary domains, to
 * avoid validation issues).
 *
 * Disable if you only need to support RFC 5915 + 5480 key formats.
 */

Marco MBEDTLS_GENPRIME

#define MBEDTLS_GENPRIME
/**
 * \def MBEDTLS_GENPRIME
 *
 * Enable the prime-number generation code.
 *
 * Requires: MBEDTLS_BIGNUM_C
 */

Marco MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES

#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
/**
 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
 *
 * Do not add default entropy sources. These are the platform specific,
 * mbedtls_timing_hardclock and HAVEGE based poll functions.
 *
 * This is useful to have more control over the added entropy sources in an
 * application.
 *
 * Uncomment this macro to prevent loading of default entropy functions.
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_PK_RSA_ALT_SUPPORT

#define MBEDTLS_PK_RSA_ALT_SUPPORT
/**
 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
 *
 * Support external private RSA keys (eg from a HSM) in the PK layer.
 *
 * Comment this macro to disable support for external private RSA keys.
 */

Marco MBEDTLS_PKCS1_V15

#define MBEDTLS_PKCS1_V15
/**
 * \def MBEDTLS_PKCS1_V15
 *
 * Enable support for PKCS#1 v1.5 encoding.
 *
 * Requires: MBEDTLS_RSA_C
 *
 * This enables support for PKCS#1 v1.5 operations.
 */

Marco MBEDTLS_PKCS1_V21

#define MBEDTLS_PKCS1_V21
/**
 * \def MBEDTLS_PKCS1_V21
 *
 * Enable support for PKCS#1 v2.1 encoding.
 *
 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
 *
 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_FALLBACK_SCSV

#define MBEDTLS_SSL_FALLBACK_SCSV
/**
 * \def MBEDTLS_SSL_FALLBACK_SCSV
 *
 * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00).
 *
 * For servers, it is recommended to always enable this, unless you support
 * only one version of TLS, or know for sure that none of your clients
 * implements a fallback strategy.
 *
 * For clients, you only need this if you're using a fallback strategy, which
 * is not recommended in the first place, unless you absolutely need it to
 * interoperate with buggy (version-intolerant) servers.
 *
 * Comment this macro to disable support for FALLBACK_SCSV
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_SERVER_NAME_INDICATION

#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/**
 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
 *
 * Enable support for RFC 6066 server name indication (SNI) in SSL.
 *
 * Requires: MBEDTLS_X509_CRT_PARSE_C
 *
 * Comment this macro to disable support for server name indication in SSL
 */

Marco MBEDTLS_X509_CHECK_KEY_USAGE

#define MBEDTLS_X509_CHECK_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_KEY_USAGE
 *
 * Enable verification of the keyUsage extension (CA and leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused
 * (intermediate) CA and leaf certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip keyUsage checking for both CA and leaf certificates.
 */

Marco MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
 *
 * Enable verification of the extendedKeyUsage extension (leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip extendedKeyUsage checking for certificates.
 */

Marco MBEDTLS_X509_RSASSA_PSS_SUPPORT

#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
/**
 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
 *
 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
 *
 * Comment this macro to disallow using RSASSA-PSS in certificates.
 */

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C
/**
 * \def MBEDTLS_ASN1_PARSE_C
 *
 * Enable the generic ASN1 parser.
 *
 * Module:  library/asn1.c
 * Caller:  library/x509.c
 *          library/dhm.c
 *          library/pkcs12.c
 *          library/pkcs5.c
 *          library/pkparse.c
 */

Marco MBEDTLS_ASN1_WRITE_C

#define MBEDTLS_ASN1_WRITE_C
/**
 * \def MBEDTLS_ASN1_WRITE_C
 *
 * Enable the generic ASN1 writer.
 *
 * Module:  library/asn1write.c
 * Caller:  library/ecdsa.c
 *          library/pkwrite.c
 *          library/x509_create.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 */

Marco MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C
/**
 * \def MBEDTLS_BASE64_C
 *
 * Enable the Base64 module.
 *
 * Module:  library/base64.c
 * Caller:  library/pem.c
 *
 * This module is required for PEM support (required by X.509).
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CCM_C

#define MBEDTLS_CCM_C
/**
 * \def MBEDTLS_CCM_C
 *
 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
 *
 * Module:  library/ccm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-CCM ciphersuites, if other requisites are
 * enabled as well.
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_DHM_C

#define MBEDTLS_DHM_C
/**
 * \def MBEDTLS_DHM_C
 *
 * Enable the Diffie-Hellman-Merkle module.
 *
 * Module:  library/dhm.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      DHE-RSA, DHE-PSK
 *
 * \warning    Using DHE constitutes a security risk as it
 *             is not possible to validate custom DH parameters.
 *             If possible, it is recommended users should consider
 *             preferring other methods of key exchange.
 *             See dhm.h for more details.
 *
 */

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C
/**
 * \def MBEDTLS_ECDH_C
 *
 * Enable the elliptic curve Diffie-Hellman library.
 *
 * Module:  library/ecdh.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
 *
 * Requires: MBEDTLS_ECP_C
 */

Marco MBEDTLS_ECDSA_C

#define MBEDTLS_ECDSA_C
/**
 * \def MBEDTLS_ECDSA_C
 *
 * Enable the elliptic curve DSA library.
 *
 * Module:  library/ecdsa.c
 * Caller:
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA
 *
 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
 */

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_OID_C

#define MBEDTLS_OID_C
/**
 * \def MBEDTLS_OID_C
 *
 * Enable the OID database.
 *
 * Module:  library/oid.c
 * Caller:  library/asn1write.c
 *          library/pkcs5.c
 *          library/pkparse.c
 *          library/pkwrite.c
 *          library/rsa.c
 *          library/x509.c
 *          library/x509_create.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * This modules translates between OIDs and internal values.
 */

Marco MBEDTLS_PEM_PARSE_C

#define MBEDTLS_PEM_PARSE_C
/**
 * \def MBEDTLS_PEM_PARSE_C
 *
 * Enable PEM decoding / parsing.
 *
 * Module:  library/pem.c
 * Caller:  library/dhm.c
 *          library/pkparse.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_BASE64_C
 *
 * This modules adds support for decoding / parsing PEM files.
 */

Marco MBEDTLS_PK_C

#define MBEDTLS_PK_C
/**
 * \def MBEDTLS_PK_C
 *
 * Enable the generic public (asymetric) key layer.
 *
 * Module:  library/pk.c
 * Caller:  library/ssl_tls.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
 *
 * Uncomment to enable generic public key wrappers.
 */

Marco MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C
/**
 * \def MBEDTLS_PK_PARSE_C
 *
 * Enable the generic public (asymetric) key parser.
 *
 * Module:  library/pkparse.c
 * Caller:  library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key parse functions.
 */

Marco MBEDTLS_PK_WRITE_C

#define MBEDTLS_PK_WRITE_C
/**
 * \def MBEDTLS_PK_WRITE_C
 *
 * Enable the generic public (asymetric) key writer.
 *
 * Module:  library/pkwrite.c
 * Caller:  library/x509write.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key write functions.
 */

Marco MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C
/**
 * \def MBEDTLS_PKCS5_C
 *
 * Enable PKCS#5 functions.
 *
 * Module:  library/pkcs5.c
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the PKCS#5 functions.
 */

Marco MBEDTLS_PKCS12_C

#define MBEDTLS_PKCS12_C
/**
 * \def MBEDTLS_PKCS12_C
 *
 * Enable PKCS#12 PBE functions.
 * Adds algorithms for parsing PKCS#8 encrypted private keys
 *
 * Module:  library/pkcs12.c
 * Caller:  library/pkparse.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 * Can use:  MBEDTLS_ARC4_C
 *
 * This module enables PKCS#12 functions.
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_RSA_C

#define MBEDTLS_RSA_C
/**
 * \def MBEDTLS_RSA_C
 *
 * Enable the RSA public-key cryptosystem.
 *
 * Module:  library/rsa.c
 *          library/rsa_internal.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509.c
 *
 * This module is used by the following key exchanges:
 *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C


      

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SHA512_C

#define MBEDTLS_SHA512_C
/**
 * \def MBEDTLS_SHA512_C
 *
 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
 *
 * Module:  library/sha512.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module adds support for SHA-384 and SHA-512.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_VERSION_C

#define MBEDTLS_VERSION_C
/**
 * \def MBEDTLS_VERSION_C
 *
 * Enable run-time version information.
 *
 * Module:  library/version.c
 *
 * This module provides run-time version information.
 */

Marco MBEDTLS_X509_USE_C

#define MBEDTLS_X509_USE_C
/**
 * \def MBEDTLS_X509_USE_C
 *
 * Enable X.509 core for using certificates.
 *
 * Module:  library/x509.c
 * Caller:  library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
 *           MBEDTLS_PK_PARSE_C
 *
 * This module is required for the X.509 parsing modules.
 */

Marco MBEDTLS_X509_CRT_PARSE_C

#define MBEDTLS_X509_CRT_PARSE_C
/**
 * \def MBEDTLS_X509_CRT_PARSE_C
 *
 * Enable X.509 certificate parsing.
 *
 * Module:  library/x509_crt.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is required for X.509 certificate parsing.
 */

Marco MBEDTLS_X509_CSR_PARSE_C

#define MBEDTLS_X509_CSR_PARSE_C
/**
 * \def MBEDTLS_X509_CSR_PARSE_C
 *
 * Enable X.509 Certificate Signing Request (CSR) parsing.
 *
 * Module:  library/x509_csr.c
 * Caller:  library/x509_crt_write.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is used for reading X.509 certificate request.
 */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            1024 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_SSL_IN_CONTENT_LEN

#define MBEDTLS_SSL_IN_CONTENT_LEN (ssl->in_content_len)


      

Marco MBEDTLS_SSL_OUT_CONTENT_LEN

#define MBEDTLS_SSL_OUT_CONTENT_LEN (ssl->out_content_len)


      

Marco MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE

#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
/**
 * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
 * signature and ciphersuite selection. Without this build-time option, SHA-1
 * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
 * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
 * default. At the time of writing, there is no practical attack on the use
 * of SHA-1 in handshake signatures, hence this option is turned on by default
 * to preserve compatibility with existing peers, but the general
 * warning applies nonetheless:
 *
 * \warning   SHA-1 is considered a weak message digest and its use constitutes
 *            a security risk. If possible, we recommend avoiding dependencies
 *            on it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_CONFIG_H_CAT1_ONLY

#define MBEDTLS_CONFIG_H_CAT1_ONLY


      

Marco MBEDTLS_SSL_HANDSHAKE_FORCED_QUIT

#define MBEDTLS_SSL_HANDSHAKE_FORCED_QUIT


      

Marco TUYA_TLS_DEBUG_THRDSHOLD

#define TUYA_TLS_DEBUG_THRDSHOLD               5		//TLS 调试等级


      

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_AES_ALT

#define MBEDTLS_AES_ALT
/**
 * \def MBEDTLS_AES_ALT
 *
 * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your
 * alternate core implementation of a symmetric crypto, an arithmetic or hash
 * module (e.g. platform specific assembly optimized implementations). Keep
 * in mind that the function prototypes should remain the same.
 *
 * This replaces the whole module. If you only want to replace one of the
 * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags.
 *
 * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer
 * provide the "struct mbedtls_aes_context" definition and omit the base
 * function declarations and implementations. "aes_alt.h" will be included from
 * "aes.h" to include the new function definitions.
 *
 * Uncomment a macro to enable alternate implementation of the corresponding
 * module.
 *
 * \warning   MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their
 *            use constitutes a security risk. If possible, we recommend
 *            avoiding dependencies on them, and considering stronger message
 *            digests and ciphers instead.
 *
 */

Marco MBEDTLS_AES_ROM_TABLES

#define MBEDTLS_AES_ROM_TABLES
/**
 * \def MBEDTLS_AES_ROM_TABLES
 *
 * Use precomputed AES tables stored in ROM.
 *
 * Uncomment this macro to use precomputed AES tables stored in ROM.
 * Comment this macro to generate AES tables in RAM at runtime.
 *
 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
 * initialization time before the first AES operation can be performed.
 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
 * performance if ROM access is slower than RAM access.
 *
 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
 *
 */

Marco MBEDTLS_AES_FEWER_TABLES

#define MBEDTLS_AES_FEWER_TABLES
/**
 * \def MBEDTLS_AES_FEWER_TABLES
 *
 * Use less ROM/RAM for AES tables.
 *
 * Uncommenting this macro omits 75% of the AES tables from
 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
 * by computing their values on the fly during operations
 * (the tables are entry-wise rotations of one another).
 *
 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
 * by ~6kb but at the cost of more arithmetic operations during
 * runtime. Specifically, one has to compare 4 accesses within
 * different tables to 4 accesses with additional arithmetic
 * operations within the same table. The performance gain/loss
 * depends on the system and memory details.
 *
 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
 *
 */

Marco MBEDTLS_CAMELLIA_SMALL_MEMORY

#define MBEDTLS_CAMELLIA_SMALL_MEMORY
/**
 * \def MBEDTLS_CAMELLIA_SMALL_MEMORY
 *
 * Use less ROM for the Camellia implementation (saves about 768 bytes).
 *
 * Uncomment this macro to use less memory for Camellia.
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP192R1_ENABLED

#define MBEDTLS_ECP_DP_SECP192R1_ENABLED
/**
 * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED
 *
 * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve
 * module.  By default all supported curves are enabled.
 *
 * Comment macros to disable the curve and functions for it
 */

Marco MBEDTLS_ECP_DP_SECP224R1_ENABLED

#define MBEDTLS_ECP_DP_SECP224R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP384R1_ENABLED

#define MBEDTLS_ECP_DP_SECP384R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP521R1_ENABLED

#define MBEDTLS_ECP_DP_SECP521R1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP192K1_ENABLED

#define MBEDTLS_ECP_DP_SECP192K1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP224K1_ENABLED

#define MBEDTLS_ECP_DP_SECP224K1_ENABLED


      

Marco MBEDTLS_ECP_DP_SECP256K1_ENABLED

#define MBEDTLS_ECP_DP_SECP256K1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP256R1_ENABLED

#define MBEDTLS_ECP_DP_BP256R1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP384R1_ENABLED

#define MBEDTLS_ECP_DP_BP384R1_ENABLED


      

Marco MBEDTLS_ECP_DP_BP512R1_ENABLED

#define MBEDTLS_ECP_DP_BP512R1_ENABLED


      

Marco MBEDTLS_ECP_DP_CURVE25519_ENABLED

#define MBEDTLS_ECP_DP_CURVE25519_ENABLED


      

Marco MBEDTLS_ECP_DP_CURVE448_ENABLED

#define MBEDTLS_ECP_DP_CURVE448_ENABLED


      

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_PSK_ENABLED

#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
 *
 * Enable the PSK based ciphersuite modes in SSL / TLS.
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
 *
 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
 *           MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_PK_PARSE_EC_EXTENDED

#define MBEDTLS_PK_PARSE_EC_EXTENDED
/**
 * \def MBEDTLS_PK_PARSE_EC_EXTENDED
 *
 * Enhance support for reading EC keys using variants of SEC1 not allowed by
 * RFC 5915 and RFC 5480.
 *
 * Currently this means parsing the SpecifiedECDomain choice of EC
 * parameters (only known groups are supported, not arbitrary domains, to
 * avoid validation issues).
 *
 * Disable if you only need to support RFC 5915 + 5480 key formats.
 */

Marco MBEDTLS_GENPRIME

#define MBEDTLS_GENPRIME
/**
 * \def MBEDTLS_GENPRIME
 *
 * Enable the prime-number generation code.
 *
 * Requires: MBEDTLS_BIGNUM_C
 */

Marco MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES

#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
/**
 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
 *
 * Do not add default entropy sources. These are the platform specific,
 * mbedtls_timing_hardclock and HAVEGE based poll functions.
 *
 * This is useful to have more control over the added entropy sources in an
 * application.
 *
 * Uncomment this macro to prevent loading of default entropy functions.
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_PK_RSA_ALT_SUPPORT

#define MBEDTLS_PK_RSA_ALT_SUPPORT
/**
 * \def MBEDTLS_PK_RSA_ALT_SUPPORT
 *
 * Support external private RSA keys (eg from a HSM) in the PK layer.
 *
 * Comment this macro to disable support for external private RSA keys.
 */

Marco MBEDTLS_PKCS1_V15

#define MBEDTLS_PKCS1_V15
/**
 * \def MBEDTLS_PKCS1_V15
 *
 * Enable support for PKCS#1 v1.5 encoding.
 *
 * Requires: MBEDTLS_RSA_C
 *
 * This enables support for PKCS#1 v1.5 operations.
 */

Marco MBEDTLS_PKCS1_V21

#define MBEDTLS_PKCS1_V21
/**
 * \def MBEDTLS_PKCS1_V21
 *
 * Enable support for PKCS#1 v2.1 encoding.
 *
 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
 *
 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_FALLBACK_SCSV

#define MBEDTLS_SSL_FALLBACK_SCSV
/**
 * \def MBEDTLS_SSL_FALLBACK_SCSV
 *
 * Enable support for FALLBACK_SCSV (draft-ietf-tls-downgrade-scsv-00).
 *
 * For servers, it is recommended to always enable this, unless you support
 * only one version of TLS, or know for sure that none of your clients
 * implements a fallback strategy.
 *
 * For clients, you only need this if you're using a fallback strategy, which
 * is not recommended in the first place, unless you absolutely need it to
 * interoperate with buggy (version-intolerant) servers.
 *
 * Comment this macro to disable support for FALLBACK_SCSV
 */

Marco MBEDTLS_SSL_RENEGOTIATION

#define MBEDTLS_SSL_RENEGOTIATION
/**
 * \def MBEDTLS_SSL_RENEGOTIATION
 *
 * Enable support for TLS renegotiation.
 *
 * The two main uses of renegotiation are (1) refresh keys on long-lived
 * connections and (2) client authentication after the initial handshake.
 * If you don't need renegotiation, it's probably better to disable it, since
 * it has been associated with security issues in the past and is easy to
 * misuse/misunderstand.
 *
 * Comment this to disable support for renegotiation.
 *
 * \note   Even if this option is disabled, both client and server are aware
 *         of the Renegotiation Indication Extension (RFC 5746) used to
 *         prevent the SSL renegotiation attack (see RFC 5746 Sect. 1).
 *         (See \c mbedtls_ssl_conf_legacy_renegotiation for the
 *          configuration of this extension).
 *
 */

Marco MBEDTLS_SSL_MAX_FRAGMENT_LENGTH

#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
/**
 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
 *
 * Enable support for RFC 6066 max_fragment_length extension in SSL.
 *
 * Comment this macro to disable support for the max_fragment_length extension
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_SESSION_TICKETS

#define MBEDTLS_SSL_SESSION_TICKETS
/**
 * \def MBEDTLS_SSL_SESSION_TICKETS
 *
 * Enable support for RFC 5077 session tickets in SSL.
 * Client-side, provides full support for session tickets (maintainance of a
 * session store remains the responsibility of the application, though).
 * Server-side, you also need to provide callbacks for writing and parsing
 * tickets, including authenticated encryption and key management. Example
 * callbacks are provided by MBEDTLS_SSL_TICKET_C.
 *
 * Comment this macro to disable support for SSL session tickets
 */

Marco MBEDTLS_SSL_SERVER_NAME_INDICATION

#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/**
 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
 *
 * Enable support for RFC 6066 server name indication (SNI) in SSL.
 *
 * Requires: MBEDTLS_X509_CRT_PARSE_C
 *
 * Comment this macro to disable support for server name indication in SSL
 */

Marco MBEDTLS_X509_CHECK_KEY_USAGE

#define MBEDTLS_X509_CHECK_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_KEY_USAGE
 *
 * Enable verification of the keyUsage extension (CA and leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused
 * (intermediate) CA and leaf certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip keyUsage checking for both CA and leaf certificates.
 */

Marco MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
 *
 * Enable verification of the extendedKeyUsage extension (leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip extendedKeyUsage checking for certificates.
 */

Marco MBEDTLS_X509_RSASSA_PSS_SUPPORT

#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
/**
 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
 *
 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
 *
 * Comment this macro to disallow using RSASSA-PSS in certificates.
 */

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_ARC4_C

#define MBEDTLS_ARC4_C
/**
 * \def MBEDTLS_ARC4_C
 *
 * Enable the ARCFOUR stream cipher.
 *
 * Module:  library/arc4.c
 * Caller:  library/cipher.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_RSA_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_RSA_WITH_RC4_128_MD5
 *      MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
 *      MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
 *
 * \warning   ARC4 is considered a weak cipher and its use constitutes a
 *            security risk. If possible, we recommend avoidng dependencies on
 *            it, and considering stronger ciphers instead.
 *
 */

Marco MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C
/**
 * \def MBEDTLS_ASN1_PARSE_C
 *
 * Enable the generic ASN1 parser.
 *
 * Module:  library/asn1.c
 * Caller:  library/x509.c
 *          library/dhm.c
 *          library/pkcs12.c
 *          library/pkcs5.c
 *          library/pkparse.c
 */

Marco MBEDTLS_ASN1_WRITE_C

#define MBEDTLS_ASN1_WRITE_C
/**
 * \def MBEDTLS_ASN1_WRITE_C
 *
 * Enable the generic ASN1 writer.
 *
 * Module:  library/asn1write.c
 * Caller:  library/ecdsa.c
 *          library/pkwrite.c
 *          library/x509_create.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 */

Marco MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C
/**
 * \def MBEDTLS_BASE64_C
 *
 * Enable the Base64 module.
 *
 * Module:  library/base64.c
 * Caller:  library/pem.c
 *
 * This module is required for PEM support (required by X.509).
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_CTR_DRBG_C

#define MBEDTLS_CTR_DRBG_C


      

Marco MBEDTLS_DEBUG_C

#define MBEDTLS_DEBUG_C


      

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C
/**
 * \def MBEDTLS_ECDH_C
 *
 * Enable the elliptic curve Diffie-Hellman library.
 *
 * Module:  library/ecdh.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
 *
 * Requires: MBEDTLS_ECP_C
 */

Marco MBEDTLS_ECDSA_C

#define MBEDTLS_ECDSA_C
/**
 * \def MBEDTLS_ECDSA_C
 *
 * Enable the elliptic curve DSA library.
 *
 * Module:  library/ecdsa.c
 * Caller:
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA
 *
 * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C
 */

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_ENTROPY_C

#define MBEDTLS_ENTROPY_C
/**
 * \def MBEDTLS_ENTROPY_C
 *
 * Enable the platform-specific entropy code.
 *
 * Module:  library/entropy.c
 * Caller:
 *
 * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C
 *
 * This module provides a generic entropy pool
 */

Marco MBEDTLS_ERROR_C

#define MBEDTLS_ERROR_C
/**
 * \def MBEDTLS_ERROR_C
 *
 * Enable error code to error string conversion.
 *
 * Module:  library/error.c
 * Caller:
 *
 * This module enables mbedtls_strerror().
 */

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_NET_C

#define MBEDTLS_NET_C
/**
 * \def MBEDTLS_NET_C
 *
 * Enable the TCP and UDP over IPv6/IPv4 networking routines.
 *
 * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
 * and Windows. For other platforms, you'll want to disable it, and write your
 * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
 *
 * \note See also our Knowledge Base article about porting to a new
 * environment:
 * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
 *
 * Module:  library/net_sockets.c
 *
 * This module provides networking routines.
 */

Marco MBEDTLS_OID_C

#define MBEDTLS_OID_C
/**
 * \def MBEDTLS_OID_C
 *
 * Enable the OID database.
 *
 * Module:  library/oid.c
 * Caller:  library/asn1write.c
 *          library/pkcs5.c
 *          library/pkparse.c
 *          library/pkwrite.c
 *          library/rsa.c
 *          library/x509.c
 *          library/x509_create.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * This modules translates between OIDs and internal values.
 */

Marco MBEDTLS_PEM_PARSE_C

#define MBEDTLS_PEM_PARSE_C
/**
 * \def MBEDTLS_PEM_PARSE_C
 *
 * Enable PEM decoding / parsing.
 *
 * Module:  library/pem.c
 * Caller:  library/dhm.c
 *          library/pkparse.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_BASE64_C
 *
 * This modules adds support for decoding / parsing PEM files.
 */

Marco MBEDTLS_PK_C

#define MBEDTLS_PK_C
/**
 * \def MBEDTLS_PK_C
 *
 * Enable the generic public (asymetric) key layer.
 *
 * Module:  library/pk.c
 * Caller:  library/ssl_tls.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
 *
 * Uncomment to enable generic public key wrappers.
 */

Marco MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C
/**
 * \def MBEDTLS_PK_PARSE_C
 *
 * Enable the generic public (asymetric) key parser.
 *
 * Module:  library/pkparse.c
 * Caller:  library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key parse functions.
 */

Marco MBEDTLS_PK_WRITE_C

#define MBEDTLS_PK_WRITE_C
/**
 * \def MBEDTLS_PK_WRITE_C
 *
 * Enable the generic public (asymetric) key writer.
 *
 * Module:  library/pkwrite.c
 * Caller:  library/x509write.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key write functions.
 */

Marco MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C
/**
 * \def MBEDTLS_PKCS5_C
 *
 * Enable PKCS#5 functions.
 *
 * Module:  library/pkcs5.c
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the PKCS#5 functions.
 */

Marco MBEDTLS_PKCS12_C

#define MBEDTLS_PKCS12_C
/**
 * \def MBEDTLS_PKCS12_C
 *
 * Enable PKCS#12 PBE functions.
 * Adds algorithms for parsing PKCS#8 encrypted private keys
 *
 * Module:  library/pkcs12.c
 * Caller:  library/pkparse.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 * Can use:  MBEDTLS_ARC4_C
 *
 * This module enables PKCS#12 functions.
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_RSA_C

#define MBEDTLS_RSA_C
/**
 * \def MBEDTLS_RSA_C
 *
 * Enable the RSA public-key cryptosystem.
 *
 * Module:  library/rsa.c
 *          library/rsa_internal.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509.c
 *
 * This module is used by the following key exchanges:
 *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C


      

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SHA512_C

#define MBEDTLS_SHA512_C
/**
 * \def MBEDTLS_SHA512_C
 *
 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
 *
 * Module:  library/sha512.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module adds support for SHA-384 and SHA-512.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_TIMING_C

#define MBEDTLS_TIMING_C


      

Marco MBEDTLS_VERSION_C

#define MBEDTLS_VERSION_C
/**
 * \def MBEDTLS_VERSION_C
 *
 * Enable run-time version information.
 *
 * Module:  library/version.c
 *
 * This module provides run-time version information.
 */

Marco MBEDTLS_X509_USE_C

#define MBEDTLS_X509_USE_C
/**
 * \def MBEDTLS_X509_USE_C
 *
 * Enable X.509 core for using certificates.
 *
 * Module:  library/x509.c
 * Caller:  library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
 *           MBEDTLS_PK_PARSE_C
 *
 * This module is required for the X.509 parsing modules.
 */

Marco MBEDTLS_X509_CRT_PARSE_C

#define MBEDTLS_X509_CRT_PARSE_C
/**
 * \def MBEDTLS_X509_CRT_PARSE_C
 *
 * Enable X.509 certificate parsing.
 *
 * Module:  library/x509_crt.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is required for X.509 certificate parsing.
 */

Marco MBEDTLS_X509_CSR_PARSE_C

#define MBEDTLS_X509_CSR_PARSE_C
/**
 * \def MBEDTLS_X509_CSR_PARSE_C
 *
 * Enable X.509 Certificate Signing Request (CSR) parsing.
 *
 * Module:  library/x509_csr.c
 * Caller:  library/x509_crt_write.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is used for reading X.509 certificate request.
 */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            5200 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE

#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
/**
 * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
 * signature and ciphersuite selection. Without this build-time option, SHA-1
 * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes.
 * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by
 * default. At the time of writing, there is no practical attack on the use
 * of SHA-1 in handshake signatures, hence this option is turned on by default
 * to preserve compatibility with existing peers, but the general
 * warning applies nonetheless:
 *
 * \warning   SHA-1 is considered a weak message digest and its use constitutes
 *            a security risk. If possible, we recommend avoiding dependencies
 *            on it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_CONFIG_H_TY_ECC_ONLY

#define MBEDTLS_CONFIG_H_TY_ECC_ONLY


      

Marco TUYA_ECP_MUL_COMB_ROM_TABLES

#define TUYA_ECP_MUL_COMB_ROM_TABLES 1	//使用ROM代替RAM
//#define TUYA_ECP_MUL_COMB_OPTIM 1			//打开ECP点乘优化

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING
/**
 * \def MBEDTLS_DEPRECATED_WARNING
 *
 * Mark deprecated functions so that they generate a warning if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * This only works with GCC and Clang. With other compilers, you may want to
 * use MBEDTLS_DEPRECATED_REMOVED
 *
 * Uncomment to get warnings on using deprecated functions.
 */

Marco MBEDTLS_DEPRECATED_REMOVED

#define MBEDTLS_DEPRECATED_REMOVED
/**
 * \def MBEDTLS_DEPRECATED_REMOVED
 *
 * Remove deprecated functions so that they generate an error if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * Uncomment to get errors on using deprecated functions.
 */

Marco MBEDTLS_AES_ROM_TABLES

#define MBEDTLS_AES_ROM_TABLES
/**
 * \def MBEDTLS_AES_ROM_TABLES
 *
 * Use precomputed AES tables stored in ROM.
 *
 * Uncomment this macro to use precomputed AES tables stored in ROM.
 * Comment this macro to generate AES tables in RAM at runtime.
 *
 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
 * initialization time before the first AES operation can be performed.
 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
 * performance if ROM access is slower than RAM access.
 *
 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
 *
 */

Marco MBEDTLS_AES_FEWER_TABLES

#define MBEDTLS_AES_FEWER_TABLES
/**
 * \def MBEDTLS_AES_FEWER_TABLES
 *
 * Use less ROM/RAM for AES tables.
 *
 * Uncommenting this macro omits 75% of the AES tables from
 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
 * by computing their values on the fly during operations
 * (the tables are entry-wise rotations of one another).
 *
 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
 * by ~6kb but at the cost of more arithmetic operations during
 * runtime. Specifically, one has to compare 4 accesses within
 * different tables to 4 accesses with additional arithmetic
 * operations within the same table. The performance gain/loss
 * depends on the system and memory details.
 *
 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
 *
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
//#define MBEDTLS_ECP_DP_SECP224R1_ENABLED

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED

#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
 *
 * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS.
 *
 * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15,
 *           MBEDTLS_X509_CRT_PARSE_C
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA
 */

Marco MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES

#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
/**
 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
 *
 * Do not add default entropy sources. These are the platform specific,
 * mbedtls_timing_hardclock and HAVEGE based poll functions.
 *
 * This is useful to have more control over the added entropy sources in an
 * application.
 *
 * Uncomment this macro to prevent loading of default entropy functions.
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_PKCS1_V15

#define MBEDTLS_PKCS1_V15
/**
 * \def MBEDTLS_PKCS1_V15
 *
 * Enable support for PKCS#1 v1.5 encoding.
 *
 * Requires: MBEDTLS_RSA_C
 *
 * This enables support for PKCS#1 v1.5 operations.
 */

Marco MBEDTLS_PKCS1_V21

#define MBEDTLS_PKCS1_V21
/**
 * \def MBEDTLS_PKCS1_V21
 *
 * Enable support for PKCS#1 v2.1 encoding.
 *
 * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C
 *
 * This enables support for RSAES-OAEP and RSASSA-PSS operations.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_SERVER_NAME_INDICATION

#define MBEDTLS_SSL_SERVER_NAME_INDICATION
/**
 * \def MBEDTLS_SSL_SERVER_NAME_INDICATION
 *
 * Enable support for RFC 6066 server name indication (SNI) in SSL.
 *
 * Requires: MBEDTLS_X509_CRT_PARSE_C
 *
 * Comment this macro to disable support for server name indication in SSL
 */

Marco MBEDTLS_THREADING_PTHREAD

#define MBEDTLS_THREADING_PTHREAD


      

Marco MBEDTLS_X509_CHECK_KEY_USAGE

#define MBEDTLS_X509_CHECK_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_KEY_USAGE
 *
 * Enable verification of the keyUsage extension (CA and leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused
 * (intermediate) CA and leaf certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip keyUsage checking for both CA and leaf certificates.
 */

Marco MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
/**
 * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
 *
 * Enable verification of the extendedKeyUsage extension (leaf certificates).
 *
 * Disabling this avoids problems with mis-issued and/or misused certificates.
 *
 * \warning Depending on your PKI use, disabling this can be a security risk!
 *
 * Comment to skip extendedKeyUsage checking for certificates.
 */

Marco MBEDTLS_X509_RSASSA_PSS_SUPPORT

#define MBEDTLS_X509_RSASSA_PSS_SUPPORT
/**
 * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT
 *
 * Enable parsing and verification of X.509 certificates, CRLs and CSRS
 * signed with RSASSA-PSS (aka PKCS#1 v2.1).
 *
 * Comment this macro to disallow using RSASSA-PSS in certificates.
 */

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_ASN1_PARSE_C

#define MBEDTLS_ASN1_PARSE_C
/**
 * \def MBEDTLS_ASN1_PARSE_C
 *
 * Enable the generic ASN1 parser.
 *
 * Module:  library/asn1.c
 * Caller:  library/x509.c
 *          library/dhm.c
 *          library/pkcs12.c
 *          library/pkcs5.c
 *          library/pkparse.c
 */

Marco MBEDTLS_BASE64_C

#define MBEDTLS_BASE64_C
/**
 * \def MBEDTLS_BASE64_C
 *
 * Enable the Base64 module.
 *
 * Module:  library/base64.c
 * Caller:  library/pem.c
 *
 * This module is required for PEM support (required by X.509).
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CCM_C

#define MBEDTLS_CCM_C
/**
 * \def MBEDTLS_CCM_C
 *
 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
 *
 * Module:  library/ccm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-CCM ciphersuites, if other requisites are
 * enabled as well.
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C
/**
 * \def MBEDTLS_ECDH_C
 *
 * Enable the elliptic curve Diffie-Hellman library.
 *
 * Module:  library/ecdh.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module is used by the following key exchanges:
 *      ECDHE-ECDSA, ECDHE-RSA, DHE-PSK
 *
 * Requires: MBEDTLS_ECP_C
 */

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_GCM_C

#define MBEDTLS_GCM_C
/**
 * \def MBEDTLS_GCM_C
 *
 * Enable the Galois/Counter Mode (GCM) for AES.
 *
 * Module:  library/gcm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other
 * requisites are enabled as well.
 */

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_NET_C

#define MBEDTLS_NET_C
/**
 * \def MBEDTLS_NET_C
 *
 * Enable the TCP and UDP over IPv6/IPv4 networking routines.
 *
 * \note This module only works on POSIX/Unix (including Linux, BSD and OS X)
 * and Windows. For other platforms, you'll want to disable it, and write your
 * own networking callbacks to be passed to \c mbedtls_ssl_set_bio().
 *
 * \note See also our Knowledge Base article about porting to a new
 * environment:
 * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS
 *
 * Module:  library/net_sockets.c
 *
 * This module provides networking routines.
 */

Marco MBEDTLS_OID_C

#define MBEDTLS_OID_C
/**
 * \def MBEDTLS_OID_C
 *
 * Enable the OID database.
 *
 * Module:  library/oid.c
 * Caller:  library/asn1write.c
 *          library/pkcs5.c
 *          library/pkparse.c
 *          library/pkwrite.c
 *          library/rsa.c
 *          library/x509.c
 *          library/x509_create.c
 *          library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *          library/x509write_crt.c
 *          library/x509write_csr.c
 *
 * This modules translates between OIDs and internal values.
 */

Marco MBEDTLS_PK_C

#define MBEDTLS_PK_C
/**
 * \def MBEDTLS_PK_C
 *
 * Enable the generic public (asymetric) key layer.
 *
 * Module:  library/pk.c
 * Caller:  library/ssl_tls.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C
 *
 * Uncomment to enable generic public key wrappers.
 */

Marco MBEDTLS_PK_PARSE_C

#define MBEDTLS_PK_PARSE_C
/**
 * \def MBEDTLS_PK_PARSE_C
 *
 * Enable the generic public (asymetric) key parser.
 *
 * Module:  library/pkparse.c
 * Caller:  library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_PK_C
 *
 * Uncomment to enable generic public key parse functions.
 */

Marco MBEDTLS_PKCS5_C

#define MBEDTLS_PKCS5_C
/**
 * \def MBEDTLS_PKCS5_C
 *
 * Enable PKCS#5 functions.
 *
 * Module:  library/pkcs5.c
 *
 * Requires: MBEDTLS_MD_C
 *
 * This module adds support for the PKCS#5 functions.
 */

Marco MBEDTLS_PKCS12_C

#define MBEDTLS_PKCS12_C
/**
 * \def MBEDTLS_PKCS12_C
 *
 * Enable PKCS#12 PBE functions.
 * Adds algorithms for parsing PKCS#8 encrypted private keys
 *
 * Module:  library/pkcs12.c
 * Caller:  library/pkparse.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 * Can use:  MBEDTLS_ARC4_C
 *
 * This module enables PKCS#12 functions.
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_RSA_C

#define MBEDTLS_RSA_C
/**
 * \def MBEDTLS_RSA_C
 *
 * Enable the RSA public-key cryptosystem.
 *
 * Module:  library/rsa.c
 *          library/rsa_internal.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509.c
 *
 * This module is used by the following key exchanges:
 *      RSA, DHE-RSA, ECDHE-RSA, RSA-PSK
 *
 * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C


      

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SHA512_C

#define MBEDTLS_SHA512_C
/**
 * \def MBEDTLS_SHA512_C
 *
 * Enable the SHA-384 and SHA-512 cryptographic hash algorithms.
 *
 * Module:  library/sha512.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * This module adds support for SHA-384 and SHA-512.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_THREADING_C

#define MBEDTLS_THREADING_C


      

Marco MBEDTLS_VERSION_C

#define MBEDTLS_VERSION_C
/**
 * \def MBEDTLS_VERSION_C
 *
 * Enable run-time version information.
 *
 * Module:  library/version.c
 *
 * This module provides run-time version information.
 */

Marco MBEDTLS_X509_USE_C

#define MBEDTLS_X509_USE_C
/**
 * \def MBEDTLS_X509_USE_C
 *
 * Enable X.509 core for using certificates.
 *
 * Module:  library/x509.c
 * Caller:  library/x509_crl.c
 *          library/x509_crt.c
 *          library/x509_csr.c
 *
 * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C,
 *           MBEDTLS_PK_PARSE_C
 *
 * This module is required for the X.509 parsing modules.
 */

Marco MBEDTLS_X509_CRT_PARSE_C

#define MBEDTLS_X509_CRT_PARSE_C
/**
 * \def MBEDTLS_X509_CRT_PARSE_C
 *
 * Enable X.509 certificate parsing.
 *
 * Module:  library/x509_crt.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * Requires: MBEDTLS_X509_USE_C
 *
 * This module is required for X.509 certificate parsing.
 */

Marco MBEDTLS_MPI_WINDOW_SIZE

#define MBEDTLS_MPI_WINDOW_SIZE          1 /**< Maximum windows size used. */
/* MPI / BIGNUM options */

Marco MBEDTLS_MPI_MAX_SIZE

#define MBEDTLS_MPI_MAX_SIZE           1024 /**< Maximum number of bytes for usable MPIs. */


      

Marco MBEDTLS_ECP_MAX_BITS

#define MBEDTLS_ECP_MAX_BITS            256 /**< Maximum bit size of groups */
/* ECP options */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            1024 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_CONFIG_H_TY_PSK_ONLY

#define MBEDTLS_CONFIG_H_TY_PSK_ONLY


      

Marco TUYA_TLS_DYNAMIC_MEMORY_ALLOCATION

#define TUYA_TLS_DYNAMIC_MEMORY_ALLOCATION	1 //开启TLS动态内存


      

Marco TLS_MEM_DEBUG

#define TLS_MEM_DEBUG				0		//开启TLS内存调试
//#define TLS_SESSION 				1			//开启TLS_SESSION

Marco TUYA_TLS_DEBUG_THRDSHOLD

#define TUYA_TLS_DEBUG_THRDSHOLD   5		//TLS 调试等级


      

Marco _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE 1


      

Marco MBEDTLS_PLATFORM_MEMORY

#define MBEDTLS_PLATFORM_MEMORY
/**
 * \def MBEDTLS_PLATFORM_MEMORY
 *
 * Enable the memory allocation layer.
 *
 * By default mbed TLS uses the system-provided calloc() and free().
 * This allows different allocators (self-implemented or provided) to be
 * provided to the platform abstraction layer.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY without the
 * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide
 * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and
 * free() function pointer at runtime.
 *
 * Enabling MBEDTLS_PLATFORM_MEMORY and specifying
 * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the
 * alternate function at compile time.
 *
 * Requires: MBEDTLS_PLATFORM_C
 *
 * Enable this layer to allow use of alternative memory allocators.
 */

Marco MBEDTLS_DEPRECATED_WARNING

#define MBEDTLS_DEPRECATED_WARNING
/**
 * \def MBEDTLS_DEPRECATED_WARNING
 *
 * Mark deprecated functions so that they generate a warning if used.
 * Functions deprecated in one version will usually be removed in the next
 * version. You can enable this to help you prepare the transition to a new
 * major version by making sure your code is not using these functions.
 *
 * This only works with GCC and Clang. With other compilers, you may want to
 * use MBEDTLS_DEPRECATED_REMOVED
 *
 * Uncomment to get warnings on using deprecated functions.
 */

Marco MBEDTLS_AES_ALT

#define MBEDTLS_AES_ALT


      

Marco MBEDTLS_AES_ROM_TABLES

#define MBEDTLS_AES_ROM_TABLES
/**
 * \def MBEDTLS_AES_ROM_TABLES
 *
 * Use precomputed AES tables stored in ROM.
 *
 * Uncomment this macro to use precomputed AES tables stored in ROM.
 * Comment this macro to generate AES tables in RAM at runtime.
 *
 * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb
 * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the
 * initialization time before the first AES operation can be performed.
 * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c
 * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded
 * performance if ROM access is slower than RAM access.
 *
 * This option is independent of \c MBEDTLS_AES_FEWER_TABLES.
 *
 */

Marco MBEDTLS_AES_FEWER_TABLES

#define MBEDTLS_AES_FEWER_TABLES
/**
 * \def MBEDTLS_AES_FEWER_TABLES
 *
 * Use less ROM/RAM for AES tables.
 *
 * Uncommenting this macro omits 75% of the AES tables from
 * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES)
 * by computing their values on the fly during operations
 * (the tables are entry-wise rotations of one another).
 *
 * Tradeoff: Uncommenting this reduces the RAM / ROM footprint
 * by ~6kb but at the cost of more arithmetic operations during
 * runtime. Specifically, one has to compare 4 accesses within
 * different tables to 4 accesses with additional arithmetic
 * operations within the same table. The performance gain/loss
 * depends on the system and memory details.
 *
 * This option is independent of \c MBEDTLS_AES_ROM_TABLES.
 *
 */

Marco MBEDTLS_CIPHER_MODE_CBC

#define MBEDTLS_CIPHER_MODE_CBC
/**
 * \def MBEDTLS_CIPHER_MODE_CBC
 *
 * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers.
 */

Marco MBEDTLS_CIPHER_PADDING_PKCS7

#define MBEDTLS_CIPHER_PADDING_PKCS7
/**
 * \def MBEDTLS_CIPHER_PADDING_PKCS7
 *
 * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for
 * specific padding modes in the cipher layer with cipher modes that support
 * padding (e.g. CBC)
 *
 * If you disable all padding modes, only full blocks can be used with CBC.
 *
 * Enable padding modes in the cipher layer.
 */

Marco MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS

#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN

#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN


      

Marco MBEDTLS_CIPHER_PADDING_ZEROS

#define MBEDTLS_CIPHER_PADDING_ZEROS


      

Marco MBEDTLS_REMOVE_ARC4_CIPHERSUITES

#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
/**
 * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES
 *
 * Remove RC4 ciphersuites by default in SSL / TLS.
 * This flag removes the ciphersuites based on RC4 from the default list as
 * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to
 * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them
 * explicitly.
 *
 * Uncomment this macro to remove RC4 ciphersuites by default.
 */

Marco MBEDTLS_ECP_DP_SECP256R1_ENABLED

#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
//#define MBEDTLS_ECP_DP_SECP224R1_ENABLED

Marco MBEDTLS_ECP_NIST_OPTIM

#define MBEDTLS_ECP_NIST_OPTIM
/**
 * \def MBEDTLS_ECP_NIST_OPTIM
 *
 * Enable specific 'modulo p' routines for each NIST prime.
 * Depending on the prime and architecture, makes operations 4 to 8 times
 * faster on the corresponding curve.
 *
 * Comment this macro to disable NIST curves optimisation.
 */

Marco MBEDTLS_KEY_EXCHANGE_PSK_ENABLED

#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
/**
 * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
 *
 * Enable the PSK based ciphersuite modes in SSL / TLS.
 *
 * This enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_RC4_128_SHA
 */

Marco MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES

#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
/**
 * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
 *
 * Do not add default entropy sources. These are the platform specific,
 * mbedtls_timing_hardclock and HAVEGE based poll functions.
 *
 * This is useful to have more control over the added entropy sources in an
 * application.
 *
 * Uncomment this macro to prevent loading of default entropy functions.
 */

Marco MBEDTLS_NO_PLATFORM_ENTROPY

#define MBEDTLS_NO_PLATFORM_ENTROPY
/**
 * \def MBEDTLS_NO_PLATFORM_ENTROPY
 *
 * Do not use built-in platform entropy functions.
 * This is useful if your platform does not support
 * standards like the /dev/urandom or Windows CryptoAPI.
 *
 * Uncomment this macro to disable the built-in platform entropy functions.
 */

Marco MBEDTLS_SSL_ALL_ALERT_MESSAGES

#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
/**
 * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
 *
 * Enable sending of alert messages in case of encountered errors as per RFC.
 * If you choose not to send the alert messages, mbed TLS can still communicate
 * with other servers, only debugging of failures is harder.
 *
 * The advantage of not sending alert messages, is that no information is given
 * about reasons for failures thus preventing adversaries of gaining intel.
 *
 * Enable sending of all alert messages
 */

Marco MBEDTLS_SSL_ENCRYPT_THEN_MAC

#define MBEDTLS_SSL_ENCRYPT_THEN_MAC
/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC
 *
 * Enable support for Encrypt-then-MAC, RFC 7366.
 *
 * This allows peers that both support it to use a more robust protection for
 * ciphersuites using CBC, providing deep resistance against timing attacks
 * on the padding or underlying cipher.
 *
 * This only affects CBC ciphersuites, and is useless if none is defined.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Encrypt-then-MAC
 */

Marco MBEDTLS_SSL_EXTENDED_MASTER_SECRET

#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET
 *
 * Enable support for Extended Master Secret, aka Session Hash
 * (draft-ietf-tls-session-hash-02).
 *
 * This was introduced as "the proper fix" to the Triple Handshake familiy of
 * attacks, but it is recommended to always use it (even if you disable
 * renegotiation), since it actually fixes a more fundamental issue in the
 * original SSL/TLS design, and has implications beyond Triple Handshake.
 *
 * Requires: MBEDTLS_SSL_PROTO_TLS1    or
 *           MBEDTLS_SSL_PROTO_TLS1_1  or
 *           MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Comment this macro to disable support for Extended Master Secret.
 */

Marco MBEDTLS_SSL_MAX_FRAGMENT_LENGTH

#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
/**
 * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
 *
 * Enable support for RFC 6066 max_fragment_length extension in SSL.
 *
 * Comment this macro to disable support for the max_fragment_length extension
 */

Marco MBEDTLS_SSL_PROTO_TLS1_2

#define MBEDTLS_SSL_PROTO_TLS1_2
/**
 * \def MBEDTLS_SSL_PROTO_TLS1_2
 *
 * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled).
 *
 * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C
 *           (Depends on ciphersuites)
 *
 * Comment this macro to disable support for TLS 1.2 / DTLS 1.2
 */

Marco MBEDTLS_SSL_SESSION_TICKETS

#define MBEDTLS_SSL_SESSION_TICKETS


      

Marco MBEDTLS_AES_C

#define MBEDTLS_AES_C
/**
 * \def MBEDTLS_AES_C
 *
 * Enable the AES block cipher.
 *
 * Module:  library/aes.c
 * Caller:  library/cipher.c
 *          library/pem.c
 *          library/ctr_drbg.c
 *
 * This module enables the following ciphersuites (if other requisites are
 * enabled as well):
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384
 *      MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA
 *      MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256
 *      MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA
 *
 * PEM_PARSE uses AES for decrypting encrypted keys.
 */

Marco MBEDTLS_BIGNUM_C

#define MBEDTLS_BIGNUM_C
/**
 * \def MBEDTLS_BIGNUM_C
 *
 * Enable the multi-precision integer library.
 *
 * Module:  library/bignum.c
 * Caller:  library/dhm.c
 *          library/ecp.c
 *          library/ecdsa.c
 *          library/rsa.c
 *          library/rsa_internal.c
 *          library/ssl_tls.c
 *
 * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support.
 */

Marco MBEDTLS_CCM_C

#define MBEDTLS_CCM_C
/**
 * \def MBEDTLS_CCM_C
 *
 * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher.
 *
 * Module:  library/ccm.c
 *
 * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C
 *
 * This module enables the AES-CCM ciphersuites, if other requisites are
 * enabled as well.
 */

Marco MBEDTLS_CIPHER_C

#define MBEDTLS_CIPHER_C
/**
 * \def MBEDTLS_CIPHER_C
 *
 * Enable the generic cipher layer.
 *
 * Module:  library/cipher.c
 * Caller:  library/ssl_tls.c
 *
 * Uncomment to enable generic cipher wrappers.
 */

Marco MBEDTLS_DHM_C

#define MBEDTLS_DHM_C


      

Marco MBEDTLS_ECDH_C

#define MBEDTLS_ECDH_C


      

Marco MBEDTLS_ECP_C

#define MBEDTLS_ECP_C
/**
 * \def MBEDTLS_ECP_C
 *
 * Enable the elliptic curve over GF(p) library.
 *
 * Module:  library/ecp.c
 * Caller:  library/ecdh.c
 *          library/ecdsa.c
 *          library/ecjpake.c
 *
 * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED
 */

Marco MBEDTLS_MD_C

#define MBEDTLS_MD_C
/**
 * \def MBEDTLS_MD_C
 *
 * Enable the generic message digest layer.
 *
 * Module:  library/md.c
 * Caller:
 *
 * Uncomment to enable generic message digest wrappers.
 */

Marco MBEDTLS_MD5_C

#define MBEDTLS_MD5_C
/**
 * \def MBEDTLS_MD5_C
 *
 * Enable the MD5 hash algorithm.
 *
 * Module:  library/md5.c
 * Caller:  library/md.c
 *          library/pem.c
 *          library/ssl_tls.c
 *
 * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2
 * depending on the handshake parameters. Further, it is used for checking
 * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded
 * encrypted keys.
 *
 * \warning   MD5 is considered a weak message digest and its use constitutes a
 *            security risk. If possible, we recommend avoiding dependencies on
 *            it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_PLATFORM_C

#define MBEDTLS_PLATFORM_C
/**
 * \def MBEDTLS_PLATFORM_C
 *
 * Enable the platform abstraction layer that allows you to re-assign
 * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit().
 *
 * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT
 * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned
 * above to be specified at runtime or compile time respectively.
 *
 * \note This abstraction layer must be enabled on Windows (including MSYS2)
 * as other module rely on it for a fixed snprintf implementation.
 *
 * Module:  library/platform.c
 * Caller:  Most other .c files
 *
 * This module enables abstraction of common (libc) functions.
 */

Marco MBEDTLS_SHA1_C

#define MBEDTLS_SHA1_C
/**
 * \def MBEDTLS_SHA1_C
 *
 * Enable the SHA1 cryptographic hash algorithm.
 *
 * Module:  library/sha1.c
 * Caller:  library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *          library/x509write_crt.c
 *
 * This module is required for SSL/TLS up to version 1.1, for TLS 1.2
 * depending on the handshake parameters, and for SHA1-signed certificates.
 *
 * \warning   SHA-1 is considered a weak message digest and its use constitutes
 *            a security risk. If possible, we recommend avoiding dependencies
 *            on it, and considering stronger message digests instead.
 *
 */

Marco MBEDTLS_SHA256_C

#define MBEDTLS_SHA256_C
/**
 * \def MBEDTLS_SHA256_C
 *
 * Enable the SHA-224 and SHA-256 cryptographic hash algorithms.
 *
 * Module:  library/sha256.c
 * Caller:  library/entropy.c
 *          library/md.c
 *          library/ssl_cli.c
 *          library/ssl_srv.c
 *          library/ssl_tls.c
 *
 * This module adds support for SHA-224 and SHA-256.
 * This module is required for the SSL/TLS 1.2 PRF function.
 */

Marco MBEDTLS_SSL_CLI_C

#define MBEDTLS_SSL_CLI_C
/**
 * \def MBEDTLS_SSL_CLI_C
 *
 * Enable the SSL/TLS client code.
 *
 * Module:  library/ssl_cli.c
 * Caller:
 *
 * Requires: MBEDTLS_SSL_TLS_C
 *
 * This module is required for SSL/TLS client support.
 */

Marco MBEDTLS_SSL_TLS_C

#define MBEDTLS_SSL_TLS_C
/**
 * \def MBEDTLS_SSL_TLS_C
 *
 * Enable the generic SSL/TLS code.
 *
 * Module:  library/ssl_tls.c
 * Caller:  library/ssl_cli.c
 *          library/ssl_srv.c
 *
 * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C
 *           and at least one of the MBEDTLS_SSL_PROTO_XXX defines
 *
 * This module is required for SSL/TLS.
 */

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            1024 /**< Maxium fragment length in bytes, determines the size of each of the two internal I/O buffers */


      

Marco MBEDTLS_SSL_MAX_CONTENT_LEN

#define MBEDTLS_SSL_MAX_CONTENT_LEN            16384


      

Marco MBEDTLS_SSL_IN_CONTENT_LEN

#define MBEDTLS_SSL_IN_CONTENT_LEN (ssl->in_content_len)


      

Marco MBEDTLS_SSL_OUT_CONTENT_LEN

#define MBEDTLS_SSL_OUT_CONTENT_LEN (ssl->out_content_len)


      

Marco __SVC_ASTRO_TIMER__

#define __SVC_ASTRO_TIMER__


      

Marco _TUYA_WS_DB_H

#define _TUYA_WS_DB_H


      

Marco __BASE_EVENT_H__

#define __BASE_EVENT_H__


      

Marco EVENT_NAME_MAX_LEN

#define EVENT_NAME_MAX_LEN (16) // move to tuya_iot_config.h. use kconfig config. default is 16


      

Marco EVENT_DESC_MAX_LEN

#define EVENT_DESC_MAX_LEN (32)
/**
 * @brief max length of event description
 * 
 */

Marco __BASE_EVENT_INFO_H__

#define __BASE_EVENT_INFO_H__


      

Marco EVENT_RESET

#define EVENT_RESET            "dev.reset"        // device reset
/**
 * @brief the event define
 * 
 */

Marco EVENT_INIT

#define EVENT_INIT             "dev.init"         // sdk init finished, device init start


      

Marco EVENT_RUN

#define EVENT_RUN              "dev.run"          // sdk active finished, device run start


      

Marco EVENT_REBOOT_REQ

#define EVENT_REBOOT_REQ       "dev.reboot.req"   // device health check reboot request, application should subscribe it if needed


      

Marco EVENT_REBOOT_ACK

#define EVENT_REBOOT_ACK       "dev.reboot.ack"   // device health check reboot ack, application should publish when it ready


      

Marco EVENT_CAD_VER_UPDATE

#define EVENT_CAD_VER_UPDATE   "cad.update"       // cad protocol update


      

Marco EVENT_FW_VER_UPDATE

#define EVENT_FW_VER_UPDATE    "fw.update"        // firmware version update


      

Marco EVENT_POST_ACTIVATE

#define EVENT_POST_ACTIVATE    "activate.post"    // active


      

Marco EVENT_PROD_INFO_CHANGED

#define EVENT_PROD_INFO_CHANGED "prod.chg"         //


      

Marco EVENT_HTTP_FAILED

#define EVENT_HTTP_FAILED      "http.failed"      // http request failed


      

Marco EVENT_SDK_EARLY_INIT_OK

#define EVENT_SDK_EARLY_INIT_OK "early.init"       // before kv flash init


      

Marco EVENT_SDK_DB_INIT_OK

#define EVENT_SDK_DB_INIT_OK   "db.init"          // before db init


      

Marco EVENT_SCHEMA_UPDATE

#define EVENT_SCHEMA_UPDATE    "schema.update"    // schema update


      

Marco EVENT_OTA_START_NOTIFY

#define EVENT_OTA_START_NOTIFY "ota.start"        // ota start


      

Marco EVENT_NETCFG_ERROR

#define EVENT_NETCFG_ERROR     "netcfg.error"     // error happened when netcfg


      

Marco EVENT_BLE_ACTIVE_START

#define EVENT_BLE_ACTIVE_START "ble.active.start" // ble active start


      

Marco EVENT_MQTT_CONNECTED

#define EVENT_MQTT_CONNECTED   "mqtt.con"         // mqtt connect


      

Marco EVENT_MQTT_DISCONNECTED

#define EVENT_MQTT_DISCONNECTED "mqtt.disc"        // mqtt disconnect


      

Marco EVENT_LAN_DISABLE

#define EVENT_LAN_DISABLE      "lan.disable"      // lan disable


      

Marco EVENT_LAN_ENABLE

#define EVENT_LAN_ENABLE       "lan.enable"       // lan enable


      

Marco EVENT_RECOVER_DB

#define EVENT_RECOVER_DB       "dev.recover.db"   // db is lost, device need recover from cloud


      

Marco EVENT_SUMMER_TZ

#define EVENT_SUMMER_TZ        "summer.tz"        // summer time zone update


      

Marco EVENT_OTA_START_NOTIFY

#define EVENT_OTA_START_NOTIFY     "ota.start"
// ota

Marco EVENT_OTA_PROCESS_NOTIFY

#define EVENT_OTA_PROCESS_NOTIFY   "ota.process"


      

Marco EVENT_OTA_FAILED_NOTIFY

#define EVENT_OTA_FAILED_NOTIFY    "ota.failed"


      

Marco EVENT_OTA_FINISHED_NOTIFY

#define EVENT_OTA_FINISHED_NOTIFY  "ota.finished"


      

Marco __LOG_SEQ_H

#define __LOG_SEQ_H


      

Marco STR_DATA_MAX_LENGTH

#define STR_DATA_MAX_LENGTH 64


      

Marco LS_DELIMITER

#define LS_DELIMITER " | "


      

Marco INSERT_LOG_SEQ_NULL(seq)

#define INSERT_LOG_SEQ_NULL(seq)          log_seq_insert_log(LOGSEQ_OBJ, seq, LDT_NULL, NULL)


      

Marco INSERT_LOG_SEQ_DEC(seq,dec)

#define INSERT_LOG_SEQ_DEC(seq,dec)       log_seq_insert_log(LOGSEQ_OBJ, seq, LDT_DEC, (VOID_T*)(intptr_t)dec)


      

Marco INSERT_LOG_SEQ_HEX(seq,hex)

#define INSERT_LOG_SEQ_HEX(seq,hex)       log_seq_insert_log(LOGSEQ_OBJ, seq, LDT_HEX, (VOID_T*)(uintptr_t)hex)


      

Marco INSERT_LOG_SEQ_TM(seq,tm)

#define INSERT_LOG_SEQ_TM(seq,tm)         log_seq_insert_log(LOGSEQ_OBJ, seq, LDT_TIMESTAMP, (VOID_T*)tm)


      

Marco INSERT_LOG_SEQ_STR(seq,str)

#define INSERT_LOG_SEQ_STR(seq,str)       log_seq_insert_log(LOGSEQ_OBJ, seq, LDT_STRING, (VOID_T*)str)
//string max length is STR_DATA_MAX_LENGTH

Marco INSERT_ERROR_LOG_SEQ_NULL(seq)

#define INSERT_ERROR_LOG_SEQ_NULL(seq)    log_seq_insert_error_log(LOGSEQ_OBJ, seq, LDT_NULL, NULL)


      

Marco INSERT_ERROR_LOG_SEQ_DEC(seq,dec)

#define INSERT_ERROR_LOG_SEQ_DEC(seq,dec) log_seq_insert_error_log(LOGSEQ_OBJ, seq, LDT_DEC, (VOID_T*)(intptr_t)dec)


      

Marco INSERT_ERROR_LOG_SEQ_HEX(seq,hex)

#define INSERT_ERROR_LOG_SEQ_HEX(seq,hex) log_seq_insert_error_log(LOGSEQ_OBJ, seq, LDT_HEX, (VOID_T*)(uintptr_t)hex)


      

Marco INSERT_ERROR_LOG_SEQ_TM(seq,tm)

#define INSERT_ERROR_LOG_SEQ_TM(seq,tm)   log_seq_insert_error_log(LOGSEQ_OBJ, seq, LDT_TIMESTAMP, (VOID_T*)tm)


      

Marco INSERT_ERROR_LOG_SEQ_STR(seq,str)

#define INSERT_ERROR_LOG_SEQ_STR(seq,str) log_seq_insert_error_log(LOGSEQ_OBJ, seq, LDT_STRING, (VOID_T*)str)
//string max length is STR_DATA_MAX_LENGTH

Marco INSERT_REPORT_LOG_SEQ_NULL(seq)

#define INSERT_REPORT_LOG_SEQ_NULL(seq)   log_seq_insert_report_log(LOGSEQ_OBJ, seq, LDT_NULL, NULL)


      

Marco INSERT_REPORT_LOG_SEQ_DEC(seq,dec)

#define INSERT_REPORT_LOG_SEQ_DEC(seq,dec) log_seq_insert_report_log(LOGSEQ_OBJ, seq, LDT_DEC, (VOID_T*)(intptr_t)dec)


      

Marco INSERT_REPORT_LOG_SEQ_HEX(seq,hex)

#define INSERT_REPORT_LOG_SEQ_HEX(seq,hex) log_seq_insert_report_log(LOGSEQ_OBJ, seq, LDT_HEX, (VOID_T*)(uintptr_t)hex)


      

Marco INSERT_REPORT_LOG_SEQ_TM(seq,tm)

#define INSERT_REPORT_LOG_SEQ_TM(seq,tm)  log_seq_insert_report_log(LOGSEQ_OBJ, seq, LDT_TIMESTAMP, (VOID_T*)tm)


      

Marco INSERT_REPORT_LOG_SEQ_STR(seq,str)

#define INSERT_REPORT_LOG_SEQ_STR(seq,str) log_seq_insert_report_log(LOGSEQ_OBJ, seq, LDT_STRING, (VOID_T*)str)
//string max length is STR_DATA_MAX_LENGTH

Marco __LOG_SEQ_HTTP_H

#define __LOG_SEQ_HTTP_H


      

Marco LOGSEQ_OBJ

#define LOGSEQ_OBJ "http"
// define log sequence object is "http", include this head file can recorde log sequence to "http" module

Marco __LOG_SEQ_MQTT_H

#define __LOG_SEQ_MQTT_H


      

Marco LOGSEQ_OBJ

#define LOGSEQ_OBJ "mqtt"
// define log sequence object is "mqtt", include this head file can recorde log sequence to "mqtt" module

Marco __LOG_SEQ_NETCFG_H

#define __LOG_SEQ_NETCFG_H


      

Marco LOGSEQ_OBJ

#define LOGSEQ_OBJ "netcfg"
// define log sequence object is "netcfg", include this head file can recorde log sequence to "netcfg" module

Marco __LOG_SEQ_TIMER_TASK_H

#define __LOG_SEQ_TIMER_TASK_H


      

Marco LOGSEQ_OBJ

#define LOGSEQ_OBJ "svc_timer_task"
// define log sequence object is "timer_task", include this head file can recorde log sequence to "timer_task" module

Marco _UNI_LOG_H

#define _UNI_LOG_H


      

Marco TY_LOG_LEVEL_ERR

#define TY_LOG_LEVEL_ERR      0 // error information
/**
 * @brief Definition of log level
 */

Marco TY_LOG_LEVEL_WARN

#define TY_LOG_LEVEL_WARN     1 // warnning information


      

Marco TY_LOG_LEVEL_NOTICE

#define TY_LOG_LEVEL_NOTICE   2 // notice information


      

Marco TY_LOG_LEVEL_INFO

#define TY_LOG_LEVEL_INFO     3 // information


      

Marco TY_LOG_LEVEL_DEBUG

#define TY_LOG_LEVEL_DEBUG    4 // debug information , should delete in release version


      

Marco TY_LOG_LEVEL_TRACE

#define TY_LOG_LEVEL_TRACE    5 // trace information , should delete in release version


      

Marco TY_DEAULT_LOG_LEVEL

#define TY_DEAULT_LOG_LEVEL   TY_LOG_LEVEL_DEBUG


      

Marco TY_DEAULT_LOG_LEVEL

#define TY_DEAULT_LOG_LEVEL   TY_LOG_LEVEL_INFO


      

Marco DEF_LOG_BUF_LEN

#define DEF_LOG_BUF_LEN	1024


      

Marco LOG_LEVEL_MIN

#define LOG_LEVEL_MIN	0


      

Marco LOG_LEVEL_MAX

#define LOG_LEVEL_MAX	5


      

Marco _THIS_FILE_NAME_

#define _THIS_FILE_NAME_ __FILE__


      

Marco SAK_PRINT_LOG(module,level,fmt, ...)

#define SAK_PRINT_LOG(module,level,fmt, ...) \
do \
{ \
   PrintLog(module,level, \
            _THIS_FILE_NAME_, __LINE__,\
            fmt,##__VA_ARGS__); \
}while(0)


      

Marco TUYA_REDUCE_BIN_LEVEL1

#define TUYA_REDUCE_BIN_LEVEL1 1
// this level, log dont has line_number information 

Marco TUYA_REDUCE_BIN_LEVEL2

#define TUYA_REDUCE_BIN_LEVEL2 2
// this level, log dont has file_name and line_number information

Marco TUYA_REDUCE_BIN_LEVEL3

#define TUYA_REDUCE_BIN_LEVEL3 3
// this level, log dont has file_name , line_number and no tare and debug information

Marco SAK_PRINT_ERR_LOG(fmt, ...)

#define SAK_PRINT_ERR_LOG(fmt, ...) \
do \
{ \
   PrintErrLog(fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_WARN_LOG(fmt, ...)

#define SAK_PRINT_WARN_LOG(fmt, ...) \
do \
{ \
   PrintWarnLog(fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_INFO_LOG(fmt, ...)

#define SAK_PRINT_INFO_LOG(fmt, ...) \
do \
{ \
   PrintInfoLog(fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_NOTICE_LOG(fmt, ...)

#define SAK_PRINT_NOTICE_LOG(fmt, ...) \
do \
{ \
   PrintNoticeLog(fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_DEBUG_LOG(fmt, ...)

#define SAK_PRINT_DEBUG_LOG(fmt, ...) \
do \
{ \
   PrintDebugLog(fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_TRACE_LOG(fmt, ...)

#define SAK_PRINT_TRACE_LOG(fmt, ...) \
do \
{ \
   PrintTraceLog(fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_ERR_LOG(fmt, ...)

#define SAK_PRINT_ERR_LOG(fmt, ...) \
do \
{ \
   PrintErrLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_WARN_LOG(fmt, ...)

#define SAK_PRINT_WARN_LOG(fmt, ...) \
do \
{ \
   PrintWarnLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_INFO_LOG(fmt, ...)

#define SAK_PRINT_INFO_LOG(fmt, ...) \
do \
{ \
   PrintInfoLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_NOTICE_LOG(fmt, ...)

#define SAK_PRINT_NOTICE_LOG(fmt, ...) \
do \
{ \
   PrintNoticeLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_DEBUG_LOG(fmt, ...)

#define SAK_PRINT_DEBUG_LOG(fmt, ...) \
do \
{ \
   PrintDebugLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_TRACE_LOG(fmt, ...)

#define SAK_PRINT_TRACE_LOG(fmt, ...) \
do \
{ \
   PrintTraceLog(_THIS_FILE_NAME_, fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_ERR_LOG(fmt, ...)

#define SAK_PRINT_ERR_LOG(fmt, ...) \
do \
{ \
   PrintErrLog(_THIS_FILE_NAME_, __LINE__, fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_WARN_LOG(fmt, ...)

#define SAK_PRINT_WARN_LOG(fmt, ...) \
do \
{ \
   PrintWarnLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_INFO_LOG(fmt, ...)

#define SAK_PRINT_INFO_LOG(fmt, ...) \
do \
{ \
   PrintInfoLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_NOTICE_LOG(fmt, ...)

#define SAK_PRINT_NOTICE_LOG(fmt, ...) \
do \
{ \
   PrintNoticeLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_DEBUG_LOG(fmt, ...)

#define SAK_PRINT_DEBUG_LOG(fmt, ...) \
do \
{ \
   PrintDebugLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)


      

Marco SAK_PRINT_TRACE_LOG(fmt, ...)

#define SAK_PRINT_TRACE_LOG(fmt, ...) \
do \
{ \
   PrintTraceLog(_THIS_FILE_NAME_, __LINE__,fmt,##__VA_ARGS__); \
}while(0)


      

Marco PR_TRACE(fmt, ...)

#define PR_TRACE(fmt, ...) 


      

Marco PR_TRACE_ENTER()

#define PR_TRACE_ENTER() 


      

Marco PR_TRACE_LEAVE

#define PR_TRACE_LEAVE()


      

Marco MPR_TRACE(module,fmt, ...)

#define MPR_TRACE(module,fmt, ...) 


      

Marco PR_DEBUG(fmt, ...)

#define PR_DEBUG(fmt, ...) 


      

Marco MPR_DEBUG(module,fmt, ...)

#define MPR_DEBUG(module,fmt, ...) 


      

Marco PR_TRACE(fmt, ...)

#define PR_TRACE(fmt, ...)  SAK_PRINT_TRACE_LOG(fmt, ##__VA_ARGS__)


      

Marco PR_TRACE_ENTER()

#define PR_TRACE_ENTER()    PR_TRACE("enter [%s]", (const char*)__func__)


      

Marco PR_TRACE_LEAVE()

#define PR_TRACE_LEAVE()    PR_TRACE("leave [%s]", (const char*)__func__)


      

Marco MPR_TRACE(module,fmt, ...)

#define MPR_TRACE(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_TRACE, fmt, ##__VA_ARGS__)


      

Marco PR_DEBUG(fmt, ...)

#define PR_DEBUG(fmt, ...)        SAK_PRINT_DEBUG_LOG(fmt, ##__VA_ARGS__)


      

Marco MPR_DEBUG(module,fmt, ...)

#define MPR_DEBUG(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_DEBUG, fmt, ##__VA_ARGS__)


      

Marco PR_ERR(fmt, ...)

#define PR_ERR(fmt, ...) SAK_PRINT_ERR_LOG(fmt, ##__VA_ARGS__)
// log interface for user

Marco PR_WARN(fmt, ...)

#define PR_WARN(fmt, ...) SAK_PRINT_WARN_LOG(fmt, ##__VA_ARGS__)


      

Marco PR_NOTICE(fmt, ...)

#define PR_NOTICE(fmt, ...) SAK_PRINT_NOTICE_LOG(fmt, ##__VA_ARGS__)


      

Marco PR_INFO(fmt, ...)

#define PR_INFO(fmt, ...) SAK_PRINT_INFO_LOG(fmt, ##__VA_ARGS__)


      

Marco SET_PR_DEBUG_LEVEL(level)

#define SET_PR_DEBUG_LEVEL(level) SetLogManageAttr(level)
// set log level

Marco MPR_ERR(module,fmt, ...)

#define MPR_ERR(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_ERR, fmt, ##__VA_ARGS__)
// log output interface with module name

Marco MPR_WARN(module,fmt, ...)

#define MPR_WARN(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_WARN, fmt, ##__VA_ARGS__)


      

Marco MPR_NOTICE(module,fmt, ...)

#define MPR_NOTICE(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_NOTICE, fmt, ##__VA_ARGS__)


      

Marco MPR_INFO(module,fmt, ...)

#define MPR_INFO(module,fmt, ...) SAK_PRINT_LOG(module,TY_LOG_LEVEL_INFO, fmt, ##__VA_ARGS__)


      

Marco PR_DEBUG_RAW

#define PR_DEBUG_RAW(fmt, ...)


      

Marco PR_DEBUG_RAW(fmt, ...)

#define PR_DEBUG_RAW(fmt, ...) PrintLogRaw(fmt, ##__VA_ARGS__)


      

Marco PR_DEBUG_RAW

#define PR_DEBUG_RAW(fmt, ...)


      

Marco _COM_MMOD_H

#define _COM_MMOD_H


      

Marco _UNI_MODULE_H

#define _UNI_MODULE_H


      

Marco _UNI_MSG_QUEUE_H

#define _UNI_MSG_QUEUE_H


      

Marco USE_SEM_COUNTING

#define USE_SEM_COUNTING 1


      

Marco PROC_MSG_DELAY

#define PROC_MSG_DELAY 100


      

Marco UNVALUED_MSGID

#define UNVALUED_MSGID 65535 // invalid message id


      

Marco _BASE_OS_ADAPTER_H

#define _BASE_OS_ADAPTER_H


      

Marco __TUYA_HAL_BLE_MESH_PROV_H__

#define __TUYA_HAL_BLE_MESH_PROV_H__


      

Marco TUYA_HAL_BT_H__

#define TUYA_HAL_BT_H__


      

Marco __TUYA_HAL_CELLULAR_H__

#define __TUYA_HAL_CELLULAR_H__


      

Marco __TUYA_HAL_FS_H__

#define __TUYA_HAL_FS_H__


      

Marco __TUYA_HAL_MEMORY_H__

#define __TUYA_HAL_MEMORY_H__


      

Marco _TUYA_HAL_MUTEX_H

#define _TUYA_HAL_MUTEX_H


      

Marco __TUYA_HAL_NETWORK_H__

#define __TUYA_HAL_NETWORK_H__


      

Marco UNW_FD_SET(n,p)

#define UNW_FD_SET(n,p)    tuya_hal_net_fd_set(n, p)
//Add file descriptor to set

Marco UNW_FD_CLR(n, p)

#define UNW_FD_CLR(n, p)   tuya_hal_net_fd_clear(n, p)
//Clear file descriptor from set

Marco UNW_FD_ISSET(n,p)

#define UNW_FD_ISSET(n,p)  tuya_hal_net_fd_isset(n,p)
//Check file descriptor is in set

Marco UNW_FD_ZERO(p)

#define UNW_FD_ZERO(p)     tuya_hal_net_fd_zero(p)
//Clear all descriptor in set

Marco _TUYA_HAL_OTA_H_

#define _TUYA_HAL_OTA_H_


      

Marco _TUYA_HAL_OUTPUT_H

#define _TUYA_HAL_OUTPUT_H


      

Marco _TUYA_HAL_QUEUE_H

#define _TUYA_HAL_QUEUE_H


      

Marco _TUYA_HAL_SEMAPHORE_H

#define _TUYA_HAL_SEMAPHORE_H


      

Marco __TUYA_HAL_STORAGE_H__

#define __TUYA_HAL_STORAGE_H__


      

Marco _TUYA_HAL_SYSTEM_H

#define _TUYA_HAL_SYSTEM_H


      

Marco __TUYA_HAL_THREAD_H__

#define __TUYA_HAL_THREAD_H__


      

Marco __TUYA_HAL_WIFI_H__

#define __TUYA_HAL_WIFI_H__


      

Marco __TUYA_HAL_WIRED_H__

#define __TUYA_HAL_WIRED_H__


      

Marco _TUYA_OS_ADAPTER_H

#define _TUYA_OS_ADAPTER_H


      

Marco TUYA_IRUSR

#define TUYA_IRUSR 256   /* Read by owner.  */
// 文件访问权限

Marco TUYA_IWUSR

#define TUYA_IWUSR 128   /* Write by owner.  */


      

Marco TUYA_IXUSR

#define TUYA_IXUSR 64   /* Execute by owner.  */


      

Marco TUYA_SEEK_SET

#define TUYA_SEEK_SET  0  /* Seek from beginning of file.  */
// 缓冲区搜索起始位置类型

Marco TUYA_SEEK_CUR

#define TUYA_SEEK_CUR  1  /* Seek from current position.  */


      

Marco TUYA_SEEK_END

#define TUYA_SEEK_END  2  /* Seek from end of file.  */


      

Marco TY_MAC_ADDR_LEN

#define TY_MAC_ADDR_LEN 6
//the MAC addr len

Marco TY_IPPROTO_IP

#define TY_IPPROTO_IP     0
/* tuya sdk multicast info */

Marco TY_IP_ADD_MEMBERSHIP

#define TY_IP_ADD_MEMBERSHIP 3


      

Marco TY_IP_DROP_MEMBERSHIP

#define TY_IP_DROP_MEMBERSHIP 4


      

Marco DEVICE_NAME_LEN

#define DEVICE_NAME_LEN        16
/********************************************************************************
 *********************************tuya_os_bt_intf********************************
 ********************************************************************************/

Marco TY_BT_MESH_APP_KEY_LEN

#define TY_BT_MESH_APP_KEY_LEN 16


      

Marco TY_BT_MESH_NET_KEY_LEN

#define TY_BT_MESH_NET_KEY_LEN 16


      

Marco TAG_SSID_NUMBER

#define TAG_SSID_NUMBER 0
/********************************************************************************
 *********************************tuya_os_wifi_intf******************************
 ********************************************************************************/

Marco TAG_PAYLOAD_NUMBER

#define TAG_PAYLOAD_NUMBER 221


      

Marco PROBE_REQUEST_TYPE_SUBTYPE

#define PROBE_REQUEST_TYPE_SUBTYPE 64


      

Marco PROBE_REQSPONSE_TYPE_SUBTYPE

#define PROBE_REQSPONSE_TYPE_SUBTYPE 80


      

Marco PROBE_REQUEST_DURATION_ID

#define PROBE_REQUEST_DURATION_ID 0


      

Marco PROBE_RESPONSET_DURATION_ID

#define PROBE_RESPONSET_DURATION_ID 0


      

Marco PROBE_REQUEST_PAYLOAD_LEN_MAX

#define PROBE_REQUEST_PAYLOAD_LEN_MAX 255


      

Marco BROADCAST_MAC_ADDR

#define BROADCAST_MAC_ADDR 4294967295


      

Marco WIFI_SSID_LEN

#define WIFI_SSID_LEN 32   // tuya sdk definition WIFI SSID MAX LEN
/* tuya sdk definition of wifi ap info */

Marco WIFI_PASSWD_LEN

#define WIFI_PASSWD_LEN 64 // tuya sdk definition WIFI PASSWD MAX LEN


      

Marco TO_FROM_DS_MASK

#define TO_FROM_DS_MASK 3


      

Marco TFD_IBSS

#define TFD_IBSS 0          ///< da+sa+bssid


      

Marco TFD_TO_AP

#define TFD_TO_AP 1         ///< bssid+sa+da


      

Marco TFD_FROM_AP

#define TFD_FROM_AP 2       ///< ds+bssid+sa


      

Marco TFD_WDS

#define TFD_WDS 3           ///< ra+ta+da


      

Marco PARTATION_NUM_MAX

#define PARTATION_NUM_MAX 3


      

Marco TUYA_OS_ADAPTER_ERROR_CODE_H

#define TUYA_OS_ADAPTER_ERROR_CODE_H


      

Marco IN

#define IN


      

Marco OUT

#define OUT


      

Marco INOUT

#define INOUT


      

Marco OPRT_OS_INTF_INVALID

#define OPRT_OS_INTF_INVALID  -200 //Component interface service is invalid


      

Marco OPRT_OS_ADAPTER_OK

#define OPRT_OS_ADAPTER_OK                     0
/**
 * @brief common error code
 */

Marco OPRT_OS_ADAPTER_COM_ERROR

#define OPRT_OS_ADAPTER_COM_ERROR              -1


      

Marco OPRT_OS_ADAPTER_INVALID_PARM

#define OPRT_OS_ADAPTER_INVALID_PARM           -2


      

Marco OPRT_OS_ADAPTER_MALLOC_FAILED

#define OPRT_OS_ADAPTER_MALLOC_FAILED          -3


      

Marco OPRT_OS_ADAPTER_NOT_SUPPORTED

#define OPRT_OS_ADAPTER_NOT_SUPPORTED          -4


      

Marco OPRT_OS_ADAPTER_NETWORK_ERROR

#define OPRT_OS_ADAPTER_NETWORK_ERROR          -5


      

Marco OPRT_OS_ADAPTER_ERRCODE_MUTEX

#define OPRT_OS_ADAPTER_ERRCODE_MUTEX          10100
/**
 * @brief error code of mutex
 */

Marco OPRT_OS_ADAPTER_MUTEX_CREAT_FAILED

#define OPRT_OS_ADAPTER_MUTEX_CREAT_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_MUTEX + 1)


      

Marco OPRT_OS_ADAPTER_MUTEX_LOCK_FAILED

#define OPRT_OS_ADAPTER_MUTEX_LOCK_FAILED      -(OPRT_OS_ADAPTER_ERRCODE_MUTEX + 2)


      

Marco OPRT_OS_ADAPTER_MUTEX_UNLOCK_FAILED

#define OPRT_OS_ADAPTER_MUTEX_UNLOCK_FAILED    -(OPRT_OS_ADAPTER_ERRCODE_MUTEX + 3)


      

Marco OPRT_OS_ADAPTER_MUTEX_RELEASE_FAILED

#define OPRT_OS_ADAPTER_MUTEX_RELEASE_FAILED   -(OPRT_OS_ADAPTER_ERRCODE_MUTEX + 4)


      

Marco OPRT_OS_ADAPTER_ERRCODE_SEM

#define OPRT_OS_ADAPTER_ERRCODE_SEM            10110
/**
 * @brief error code of semaphore
 */

Marco OPRT_OS_ADAPTER_SEM_CREAT_FAILED

#define OPRT_OS_ADAPTER_SEM_CREAT_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_SEM + 1)


      

Marco OPRT_OS_ADAPTER_SEM_WAIT_FAILED

#define OPRT_OS_ADAPTER_SEM_WAIT_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_SEM + 2)


      

Marco OPRT_OS_ADAPTER_SEM_POST_FAILED

#define OPRT_OS_ADAPTER_SEM_POST_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_SEM + 3)


      

Marco OPRT_OS_ADAPTER_SEM_RELEASE_FAILED

#define OPRT_OS_ADAPTER_SEM_RELEASE_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_SEM + 4)


      

Marco OPRT_OS_ADAPTER_ERRCODE_QUEUE

#define OPRT_OS_ADAPTER_ERRCODE_QUEUE          10120
/**
 * @brief error code of queue
 */

Marco OPRT_OS_ADAPTER_QUEUE_CREAT_FAILED

#define OPRT_OS_ADAPTER_QUEUE_CREAT_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_QUEUE + 1)


      

Marco OPRT_OS_ADAPTER_QUEUE_SEND_FAIL

#define OPRT_OS_ADAPTER_QUEUE_SEND_FAIL        -(OPRT_OS_ADAPTER_ERRCODE_QUEUE + 2)


      

Marco OPRT_OS_ADAPTER_QUEUE_RECV_FAIL

#define OPRT_OS_ADAPTER_QUEUE_RECV_FAIL        -(OPRT_OS_ADAPTER_ERRCODE_QUEUE + 3)


      

Marco OPRT_OS_ADAPTER_ERRCODE_THRD

#define OPRT_OS_ADAPTER_ERRCODE_THRD           10130
/**
 * @brief error code of thread
 */

Marco OPRT_OS_ADAPTER_THRD_CREAT_FAILED

#define OPRT_OS_ADAPTER_THRD_CREAT_FAILED      -(OPRT_OS_ADAPTER_ERRCODE_THRD + 1)


      

Marco OPRT_OS_ADAPTER_THRD_RELEASE_FAILED

#define OPRT_OS_ADAPTER_THRD_RELEASE_FAILED    -(OPRT_OS_ADAPTER_ERRCODE_THRD + 2)


      

Marco OPRT_OS_ADAPTER_THRD_JUDGE_SELF_FAILED

#define OPRT_OS_ADAPTER_THRD_JUDGE_SELF_FAILED -(OPRT_OS_ADAPTER_ERRCODE_THRD + 3)


      

Marco OPRT_OS_ADAPTER_ERRCODE_SYSTEM

#define OPRT_OS_ADAPTER_ERRCODE_SYSTEM         10140
/**
 * @brief error code of system
 */

Marco OPRT_OS_ADAPTER_CPU_LPMODE_SET_FAILED

#define OPRT_OS_ADAPTER_CPU_LPMODE_SET_FAILED  -(OPRT_OS_ADAPTER_ERRCODE_SYSTEM + 1)


      

Marco OPRT_OS_ADAPTER_ERRCODE_LOG

#define OPRT_OS_ADAPTER_ERRCODE_LOG            10150
/**
 * @brief error code of output
 */

Marco OPRT_OS_ADAPTER_LOG_CLOSE_FAILED

#define OPRT_OS_ADAPTER_LOG_CLOSE_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_LOG + 1)


      

Marco OPRT_OS_ADAPTER_LOG_OPEN_FAILED

#define OPRT_OS_ADAPTER_LOG_OPEN_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_LOG + 2)


      

Marco OPRT_OS_ADAPTER_ERRCODE_WIFI

#define OPRT_OS_ADAPTER_ERRCODE_WIFI           10160
/**
 * @brief error code of wifi
 */

Marco OPRT_OS_ADAPTER_AP_NOT_FOUND

#define OPRT_OS_ADAPTER_AP_NOT_FOUND           -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 1)


      

Marco OPRT_OS_ADAPTER_AP_SCAN_FAILED

#define OPRT_OS_ADAPTER_AP_SCAN_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 2)


      

Marco OPRT_OS_ADAPTER_AP_RELEASE_FAILED

#define OPRT_OS_ADAPTER_AP_RELEASE_FAILED      -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 3)


      

Marco OPRT_OS_ADAPTER_CHAN_SET_FAILED

#define OPRT_OS_ADAPTER_CHAN_SET_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 4)


      

Marco OPRT_OS_ADAPTER_CHAN_GET_FAILED

#define OPRT_OS_ADAPTER_CHAN_GET_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 5)


      

Marco OPRT_OS_ADAPTER_IP_GET_FAILED

#define OPRT_OS_ADAPTER_IP_GET_FAILED          -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 6)


      

Marco OPRT_OS_ADAPTER_MAC_SET_FAILED

#define OPRT_OS_ADAPTER_MAC_SET_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 7)


      

Marco OPRT_OS_ADAPTER_MAC_GET_FAILED

#define OPRT_OS_ADAPTER_MAC_GET_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 8)


      

Marco OPRT_OS_ADAPTER_WORKMODE_SET_FAILED

#define OPRT_OS_ADAPTER_WORKMODE_SET_FAILED    -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 9)


      

Marco OPRT_OS_ADAPTER_WORKMODE_GET_FAILED

#define OPRT_OS_ADAPTER_WORKMODE_GET_FAILED    -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 10)


      

Marco OPRT_OS_ADAPTER_SNIFFER_SET_FAILED

#define OPRT_OS_ADAPTER_SNIFFER_SET_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 11)


      

Marco OPRT_OS_ADAPTER_AP_START_FAILED

#define OPRT_OS_ADAPTER_AP_START_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 12)


      

Marco OPRT_OS_ADAPTER_AP_STOP_FAILED

#define OPRT_OS_ADAPTER_AP_STOP_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 13)


      

Marco OPRT_OS_ADAPTER_APINFO_GET_FAILED

#define OPRT_OS_ADAPTER_APINFO_GET_FAILED      -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 14)


      

Marco OPRT_OS_ADAPTER_FAST_CONN_FAILED

#define OPRT_OS_ADAPTER_FAST_CONN_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 15)


      

Marco OPRT_OS_ADAPTER_CONN_FAILED

#define OPRT_OS_ADAPTER_CONN_FAILED            -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 16)


      

Marco OPRT_OS_ADAPTER_DISCONN_FAILED

#define OPRT_OS_ADAPTER_DISCONN_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 17)


      

Marco OPRT_OS_ADAPTER_RSSI_GET_FAILED

#define OPRT_OS_ADAPTER_RSSI_GET_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 18)


      

Marco OPRT_OS_ADAPTER_BSSID_GET_FAILED

#define OPRT_OS_ADAPTER_BSSID_GET_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 19)


      

Marco OPRT_OS_ADAPTER_STAT_GET_FAILED

#define OPRT_OS_ADAPTER_STAT_GET_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 20)


      

Marco OPRT_OS_ADAPTER_CCODE_SET_FAILED

#define OPRT_OS_ADAPTER_CCODE_SET_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 21)


      

Marco OPRT_OS_ADAPTER_MGNT_SEND_FAILED

#define OPRT_OS_ADAPTER_MGNT_SEND_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 22)


      

Marco OPRT_OS_ADAPTER_MGNT_REG_FAILED

#define OPRT_OS_ADAPTER_MGNT_REG_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 23)


      

Marco OPRT_OS_ADAPTER_WF_LPMODE_SET_FAILED

#define OPRT_OS_ADAPTER_WF_LPMODE_SET_FAILED   -(OPRT_OS_ADAPTER_ERRCODE_WIFI + 24)


      

Marco OPRT_OS_ADAPTER_ERRCODE_FLASH

#define OPRT_OS_ADAPTER_ERRCODE_FLASH          10210
/**
 * @brief error code of flash
 */

Marco OPRT_OS_ADAPTER_FLASH_READ_FAILED

#define OPRT_OS_ADAPTER_FLASH_READ_FAILED      -(OPRT_OS_ADAPTER_ERRCODE_FLASH + 1)


      

Marco OPRT_OS_ADAPTER_FLASH_WRITE_FAILED

#define OPRT_OS_ADAPTER_FLASH_WRITE_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_FLASH + 2)


      

Marco OPRT_OS_ADAPTER_FLASH_ERASE_FAILED

#define OPRT_OS_ADAPTER_FLASH_ERASE_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_FLASH + 3)


      

Marco OPRT_OS_ADAPTER_ERRCODE_OTA

#define OPRT_OS_ADAPTER_ERRCODE_OTA            10220
/**
 * @brief error code of ota
 */

Marco OPRT_OS_ADAPTER_OTA_START_INFORM_FAILED

#define OPRT_OS_ADAPTER_OTA_START_INFORM_FAILED -(OPRT_OS_ADAPTER_ERRCODE_OTA + 1)


      

Marco OPRT_OS_ADAPTER_OTA_PKT_SIZE_FAILED

#define OPRT_OS_ADAPTER_OTA_PKT_SIZE_FAILED    -(OPRT_OS_ADAPTER_ERRCODE_OTA + 2)


      

Marco OPRT_OS_ADAPTER_OTA_PROCESS_FAILED

#define OPRT_OS_ADAPTER_OTA_PROCESS_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_OTA + 3)


      

Marco OPRT_OS_ADAPTER_OTA_VERIFY_FAILED

#define OPRT_OS_ADAPTER_OTA_VERIFY_FAILED      -(OPRT_OS_ADAPTER_ERRCODE_OTA + 4)


      

Marco OPRT_OS_ADAPTER_OTA_END_INFORM_FAILED

#define OPRT_OS_ADAPTER_OTA_END_INFORM_FAILED  -(OPRT_OS_ADAPTER_ERRCODE_OTA + 5)


      

Marco OPRT_OS_ADAPTER_ERRCODE_WD

#define OPRT_OS_ADAPTER_ERRCODE_WD             10230
/**
 * @brief error code of watchdog
 */

Marco OPRT_OS_ADAPTER_WD_INIT_FAILED

#define OPRT_OS_ADAPTER_WD_INIT_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_WD + 1)


      

Marco OPRT_OS_ADAPTER_ERRCODE_GPIO

#define OPRT_OS_ADAPTER_ERRCODE_GPIO           10240
/**
 * @brief error code of gpio
 */

Marco OPRT_OS_ADAPTER_GPIO_INOUT_SET_FAILED

#define OPRT_OS_ADAPTER_GPIO_INOUT_SET_FAILED  -(OPRT_OS_ADAPTER_ERRCODE_GPIO + 1)


      

Marco OPRT_OS_ADAPTER_GPIO_MODE_SET_FAILED

#define OPRT_OS_ADAPTER_GPIO_MODE_SET_FAILED   -(OPRT_OS_ADAPTER_ERRCODE_GPIO + 2)


      

Marco OPRT_OS_ADAPTER_GPIO_WRITE_FAILED

#define OPRT_OS_ADAPTER_GPIO_WRITE_FAILED      -(OPRT_OS_ADAPTER_ERRCODE_GPIO + 3)


      

Marco OPRT_OS_ADAPTER_GPIO_IRQ_INIT_FAILED

#define OPRT_OS_ADAPTER_GPIO_IRQ_INIT_FAILED   -(OPRT_OS_ADAPTER_ERRCODE_GPIO + 4)


      

Marco OPRT_OS_ADAPTER_ERRCODE_UART

#define OPRT_OS_ADAPTER_ERRCODE_UART           10250
/**
 * @brief error code of uart
 */

Marco OPRT_OS_ADAPTER_UART_INIT_FAILED

#define OPRT_OS_ADAPTER_UART_INIT_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_UART + 1)


      

Marco OPRT_OS_ADAPTER_UART_DEINIT_FAILED

#define OPRT_OS_ADAPTER_UART_DEINIT_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_UART + 2)


      

Marco OPRT_OS_ADAPTER_UART_SEND_FAILED

#define OPRT_OS_ADAPTER_UART_SEND_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_UART + 3)


      

Marco OPRT_OS_ADAPTER_UART_READ_FAILED

#define OPRT_OS_ADAPTER_UART_READ_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_UART + 4)


      

Marco OPRT_OS_ADAPTER_ERRCODE_I2C

#define OPRT_OS_ADAPTER_ERRCODE_I2C            10260
/**
 * @brief error code of i2c
 */

Marco OPRT_OS_ADAPTER_I2C_OPEN_FAILED

#define OPRT_OS_ADAPTER_I2C_OPEN_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_I2C + 1)


      

Marco OPRT_OS_ADAPTER_I2C_CLOSE_FAILED

#define OPRT_OS_ADAPTER_I2C_CLOSE_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_I2C + 2)


      

Marco OPRT_OS_ADAPTER_I2C_READ_FAILED

#define OPRT_OS_ADAPTER_I2C_READ_FAILED        -(OPRT_OS_ADAPTER_ERRCODE_I2C + 3)


      

Marco OPRT_OS_ADAPTER_I2C_WRITE_FAILED

#define OPRT_OS_ADAPTER_I2C_WRITE_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_I2C + 4)


      

Marco OPRT_OS_ADAPTER_ERRCODE_BT

#define OPRT_OS_ADAPTER_ERRCODE_BT             10270
/**
 * @brief error code of bluetooth
 */

Marco OPRT_OS_ADAPTER_BT_INIT_FAILED

#define OPRT_OS_ADAPTER_BT_INIT_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_BT + 1)


      

Marco OPRT_OS_ADAPTER_BT_DEINIT_FAILED

#define OPRT_OS_ADAPTER_BT_DEINIT_FAILED       -(OPRT_OS_ADAPTER_ERRCODE_BT + 2)


      

Marco OPRT_OS_ADAPTER_BT_DISCONN_FAILED

#define OPRT_OS_ADAPTER_BT_DISCONN_FAILED      -(OPRT_OS_ADAPTER_ERRCODE_BT + 3)


      

Marco OPRT_OS_ADAPTER_BT_SEND_FAILED

#define OPRT_OS_ADAPTER_BT_SEND_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_BT + 4)


      

Marco OPRT_OS_ADAPTER_BT_ADV_RESET_FAILED

#define OPRT_OS_ADAPTER_BT_ADV_RESET_FAILED    -(OPRT_OS_ADAPTER_ERRCODE_BT + 5)


      

Marco OPRT_OS_ADAPTER_BT_RSSI_GET_FAILED

#define OPRT_OS_ADAPTER_BT_RSSI_GET_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_BT + 6)


      

Marco OPRT_OS_ADAPTER_BT_ADV_START_FAILED

#define OPRT_OS_ADAPTER_BT_ADV_START_FAILED    -(OPRT_OS_ADAPTER_ERRCODE_BT + 7)


      

Marco OPRT_OS_ADAPTER_BT_ADV_STOP_FAILED

#define OPRT_OS_ADAPTER_BT_ADV_STOP_FAILED     -(OPRT_OS_ADAPTER_ERRCODE_BT + 8)


      

Marco OPRT_OS_ADAPTER_BT_SCAN_FAILED

#define OPRT_OS_ADAPTER_BT_SCAN_FAILED         -(OPRT_OS_ADAPTER_ERRCODE_BT + 9)


      

Marco _AES_INF_H

#define _AES_INF_H


      

Marco AES128_ENCRYPT_KEY_LEN

#define AES128_ENCRYPT_KEY_LEN 16


      

Marco aes128_free_data

#define aes128_free_data                   aes_free_data


      

Marco aes128_get_data_actual_length

#define aes128_get_data_actual_length      aes_get_actual_length


      

Marco APR_SHA1_H

#define APR_SHA1_H


      

Marco APR_SHA1_DIGESTSIZE

#define APR_SHA1_DIGESTSIZE 20
/** size of the SHA1 DIGEST */

Marco APR_SHA1PW_ID

#define APR_SHA1PW_ID "{SHA}"
/**
 * Define the Magic String prefix that identifies a password as being
 * hashed using our algorithm.
 */

Marco APR_SHA1PW_IDLEN

#define APR_SHA1PW_IDLEN 5
/** length of the SHA Password */

Marco __CR_CRC32I_H__

#define __CR_CRC32I_H__ 


      

Marco _CRC_16_H

#define _CRC_16_H


      

Marco __CRC_16_MODULE_EXT

#define __CRC_16_MODULE_EXT


      

Marco __CRC_16_MODULE_EXT

#define __CRC_16_MODULE_EXT extern


      

Marco _CRC_8_H

#define _CRC_8_H


      

Marco __CRC_8_MODULE_EXT

#define __CRC_8_MODULE_EXT


      

Marco __CRC_8_MODULE_EXT

#define __CRC_8_MODULE_EXT extern


      

Marco POLARSSL_SHA2_H

#define POLARSSL_SHA2_H


      

Marco POLARSSL_SHA2_C

#define POLARSSL_SHA2_C 1


      

Marco POLARSSL_ERR_SHA2_FILE_IO_ERROR

#define POLARSSL_ERR_SHA2_FILE_IO_ERROR -120 /**< Read/write error in file. */
//#define POLARSSL_SELF_TEST	1

Marco SHA256TYPE

#define SHA256TYPE 0


      

Marco SHA244TYPE

#define SHA244TYPE 1


      

Marco _UNI_BASE64_H

#define _UNI_BASE64_H


      

Marco __UNI_MD5_H

#define __UNI_MD5_H 


      

Marco MD5_DECRYPT_LEN

#define MD5_DECRYPT_LEN  16


      

Marco _ASYNC_NOTIFY_H

#define _ASYNC_NOTIFY_H


      

Marco _SYS_TIMER_H

#define _SYS_TIMER_H


      

Marco _UNI_TIME_QUEUE_H

#define _UNI_TIME_QUEUE_H


      

Marco _TUYA_UF_DB_H_

#define _TUYA_UF_DB_H_


      

Marco cJSON__h

#define cJSON__h


      

Marco __HASHMAP_H__

#define __HASHMAP_H__


      

Marco MAP_MISSING

#define MAP_MISSING -2 /* No such element */
/**
 * @brief define some special error code for hashmap module
 * 
 */

Marco MAP_OMEM

#define MAP_OMEM -1	/* Out of Memory */


      

Marco MAP_OK

#define MAP_OK 0	/* OK */


      

Marco HASHMAP_FOR_EACH_DATA(in, key, data_iter)

#define HASHMAP_FOR_EACH_DATA(in, key, data_iter) \
   for(data_iter = NULL; hashmap_data_traversal(in, key, (any_t_iter *)&data_iter) == MAP_OK; /*empty*/)
/**
 * @brief traverse all data with same key
 * 
 */

Marco _MEM_POOL_H

#define _MEM_POOL_H


      

Marco SYS_MEM_DEBUG

#define SYS_MEM_DEBUG 0 
/**
 * @brief system memory debug flag
 * 
 */

Marco SHOW_MEM_POOL_DEBUG

#define SHOW_MEM_POOL_DEBUG 1 
/**
 * @brief system memory debug  display flag
 * 
 */

Marco MEM_POOL_MUTLI_THREAD

#define MEM_POOL_MUTLI_THREAD 1
/**
 * @brief support multi thread memory process
 * 
 */

Marco Malloc(x)

#define Malloc(x) __Malloc(x,__FILE__,__LINE__)
/**
 * @brief malloc memory
 * 
 * @param[in] reqSize the required memory size 
 * @return  NULL on failed, others on the address of the memory
 */

Marco Calloc(x)

#define Calloc(x) __Calloc(x, y,__FILE__,__LINE__)
/**
 * @brief malloc consecutive memory, the size is reqCount*reqSize
 * 
 * @param[in] reqCount the required memory count
 * @param[in] reqSize the required memory szie
 * @return NULL on failed, others on the address of the memory
 */

Marco Free(x)

#define Free(x) __Free(x,__FILE__,__LINE__)
/**
 * @brief free memory
 * 
 * @param[in] pReqMem the memory address which got from Malloc or Calloc function
 * @return VOID 
 */

Marco _MIX_METHOD_H

#define _MIX_METHOD_H


      

Marco _TUYA_BASE_UTILITIES_H

#define _TUYA_BASE_UTILITIES_H


      

Marco ty_cJSON__h

#define ty_cJSON__h


      

Marco ty_cJSON_AddNullToObject(object,name)

#define ty_cJSON_AddNullToObject(object,name)	ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateNull())
/* Macros for creating things quickly. */

Marco ty_cJSON_AddTrueToObject(object,name)

#define ty_cJSON_AddTrueToObject(object,name)	ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateTrue())


      

Marco ty_cJSON_AddFalseToObject(object,name)

#define ty_cJSON_AddFalseToObject(object,name)	ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateFalse())


      

Marco ty_cJSON_AddBoolToObject(object,name,b)

#define ty_cJSON_AddBoolToObject(object,name,b)    ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateBool(b))


      

Marco ty_cJSON_AddNumberToObject(object,name,n)

#define ty_cJSON_AddNumberToObject(object,name,n) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateNumber(n))


      

Marco ty_cJSON_AddStringToObject(object,name,s)

#define ty_cJSON_AddStringToObject(object,name,s) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateString(s))


      

Marco ty_cJSON_SetIntValue(object,val)

#define ty_cJSON_SetIntValue(object,val)		((object)?(object)->valueint=(object)->valuedouble=(val):(val))
/* When assigning an integer value, it needs to be propagated to valuedouble too. */

Marco ty_cJSON_ArrayForEach(pos, head)

#define ty_cJSON_ArrayForEach(pos, head)           for(pos = (head)->child; pos != NULL; pos = pos->next)
/* Macro for iterating over an array */

Marco __TUYA_UNI_FS_H__

#define __TUYA_UNI_FS_H__


      

Marco _UNI_HLIST_H

#define _UNI_HLIST_H


      

Marco HLIST_HEAD_INIT

#define HLIST_HEAD_INIT { .first = NULL}
/**
 * @brief hash list head initialization
 * 
 */

Marco HLIST_HEAD(name)

#define HLIST_HEAD(name) HLIST_HEAD name = {.first = NULL}
/**
 * @brief hash list head define and initialization
 * 
 */

Marco INIT_HLIST_HEAD(ptr)

#define INIT_HLIST_HEAD(ptr) ((ptr->first)=NULL)
/**
 * @brief hash list head pointer initialization
 * 
 */

Marco HLIST_ENTRY(ptr, type, member)

#define HLIST_ENTRY(ptr, type, member) CNTR_OF(ptr,type,member)
/**
 * @brief convert hash list node to object
 * 
 */

Marco HLIST_FOR_EACH_ENTRY(tpos, type, pos, head, member)

#define HLIST_FOR_EACH_ENTRY(tpos, type, pos, head, member) \
   for (pos = (head)->first;                    \
        pos && (tpos = HLIST_ENTRY(pos, type, member), 1); \
        pos = pos->next)
/**
 * @brief traverse the member of the hash list
 * 
 */

Marco HLIST_FOR_EACH_ENTRY_CURR(tpos, type, pos, curr, member)

#define HLIST_FOR_EACH_ENTRY_CURR(tpos, type, pos, curr, member) \
   for (pos = (curr)->next;                    \
        pos && (tpos = HLIST_ENTRY(pos, type, member), 1); \
        pos = pos->next)
/**
 * @brief traverse the member of the hash list from a special member
 * 
 */

Marco HLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, head, member)

#define HLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, head, member) \
   for (pos = (head)->first; \
        pos && (n = pos->next, 1) && \
       (tpos = HLIST_ENTRY(pos, type, member), 1); \
        pos = n)
/**
 * @brief traverse the member of the hash list in safe mode, can change the hash list when traverse
 * 
 */

Marco HLIST_FOR_EACH(pos, head)

#define HLIST_FOR_EACH(pos, head) \
   for (pos = (head)->first; pos ; \
        pos = pos->next)
/**
 * @brief traverse the hash list node
 * 
 */

Marco HLIST_FOR_EACH_SAFE(pos, n, head)

#define HLIST_FOR_EACH_SAFE(pos, n, head) \
   for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
        pos = n)
/**
 * @brief traverse the hash list node in safe mode, can change the hash list when traverse
 * 
 */

Marco __TUYA_BASE_UNI_DNS_CACHE_H__

#define __TUYA_BASE_UNI_DNS_CACHE_H__


      

Marco MAX_DOMAIN_NAME_LEN

#define MAX_DOMAIN_NAME_LEN    128
/**
 * @brief max length of domain name
 * 
 */

Marco HTTP_DNS_SERVER_DOMAIN

#define HTTP_DNS_SERVER_DOMAIN   "h3.iot-dns.com"
// TLS_MODE==TLS_TUYA_PSK_ONLY or TLS_MODE==TLS_TUYA_ECC_PSK

Marco HTTP_DNS_SERVER_DOMAIN_WE

#define HTTP_DNS_SERVER_DOMAIN_WE "h3-we.iot-dns.com"


      

Marco HTTP_DNS_SERVER_DOMAIN

#define HTTP_DNS_SERVER_DOMAIN   "h4.iot-dns.com"
// TLS_MODE==TLS_TUYA_ECC_CLIENT_AUTH

Marco HTTP_DNS_SERVER_DOMAIN_WE

#define HTTP_DNS_SERVER_DOMAIN_WE "h4-we.iot-dns.com"


      

Marco HTTP_DNS_SERVER_DOMAIN

#define HTTP_DNS_SERVER_DOMAIN   "h2.iot-dns.com"
// TLS_MODE==TLS_TUYA_PSK_ONLY or TLS_MODE==TLS_TUYA_ECC_ONLY_NOSTRIP

Marco HTTP_DNS_SERVER_DOMAIN_WE

#define HTTP_DNS_SERVER_DOMAIN_WE "h2-we.iot-dns.com"


      

Marco _UNI_POINTER_H

#define _UNI_POINTER_H


      

Marco LIST_HEAD_INIT(name)

#define LIST_HEAD_INIT(name) { &(name), &(name) }
/**
 * @brief define and initialize bidirection list head
 * 
 */

Marco LIST_HEAD(name)

#define LIST_HEAD(name) \
LIST_HEAD name = LIST_HEAD_INIT(name)


      

Marco INIT_LIST_HEAD(ptr)

#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
/**
 * @brief bidirection list initialization
 * 
 */

Marco NEW_LIST_NODE(type, node)

#define NEW_LIST_NODE(type, node) \
{\
   node = (type *)Malloc(sizeof(type));\
}
/**
 * @brief create a new bidirection list, will call malloc
 * 
 */

Marco FREE_LIST(type, p, list_name)\ {\

#define FREE_LIST(type, p, list_name)\
{\
   type *posnode;\
   while(!tuya_list_empty(&(p)->list_name)) {\
   posnode = tuya_list_entry((&(p)->list_name)->next, type, list_name);\
   tuya_list_del((&(p)->list_name)->next);\
   Free(posnode);\
   }\
}
/**
 * @brief free all objects in the bidirection list
 * 
 */

Marco GetFirstNode(type,p,list_name,pGetNode)\ {\

#define GetFirstNode(type,p,list_name,pGetNode)\
{\
   pGetNode = NULL;\
   while(!tuya_list_empty(&(p)->list_name)){\
   pGetNode = tuya_list_entry((&(p)->list_name)->next, type, list_name);\
   break;\
   }\
}
/**
 * @brief get the first object of the bidirection list
 * 
 */

Marco DeleteNodeAndFree(pDelNode,list_name)\ {\

#define DeleteNodeAndFree(pDelNode,list_name)\
{\
   tuya_list_del(&(pDelNode->list_name));\
   Free(pDelNode);\
}
/**
 * @brief remove the object from bidirection list and free the memory
 * 
 * @note the pDelNode must be the object pointer
 */

Marco DeleteNode(pDelNode,list_name)\ {\

#define DeleteNode(pDelNode,list_name)\
{\
   tuya_list_del(&(pDelNode->list_name));\
}
/**
 * @brief remove the object from the bidirection list
 * 
 */

Marco FreeNode(pDelNode)\ {\

#define FreeNode(pDelNode)\
{\
   Free(pDelNode);\
}
/**
 * @brief free the object in bidirection list
 * 
 */

Marco tuya_list_entry(ptr, type, member)

#define tuya_list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(size_t)(&((type *)0)->member)))
/**
 * @brief cast the bidirection list node to object
 * 
 */

Marco tuya_list_for_each(pos, head)

#define tuya_list_for_each(pos, head) \
for (pos = (head)->next; (pos != NULL) && (pos != (head)); pos = pos->next)
/**
 * @brief traverse the bidirection list, cannot change the bidiretion list during traverse
 * 
 */

Marco tuya_list_for_each_safe(p, n, head)

#define tuya_list_for_each_safe(p, n, head) \
for (p = (head)->next; n = p->next, p != (head); p = n)
/**
 * @brief traverse the bidirection list, can change the bidiretion list during traverse
 * 
 */

Marco _UNI_QUEUE_H

#define _UNI_QUEUE_H


      

Marco QUEUE_SAFE_FUNC

#define QUEUE_SAFE_FUNC
/**
 * @brief support reentry prevent
 * 
 */

Marco __UNI_RANDOM_H__

#define __UNI_RANDOM_H__


      

Marco _UNI_RFC_H

#define _UNI_RFC_H


      

Marco _UNI_SLIST_H

#define _UNI_SLIST_H


      

Marco SLIST_HEAD(name)

#define SLIST_HEAD(name) \
SLIST_HEAD name = {NULL}
/**
 * @brief define a sigle list head and initialize to empty
 * 
 */

Marco INIT_SLIST_HEAD(ptr)

#define INIT_SLIST_HEAD(ptr) do { \
   (ptr)->next = NULL; \
} while (0)
/**
 * @brief sigle list head initialization
 * 
 */

Marco NEW_SLIST_NODE(type,node)

#define NEW_SLIST_NODE(type,node) \
{\
   node = (type *)Malloc(sizeof(type));\
}
/**
 * @brief new a sigle list head, will call Malloc
 * 
 */

Marco SLIST_ENTRY(ptr, type, member)

#define SLIST_ENTRY(ptr, type, member) CNTR_OF(ptr,type,member)
/**
 * @brief cast the slist entry to special type 
 * 
 */

Marco SLIST_FOR_EACH_ENTRY(tpos, type, pos, list, member)

#define SLIST_FOR_EACH_ENTRY(tpos, type, pos, list, member) \
   for (pos = (list)->next;                    \
        pos && (tpos = SLIST_ENTRY(pos, type, member), 1); \
        pos = pos->next)
/**
 * @brief traverse each object of the sigle list, cannot change the sigle list
 * 
 */

Marco SLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, list, member)

#define SLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, list, member) \
   for (pos = (list)->next; \
        pos && (n = pos->next, 1) && \
       (tpos = SLIST_ENTRY(pos, type, member), 1); \
        pos = n)
/**
 * @brief traverse each object of the sigle list, you can add or del the object during traverse
 * 
 */

Marco SLIST_FOR_EACH(pos, list)

#define SLIST_FOR_EACH(pos, list) \
   for (pos = (list)->next; pos ; \
        pos = pos->next)
/**
 * @brief traverse each node of the sigle list, cannot change the sigle list
 * 
 */

Marco SLIST_FOR_EACH_SAFE(pos, n, list)

#define SLIST_FOR_EACH_SAFE(pos, n, list) \
   for (pos = (list)->next; pos && ({ n = pos->next; 1; }); \
        pos = n)
/**
 * @brief traverse each node of the sigle list, you can add or del the object during traverse
 * 
 */

Marco FREE_SLIST_SAFE(tpos, type, pos, n, list, member)

#define FREE_SLIST_SAFE(tpos, type, pos, n, list, member) \
{\
   type *posnode; \
   SLIST_FOR_EACH_ENTRY_SAFE(tpos, type, pos, n, list, member) { \
       list->next = n; \
       posnode = tpos; \
       Free(posnode); \
   } \
}
/**
 * @brief traverse and free each object of the sigle list
 * 
 */

Marco _UNI_THREAD_H

#define _UNI_THREAD_H


      

Marco MAX_THREAD_NAME_LEN

#define MAX_THREAD_NAME_LEN    16
/**
 * @brief max length of thread name
 * 
 */

Marco _UNI_TIME_H

#define _UNI_TIME_H


      

Marco SUM_ZONE_TAB_LMT

#define SUM_ZONE_TAB_LMT 6
/**
 * @brief number of time zone table
 * 
 */

Marco _WIFI_MGNT_H

#define _WIFI_MGNT_H


      

Marco _WIFI_MGNT_EXT

#define _WIFI_MGNT_EXT


      

Marco _WIFI_MGNT_EXT

#define _WIFI_MGNT_EXT extern


      

Marco PROBE_SSID

#define PROBE_SSID "tuya_smart"
/***********************************************************
*************************micro define***********************
***********************************************************/

Marco _WF_BASIC_INTF_H

#define _WF_BASIC_INTF_H


      

Marco __WF_BASIC_INTF_EXT

#define __WF_BASIC_INTF_EXT


      

Marco __WF_BASIC_INTF_EXT

#define __WF_BASIC_INTF_EXT extern


      

Marco _BASE_NW_INTF_H

#define _BASE_NW_INTF_H


      

Marco _TY_WORK_QUEUE_H

#define _TY_WORK_QUEUE_H


      

Marco _UNI_WORK_QUEUE_H

#define _UNI_WORK_QUEUE_H


      

Marco _AP_NETCFG_H_

#define _AP_NETCFG_H_


      

Marco __FFS_KEY_H__

#define __FFS_KEY_H__


      

Marco COMMON_THBG23JMC_1

#define COMMON_THBG23JMC_1
//#define IPC_1

Marco FFS_PID_TEST

#define FFS_PID_TEST                       ("RLM2")


      

Marco FFS_PIN_TEST

#define FFS_PIN_TEST                       ("QuMCv58GG")


      

Marco FFS_SERIAL_NUMBER_TEST

#define FFS_SERIAL_NUMBER_TEST             ("THBG23JMC00001")


      

Marco FFS_PID_TEST

#define FFS_PID_TEST                       ("yczP")


      

Marco FFS_PIN_TEST

#define FFS_PIN_TEST                       ("fYM0q0Ru0")


      

Marco FFS_SERIAL_NUMBER_TEST

#define FFS_SERIAL_NUMBER_TEST             ("GEBF12MRP00001")


      

Marco FFS_PID_TEST

#define FFS_PID_TEST                       ("RLM2")
//wipro #8 ok

Marco FFS_PIN_TEST

#define FFS_PIN_TEST                       ("TvS5w66KL")


      

Marco FFS_SERIAL_NUMBER_TEST

#define FFS_SERIAL_NUMBER_TEST             ("SLBE25APT00008")


      

Marco __FFS_NETCFG__

#define __FFS_NETCFG__


      

Marco __TUYA_FFS_H__

#define __TUYA_FFS_H__


      

Marco __TUYA_FFS_ADAPTER_H__

#define __TUYA_FFS_ADAPTER_H__


      

Marco __TUYA_FFS_CONFIG_H__

#define __TUYA_FFS_CONFIG_H__


      

Marco TUYA_FFS_TEST_MODE

#define TUYA_FFS_TEST_MODE                 (0)


      

Marco TUYA_FFS_MODE

#define TUYA_FFS_MODE                      (1)


      

Marco TUYA_FFS_SUPPORT_MBEDTLS

#define TUYA_FFS_SUPPORT_MBEDTLS           (1)


      

Marco TUYA_FFS_SUPPORT_OPENSSL

#define TUYA_FFS_SUPPORT_OPENSSL           (0)


      

Marco TUYA_FFS_DSS_API_VERSION

#define TUYA_FFS_DSS_API_VERSION           ("v1")


      

Marco FFS_MANUFACTURER_NAME

#define FFS_MANUFACTURER_NAME              ("Tuya")


      

Marco FFS_MODEL_NUMBER

#define FFS_MODEL_NUMBER                   ("RTL8720DN")


      

Marco FFS_HARDWARE_REVISION

#define FFS_HARDWARE_REVISION              ("1.0.0")


      

Marco FFS_FIRMWARE_REVISION

#define FFS_FIRMWARE_REVISION              ("1.0.0")


      

Marco FFS_DEVICE_NAME

#define FFS_DEVICE_NAME                    ("TestDevice")


      

Marco FFS_HTTPS_PORT

#define FFS_HTTPS_PORT                     (443)


      

Marco FFS_DSS_ENDPOINT_DEFAULT

#define FFS_DSS_ENDPOINT_DEFAULT           ("https://dp-sps-na.amazon.com")


      

Marco FFS_DEFAULT_SSID

#define FFS_DEFAULT_SSID                   ("simple_setup")


      

Marco FFS_TASK_STACK_DEPTH

#define FFS_TASK_STACK_DEPTH               (2048)


      

Marco FFS_TASK_PRIORITY

#define FFS_TASK_PRIORITY                  (TRD_PRIO_0)


      

Marco FFS_CLIENT_NONCE_SIZE

#define FFS_CLIENT_NONCE_SIZE              (12)


      

Marco FFS_DSS_NONCE_SIZE

#define FFS_DSS_NONCE_SIZE                 (31)


      

Marco FFS_PIN_SIZE

#define FFS_PIN_SIZE                       (9)


      

Marco FFS_PID_SIZE

#define FFS_PID_SIZE                       (4)


      

Marco FFS_SN_SIZE

#define FFS_SN_SIZE                        (15)


      

Marco FFS_CONNECT_WIFI_TIMEOUT_SEC

#define FFS_CONNECT_WIFI_TIMEOUT_SEC       (10)


      

Marco FFS_WIFI_SSID_LEN

#define FFS_WIFI_SSID_LEN                  (32)


      

Marco FFS_WIFI_PASSWD_LEN

#define FFS_WIFI_PASSWD_LEN                (64)


      

Marco FFS_CHECK_SUCCESS(ret)

#define FFS_CHECK_SUCCESS(ret) { \
       if (OPRT_OK != ret) { \
           PR_ERR("fail."); \
           return ret; \
       } \
   }


      

Marco __TUYA_FFS_DSS_H__

#define __TUYA_FFS_DSS_H__


      

Marco TUYA_FFS_DSS_HOST_LEN

#define TUYA_FFS_DSS_HOST_LEN                      (127)


      

Marco __TUYA_FFS_INC_H__

#define __TUYA_FFS_INC_H__


      

Marco __TUYA_FFS_STREAM_H__

#define __TUYA_FFS_STREAM_H__


      

Marco TUYA_FFS_TEMPORARY_STREAM(name, size)

#define TUYA_FFS_TEMPORARY_STREAM(name, size) \
   CHAR_T name ## data[size] = {0}; \
   tuya_ffs_stream_t name ; \
   memset(&name, 0, sizeof(name)); \
   name.data = name ## data; \
   name.max_size = size; \



      

Marco __NETCFG_API__H__

#define __NETCFG_API__H__


      

Marco _AIRKISS_BC_H

#define _AIRKISS_BC_H


      

Marco __AIRKISS_BC_MODULE_EXT

#define __AIRKISS_BC_MODULE_EXT


      

Marco __AIRKISS_BC_MODULE_EXT

#define __AIRKISS_BC_MODULE_EXT extern


      

Marco _EZ_MC_H

#define _EZ_MC_H


      

Marco __EZ_MC_MODULE_EXT

#define __EZ_MC_MODULE_EXT


      

Marco __EZ_MC_MODULE_EXT

#define __EZ_MC_MODULE_EXT extern


      

Marco __THING_CONFIG_H__

#define __THING_CONFIG_H__


      
      
#define _TLINK_BC_H


      
      
#define __TLINK_BC_MODULE_EXT


      
      
#define __TLINK_BC_MODULE_EXT extern


      

Marco _WF_NW_CFG_H

#define _WF_NW_CFG_H


      

Marco __WF_NW_CFG_EXT

#define __WF_NW_CFG_EXT


      

Marco __WF_NW_CFG_EXT

#define __WF_NW_CFG_EXT extern


      

Marco _WL_CFG_COM_H

#define _WL_CFG_COM_H


      

Marco __WL_CFG_COM_MODULE_EXT

#define __WL_CFG_COM_MODULE_EXT


      

Marco __WL_CFG_COM_MODULE_EXT

#define __WL_CFG_COM_MODULE_EXT extern


      

Marco WL_CHAN_NUM

#define WL_CHAN_NUM 14

      

Functions

Func reg_proc_key

OPERATE_RET reg_proc_key(IN CONST KEY_USER_DEF_S *key_ud);
/**
 * @brief Register a new KEY
 * 
 * @param[in] key_ud User defined key, see KEY_USER_DEF_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func key_init

OPERATE_RET key_init(IN CONST KEY_USER_DEF_S *p_tbl,IN CONST INT_T cnt,\
                        IN CONST INT_T timer_space);
/**
 * @brief Initialize KEY process service
 * 
 * @param[in] p_tbl User defined key tables, see KEY_USER_DEF_S
 * @param[in] cnt Count of key tables
 * @param[in] timer_space Key detect interval (unit ms). No more than 100,
 * if 0 then use default value(20ms)
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_create_led_handle

OPERATE_RET tuya_create_led_handle(IN CONST tuya_pin_name_t pinname,IN CONST BOOL_T high,OUT LED_HANDLE *handle);
/**
 * @brief Create LED instance
 * 
 * @param[in] pinname Work state info, see GW_WORK_STAT_MAG_S
 * @param[in] high Default is high
 * @param[out] handle Handler of LED instance
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_create_led_handle_select

OPERATE_RET tuya_create_led_handle_select(IN CONST tuya_pin_name_t pinname,IN CONST BOOL_T high,OUT LED_HANDLE *handle);
/**
 * @brief Create LED instance
 * 
 * @param[in] pinname Work state info, see GW_WORK_STAT_MAG_S
 * @param[in] high Default is high
 * @param[out] handle Handler of LED instance
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_set_led_light_type

VOID tuya_set_led_light_type(IN CONST LED_HANDLE handle,IN CONST LED_LT_E type,
                           IN CONST USHORT_T flh_mstime,IN CONST USHORT_T flh_ms_sumtime);
/**
 * @brief Config LED light flash params
 * 
 * @param[in] handle LED handle created by tuya_create_led_handle
 * @param[in] type LED output type, see LED_LT_E
 * @param[in] flh_mstime Flash duration (unit ms)
 * @param[in] flh_ms_sumtime Total flash time (unit ms), 0xFFff indicate forever
 * 
 * @note if(OL_FLASH_XXX == type) then flh_mstime and flh_ms_sumtime is valid
 */

Func altcp_new

struct altcp_pcb *altcp_new(altcp_allocator_t *allocator);


      

Func altcp_new_ip6

struct altcp_pcb *altcp_new_ip6(altcp_allocator_t *allocator);


      

Func altcp_new_ip_type

struct altcp_pcb *altcp_new_ip_type(altcp_allocator_t *allocator, u8_t ip_type);


      

Func altcp_arg

void altcp_arg(struct altcp_pcb *conn, void *arg);


      

Func altcp_accept

void altcp_accept(struct altcp_pcb *conn, altcp_accept_fn accept);


      

Func altcp_recv

void altcp_recv(struct altcp_pcb *conn, altcp_recv_fn recv);


      

Func altcp_sent

void altcp_sent(struct altcp_pcb *conn, altcp_sent_fn sent);


      

Func altcp_poll

void altcp_poll(struct altcp_pcb *conn, altcp_poll_fn poll, u8_t interval);


      

Func altcp_err

void altcp_err(struct altcp_pcb *conn, altcp_err_fn err);


      

Func altcp_recved

void altcp_recved(struct altcp_pcb *conn, u16_t len);


      

Func altcp_bind

err_t altcp_bind(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port);


      

Func altcp_connect

err_t altcp_connect(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port, altcp_connected_fn connected);


      

Func altcp_listen_with_backlog_and_err

struct altcp_pcb *altcp_listen_with_backlog_and_err(struct altcp_pcb *conn, u8_t backlog, err_t *err);
/* return conn for source code compatibility to tcp callback API only */

Func altcp_abort

void altcp_abort(struct altcp_pcb *conn);


      

Func altcp_close

err_t altcp_close(struct altcp_pcb *conn);


      

Func altcp_shutdown

err_t altcp_shutdown(struct altcp_pcb *conn, int shut_rx, int shut_tx);


      

Func altcp_write

err_t altcp_write(struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags);


      

Func altcp_output

err_t altcp_output(struct altcp_pcb *conn);


      

Func altcp_mss

u16_t altcp_mss(struct altcp_pcb *conn);


      

Func altcp_sndbuf

u16_t altcp_sndbuf(struct altcp_pcb *conn);


      

Func altcp_sndqueuelen

u16_t altcp_sndqueuelen(struct altcp_pcb *conn);


      

Func altcp_nagle_disable

void altcp_nagle_disable(struct altcp_pcb *conn);


      

Func altcp_nagle_enable

void altcp_nagle_enable(struct altcp_pcb *conn);


      

Func altcp_nagle_disabled

int  altcp_nagle_disabled(struct altcp_pcb *conn);


      

Func altcp_setprio

void altcp_setprio(struct altcp_pcb *conn, u8_t prio);


      

Func altcp_get_tcp_addrinfo

err_t altcp_get_tcp_addrinfo(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);


      

Func altcp_get_ip

ip_addr_t *altcp_get_ip(struct altcp_pcb *conn, int local);


      

Func altcp_get_port

u16_t altcp_get_port(struct altcp_pcb *conn, int local);


      

Func altcp_tcp_new_ip_type

struct altcp_pcb *altcp_tcp_new_ip_type(u8_t ip_type);


      

Func altcp_tcp_alloc

struct altcp_pcb *altcp_tcp_alloc(void *arg, u8_t ip_type);


      

Func altcp_tcp_wrap

struct altcp_pcb *altcp_tcp_wrap(struct tcp_pcb *tpcb);


      

Func altcp_tls_free_config

void altcp_tls_free_config(struct altcp_tls_config *conf);
/** @ingroup altcp_tls
 * Free an ALTCP_TLS configuration handle
 */

Func altcp_tls_wrap

struct altcp_pcb *altcp_tls_wrap(struct altcp_tls_config *config, struct altcp_pcb *inner_pcb);
/** @ingroup altcp_tls
 * Create new ALTCP_TLS layer wrapping an existing pcb as inner connection (e.g. TLS over TCP)
 */

Func altcp_tls_new

struct altcp_pcb *altcp_tls_new(struct altcp_tls_config *config, u8_t ip_type);
/** @ingroup altcp_tls
 * Create new ALTCP_TLS pcb and its inner tcp pcb
 */

Func altcp_tls_alloc

struct altcp_pcb *altcp_tls_alloc(void *arg, u8_t ip_type);
/** @ingroup altcp_tls
 * Create new ALTCP_TLS layer pcb and its inner tcp pcb.
 * Same as @ref altcp_tls_new but this allocator function fits to
 * @ref altcp_allocator_t / @ref altcp_new.\n
 'arg' must contain a struct altcp_tls_config *.
 */

Func altcp_tls_context

void *altcp_tls_context(struct altcp_pcb *conn);
/** @ingroup altcp_tls
 * Return pointer to internal TLS context so application can tweak it.
 * Real type depends on port (e.g. mbedtls)
 */

Func netconn_prepare_delete

err_t  netconn_prepare_delete(struct netconn *conn);


      

Func netconn_delete

err_t  netconn_delete(struct netconn *conn);


      

Func netconn_getaddr

err_t  netconn_getaddr(struct netconn *conn, ip_addr_t *addr,
                       u16_t *port, u8_t local);


      

Func netconn_bind

err_t  netconn_bind(struct netconn *conn, const ip_addr_t *addr, u16_t port);


      

Func netconn_bind_if

err_t  netconn_bind_if(struct netconn *conn, u8_t if_idx);


      

Func netconn_connect

err_t  netconn_connect(struct netconn *conn, const ip_addr_t *addr, u16_t port);


      

Func netconn_disconnect

err_t  netconn_disconnect (struct netconn *conn);


      

Func netconn_listen_with_backlog

err_t  netconn_listen_with_backlog(struct netconn *conn, u8_t backlog);


      

Func netconn_accept

err_t  netconn_accept(struct netconn *conn, struct netconn **new_conn);


      

Func netconn_recv

err_t  netconn_recv(struct netconn *conn, struct netbuf **new_buf);


      

Func netconn_recv_udp_raw_netbuf

err_t  netconn_recv_udp_raw_netbuf(struct netconn *conn, struct netbuf **new_buf);


      

Func netconn_recv_udp_raw_netbuf_flags

err_t  netconn_recv_udp_raw_netbuf_flags(struct netconn *conn, struct netbuf **new_buf, u8_t apiflags);


      

Func netconn_recv_tcp_pbuf

err_t  netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf);


      

Func netconn_recv_tcp_pbuf_flags

err_t  netconn_recv_tcp_pbuf_flags(struct netconn *conn, struct pbuf **new_buf, u8_t apiflags);


      

Func netconn_tcp_recvd

err_t  netconn_tcp_recvd(struct netconn *conn, size_t len);


      

Func netconn_sendto

err_t  netconn_sendto(struct netconn *conn, struct netbuf *buf,
                            const ip_addr_t *addr, u16_t port);


      

Func netconn_send

err_t  netconn_send(struct netconn *conn, struct netbuf *buf);


      

Func netconn_write_partly

err_t  netconn_write_partly(struct netconn *conn, const void *dataptr, size_t size,
                            u8_t apiflags, size_t *bytes_written);


      

Func netconn_write_vectors_partly

err_t  netconn_write_vectors_partly(struct netconn *conn, struct netvector *vectors, u16_t vectorcnt,
                                    u8_t apiflags, size_t *bytes_written);


      

Func netconn_close

err_t  netconn_close(struct netconn *conn);


      

Func netconn_shutdown

err_t  netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx);


      

Func netconn_join_leave_group

err_t  netconn_join_leave_group(struct netconn *conn, const ip_addr_t *multiaddr,
                            const ip_addr_t *netif_addr, enum netconn_igmp join_or_leave);


      

Func netconn_join_leave_group_netif

err_t  netconn_join_leave_group_netif(struct netconn *conn, const ip_addr_t *multiaddr,
                            u8_t if_idx, enum netconn_igmp join_or_leave);


      

Func netconn_gethostbyname_addrtype

err_t  netconn_gethostbyname_addrtype(const char *name, ip_addr_t *addr, u8_t dns_addrtype);


      

Func netconn_gethostbyname

err_t  netconn_gethostbyname(const char *name, ip_addr_t *addr);


      

Func netconn_err

err_t  netconn_err(struct netconn *conn);


      

Func netconn_thread_init

err_t netconn_thread_init(void *ptask);


      

Func netconn_thread_cleanup

err_t netconn_thread_cleanup(void *ptask);


      

Func altcp_proxyconnect_new

struct altcp_pcb *altcp_proxyconnect_new(struct altcp_proxyconnect_config *config, struct altcp_pcb *inner_pcb);


      

Func altcp_proxyconnect_new_tcp

struct altcp_pcb *altcp_proxyconnect_new_tcp(struct altcp_proxyconnect_config *config, u8_t ip_type);


      

Func altcp_proxyconnect_alloc

struct altcp_pcb *altcp_proxyconnect_alloc(void *arg, u8_t ip_type);


      

Func altcp_proxyconnect_tls_alloc

struct altcp_pcb *altcp_proxyconnect_tls_alloc(void *arg, u8_t ip_type);


      

Func fs_open

err_t fs_open(struct fs_file *file, const char *name);


      

Func fs_close

void fs_close(struct fs_file *file);


      

Func fs_read_async

int fs_read_async(struct fs_file *file, char *buffer, int count, fs_wait_cb callback_fn, void *callback_arg);


      

Func fs_read

int fs_read(struct fs_file *file, char *buffer, int count);


      

Func fs_is_file_ready

int fs_is_file_ready(struct fs_file *file, fs_wait_cb callback_fn, void *callback_arg);


      

Func fs_bytes_left

int fs_bytes_left(struct fs_file *file);


      

Func fs_state_init

void *fs_state_init(struct fs_file *file, const char *name);
/** This user-defined function is called when a file is opened. */

Func fs_state_free

void fs_state_free(struct fs_file *file, void *state);
/** This user-defined function is called when a file is closed. */

Func httpc_get_file

err_t httpc_get_file(const ip_addr_t* server_addr, u16_t port, const char* uri, const httpc_connection_t *settings,
                    altcp_recv_fn recv_fn, void* callback_arg, httpc_state_t **connection);


      

Func httpc_get_file_dns

err_t httpc_get_file_dns(const char* server_name, u16_t port, const char* uri, const httpc_connection_t *settings,
                    altcp_recv_fn recv_fn, void* callback_arg, httpc_state_t **connection);


      

Func httpc_get_file_to_disk

err_t httpc_get_file_to_disk(const ip_addr_t* server_addr, u16_t port, const char* uri, const httpc_connection_t *settings,
                    void* callback_arg, const char* local_file_name, httpc_state_t **connection);


      

Func httpc_get_file_dns_to_disk

err_t httpc_get_file_dns_to_disk(const char* server_name, u16_t port, const char* uri, const httpc_connection_t *settings,
                    void* callback_arg, const char* local_file_name, httpc_state_t **connection);


      

Func http_set_cgi_handlers

void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers);


      

Func http_set_ssi_handler

void http_set_ssi_handler(tSSIHandler pfnSSIHandler,
                         const char **ppcTags, int iNumTags);
/** Set the SSI handler function
 * (if LWIP_HTTPD_SSI_RAW==1, only the first argument is used)
 */

Func httpd_post_begin

err_t httpd_post_begin(void *connection, const char *uri, const char *http_request,
                      u16_t http_request_len, int content_len, char *response_uri,
                      u16_t response_uri_len, u8_t *post_auto_wnd);
/**
 * @ingroup httpd
 * Called when a POST request has been received. The application can decide
 * whether to accept it or not.
 *
 * @param connection Unique connection identifier, valid until httpd_post_end
 *        is called.
 * @param uri The HTTP header URI receiving the POST request.
 * @param http_request The raw HTTP request (the first packet, normally).
 * @param http_request_len Size of 'http_request'.
 * @param content_len Content-Length from HTTP header.
 * @param response_uri Filename of response file, to be filled when denying the
 *        request
 * @param response_uri_len Size of the 'response_uri' buffer.
 * @param post_auto_wnd Set this to 0 to let the callback code handle window
 *        updates by calling 'httpd_post_data_recved' (to throttle rx speed)
 *        default is 1 (httpd handles window updates automatically)
 * @return ERR_OK: Accept the POST request, data may be passed in
 *         another err_t: Deny the POST request, send back 'bad request'.
 */

Func httpd_post_receive_data

err_t httpd_post_receive_data(void *connection, struct pbuf *p);
/**
 * @ingroup httpd
 * Called for each pbuf of data that has been received for a POST.
 * ATTENTION: The application is responsible for freeing the pbufs passed in!
 *
 * @param connection Unique connection identifier.
 * @param p Received data.
 * @return ERR_OK: Data accepted.
 *         another err_t: Data denied, http_post_get_response_uri will be called.
 */

Func httpd_post_finished

void httpd_post_finished(void *connection, char *response_uri, u16_t response_uri_len);
/**
 * @ingroup httpd
 * Called when all data is received or when the connection is closed.
 * The application must return the filename/URI of a file to send in response
 * to this POST request. If the response_uri buffer is untouched, a 404
 * response is returned.
 *
 * @param connection Unique connection identifier.
 * @param response_uri Filename of response file, to be filled when denying the request
 * @param response_uri_len Size of the 'response_uri' buffer.
 */

Func httpd_post_data_recved

void httpd_post_data_recved(void *connection, u16_t recved_len);


      

Func httpd_init

void httpd_init(void);


      

Func httpd_inits

void httpd_inits(struct altcp_tls_config *conf);


      

Func lwiperf_start_tcp_server

void* lwiperf_start_tcp_server(const ip_addr_t* local_addr, u16_t local_port,
                              lwiperf_report_fn report_fn, void* report_arg);


      

Func lwiperf_start_tcp_server_default

void* lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg);


      

Func lwiperf_start_tcp_client

void* lwiperf_start_tcp_client(const ip_addr_t* remote_addr, u16_t remote_port,
                              enum lwiperf_client_type type,
                              lwiperf_report_fn report_fn, void* report_arg);


      

Func lwiperf_start_tcp_client_default

void* lwiperf_start_tcp_client_default(const ip_addr_t* remote_addr,
                              lwiperf_report_fn report_fn, void* report_arg);


      

Func lwiperf_abort

void lwiperf_abort(void* lwiperf_session);


      

Func mdns_resp_init

void mdns_resp_init(void);


      

Func mdns_resp_register_name_result_cb

void mdns_resp_register_name_result_cb(mdns_name_result_cb_t cb);


      

Func mdns_resp_add_netif

err_t mdns_resp_add_netif(struct netif *netif, const char *hostname, u32_t dns_ttl);


      

Func mdns_resp_remove_netif

err_t mdns_resp_remove_netif(struct netif *netif);


      

Func mdns_resp_rename_netif

err_t mdns_resp_rename_netif(struct netif *netif, const char *hostname);


      

Func mdns_resp_add_service

s8_t mdns_resp_add_service(struct netif *netif, const char *name, const char *service, enum mdns_sd_proto proto, u16_t port, u32_t dns_ttl, service_get_txt_fn_t txt_fn, void *txt_userdata);


      

Func mdns_resp_del_service

err_t mdns_resp_del_service(struct netif *netif, s8_t slot);


      

Func mdns_resp_rename_service

err_t mdns_resp_rename_service(struct netif *netif, s8_t slot, const char *name);


      

Func mdns_resp_add_service_txtitem

err_t mdns_resp_add_service_txtitem(struct mdns_service *service, const char *txt, u8_t txt_len);


      

Func mdns_resp_restart

void mdns_resp_restart(struct netif *netif);


      

Func mdns_resp_announce

void mdns_resp_announce(struct netif *netif);


      

Func mdns_domain_add_label

err_t mdns_domain_add_label(struct mdns_domain *domain, const char *label, u8_t len);


      

Func mdns_readname

u16_t mdns_readname(struct pbuf *p, u16_t offset, struct mdns_domain *domain);


      

Func mdns_domain_eq

int mdns_domain_eq(struct mdns_domain *a, struct mdns_domain *b);


      

Func mdns_compress_domain

u16_t mdns_compress_domain(struct pbuf *pbuf, u16_t *offset, struct mdns_domain *domain);


      

Func mqtt_client_connect

err_t mqtt_client_connect(mqtt_client_t *client, const ip_addr_t *ipaddr, u16_t port, mqtt_connection_cb_t cb, void *arg,
                  const struct mqtt_connect_client_info_t *client_info);


      

Func mqtt_disconnect

void mqtt_disconnect(mqtt_client_t *client);


      

Func mqtt_client_new

mqtt_client_t *mqtt_client_new(void);


      

Func mqtt_client_free

void mqtt_client_free(mqtt_client_t* client);


      

Func mqtt_client_is_connected

u8_t mqtt_client_is_connected(mqtt_client_t *client);


      

Func mqtt_set_inpub_callback

void mqtt_set_inpub_callback(mqtt_client_t *client, mqtt_incoming_publish_cb_t,
                            mqtt_incoming_data_cb_t data_cb, void *arg);


      

Func mqtt_sub_unsub

err_t mqtt_sub_unsub(mqtt_client_t *client, const char *topic, u8_t qos, mqtt_request_cb_t cb, void *arg, u8_t sub);


      

Func mqtt_publish

err_t mqtt_publish(mqtt_client_t *client, const char *topic, const void *payload, u16_t payload_length, u8_t qos, u8_t retain,
                                   mqtt_request_cb_t cb, void *arg);


      

Func netbiosns_init

void netbiosns_init(void);


      

Func netbiosns_set_name

void netbiosns_set_name(const char* hostname);


      

Func netbiosns_stop

void netbiosns_stop(void);


      

Func smtp_send_mail_bodycback

err_t smtp_send_mail_bodycback(const char *from, const char* to, const char* subject,
                    smtp_bodycback_fn bodycback_fn, smtp_result_fn callback_fn, void* callback_arg);


      

Func smtp_set_server_addr

err_t smtp_set_server_addr(const char* server);


      

Func smtp_set_server_port

void smtp_set_server_port(u16_t port);


      

Func smtp_set_tls_config

void smtp_set_tls_config(struct altcp_tls_config *tls_config);


      

Func smtp_set_auth

err_t smtp_set_auth(const char* username, const char* pass);


      

Func smtp_send_mail

err_t smtp_send_mail(const char *from, const char* to, const char* subject, const char* body,
                    smtp_result_fn callback_fn, void* callback_arg);


      

Func smtp_send_mail_static

err_t smtp_send_mail_static(const char *from, const char* to, const char* subject, const char* body,
                    smtp_result_fn callback_fn, void* callback_arg);


      

Func smtp_send_mail_int

void smtp_send_mail_int(void *arg);


      

Func snmp_init

void snmp_init(void);
/**
 * @ingroup snmp_core
 * Agent setup, start listening to port 161.
 */

Func snmp_set_mibs

void snmp_set_mibs(const struct snmp_mib **mibs, u8_t num_mibs);


      

Func snmp_set_device_enterprise_oid

void snmp_set_device_enterprise_oid(const struct snmp_obj_id* device_enterprise_oid);


      

Func snmp_trap_dst_enable

void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable);


      

Func snmp_trap_dst_ip_set

void snmp_trap_dst_ip_set(u8_t dst_idx, const ip_addr_t *dst);


      

Func snmp_send_trap_generic

err_t snmp_send_trap_generic(s32_t generic_trap);


      

Func snmp_send_trap_specific

err_t snmp_send_trap_specific(s32_t specific_trap, struct snmp_varbind *varbinds);


      

Func snmp_send_trap

err_t snmp_send_trap(const struct snmp_obj_id* oid, s32_t generic_trap, s32_t specific_trap, struct snmp_varbind *varbinds);


      

Func snmp_set_auth_traps_enabled

void snmp_set_auth_traps_enabled(u8_t enable);


      

Func snmp_get_auth_traps_enabled

u8_t snmp_get_auth_traps_enabled(void);


      

Func snmp_v1_enabled

u8_t snmp_v1_enabled(void);


      

Func snmp_v2c_enabled

u8_t snmp_v2c_enabled(void);


      

Func snmp_v3_enabled

u8_t snmp_v3_enabled(void);


      

Func snmp_v1_enable

void snmp_v1_enable(u8_t enable);


      

Func snmp_v2c_enable

void snmp_v2c_enable(u8_t enable);


      

Func snmp_v3_enable

void snmp_v3_enable(u8_t enable);


      

Func snmp_set_community

void snmp_set_community(const char * const community);


      

Func snmp_set_community_write

void snmp_set_community_write(const char * const community);


      

Func snmp_set_community_trap

void snmp_set_community_trap(const char * const community);


      

Func snmp_coldstart_trap

void snmp_coldstart_trap(void);


      

Func snmp_authfail_trap

void snmp_authfail_trap(void);


      

Func snmp_set_write_callback

void snmp_set_write_callback(snmp_write_callback_fct write_callback, void* callback_arg);


      

Func snmp_oid_in_range

u8_t snmp_oid_in_range(const u32_t *oid_in, u8_t oid_len, const struct snmp_oid_range *oid_ranges, u8_t oid_ranges_len);
/** checks if incoming OID length and values are in allowed ranges */

Func snmp_next_oid_init

void snmp_next_oid_init(struct snmp_next_oid_state *state,
 const u32_t *start_oid, u8_t start_oid_len,
 u32_t *next_oid_buf, u8_t next_oid_max_len);


      

Func snmp_next_oid_precheck

u8_t snmp_next_oid_precheck(struct snmp_next_oid_state *state, const u32_t *oid, u8_t oid_len);


      

Func snmp_next_oid_check

u8_t snmp_next_oid_check(struct snmp_next_oid_state *state, const u32_t *oid, u8_t oid_len, void* reference);


      

Func snmp_oid_assign

void snmp_oid_assign(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len);


      

Func snmp_oid_combine

void snmp_oid_combine(struct snmp_obj_id* target, const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len);


      

Func snmp_oid_prefix

void snmp_oid_prefix(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len);


      

Func snmp_oid_append

void snmp_oid_append(struct snmp_obj_id* target, const u32_t *oid, u8_t oid_len);


      

Func snmp_oid_equal

u8_t snmp_oid_equal(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len);


      

Func snmp_oid_compare

s8_t snmp_oid_compare(const u32_t *oid1, u8_t oid1_len, const u32_t *oid2, u8_t oid2_len);


      

Func snmp_oid_to_ip4

u8_t snmp_oid_to_ip4(const u32_t *oid, ip4_addr_t *ip);


      

Func snmp_ip4_to_oid

void snmp_ip4_to_oid(const ip4_addr_t *ip, u32_t *oid);


      

Func snmp_oid_to_ip6

u8_t snmp_oid_to_ip6(const u32_t *oid, ip6_addr_t *ip);


      

Func snmp_ip6_to_oid

void snmp_ip6_to_oid(const ip6_addr_t *ip, u32_t *oid);


      

Func snmp_ip_to_oid

u8_t snmp_ip_to_oid(const ip_addr_t *ip, u32_t *oid);


      

Func snmp_ip_port_to_oid

u8_t snmp_ip_port_to_oid(const ip_addr_t *ip, u16_t port, u32_t *oid);


      

Func snmp_oid_to_ip

u8_t snmp_oid_to_ip(const u32_t *oid, u8_t oid_len, ip_addr_t *ip);


      

Func snmp_oid_to_ip_port

u8_t snmp_oid_to_ip_port(const u32_t *oid, u8_t oid_len, ip_addr_t *ip, u16_t *port);


      

Func netif_to_num

u8_t netif_to_num(const struct netif *netif);


      

Func snmp_set_test_ok

snmp_err_t snmp_set_test_ok(struct snmp_node_instance* instance, u16_t value_len, void* value);


      

Func snmp_decode_bits

err_t snmp_decode_bits(const u8_t *buf, u32_t buf_len, u32_t *bit_value);


      

Func snmp_decode_truthvalue

err_t snmp_decode_truthvalue(const s32_t *asn1_value, u8_t *bool_value);


      

Func snmp_encode_bits

u8_t snmp_encode_bits(u8_t *buf, u32_t buf_len, u32_t bit_value, u8_t bit_count);


      

Func snmp_encode_truthvalue

u8_t snmp_encode_truthvalue(s32_t *asn1_value, u32_t bool_value);


      

Func snmp_mib2_lwip_synchronizer

void snmp_mib2_lwip_synchronizer(snmp_threadsync_called_fn fn, void* arg);


      

Func snmp_mib2_set_sysdescr

void snmp_mib2_set_sysdescr(const u8_t* str, const u16_t* len);


      

Func snmp_mib2_set_syscontact

void snmp_mib2_set_syscontact(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);
/* read-only be defintion */

Func snmp_mib2_set_syscontact_readonly

void snmp_mib2_set_syscontact_readonly(const u8_t *ocstr, const u16_t *ocstrlen);


      

Func snmp_mib2_set_sysname

void snmp_mib2_set_sysname(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);


      

Func snmp_mib2_set_sysname_readonly

void snmp_mib2_set_sysname_readonly(const u8_t *ocstr, const u16_t *ocstrlen);


      

Func snmp_mib2_set_syslocation

void snmp_mib2_set_syslocation(u8_t *ocstr, u16_t *ocstrlen, u16_t bufsize);


      

Func snmp_mib2_set_syslocation_readonly

void snmp_mib2_set_syslocation_readonly(const u8_t *ocstr, const u16_t *ocstrlen);


      

Func snmp_scalar_get_instance

snmp_err_t snmp_scalar_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_scalar_get_next_instance

snmp_err_t snmp_scalar_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_scalar_array_get_instance

snmp_err_t snmp_scalar_array_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_scalar_array_get_next_instance

snmp_err_t snmp_scalar_array_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_table_get_instance

snmp_err_t snmp_table_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_table_get_next_instance

snmp_err_t snmp_table_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_table_simple_get_instance

snmp_err_t snmp_table_simple_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_table_simple_get_next_instance

snmp_err_t snmp_table_simple_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_table_extract_value_from_s32ref

s16_t snmp_table_extract_value_from_s32ref(struct snmp_node_instance* instance, void* value);


      

Func snmp_table_extract_value_from_u32ref

s16_t snmp_table_extract_value_from_u32ref(struct snmp_node_instance* instance, void* value);


      

Func snmp_table_extract_value_from_refconstptr

s16_t snmp_table_extract_value_from_refconstptr(struct snmp_node_instance* instance, void* value);


      

Func snmp_threadsync_get_instance

snmp_err_t snmp_threadsync_get_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_threadsync_get_next_instance

snmp_err_t snmp_threadsync_get_next_instance(const u32_t *root_oid, u8_t root_oid_len, struct snmp_node_instance* instance);


      

Func snmp_threadsync_init

void snmp_threadsync_init(struct snmp_threadsync_instance *instance, snmp_threadsync_synchronizer_fn sync_fn);
/** Create thread sync instance data */

Func snmpv3_get_engine_id

void snmpv3_get_engine_id(const char **id, u8_t *len);


      

Func snmpv3_set_engine_id

err_t snmpv3_set_engine_id(const char* id, u8_t len);


      

Func snmpv3_get_engine_boots

u32_t snmpv3_get_engine_boots(void);


      

Func snmpv3_set_engine_boots

void snmpv3_set_engine_boots(u32_t boots);


      

Func snmpv3_get_engine_time

u32_t snmpv3_get_engine_time(void);


      

Func snmpv3_reset_engine_time

void snmpv3_reset_engine_time(void);


      

Func snmpv3_get_user

err_t snmpv3_get_user(const char* username, snmpv3_auth_algo_t *auth_algo, u8_t *auth_key, snmpv3_priv_algo_t *priv_algo, u8_t *priv_key);


      

Func snmpv3_get_amount_of_users

u8_t snmpv3_get_amount_of_users(void);


      

Func snmpv3_get_user_storagetype

err_t snmpv3_get_user_storagetype(const char *username, snmpv3_user_storagetype_t *storagetype);


      

Func snmpv3_get_username

err_t snmpv3_get_username(char *username, u8_t index);


      

Func snmpv3_engine_id_changed

void snmpv3_engine_id_changed(void);


      

Func snmpv3_password_to_key_md5

void snmpv3_password_to_key_md5(
   const u8_t *password,    /* IN */
   size_t     passwordlen, /* IN */
   const u8_t *engineID,    /* IN  - pointer to snmpEngineID  */
   u8_t       engineLength, /* IN  - length of snmpEngineID */
   u8_t      *key);


      

Func snmpv3_password_to_key_sha

void snmpv3_password_to_key_sha(
   const u8_t *password,    /* IN */
   size_t     passwordlen, /* IN */
   const u8_t *engineID,    /* IN  - pointer to snmpEngineID  */
   u8_t       engineLength, /* IN  - length of snmpEngineID */
   u8_t      *key);


      

Func sntp_setoperatingmode

void sntp_setoperatingmode(u8_t operating_mode);


      

Func sntp_getoperatingmode

u8_t sntp_getoperatingmode(void);


      

Func sntp_init

void sntp_init(void);


      

Func sntp_stop

void sntp_stop(void);


      

Func sntp_enabled

u8_t sntp_enabled(void);


      

Func sntp_setserver

void sntp_setserver(u8_t idx, const ip_addr_t *addr);


      

Func sntp_getreachability

u8_t sntp_getreachability(u8_t idx);


      

Func sntp_setservername

void sntp_setservername(u8_t idx, const char *server);


      

Func sntp_servermode_dhcp

void sntp_servermode_dhcp(int set_servers_from_dhcp);


      

Func tftp_init

err_t tftp_init(const struct tftp_context* ctx);


      

Func tftp_cleanup

void tftp_cleanup(void);


      

Func autoip_set_struct

void autoip_set_struct(struct netif *netif, struct autoip *autoip);


      

Func autoip_start

err_t autoip_start(struct netif *netif);


      

Func autoip_stop

err_t autoip_stop(struct netif *netif);


      

Func autoip_arp_reply

void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr);


      

Func autoip_tmr

void autoip_tmr(void);


      

Func autoip_network_changed

void autoip_network_changed(struct netif *netif);


      

Func autoip_supplied_address

u8_t autoip_supplied_address(const struct netif *netif);


      

Func autoip_accept_packet

u8_t autoip_accept_packet(struct netif *netif, const ip4_addr_t *addr);
/* for lwIP internal use by ip4.c */

Func lwip_htons

u16_t lwip_htons(u16_t x);


      

Func lwip_htonl

u32_t lwip_htonl(u32_t x);


      

Func lwip_itoa

void lwip_itoa(char* result, size_t bufsize, int number);
/* This can be #defined to itoa() or snprintf(result, bufsize, "%d", number) depending on your platform */

Func lwip_strnicmp

int  lwip_strnicmp(const char* str1, const char* str2, size_t len);
/* This can be #defined to strnicmp() or strncasecmp() depending on your platform */

Func lwip_stricmp

int  lwip_stricmp(const char* str1, const char* str2);
/* This can be #defined to stricmp() or strcasecmp() depending on your platform */

Func dhcp_set_struct

void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp);


      

Func dhcp_cleanup

void dhcp_cleanup(struct netif *netif);


      

Func dhcp_start

err_t dhcp_start(struct netif *netif);


      

Func dhcp_renew

err_t dhcp_renew(struct netif *netif);


      

Func dhcp_release

err_t dhcp_release(struct netif *netif);


      

Func dhcp_stop

void dhcp_stop(struct netif *netif);


      

Func dhcp_release_and_stop

void dhcp_release_and_stop(struct netif *netif);


      

Func dhcp_inform

void dhcp_inform(struct netif *netif);


      

Func dhcp_network_changed

void dhcp_network_changed(struct netif *netif);


      

Func dhcp_arp_reply

void dhcp_arp_reply(struct netif *netif, const ip4_addr_t *addr);


      

Func dhcp_supplied_address

u8_t dhcp_supplied_address(const struct netif *netif);


      

Func dhcp_coarse_tmr

void dhcp_coarse_tmr(void);
/* to be called every minute */

Func dhcp_fine_tmr

void dhcp_fine_tmr(void);
/* to be called every half second */

Func dhcp6_set_struct

void dhcp6_set_struct(struct netif *netif, struct dhcp6 *dhcp6);


      

Func dhcp6_cleanup

void dhcp6_cleanup(struct netif *netif);


      

Func dhcp6_enable_stateful

err_t dhcp6_enable_stateful(struct netif *netif);


      

Func dhcp6_enable_stateless

err_t dhcp6_enable_stateless(struct netif *netif);


      

Func dhcp6_disable

void dhcp6_disable(struct netif *netif);


      

Func dhcp6_tmr

void dhcp6_tmr(void);


      

Func dhcp6_nd6_ra_trigger

void dhcp6_nd6_ra_trigger(struct netif *netif, u8_t managed_addr_config, u8_t other_config);


      

Func dns_init

void            dns_init(void);


      

Func dns_tmr

void            dns_tmr(void);


      

Func dns_setserver

void            dns_setserver(u8_t numdns, const ip_addr_t *dnsserver);


      

Func dns_gethostbyname

err_t           dns_gethostbyname(const char *hostname, ip_addr_t *addr,
                                  dns_found_callback found, void *callback_arg);


      

Func dns_gethostbyname_addrtype

err_t           dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr,
                                  dns_found_callback found, void *callback_arg,
                                  u8_t dns_addrtype);


      

Func dns_local_iterate

size_t        dns_local_iterate(dns_found_callback iterator_fn, void *iterator_arg);


      

Func dns_local_lookup

err_t         dns_local_lookup(const char *hostname, ip_addr_t *addr, u8_t dns_addrtype);


      

Func dns_local_removehost

int           dns_local_removehost(const char *hostname, const ip_addr_t *addr);


      

Func dns_local_addhost

err_t         dns_local_addhost(const char *hostname, const ip_addr_t *addr);


      

Func err_to_errno

int err_to_errno(err_t err);


      

Func etharp_tmr

void etharp_tmr(void);


      

Func etharp_find_addr

ssize_t etharp_find_addr(struct netif *netif, const ip4_addr_t *ipaddr,
        struct eth_addr **eth_ret, const ip4_addr_t **ip_ret);


      

Func etharp_get_entry

int etharp_get_entry(size_t i, ip4_addr_t **ipaddr, struct netif **netif, struct eth_addr **eth_ret);


      

Func etharp_output

err_t etharp_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr);


      

Func etharp_query

err_t etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q);


      

Func etharp_request

err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr);


      

Func etharp_cleanup_netif

void etharp_cleanup_netif(struct netif *netif);


      

Func etharp_add_static_entry

err_t etharp_add_static_entry(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr);


      

Func etharp_remove_static_entry

err_t etharp_remove_static_entry(const ip4_addr_t *ipaddr);


      

Func etharp_input

void etharp_input(struct pbuf *p, struct netif *netif);


      

Func ethip6_output

err_t ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr);


      

Func icmp_input

void icmp_input(struct pbuf *p, struct netif *inp);


      

Func icmp_dest_unreach

void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t);


      

Func icmp_time_exceeded

void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t);


      

Func icmp6_input

void icmp6_input(struct pbuf *p, struct netif *inp);


      

Func icmp6_dest_unreach

void icmp6_dest_unreach(struct pbuf *p, enum icmp6_dur_code c);


      

Func icmp6_packet_too_big

void icmp6_packet_too_big(struct pbuf *p, u32_t mtu);


      

Func icmp6_time_exceeded

void icmp6_time_exceeded(struct pbuf *p, enum icmp6_te_code c);


      

Func icmp6_time_exceeded_with_addrs

void icmp6_time_exceeded_with_addrs(struct pbuf *p, enum icmp6_te_code c,
   const ip6_addr_t *src_addr, const ip6_addr_t *dest_addr);


      

Func icmp6_param_problem

void icmp6_param_problem(struct pbuf *p, enum icmp6_pp_code c, const void *pointer);


      

Func lwip_if_nametoindex

unsigned int lwip_if_nametoindex(const char *ifname);


      

Func igmp_init

void  igmp_init(void);
/*  Prototypes */

Func igmp_start

err_t igmp_start(struct netif *netif);


      

Func igmp_stop

err_t igmp_stop(struct netif *netif);


      

Func igmp_report_groups

void  igmp_report_groups(struct netif *netif);


      

Func igmp_input

void  igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest);


      

Func igmp_joingroup

err_t igmp_joingroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr);


      

Func igmp_joingroup_netif

err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr);


      

Func igmp_leavegroup

err_t igmp_leavegroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr);


      

Func igmp_leavegroup_netif

err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr);


      

Func igmp_tmr

void  igmp_tmr(void);


      

Func inet_chksum

u16_t inet_chksum(const void *dataptr, u16_t len);


      

Func inet_chksum_pbuf

u16_t inet_chksum_pbuf(struct pbuf *p);


      

Func lwip_chksum_copy

u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len);


      

Func inet_chksum_pseudo

u16_t inet_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
      const ip4_addr_t *src, const ip4_addr_t *dest);


      

Func inet_chksum_pseudo_partial

u16_t inet_chksum_pseudo_partial(struct pbuf *p, u8_t proto,
      u16_t proto_len, u16_t chksum_len, const ip4_addr_t *src, const ip4_addr_t *dest);


      

Func ip6_chksum_pseudo

u16_t ip6_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
      const ip6_addr_t *src, const ip6_addr_t *dest);


      

Func ip6_chksum_pseudo_partial

u16_t ip6_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
      u16_t chksum_len, const ip6_addr_t *src, const ip6_addr_t *dest);


      

Func ip_chksum_pseudo

u16_t ip_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
      const ip_addr_t *src, const ip_addr_t *dest);


      

Func ip_chksum_pseudo_partial

u16_t ip_chksum_pseudo_partial(struct pbuf *p, u8_t proto, u16_t proto_len,
      u16_t chksum_len, const ip_addr_t *src, const ip_addr_t *dest);


      

Func lwip_init

void lwip_init(void);
/* Modules initialization */

Func ip_input

err_t ip_input(struct pbuf *p, struct netif *inp);


      

Func ip4_input

err_t ip4_input(struct pbuf *p, struct netif *inp);


      

Func ip4_output

err_t ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
      u8_t ttl, u8_t tos, u8_t proto);


      

Func ip4_output_if

err_t ip4_output_if(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
      u8_t ttl, u8_t tos, u8_t proto, struct netif *netif);


      

Func ip4_output_if_src

err_t ip4_output_if_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
      u8_t ttl, u8_t tos, u8_t proto, struct netif *netif);


      

Func ip4_output_hinted

err_t ip4_output_hinted(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
      u8_t ttl, u8_t tos, u8_t proto, struct netif_hint *netif_hint);


      

Func ip4_output_if_opt

err_t ip4_output_if_opt(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
      u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options,
      u16_t optlen);


      

Func ip4_output_if_opt_src

err_t ip4_output_if_opt_src(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
      u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options,
      u16_t optlen);


      

Func ip4_set_default_multicast_netif

void ip4_set_default_multicast_netif(struct netif* default_multicast_netif);


      

Func ip4_debug_print

void ip4_debug_print(struct pbuf *p);


      

Func ip4_addr_isbroadcast_u32

u8_t ip4_addr_isbroadcast_u32(u32_t addr, const struct netif *netif);


      

Func ip4_addr_netmask_valid

u8_t ip4_addr_netmask_valid(u32_t netmask);


      

Func ipaddr_addr

u32_t ipaddr_addr(const char *cp);


      

Func ip4addr_aton

int ip4addr_aton(const char *cp, ip4_addr_t *addr);


      

Func ip_reass_init

void ip_reass_init(void);


      

Func ip_reass_tmr

void ip_reass_tmr(void);


      

Func ip4_frag

err_t ip4_frag(struct pbuf *p, struct netif *netif, const ip4_addr_t *dest);


      

Func ip6_input

err_t        ip6_input(struct pbuf *p, struct netif *inp);


      

Func ip6_output

err_t        ip6_output(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
                        u8_t hl, u8_t tc, u8_t nexth);


      

Func ip6_output_if

err_t        ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
                           u8_t hl, u8_t tc, u8_t nexth, struct netif *netif);


      

Func ip6_output_if_src

err_t        ip6_output_if_src(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
                           u8_t hl, u8_t tc, u8_t nexth, struct netif *netif);


      

Func ip6_output_hinted

err_t        ip6_output_hinted(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
                               u8_t hl, u8_t tc, u8_t nexth, struct netif_hint *netif_hint);


      

Func ip6_options_add_hbh_ra

err_t        ip6_options_add_hbh_ra(struct pbuf * p, u8_t nexth, u8_t value);


      

Func ip6_debug_print

void ip6_debug_print(struct pbuf *p);


      

Func ip6addr_aton

int ip6addr_aton(const char *cp, ip6_addr_t *addr);


      

Func ip6_reass_tmr

void ip6_reass_tmr(void);


      

Func ip6_frag

err_t ip6_frag(struct pbuf *p, struct netif *netif, const ip6_addr_t *dest);


      

Func ipaddr_aton

int ipaddr_aton(const char *cp, ip_addr_t *addr);


      

Func mem_init

void mem_init(void);


      

Func mem_trim

void *mem_trim(void *mem, mem_size_t size);


      

Func mem_malloc

void *mem_malloc(mem_size_t size);


      

Func mem_calloc

void *mem_calloc(mem_size_t count, mem_size_t size);


      

Func mem_free

void mem_free(void *mem);


      

Func memp_init

void memp_init(void);


      

Func memp_malloc_fn

void *memp_malloc_fn(memp_t type, const char* file, const int line);


      

Func memp_malloc

void *memp_malloc(memp_t type);


      

Func memp_free

void memp_free(memp_t type, void *mem);


      

Func mld6_stop

err_t mld6_stop(struct netif *netif);


      

Func mld6_report_groups

void  mld6_report_groups(struct netif *netif);


      

Func mld6_tmr

void  mld6_tmr(void);


      

Func mld6_input

void  mld6_input(struct pbuf *p, struct netif *inp);


      

Func mld6_joingroup

err_t mld6_joingroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr);


      

Func mld6_joingroup_netif

err_t mld6_joingroup_netif(struct netif *netif, const ip6_addr_t *groupaddr);


      

Func mld6_leavegroup

err_t mld6_leavegroup(const ip6_addr_t *srcaddr, const ip6_addr_t *groupaddr);


      

Func mld6_leavegroup_netif

err_t mld6_leavegroup_netif(struct netif *netif, const ip6_addr_t *groupaddr);


      

Func nd6_tmr

void nd6_tmr(void);


      

Func nd6_input

void nd6_input(struct pbuf *p, struct netif *inp);


      

Func nd6_clear_destination_cache

void nd6_clear_destination_cache(void);


      

Func nd6_get_next_hop_addr_or_queue

err_t nd6_get_next_hop_addr_or_queue(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp);


      

Func nd6_get_destination_mtu

u16_t nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif);


      

Func nd6_reachability_hint

void nd6_reachability_hint(const ip6_addr_t *ip6addr);


      

Func nd6_cleanup_netif

void nd6_cleanup_netif(struct netif *netif);


      

Func nd6_adjust_mld_membership

void nd6_adjust_mld_membership(struct netif *netif, s8_t addr_idx, u8_t new_state);


      

Func nd6_restart_netif

void nd6_restart_netif(struct netif *netif);


      

Func lwip_gethostbyname_r

int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
               size_t buflen, struct hostent **result, int *h_errnop);


      

Func lwip_freeaddrinfo

void lwip_freeaddrinfo(struct addrinfo *ai);


      

Func lwip_getaddrinfo

int lwip_getaddrinfo(const char *nodename,
      const char *servname,
      const struct addrinfo *hints,
      struct addrinfo **res);


      

Func netif_alloc_client_data_id

u8_t netif_alloc_client_data_id(void);


      

Func netif_init

void netif_init(void);


      

Func netif_set_addr

void netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr, const ip4_addr_t *netmask,
                   const ip4_addr_t *gw);


      

Func netif_remove

void netif_remove(struct netif * netif);


      

Func netif_set_default

void netif_set_default(struct netif *netif);


      

Func netif_set_ipaddr

void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr);


      

Func netif_set_netmask

void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask);


      

Func netif_set_gw

void netif_set_gw(struct netif *netif, const ip4_addr_t *gw);


      

Func netif_set_up

void netif_set_up(struct netif *netif);


      

Func netif_set_down

void netif_set_down(struct netif *netif);


      

Func netif_set_status_callback

void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback);


      

Func netif_set_remove_callback

void netif_set_remove_callback(struct netif *netif, netif_status_callback_fn remove_callback);


      
      
void netif_set_link_up(struct netif *netif);


      
      
void netif_set_link_down(struct netif *netif);


      
      
void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback);


      

Func netif_loop_output

err_t netif_loop_output(struct netif *netif, struct pbuf *p);


      

Func netif_poll

void netif_poll(struct netif *netif);


      

Func netif_poll_all

void netif_poll_all(void);


      

Func netif_input

err_t netif_input(struct pbuf *p, struct netif *inp);


      

Func netif_ip6_addr_set

void netif_ip6_addr_set(struct netif *netif, s8_t addr_idx, const ip6_addr_t *addr6);


      

Func netif_ip6_addr_set_parts

void netif_ip6_addr_set_parts(struct netif *netif, s8_t addr_idx, u32_t i0, u32_t i1, u32_t i2, u32_t i3);


      

Func netif_ip6_addr_set_state

void netif_ip6_addr_set_state(struct netif* netif, s8_t addr_idx, u8_t state);


      

Func netif_get_ip6_addr_match

s8_t netif_get_ip6_addr_match(struct netif *netif, const ip6_addr_t *ip6addr);


      

Func netif_create_ip6_linklocal_address

void netif_create_ip6_linklocal_address(struct netif *netif, u8_t from_mac_48bit);


      

Func netif_add_ip6_address

err_t netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx);


      

Func netif_name_to_index

u8_t netif_name_to_index(const char *name);


      

Func netif_add_ext_callback

void netif_add_ext_callback(netif_ext_callback_t* callback, netif_ext_callback_fn fn);


      

Func netif_remove_ext_callback

void netif_remove_ext_callback(netif_ext_callback_t* callback);


      

Func netif_invoke_ext_callback

void netif_invoke_ext_callback(struct netif* netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t* args);


      

Func netifapi_arp_add

err_t netifapi_arp_add(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr, enum netifapi_arp_entry type);
/** @ingroup netifapi_arp */

Func netifapi_arp_remove

err_t netifapi_arp_remove(const ip4_addr_t *ipaddr, enum netifapi_arp_entry type);
/** @ingroup netifapi_arp */

Func netifapi_netif_add

err_t netifapi_netif_add(struct netif *netif,
#if LWIP_IPV4
                        const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw,
#endif /* LWIP_IPV4 */
                        void *state, netif_init_fn init, netif_input_fn input);


      

Func netifapi_netif_set_addr

err_t netifapi_netif_set_addr(struct netif *netif, const ip4_addr_t *ipaddr,
                             const ip4_addr_t *netmask, const ip4_addr_t *gw);


      

Func netifapi_netif_common

err_t netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc,
                           netifapi_errt_fn errtfunc);


      

Func netifapi_netif_name_to_index

err_t netifapi_netif_name_to_index(const char *name, u8_t *index);
/** @ingroup netifapi_netif */

Func netifapi_netif_index_to_name

err_t netifapi_netif_index_to_name(u8_t index, char *name);
/** @ingroup netifapi_netif */

Func pbuf_free_ooseq

void pbuf_free_ooseq(void);


      

Func pbuf_realloc

void pbuf_realloc(struct pbuf *p, u16_t size);


      

Func pbuf_header

u8_t pbuf_header(struct pbuf *p, s16_t header_size);


      

Func pbuf_header_force

u8_t pbuf_header_force(struct pbuf *p, s16_t header_size);


      

Func pbuf_add_header

u8_t pbuf_add_header(struct pbuf *p, size_t header_size_increment);


      

Func pbuf_add_header_force

u8_t pbuf_add_header_force(struct pbuf *p, size_t header_size_increment);


      

Func pbuf_remove_header

u8_t pbuf_remove_header(struct pbuf *p, size_t header_size);


      

Func pbuf_ref

void pbuf_ref(struct pbuf *p);


      

Func pbuf_free

u8_t pbuf_free(struct pbuf *p);


      

Func pbuf_clen

u16_t pbuf_clen(const struct pbuf *p);


      

Func pbuf_cat

void pbuf_cat(struct pbuf *head, struct pbuf *tail);


      

Func pbuf_chain

void pbuf_chain(struct pbuf *head, struct pbuf *tail);


      

Func pbuf_copy

err_t pbuf_copy(struct pbuf *p_to, const struct pbuf *p_from);


      

Func pbuf_copy_partial

u16_t pbuf_copy_partial(const struct pbuf *p, void *dataptr, u16_t len, u16_t offset);


      

Func pbuf_get_contiguous

void *pbuf_get_contiguous(const struct pbuf *p, void *buffer, size_t bufsize, u16_t len, u16_t offset);


      

Func pbuf_take

err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len);


      

Func pbuf_take_at

err_t pbuf_take_at(struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset);


      

Func pbuf_fill_chksum

err_t pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr,
                      u16_t len, u16_t *chksum);


      

Func pbuf_split_64k

void pbuf_split_64k(struct pbuf *p, struct pbuf **rest);


      

Func pbuf_get_at

u8_t pbuf_get_at(const struct pbuf* p, u16_t offset);


      

Func pbuf_try_get_at

int pbuf_try_get_at(const struct pbuf* p, u16_t offset);


      

Func pbuf_put_at

void pbuf_put_at(struct pbuf* p, u16_t offset, u8_t data);


      

Func pbuf_memcmp

u16_t pbuf_memcmp(const struct pbuf* p, u16_t offset, const void* s2, u16_t n);


      

Func pbuf_memfind

u16_t pbuf_memfind(const struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset);


      

Func pbuf_strstr

u16_t pbuf_strstr(const struct pbuf* p, const char* substr);


      

Func altcp_alloc

struct altcp_pcb *altcp_alloc(void);


      

Func altcp_free

void altcp_free(struct altcp_pcb *conn);


      

Func altcp_default_set_poll

void altcp_default_set_poll(struct altcp_pcb *conn, u8_t interval);


      

Func altcp_default_recved

void altcp_default_recved(struct altcp_pcb *conn, u16_t len);


      

Func altcp_default_bind

err_t altcp_default_bind(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port);


      

Func altcp_default_shutdown

err_t altcp_default_shutdown(struct altcp_pcb *conn, int shut_rx, int shut_tx);


      

Func altcp_default_write

err_t altcp_default_write(struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags);


      

Func altcp_default_output

err_t altcp_default_output(struct altcp_pcb *conn);


      

Func altcp_default_mss

u16_t altcp_default_mss(struct altcp_pcb *conn);


      

Func altcp_default_sndbuf

u16_t altcp_default_sndbuf(struct altcp_pcb *conn);


      

Func altcp_default_sndqueuelen

u16_t altcp_default_sndqueuelen(struct altcp_pcb *conn);


      

Func altcp_default_nagle_disable

void altcp_default_nagle_disable(struct altcp_pcb *conn);


      

Func altcp_default_nagle_enable

void altcp_default_nagle_enable(struct altcp_pcb *conn);


      

Func altcp_default_nagle_disabled

int  altcp_default_nagle_disabled(struct altcp_pcb *conn);


      

Func altcp_default_setprio

void altcp_default_setprio(struct altcp_pcb *conn, u8_t prio);


      

Func altcp_default_dealloc

void altcp_default_dealloc(struct altcp_pcb *conn);


      

Func altcp_default_get_tcp_addrinfo

err_t altcp_default_get_tcp_addrinfo(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);


      

Func altcp_default_get_ip

ip_addr_t *altcp_default_get_ip(struct altcp_pcb *conn, int local);


      

Func altcp_default_get_port

u16_t altcp_default_get_port(struct altcp_pcb *conn, int local);


      

Func lwip_netconn_is_deallocated_msg

int lwip_netconn_is_deallocated_msg(void *msg);


      

Func lwip_netconn_is_err_msg

int lwip_netconn_is_err_msg(void *msg, err_t *err);


      

Func lwip_netconn_do_join_leave_group

void lwip_netconn_do_join_leave_group(void *m);


      

Func lwip_netconn_do_join_leave_group_netif

void lwip_netconn_do_join_leave_group_netif(void *m);


      

Func lwip_netconn_do_gethostbyname

void lwip_netconn_do_gethostbyname(void *arg);


      

Func netconn_free

void netconn_free(struct netconn *conn);


      

Func mem_overflow_init_raw

void mem_overflow_init_raw(void *p, size_t size);


      

Func mem_overflow_check_raw

void mem_overflow_check_raw(void *p, size_t size, const char *descr1, const char *descr2);


      

Func memp_init_pool

void memp_init_pool(const struct memp_desc *desc);


      

Func memp_malloc_pool_fn

void *memp_malloc_pool_fn(const struct memp_desc* desc, const char* file, const int line);


      

Func memp_malloc_pool

void *memp_malloc_pool(const struct memp_desc *desc);


      

Func memp_free_pool

void memp_free_pool(const struct memp_desc* desc, void *mem);


      

Func LWIP_MEMPOOL

LWIP_MEMPOOL(RAW_PCB,       MEMP_NUM_RAW_PCB,        sizeof(struct raw_pcb),       "RAW_PCB")
#endif /* LWIP_RAW */

#if LWIP_UDP
LWIP_MEMPOOL(UDP_PCB,       MEMP_NUM_UDP_PCB,        sizeof(struct udp_pcb),       "UDP_PCB")
#endif /* LWIP_UDP */

#if LWIP_TCP
LWIP_MEMPOOL(TCP_PCB,       MEMP_NUM_TCP_PCB,        sizeof(struct tcp_pcb),       "TCP_PCB")
LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN")
LWIP_MEMPOOL(TCP_SEG,       MEMP_NUM_TCP_SEG,        sizeof(struct tcp_seg),       "TCP_SEG")
#endif /* LWIP_TCP */

#if LWIP_ALTCP && LWIP_TCP
LWIP_MEMPOOL(ALTCP_PCB,     MEMP_NUM_ALTCP_PCB,      sizeof(struct altcp_pcb),     "ALTCP_PCB")
#endif /* LWIP_ALTCP && LWIP_TCP */

#if LWIP_IPV4 && IP_REASSEMBLY
LWIP_MEMPOOL(REASSDATA,     MEMP_NUM_REASSDATA,      sizeof(struct ip_reassdata),  "REASSDATA")
#endif /* LWIP_IPV4 && IP_REASSEMBLY */
#if (IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF) || (LWIP_IPV6 && LWIP_IPV6_FRAG)
LWIP_MEMPOOL(FRAG_PBUF,     MEMP_NUM_FRAG_PBUF,      sizeof(struct pbuf_custom_ref),"FRAG_PBUF")
#endif /* IP_FRAG && !LWIP_NETIF_TX_SINGLE_PBUF || (LWIP_IPV6 && LWIP_IPV6_FRAG) */

#if LWIP_NETCONN || LWIP_SOCKET
LWIP_MEMPOOL(NETBUF,        MEMP_NUM_NETBUF,         sizeof(struct netbuf),        "NETBUF")
LWIP_MEMPOOL(NETCONN,       MEMP_NUM_NETCONN,        sizeof(struct netconn),       "NETCONN")
#endif /* LWIP_NETCONN || LWIP_SOCKET */

#if NO_SYS==0
LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API,  sizeof(struct tcpip_msg),     "TCPIP_MSG_API")
#if LWIP_MPU_COMPATIBLE
LWIP_MEMPOOL(API_MSG,       MEMP_NUM_API_MSG,        sizeof(struct api_msg),       "API_MSG")
#if LWIP_DNS
LWIP_MEMPOOL(DNS_API_MSG,   MEMP_NUM_DNS_API_MSG,    sizeof(struct dns_api_msg),   "DNS_API_MSG")
#endif
#if LWIP_SOCKET && !LWIP_TCPIP_CORE_LOCKING
LWIP_MEMPOOL(SOCKET_SETGETSOCKOPT_DATA, MEMP_NUM_SOCKET_SETGETSOCKOPT_DATA, sizeof(struct lwip_setgetsockopt_data), "SOCKET_SETGETSOCKOPT_DATA")
#endif
#if LWIP_SOCKET && (LWIP_SOCKET_SELECT || LWIP_SOCKET_POLL)
LWIP_MEMPOOL(SELECT_CB,     MEMP_NUM_SELECT_CB,      sizeof(struct lwip_select_cb), "SELECT_CB")
#endif /* LWIP_SOCKET && (LWIP_SOCKET_SELECT || LWIP_SOCKET_POLL) */
#if LWIP_NETIF_API
LWIP_MEMPOOL(NETIFAPI_MSG,  MEMP_NUM_NETIFAPI_MSG,   sizeof(struct netifapi_msg),  "NETIFAPI_MSG")
#endif
#endif /* LWIP_MPU_COMPATIBLE */
#if !LWIP_TCPIP_CORE_LOCKING_INPUT
LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg),     "TCPIP_MSG_INPKT")
#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */
#endif /* NO_SYS==0 */

#if LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING
LWIP_MEMPOOL(ARP_QUEUE,     MEMP_NUM_ARP_QUEUE,      sizeof(struct etharp_q_entry), "ARP_QUEUE")
#endif /* LWIP_IPV4 && LWIP_ARP && ARP_QUEUEING */

#if LWIP_IGMP
LWIP_MEMPOOL(IGMP_GROUP,    MEMP_NUM_IGMP_GROUP,     sizeof(struct igmp_group),    "IGMP_GROUP")
#endif /* LWIP_IGMP */

#if LWIP_TIMERS && !LWIP_TIMERS_CUSTOM
LWIP_MEMPOOL(SYS_TIMEOUT,   MEMP_NUM_SYS_TIMEOUT,    sizeof(struct sys_timeo),     "SYS_TIMEOUT")
#endif /* LWIP_TIMERS && !LWIP_TIMERS_CUSTOM */

#if LWIP_DNS && LWIP_SOCKET
LWIP_MEMPOOL(NETDB,         MEMP_NUM_NETDB,          NETDB_ELEM_SIZE,              "NETDB")
#endif /* LWIP_DNS && LWIP_SOCKET */
#if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
LWIP_MEMPOOL(LOCALHOSTLIST, MEMP_NUM_LOCALHOSTLIST,  LOCALHOSTLIST_ELEM_SIZE,      "LOCALHOSTLIST")
#endif /* LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */

#if LWIP_IPV6 && LWIP_ND6_QUEUEING
LWIP_MEMPOOL(ND6_QUEUE,     MEMP_NUM_ND6_QUEUE,      sizeof(struct nd6_q_entry),   "ND6_QUEUE")
#endif /* LWIP_IPV6 && LWIP_ND6_QUEUEING */

#if LWIP_IPV6 && LWIP_IPV6_REASS
LWIP_MEMPOOL(IP6_REASSDATA, MEMP_NUM_REASSDATA,      sizeof(struct ip6_reassdata), "IP6_REASSDATA")
#endif /* LWIP_IPV6 && LWIP_IPV6_REASS */

#if LWIP_IPV6 && LWIP_IPV6_MLD
LWIP_MEMPOOL(MLD6_GROUP,    MEMP_NUM_MLD6_GROUP,     sizeof(struct mld_group),     "MLD6_GROUP")
#endif /* LWIP_IPV6 && LWIP_IPV6_MLD */


/*
 * A list of pools of pbuf's used by LWIP.
 *
 * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description)
 *     creates a pool name MEMP_pool_name. description is used in stats.c
 *     This allocates enough space for the pbuf struct and a payload.
 *     (Example: pbuf_payload_size=0 allocates only size for the struct)
 */
LWIP_MEMPOOL(PBUF,          MEMP_NUM_PBUF,           sizeof(struct pbuf),          "PBUF_REF/ROM")
LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE,          PBUF_POOL_BUFSIZE,            "PBUF_POOL")


/*
 * Allow for user-defined pools; this must be explicitly set in lwipopts.h
 * since the default is to NOT look for lwippools.h
 */
#if MEMP_USE_CUSTOM_POOLS
#include "lwippools.h"
#endif /* MEMP_USE_CUSTOM_POOLS */

/*
 * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later
 * (#undef is ignored for something that is not defined)
 */
#undef LWIP_MEMPOOL
#undef LWIP_MALLOC_MEMPOOL
#undef LWIP_MALLOC_MEMPOOL_START
#undef LWIP_MALLOC_MEMPOOL_END
#undef LWIP_PBUF_MEMPOOL


      

Func raw_netif_ip_addr_changed

void raw_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr);


      

Func tcp_slowtmr

void            tcp_slowtmr (void);
/* It is also possible to call these two functions at the right
   intervals (instead of calling tcp_tmr()). */

Func tcp_fasttmr

void            tcp_fasttmr (void);


      

Func tcp_abandon

void            tcp_abandon (struct tcp_pcb *pcb, int reset);


      

Func tcp_send_empty_ack

err_t           tcp_send_empty_ack(struct tcp_pcb *pcb);


      

Func tcp_rexmit

err_t           tcp_rexmit (struct tcp_pcb *pcb);


      

Func tcp_rexmit_rto_prepare

err_t           tcp_rexmit_rto_prepare(struct tcp_pcb *pcb);


      

Func tcp_rexmit_rto_commit

void            tcp_rexmit_rto_commit(struct tcp_pcb *pcb);


      

Func tcp_rexmit_rto

void            tcp_rexmit_rto (struct tcp_pcb *pcb);


      

Func tcp_rexmit_fast

void            tcp_rexmit_fast (struct tcp_pcb *pcb);


      

Func tcp_update_rcv_ann_wnd

u32_t           tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb);


      

Func tcp_process_refused_data

err_t           tcp_process_refused_data(struct tcp_pcb *pcb);


      

Func tcp_pcb_purge

void tcp_pcb_purge(struct tcp_pcb *pcb);


      

Func tcp_pcb_remove

void tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb);


      

Func tcp_segs_free

void tcp_segs_free(struct tcp_seg *seg);


      

Func tcp_seg_free

void tcp_seg_free(struct tcp_seg *seg);


      

Func tcp_send_fin

err_t tcp_send_fin(struct tcp_pcb *pcb);


      

Func tcp_enqueue_flags

err_t tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags);


      

Func tcp_rexmit_seg

void tcp_rexmit_seg(struct tcp_pcb *pcb, struct tcp_seg *seg);


      

Func tcp_rst

void tcp_rst(const struct tcp_pcb* pcb, u32_t seqno, u32_t ackno,
      const ip_addr_t *local_ip, const ip_addr_t *remote_ip,
      u16_t local_port, u16_t remote_port);


      

Func tcp_next_iss

u32_t tcp_next_iss(struct tcp_pcb *pcb);


      

Func tcp_keepalive

err_t tcp_keepalive(struct tcp_pcb *pcb);


      

Func tcp_split_unsent_seg

err_t tcp_split_unsent_seg(struct tcp_pcb *pcb, u16_t split);


      

Func tcp_zero_window_probe

err_t tcp_zero_window_probe(struct tcp_pcb *pcb);


      

Func tcp_trigger_input_pcb_close

void tcp_trigger_input_pcb_close(void);


      

Func tcp_eff_send_mss_netif

u16_t tcp_eff_send_mss_netif(u16_t sendmss, struct netif *outif,
                            const ip_addr_t *dest);


      

Func tcp_recv_null

err_t tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err);


      

Func tcp_debug_print

void tcp_debug_print(struct tcp_hdr *tcphdr);


      

Func tcp_debug_print_flags

void tcp_debug_print_flags(u8_t flags);


      

Func tcp_debug_print_state

void tcp_debug_print_state(enum tcp_state s);


      

Func tcp_debug_print_pcbs

void tcp_debug_print_pcbs(void);


      

Func tcp_pcbs_sane

s16_t tcp_pcbs_sane(void);


      

Func tcp_timer_needed

void tcp_timer_needed(void);
/** External function (implemented in timers.c), called when TCP detects
 * that a timer is needed (i.e. active- or time-wait-pcb found). */

Func tcp_netif_ip_addr_changed

void tcp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr);


      

Func tcp_free_ooseq

void tcp_free_ooseq(struct tcp_pcb *pcb);


      

Func tcp_ext_arg_invoke_callbacks_passive_open

err_t tcp_ext_arg_invoke_callbacks_passive_open(struct tcp_pcb_listen *lpcb, struct tcp_pcb *cpcb);


      

Func tcpip_send_msg_wait_sem

err_t tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t* sem);


      

Func tcpip_api_call

err_t tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call);


      

Func raw_bind_netif

void            raw_bind_netif (struct raw_pcb *pcb, const struct netif *netif);


      

Func raw_disconnect

void            raw_disconnect (struct raw_pcb *pcb);


      

Func raw_sendto_if_src

err_t           raw_sendto_if_src(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, struct netif *netif, const ip_addr_t *src_ip);


      

Func sio_open

sio_fd_t sio_open(u8_t devnum);
/**
 * Opens a serial device for communication.
 *
 * @param devnum device number
 * @return handle to serial device if successful, NULL otherwise
 */

Func sio_send

void sio_send(u8_t c, sio_fd_t fd);
/**
 * Sends a single character to the serial device.
 *
 * @param c character to send
 * @param fd serial device handle
 *
 * @note This function will block until the character can be sent.
 */

Func sio_recv

u8_t sio_recv(sio_fd_t fd);
/**
 * Receives a single character from the serial device.
 *
 * @param fd serial device handle
 *
 * @note This function will block until a character is received.
 */

Func sio_read

u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len);
/**
 * Reads from the serial device.
 *
 * @param fd serial device handle
 * @param data pointer to data buffer for receiving
 * @param len maximum length (in bytes) of data to receive
 * @return number of bytes actually received - may be 0 if aborted by sio_read_abort
 *
 * @note This function will block until data can be received. The blocking
 * can be cancelled by calling sio_read_abort().
 */

Func sio_tryread

u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len);
/**
 * Tries to read from the serial device. Same as sio_read but returns
 * immediately if no data is available and never blocks.
 *
 * @param fd serial device handle
 * @param data pointer to data buffer for receiving
 * @param len maximum length (in bytes) of data to receive
 * @return number of bytes actually received
 */

Func sio_write

u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len);
/**
 * Writes to the serial device.
 *
 * @param fd serial device handle
 * @param data pointer to data to send
 * @param len length (in bytes) of data to send
 * @return number of bytes actually sent
 *
 * @note This function will block until all data can be sent.
 */

Func sio_read_abort

void sio_read_abort(sio_fd_t fd);
/**
 * Aborts a blocking sio_read() call.
 *
 * @param fd serial device handle
 */

Func mib2_netif_added

void mib2_netif_added(struct netif *ni);
/* network interface */

Func mib2_netif_removed

void mib2_netif_removed(struct netif *ni);


      

Func mib2_add_arp_entry

void mib2_add_arp_entry(struct netif *ni, ip4_addr_t *ip);
/* ARP (for atTable and ipNetToMediaTable) */

Func mib2_remove_arp_entry

void mib2_remove_arp_entry(struct netif *ni, ip4_addr_t *ip);


      

Func mib2_add_ip4

void mib2_add_ip4(struct netif *ni);


      

Func mib2_remove_ip4

void mib2_remove_ip4(struct netif *ni);


      

Func mib2_add_route_ip4

void mib2_add_route_ip4(u8_t dflt, struct netif *ni);


      

Func mib2_remove_route_ip4

void mib2_remove_route_ip4(u8_t dflt, struct netif *ni);


      

Func mib2_udp_bind

void mib2_udp_bind(struct udp_pcb *pcb);


      

Func mib2_udp_unbind

void mib2_udp_unbind(struct udp_pcb *pcb);


      

Func lwip_socket_thread_init

err_t lwip_socket_thread_init(void *task);


      

Func lwip_socket_thread_cleanup

err_t lwip_socket_thread_cleanup(void *task);
/* LWIP_NETCONN_SEM_PER_THREAD==1: initialize thread-local semaphore */

Func fcntl

int fcntl(int s, int cmd, ...);


      

Func lwip_accept

int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen);


      

Func lwip_bind

int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen);


      

Func lwip_shutdown

int lwip_shutdown(int s, int how);


      

Func lwip_getpeername

int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen);


      

Func lwip_getsockname

int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen);


      

Func lwip_getsockopt

int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen);


      

Func lwip_setsockopt

int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen);


      

Func lwip_close

int lwip_close(int s);


      

Func lwip_connect

int lwip_connect(int s, const struct sockaddr *name, socklen_t namelen);


      

Func lwip_listen

int lwip_listen(int s, int backlog);


      

Func lwip_recv

ssize_t lwip_recv(int s, void *mem, size_t len, int flags);


      

Func lwip_read

ssize_t lwip_read(int s, void *mem, size_t len);


      

Func lwip_readv

ssize_t lwip_readv(int s, const struct iovec *iov, int iovcnt);


      

Func lwip_recvfrom

ssize_t lwip_recvfrom(int s, void *mem, size_t len, int flags,
     struct sockaddr *from, socklen_t *fromlen);


      

Func lwip_recvmsg

ssize_t lwip_recvmsg(int s, struct msghdr *message, int flags);


      

Func lwip_send

ssize_t lwip_send(int s, const void *dataptr, size_t size, int flags);


      

Func lwip_sendmsg

ssize_t lwip_sendmsg(int s, const struct msghdr *message, int flags);


      

Func lwip_sendto

ssize_t lwip_sendto(int s, const void *dataptr, size_t size, int flags,
   const struct sockaddr *to, socklen_t tolen);


      

Func lwip_socket

int lwip_socket(int domain, int type, int protocol);


      

Func lwip_write

ssize_t lwip_write(int s, const void *dataptr, size_t size);


      

Func lwip_writev

ssize_t lwip_writev(int s, const struct iovec *iov, int iovcnt);


      

Func lwip_select

int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset,
               struct timeval *timeout);


      

Func lwip_poll

int lwip_poll(struct pollfd *fds, nfds_t nfds, int timeout);


      

Func lwip_ioctl

int lwip_ioctl(int s, long cmd, void *argp);


      

Func lwip_fcntl

int lwip_fcntl(int s, int cmd, int val);


      

Func lwip_inet_pton

int lwip_inet_pton(int af, const char *src, void *dst);


      

Func stats_init

void stats_init(void);
/** Init statistics */

Func stats_display

void stats_display(void);


      

Func stats_display_proto

void stats_display_proto(struct stats_proto *proto, const char *name);


      

Func stats_display_igmp

void stats_display_igmp(struct stats_igmp *igmp, const char *name);


      

Func stats_display_mem

void stats_display_mem(struct stats_mem *mem, const char *name);


      

Func stats_display_memp

void stats_display_memp(struct stats_mem *mem, int index);


      

Func stats_display_sys

void stats_display_sys(struct stats_sys *sys);


      

Func sys_mutex_new

err_t sys_mutex_new(sys_mutex_t *mutex);
/**
 * @ingroup sys_mutex
 * Create a new mutex.
 * Note that mutexes are expected to not be taken recursively by the lwIP code,
 * so both implementation types (recursive or non-recursive) should work.
 * The mutex is allocated to the memory that 'mutex'
 * points to (which can be both a pointer or the actual OS structure).
 * If the mutex has been created, ERR_OK should be returned. Returning any
 * other error will provide a hint what went wrong, but except for assertions,
 * no real error handling is implemented.
 * 
 * @param mutex pointer to the mutex to create
 * @return ERR_OK if successful, another err_t otherwise
 */

Func sys_mutex_lock

void sys_mutex_lock(sys_mutex_t *mutex);
/**
 * @ingroup sys_mutex
 * Blocks the thread until the mutex can be grabbed.
 * @param mutex the mutex to lock
 */

Func sys_mutex_unlock

void sys_mutex_unlock(sys_mutex_t *mutex);
/**
 * @ingroup sys_mutex
 * Releases the mutex previously locked through 'sys_mutex_lock()'.
 * @param mutex the mutex to unlock
 */

Func sys_mutex_free

void sys_mutex_free(sys_mutex_t *mutex);
/**
 * @ingroup sys_mutex
 * Deallocates a mutex.
 * @param mutex the mutex to delete
 */

Func sys_mutex_valid

int sys_mutex_valid(sys_mutex_t *mutex);
/**
 * @ingroup sys_mutex
 * Returns 1 if the mutes is valid, 0 if it is not valid.
 * When using pointers, a simple way is to check the pointer for != NULL.
 * When directly using OS structures, implementing this may be more complex.
 * This may also be a define, in which case the function is not prototyped.
 */

Func sys_mutex_set_invalid

void sys_mutex_set_invalid(sys_mutex_t *mutex);
/**
 * @ingroup sys_mutex
 * Invalidate a mutex so that sys_mutex_valid() returns 0.
 * ATTENTION: This does NOT mean that the mutex shall be deallocated:
 * sys_mutex_free() is always called before calling this function!
 * This may also be a define, in which case the function is not prototyped.
 */

Func sys_sem_new

err_t sys_sem_new(sys_sem_t *sem, u8_t count);
/**
 * @ingroup sys_sem
 * Create a new semaphore
 * Creates a new semaphore. The semaphore is allocated to the memory that 'sem'
 * points to (which can be both a pointer or the actual OS structure).
 * The "count" argument specifies the initial state of the semaphore (which is
 * either 0 or 1).
 * If the semaphore has been created, ERR_OK should be returned. Returning any
 * other error will provide a hint what went wrong, but except for assertions,
 * no real error handling is implemented.
 *
 * @param sem pointer to the semaphore to create
 * @param count initial count of the semaphore
 * @return ERR_OK if successful, another err_t otherwise
 */

Func sys_sem_signal

void sys_sem_signal(sys_sem_t *sem);
/**
 * @ingroup sys_sem
 * Signals a semaphore
 * @param sem the semaphore to signal
 */

Func sys_arch_sem_wait

u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout);
/**
 * @ingroup sys_sem
 *  Blocks the thread while waiting for the semaphore to be signaled. If the
 * "timeout" argument is non-zero, the thread should only be blocked for the
 * specified time (measured in milliseconds). If the "timeout" argument is zero,
 * the thread should be blocked until the semaphore is signalled.
 * 
 * The return value is SYS_ARCH_TIMEOUT if the semaphore wasn't signaled within
 * the specified time or any other value if it was signaled (with or without
 * waiting).
 * Notice that lwIP implements a function with a similar name,
 * sys_sem_wait(), that uses the sys_arch_sem_wait() function.
 * 
 * @param sem the semaphore to wait for
 * @param timeout timeout in milliseconds to wait (0 = wait forever)
 * @return SYS_ARCH_TIMEOUT on timeout, any other value on success
 */

Func sys_sem_free

void sys_sem_free(sys_sem_t *sem);
/**
 * @ingroup sys_sem
 * Deallocates a semaphore.
 * @param sem semaphore to delete
 */

Func sys_sem_valid

int sys_sem_valid(sys_sem_t *sem);
/**
 * @ingroup sys_sem
 * Returns 1 if the semaphore is valid, 0 if it is not valid.
 * When using pointers, a simple way is to check the pointer for != NULL.
 * When directly using OS structures, implementing this may be more complex.
 * This may also be a define, in which case the function is not prototyped.
 */

Func sys_sem_set_invalid

void sys_sem_set_invalid(sys_sem_t *sem);
/**
 * @ingroup sys_sem
 * Invalidate a semaphore so that sys_sem_valid() returns 0.
 * ATTENTION: This does NOT mean that the semaphore shall be deallocated:
 * sys_sem_free() is always called before calling this function!
 * This may also be a define, in which case the function is not prototyped.
 */

Func sys_msleep

void sys_msleep(u32_t ms);
/**
 * @ingroup sys_misc
 * Sleep for specified number of ms
 */

Func sys_mbox_new

err_t sys_mbox_new(sys_mbox_t *mbox, int size);
/**
 * @ingroup sys_mbox
 * Creates an empty mailbox for maximum "size" elements. Elements stored
 * in mailboxes are pointers. You have to define macros "_MBOX_SIZE"
 * in your lwipopts.h, or ignore this parameter in your implementation
 * and use a default size.
 * If the mailbox has been created, ERR_OK should be returned. Returning any
 * other error will provide a hint what went wrong, but except for assertions,
 * no real error handling is implemented.
 * 
 * @param mbox pointer to the mbox to create
 * @param size (minimum) number of messages in this mbox
 * @return ERR_OK if successful, another err_t otherwise
 */

Func sys_mbox_post

void sys_mbox_post(sys_mbox_t *mbox, void *msg);
/**
 * @ingroup sys_mbox
 * Post a message to an mbox - may not fail
 * -> blocks if full, only to be used from tasks NOT from ISR!
 * 
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL)
 */

Func sys_mbox_trypost

err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg);
/**
 * @ingroup sys_mbox
 * Try to post a message to an mbox - may fail if full.
 * Can be used from ISR (if the sys arch layer allows this).
 * Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
 * 
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL)
 */

Func sys_mbox_trypost_fromisr

err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg);
/**
 * @ingroup sys_mbox
 * Try to post a message to an mbox - may fail if full.
 * To be be used from ISR.
 * Returns ERR_MEM if it is full, else, ERR_OK if the "msg" is posted.
 * 
 * @param mbox mbox to posts the message
 * @param msg message to post (ATTENTION: can be NULL)
 */

Func sys_arch_mbox_fetch

u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout);
/**
 * @ingroup sys_mbox
 * Blocks the thread until a message arrives in the mailbox, but does
 * not block the thread longer than "timeout" milliseconds (similar to
 * the sys_arch_sem_wait() function). If "timeout" is 0, the thread should
 * be blocked until a message arrives. The "msg" argument is a result
 * parameter that is set by the function (i.e., by doing "*msg =
 * ptr"). The "msg" parameter maybe NULL to indicate that the message
 * should be dropped.
 * The return values are the same as for the sys_arch_sem_wait() function:
 * SYS_ARCH_TIMEOUT if there was a timeout, any other value if a messages
 * is received.
 * 
 * Note that a function with a similar name, sys_mbox_fetch(), is
 * implemented by lwIP. 
 * 
 * @param mbox mbox to get a message from
 * @param msg pointer where the message is stored
 * @param timeout maximum time (in milliseconds) to wait for a message (0 = wait forever)
 * @return SYS_ARCH_TIMEOUT on timeout, any other value if a message has been received
 */

Func sys_arch_mbox_tryfetch

u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg);
/**
 * @ingroup sys_mbox
 * This is similar to sys_arch_mbox_fetch, however if a message is not
 * present in the mailbox, it immediately returns with the code
 * SYS_MBOX_EMPTY. On success 0 is returned.
 * To allow for efficient implementations, this can be defined as a
 * function-like macro in sys_arch.h instead of a normal function. For
 * example, a naive implementation could be:
 * \#define sys_arch_mbox_tryfetch(mbox,msg) sys_arch_mbox_fetch(mbox,msg,1)
 * although this would introduce unnecessary delays.
 * 
 * @param mbox mbox to get a message from
 * @param msg pointer where the message is stored
 * @return 0 (milliseconds) if a message has been received
 *         or SYS_MBOX_EMPTY if the mailbox is empty
 */

Func sys_mbox_free

void sys_mbox_free(sys_mbox_t *mbox);
/**
 * @ingroup sys_mbox
 * Deallocates a mailbox. If there are messages still present in the
 * mailbox when the mailbox is deallocated, it is an indication of a
 * programming error in lwIP and the developer should be notified.
 * 
 * @param mbox mbox to delete
 */

Func sys_mbox_valid

int sys_mbox_valid(sys_mbox_t *mbox);
/**
 * @ingroup sys_mbox
 * Returns 1 if the mailbox is valid, 0 if it is not valid.
 * When using pointers, a simple way is to check the pointer for != NULL.
 * When directly using OS structures, implementing this may be more complex.
 * This may also be a define, in which case the function is not prototyped.
 */

Func sys_mbox_set_invalid

void sys_mbox_set_invalid(sys_mbox_t *mbox);
/**
 * @ingroup sys_mbox
 * Invalidate a mailbox so that sys_mbox_valid() returns 0.
 * ATTENTION: This does NOT mean that the mailbox shall be deallocated:
 * sys_mbox_free() is always called before calling this function!
 * This may also be a define, in which case the function is not prototyped.
 */

Func sys_init

void sys_init(void);
/**
 * @ingroup sys_misc
 * sys_init() must be called before anything else.
 * Initialize the sys_arch layer.
 */

Func sys_jiffies

u32_t sys_jiffies(void);
/**
 * Ticks/jiffies since power up.
 */

Func sys_now

u32_t sys_now(void);
/**
 * @ingroup sys_time
 * Returns the current time in milliseconds,
 * may be the same as sys_jiffies or at least based on it.
 * Don't care for wraparound, this is only used for time diffs.
 * Not implementing this function means you cannot use some modules (e.g. TCP
 * timestamps, internal timeouts for NO_SYS==1).
 */

Func sys_arch_unprotect

void sys_arch_unprotect(sys_prot_t pval);


      

Func tuya_app_tcpip_thread_prio_up

void tuya_app_tcpip_thread_prio_up(u32_t *prio_thread);


      

Func tuya_app_tcpip_thread_prio_back

void tuya_app_tcpip_thread_prio_back(u32_t prio_thread);


      

Func lwip_tcp_event

err_t lwip_tcp_event(void *arg, struct tcp_pcb *pcb,
        enum lwip_event,
        struct pbuf *p,
        u16_t size,
        err_t err);


      

Func tcp_accept

void            tcp_accept (struct tcp_pcb *pcb, tcp_accept_fn accept);


      

Func tcp_backlog_delayed

void            tcp_backlog_delayed(struct tcp_pcb* pcb);


      

Func tcp_backlog_accepted

void            tcp_backlog_accepted(struct tcp_pcb* pcb);


      

Func tcp_recved

void            tcp_recved (struct tcp_pcb *pcb, u16_t len);


      

Func tcp_bind_netif

void            tcp_bind_netif(struct tcp_pcb *pcb, const struct netif *netif);


      

Func tcp_connect

err_t           tcp_connect (struct tcp_pcb *pcb, const ip_addr_t *ipaddr,
                             u16_t port, tcp_connected_fn connected);


      

Func tcp_abort

void            tcp_abort (struct tcp_pcb *pcb);


      

Func tcp_shutdown

err_t           tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx);


      

Func tcp_setprio

void            tcp_setprio (struct tcp_pcb *pcb, u8_t prio);


      

Func tcp_output

err_t           tcp_output (struct tcp_pcb *pcb);


      

Func tcp_tcp_get_tcp_addrinfo

err_t           tcp_tcp_get_tcp_addrinfo(struct tcp_pcb *pcb, int local, ip_addr_t *addr, u16_t *port);


      

Func tcp_ext_arg_alloc_id

u8_t tcp_ext_arg_alloc_id(void);


      

Func tcp_ext_arg_set_callbacks

void tcp_ext_arg_set_callbacks(struct tcp_pcb *pcb, uint8_t id, const struct tcp_ext_arg_callbacks * const callbacks);


      

Func tcp_ext_arg_set

void tcp_ext_arg_set(struct tcp_pcb *pcb, uint8_t id, void *arg);


      

Func tcp_ext_arg_get

void *tcp_ext_arg_get(const struct tcp_pcb *pcb, uint8_t id);


      

Func tcpip_init

void  tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg);


      

Func tcpip_inpkt

err_t tcpip_inpkt(struct pbuf *p, struct netif *inp, netif_input_fn input_fn);


      

Func tcpip_input

err_t tcpip_input(struct pbuf *p, struct netif *inp);


      

Func tcpip_try_callback

err_t tcpip_try_callback(tcpip_callback_fn function, void *ctx);


      

Func tcpip_callback

err_t tcpip_callback(tcpip_callback_fn function, void *ctx);


      

Func tcpip_callbackmsg_delete

void  tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg);


      

Func tcpip_callbackmsg_trycallback

err_t tcpip_callbackmsg_trycallback(struct tcpip_callback_msg* msg);


      

Func tcpip_callbackmsg_trycallback_fromisr

err_t tcpip_callbackmsg_trycallback_fromisr(struct tcpip_callback_msg* msg);


      

Func pbuf_free_callback

err_t pbuf_free_callback(struct pbuf *p);
/* free pbufs or heap memory from another context without blocking */

Func mem_free_callback

err_t mem_free_callback(void *m);


      

Func tcpip_timeout

err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg);


      

Func tcpip_untimeout

err_t tcpip_untimeout(sys_timeout_handler h, void *arg);


      

Func tcpip_thread_poll_one

int tcpip_thread_poll_one(void);


      

Func sys_timeouts_init

void sys_timeouts_init(void);


      

Func sys_timeout_debug

void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name);


      

Func sys_timeout

void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg);


      

Func sys_untimeout

void sys_untimeout(sys_timeout_handler handler, void *arg);


      

Func sys_restart_timeouts

void sys_restart_timeouts(void);


      

Func sys_check_timeouts

void sys_check_timeouts(void);


      

Func sys_timeouts_sleeptime

u32_t sys_timeouts_sleeptime(void);


      

Func lwip_cyclic_timer

void lwip_cyclic_timer(void *arg);


      

Func udp_bind_netif

void            udp_bind_netif (struct udp_pcb *pcb, const struct netif* netif);


      

Func udp_disconnect

void            udp_disconnect (struct udp_pcb *pcb);


      

Func udp_sendto_if

err_t           udp_sendto_if (struct udp_pcb *pcb, struct pbuf *p,
                                const ip_addr_t *dst_ip, u16_t dst_port,
                                struct netif *netif);


      

Func udp_sendto_if_src

err_t           udp_sendto_if_src(struct udp_pcb *pcb, struct pbuf *p,
                                const ip_addr_t *dst_ip, u16_t dst_port,
                                struct netif *netif, const ip_addr_t *src_ip);


      

Func udp_sendto_if_chksum

err_t           udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p,
                                const ip_addr_t *dst_ip, u16_t dst_port,
                                struct netif *netif, u8_t have_chksum,
                                u16_t chksum);


      

Func udp_sendto_chksum

err_t           udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p,
                                const ip_addr_t *dst_ip, u16_t dst_port,
                                u8_t have_chksum, u16_t chksum);


      

Func udp_send_chksum

err_t           udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p,
                                u8_t have_chksum, u16_t chksum);


      

Func udp_sendto_if_src_chksum

err_t           udp_sendto_if_src_chksum(struct udp_pcb *pcb, struct pbuf *p,
                                const ip_addr_t *dst_ip, u16_t dst_port, struct netif *netif,
                                u8_t have_chksum, u16_t chksum, const ip_addr_t *src_ip);


      

Func udp_debug_print

void udp_debug_print(struct udp_hdr *udphdr);


      

Func udp_netif_ip_addr_changed

void udp_netif_ip_addr_changed(const ip_addr_t* old_addr, const ip_addr_t* new_addr);


      

Func bridgeif_init

err_t bridgeif_init(struct netif *netif);


      

Func bridgeif_add_port

err_t bridgeif_add_port(struct netif *bridgeif, struct netif *portif);


      

Func bridgeif_fdb_add

err_t bridgeif_fdb_add(struct netif *bridgeif, const struct eth_addr *addr, bridgeif_portmask_t ports);


      

Func bridgeif_fdb_remove

err_t bridgeif_fdb_remove(struct netif *bridgeif, const struct eth_addr *addr);


      

Func bridgeif_fdb_update_src

void               bridgeif_fdb_update_src(void *fdb_ptr, struct eth_addr *src_addr, u8_t port_idx);
/* FDB interface, can be replaced by own implementation */

Func bridgeif_fdb_get_dst_ports

bridgeif_portmask_t bridgeif_fdb_get_dst_ports(void *fdb_ptr, struct eth_addr *dst_addr);


      

Func bridgeif_fdb_init

void*              bridgeif_fdb_init(u16_t max_fdb_entries);


      

Func ethernet_input

err_t ethernet_input(struct pbuf *p, struct netif *netif);


      

Func ethernet_output

err_t ethernet_output(struct netif* netif, struct pbuf* p, const struct eth_addr* src, const struct eth_addr* dst, u16_t eth_type);


      

Func lowpan6_tmr

void lowpan6_tmr(void);


      

Func lowpan6_set_context

err_t lowpan6_set_context(u8_t idx, const ip6_addr_t * context);


      

Func lowpan6_set_short_addr

err_t lowpan6_set_short_addr(u8_t addr_high, u8_t addr_low);


      

Func lowpan4_output

err_t lowpan4_output(struct netif *netif, struct pbuf *q, const ip4_addr_t *ipaddr);


      

Func lowpan6_output

err_t lowpan6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr);


      

Func lowpan6_input

err_t lowpan6_input(struct pbuf * p, struct netif *netif);


      

Func lowpan6_if_init

err_t lowpan6_if_init(struct netif *netif);


      

Func lowpan6_set_pan_id

err_t lowpan6_set_pan_id(u16_t pan_id);
/* pan_id in network byte order. */

Func lowpan6_calc_crc

u16_t lowpan6_calc_crc(const void *buf, u16_t len);


      

Func tcpip_6lowpan_input

err_t tcpip_6lowpan_input(struct pbuf *p, struct netif *inp);


      

Func rfc7668_output

err_t rfc7668_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr);


      

Func rfc7668_input

err_t rfc7668_input(struct pbuf * p, struct netif *netif);


      

Func rfc7668_set_local_addr_eui64

err_t rfc7668_set_local_addr_eui64(struct netif *netif, const u8_t *local_addr, size_t local_addr_len);


      

Func rfc7668_set_local_addr_mac48

err_t rfc7668_set_local_addr_mac48(struct netif *netif, const u8_t *local_addr, size_t local_addr_len, int is_public_addr);


      

Func rfc7668_set_peer_addr_eui64

err_t rfc7668_set_peer_addr_eui64(struct netif *netif, const u8_t *peer_addr, size_t peer_addr_len);


      

Func rfc7668_set_peer_addr_mac48

err_t rfc7668_set_peer_addr_mac48(struct netif *netif, const u8_t *peer_addr, size_t peer_addr_len, int is_public_addr);


      

Func rfc7668_set_context

err_t rfc7668_set_context(u8_t index, const ip6_addr_t * context);


      

Func rfc7668_if_init

err_t rfc7668_if_init(struct netif *netif);


      

Func tcpip_rfc7668_input

err_t tcpip_rfc7668_input(struct pbuf *p, struct netif *inp);


      

Func ble_addr_to_eui64

void ble_addr_to_eui64(uint8_t *dst, const uint8_t *src, int public_addr);


      

Func eui64_to_ble_addr

void eui64_to_ble_addr(uint8_t *dst, const uint8_t *src);


      

Func lowpan6_get_address_mode

s8_t lowpan6_get_address_mode(const ip6_addr_t *ip6addr, const struct lowpan6_link_addr *mac_addr);


      

Func lowpan6_compress_headers

err_t lowpan6_compress_headers(struct netif *netif, u8_t *inbuf, size_t inbuf_size, u8_t *outbuf, size_t outbuf_size,
                              u8_t *lowpan6_header_len_out, u8_t *hidden_header_len_out, ip6_addr_t *lowpan6_contexts,
                              const struct lowpan6_link_addr *src, const struct lowpan6_link_addr *dst);


      

Func ccp_resetrequest

void ccp_resetrequest(ppp_pcb *pcb);


      

Func eap_authwithpeer

void eap_authwithpeer(ppp_pcb *pcb, const char *localname);


      

Func eap_authpeer

void eap_authpeer(ppp_pcb *pcb, const char *localname);


      

Func fsm_init

void fsm_init(fsm *f);
/*
 * Prototypes
 */

Func fsm_lowerup

void fsm_lowerup(fsm *f);


      

Func fsm_lowerdown

void fsm_lowerdown(fsm *f);


      

Func fsm_open

void fsm_open(fsm *f);


      

Func fsm_close

void fsm_close(fsm *f, const char *reason);


      

Func fsm_input

void fsm_input(fsm *f, u_char *inpacket, int l);


      

Func fsm_protreject

void fsm_protreject(fsm *f);


      

Func fsm_sdata

void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen);


      

Func lcp_open

void lcp_open(ppp_pcb *pcb);


      

Func lcp_close

void lcp_close(ppp_pcb *pcb, const char *reason);


      

Func lcp_lowerup

void lcp_lowerup(ppp_pcb *pcb);


      

Func lcp_lowerdown

void lcp_lowerdown(ppp_pcb *pcb);


      

Func lcp_sprotrej

void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len);


      

Func magic_init

void magic_init(void);
/*
 * Initialize the random number generator.
 */

Func magic_randomize

void magic_randomize(void);
/*
 * Randomize our random seed value.  To be called for truely random events
 * such as user operations and network traffic.
 */

Func magic

u32_t magic(void);
/*
 * Return a new random number.
 */

Func magic_random_bytes

void magic_random_bytes(unsigned char *buf, u32_t buf_len);
/*
 * Fill buffer with random bytes
 *
 * Use the random pool to generate random data.  This degrades to pseudo
 * random when used faster than randomness is supplied using magic_churnrand().
 * Thus it's important to make sure that the results of this are not
 * published directly because one could predict the next result to at
 * least some degree.  Also, it's important to get a good seed before
 * the first use.
 */

Func magic_pow

u32_t magic_pow(u8_t pow);
/*
 * Return a new random number between 0 and (2^pow)-1 included.
 */

Func mppe_set_key

void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key);


      

Func mppe_init

void mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options);


      

Func mppe_comp_reset

void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state);


      

Func mppe_compress

err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol);


      

Func mppe_decomp_reset

void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state);


      

Func mppe_decompress

err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb);


      

Func arc4_setup

void arc4_setup( arc4_context *ctx, unsigned char *key, int keylen );
/**
 * \brief          ARC4 key schedule
 *
 * \param ctx      ARC4 context to be initialized
 * \param key      the secret key
 * \param keylen   length of the key
 */

Func arc4_crypt

void arc4_crypt( arc4_context *ctx, unsigned char *buf, int buflen );
/**
 * \brief          ARC4 cipher function
 *
 * \param ctx      ARC4 context
 * \param buf      buffer to be processed
 * \param buflen   amount of data in buf
 */

Func des_setkey_enc

void des_setkey_enc( des_context *ctx, unsigned char key[8] );
/**
 * \brief          DES key schedule (56-bit, encryption)
 *
 * \param ctx      DES context to be initialized
 * \param key      8-byte secret key
 */

Func des_setkey_dec

void des_setkey_dec( des_context *ctx, unsigned char key[8] );
/**
 * \brief          DES key schedule (56-bit, decryption)
 *
 * \param ctx      DES context to be initialized
 * \param key      8-byte secret key
 */

Func des_crypt_ecb

void des_crypt_ecb( des_context *ctx,
                   const unsigned char input[8],
                   unsigned char output[8] );
/**
 * \brief          DES-ECB block encryption/decryption
 *
 * \param ctx      DES context
 * \param input    64-bit input block
 * \param output   64-bit output block
 */

Func md4_starts

void md4_starts( md4_context *ctx );
/**
 * \brief          MD4 context setup
 *
 * \param ctx      context to be initialized
 */

Func md4_update

void md4_update( md4_context *ctx, const unsigned char *input, int ilen );
/**
 * \brief          MD4 process buffer
 *
 * \param ctx      MD4 context
 * \param input    buffer holding the  data
 * \param ilen     length of the input data
 */

Func md4_finish

void md4_finish( md4_context *ctx, unsigned char output[16] );
/**
 * \brief          MD4 final digest
 *
 * \param ctx      MD4 context
 * \param output   MD4 checksum result
 */

Func md4

void md4( unsigned char *input, int ilen, unsigned char output[16] );
/**
 * \brief          Output = MD4( input buffer )
 *
 * \param input    buffer holding the  data
 * \param ilen     length of the input data
 * \param output   MD4 checksum result
 */

Func md5_starts

void md5_starts( md5_context *ctx );
/**
 * \brief          MD5 context setup
 *
 * \param ctx      context to be initialized
 */

Func md5_update

void md5_update( md5_context *ctx, const unsigned char *input, int ilen );
/**
 * \brief          MD5 process buffer
 *
 * \param ctx      MD5 context
 * \param input    buffer holding the  data
 * \param ilen     length of the input data
 */

Func md5_finish

void md5_finish( md5_context *ctx, unsigned char output[16] );
/**
 * \brief          MD5 final digest
 *
 * \param ctx      MD5 context
 * \param output   MD5 checksum result
 */

Func md5

void md5( unsigned char *input, int ilen, unsigned char output[16] );
/**
 * \brief          Output = MD5( input buffer )
 *
 * \param input    buffer holding the  data
 * \param ilen     length of the input data
 * \param output   MD5 checksum result
 */

Func sha1_starts

void sha1_starts( sha1_context *ctx );
/**
 * \brief          SHA-1 context setup
 *
 * \param ctx      context to be initialized
 */

Func sha1_update

void sha1_update( sha1_context *ctx, const unsigned char *input, int ilen );
/**
 * \brief          SHA-1 process buffer
 *
 * \param ctx      SHA-1 context
 * \param input    buffer holding the  data
 * \param ilen     length of the input data
 */

Func sha1_finish

void sha1_finish( sha1_context *ctx, unsigned char output[20] );
/**
 * \brief          SHA-1 final digest
 *
 * \param ctx      SHA-1 context
 * \param output   SHA-1 checksum result
 */

Func sha1

void sha1( unsigned char *input, int ilen, unsigned char output[20] );
/**
 * \brief          Output = SHA-1( input buffer )
 *
 * \param input    buffer holding the  data
 * \param ilen     length of the input data
 * \param output   SHA-1 checksum result
 */

Func ppp_set_auth

void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd);


      

Func ppp_set_mppe

void ppp_set_mppe(ppp_pcb *pcb, u8_t flags);
/*
 * Set MPPE configuration
 *
 * Default is disabled.
 */

Func ppp_set_notify_phase_callback

void ppp_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb);


      

Func ppp_connect

err_t ppp_connect(ppp_pcb *pcb, u16_t holdoff);
/*
 * Initiate a PPP connection.
 *
 * This can only be called if PPP is in the dead phase.
 *
 * Holdoff is the time to wait (in seconds) before initiating
 * the connection.
 *
 * If this port connects to a modem, the modem connection must be
 * established before calling this.
 */

Func ppp_listen

err_t ppp_listen(ppp_pcb *pcb);
/*
 * Listen for an incoming PPP connection.
 *
 * This can only be called if PPP is in the dead phase.
 *
 * If this port connects to a modem, the modem connection must be
 * established before calling this.
 */

Func ppp_close

err_t ppp_close(ppp_pcb *pcb, u8_t nocarrier);
/*
 * Initiate the end of a PPP connection.
 * Any outstanding packets in the queues are dropped.
 *
 * Setting nocarrier to 1 close the PPP connection without initiating the
 * shutdown procedure. Always using nocarrier = 0 is still recommended,
 * this is going to take a little longer time if your link is down, but
 * is a safer choice for the PPP state machine.
 *
 * Return 0 on success, an error code on failure.
 */

Func ppp_free

err_t ppp_free(ppp_pcb *pcb);
/*
 * Release the control block.
 *
 * This can only be called if PPP is in the dead phase.
 *
 * You must use ppp_close() before if you wish to terminate
 * an established PPP session.
 *
 * Return 0 on success, an error code on failure.
 */

Func ppp_ioctl

err_t ppp_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg);
/*
 * Get and set parameters for the given connection.
 * Return 0 on success, an error code on failure.
 */

Func ppp_init

int ppp_init(void);
/* initialize the PPP subsystem */

Func ppp_new

ppp_pcb *ppp_new(struct netif *pppif, const struct link_callbacks *callbacks, void *link_ctx_cb,
                ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
/* Create a new PPP control block */

Func ppp_start

void ppp_start(ppp_pcb *pcb);
/* Initiate LCP open request */
void ppp_link_failed(ppp_pcb *pcb);
/* Called when link failed to setup */
void ppp_link_end(ppp_pcb *pcb);
/* Called when link is normally down (i.e. it was asked to end) */

Func ppp_input

void ppp_input(ppp_pcb *pcb, struct pbuf *pb);
/* function called to process input packet */

Func ppp_write

err_t ppp_write(ppp_pcb *pcb, struct pbuf *p);
/* function called by all PPP subsystems to send packets */
void ppp_link_terminated(ppp_pcb *pcb);
/* functions called by auth.c link_terminated() */

Func new_phase

void new_phase(ppp_pcb *pcb, int p);


      

Func ppp_send_config

int ppp_send_config(ppp_pcb *pcb, int mtu, u32_t accm, int pcomp, int accomp);


      

Func ppp_recv_config

int ppp_recv_config(ppp_pcb *pcb, int mru, u32_t accm, int pcomp, int accomp);


      

Func sifaddr

int sifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr, u32_t netmask);


      

Func cifaddr

int cifaddr(ppp_pcb *pcb, u32_t our_adr, u32_t his_adr);


      

Func sifproxyarp

int sifproxyarp(ppp_pcb *pcb, u32_t his_adr);


      

Func cifproxyarp

int cifproxyarp(ppp_pcb *pcb, u32_t his_adr);


      

Func sdns

int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2);


      

Func cdns

int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2);


      

Func sifvjcomp

int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid);


      

Func sifup

int sifup(ppp_pcb *pcb);


      

Func sifdown

int sifdown (ppp_pcb *pcb);


      

Func get_mask

u32_t get_mask(u32_t addr);


      

Func sif6addr

int sif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64);


      

Func cif6addr

int cif6addr(ppp_pcb *pcb, eui64_t our_eui64, eui64_t his_eui64);


      

Func sif6up

int sif6up(ppp_pcb *pcb);


      

Func sif6down

int sif6down (ppp_pcb *pcb);


      

Func sifnpmode

int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode);


      

Func netif_set_mtu

void netif_set_mtu(ppp_pcb *pcb, int mtu);


      

Func netif_get_mtu

int netif_get_mtu(ppp_pcb *pcb);


      

Func ccp_test

int ccp_test(ppp_pcb *pcb, u_char *opt_ptr, int opt_len, int for_transmit);


      

Func ccp_set

void ccp_set(ppp_pcb *pcb, u8_t isopen, u8_t isup, u8_t receive_method, u8_t transmit_method);


      

Func ccp_reset_comp

void ccp_reset_comp(ppp_pcb *pcb);


      

Func ccp_reset_decomp

void ccp_reset_decomp(ppp_pcb *pcb);


      

Func ccp_fatal_error

int ccp_fatal_error(ppp_pcb *pcb);


      

Func get_idle_time

int get_idle_time(ppp_pcb *pcb, struct ppp_idle *ip);


      

Func get_loop_output

int get_loop_output(void);


      
      
void print_link_stats(void);


      
      
void reset_link_stats(int u);
/* Print stats, if available */
void update_link_stats(int u);
/* Reset (init) stats when link goes up */
void link_required(ppp_pcb *pcb);
/* Procedures exported from auth.c */
void link_terminated(ppp_pcb *pcb);
/* we are starting to use the link */
void link_down(ppp_pcb *pcb);
/* we are finished with the link */

Func upper_layers_down

void upper_layers_down(ppp_pcb *pcb);
/* the LCP layer has left the Opened state */
void link_established(ppp_pcb *pcb);
/* take all NCPs down */

Func start_networks

void start_networks(ppp_pcb *pcb);
/* the link is up; authenticate now */

Func continue_networks

void continue_networks(ppp_pcb *pcb);
/* start all the network control protos */

Func auth_check_passwd

int auth_check_passwd(ppp_pcb *pcb, char *auser, int userlen, char *apasswd, int passwdlen, const char **msg, int *msglen);


      

Func auth_peer_fail

void auth_peer_fail(ppp_pcb *pcb, int protocol);
/* check the user name and passwd against configuration */

Func auth_peer_success

void auth_peer_success(ppp_pcb *pcb, int protocol, int prot_flavor, const char *name, int namelen);
/* peer failed to authenticate itself */

Func auth_withpeer_fail

void auth_withpeer_fail(ppp_pcb *pcb, int protocol);


      

Func auth_withpeer_success

void auth_withpeer_success(ppp_pcb *pcb, int protocol, int prot_flavor);
/* we failed to authenticate ourselves */

Func np_up

void np_up(ppp_pcb *pcb, int proto);


      

Func np_down

void np_down(ppp_pcb *pcb, int proto);
/* a network protocol has come up */

Func np_finished

void np_finished(ppp_pcb *pcb, int proto);
/* a network protocol has gone down */

Func get_secret

int get_secret(ppp_pcb *pcb, const char *client, const char *server, char *secret, int *secret_len, int am_server);


      

Func demand_conf

void demand_conf (void);


      

Func demand_block

void demand_block (void);
/* config interface(s) for demand-dial */

Func demand_unblock

void demand_unblock (void);
/* set all NPs to queue up packets */

Func demand_discard

void demand_discard (void);
/* set all NPs to pass packets */

Func demand_rexmit

void demand_rexmit (int, u32_t);
/* set all NPs to discard packets */

Func loop_chars

int loop_chars (unsigned char *, int);
/* retransmit saved frames for an NP*/

Func loop_frame

int loop_frame (unsigned char *, int);
/* process chars from loopback */

Func mp_check_options

void mp_check_options (void);


      

Func mp_join_bundle

int mp_join_bundle (void);
/* Check multilink-related options */

Func mp_exit_bundle

void mp_exit_bundle (void);
/* join our link to an appropriate bundle */

Func mp_bundle_terminated

void mp_bundle_terminated (void);
/* have disconnected our link from bundle */

Func str_to_epdisc

int str_to_epdisc (struct epdisc *, char *);
/* string from endpoint discrim. */

Func ppp_print_string

void ppp_print_string(const u_char *p, int len, void (*printer) (void *, const char *, ...), void *arg);
/* Procedures exported from utils.c. */

Func ppp_slprintf

int ppp_slprintf(char *buf, int buflen, const char *fmt, ...);
/* Format a string for output */

Func ppp_vslprintf

int ppp_vslprintf(char *buf, int buflen, const char *fmt, va_list args);
/* sprintf++ */

Func ppp_strlcpy

size_t ppp_strlcpy(char *dest, const char *src, size_t len);
/* vsprintf++ */

Func ppp_strlcat

size_t ppp_strlcat(char *dest, const char *src, size_t len);
/* safe strcpy */

Func ppp_dbglog

void ppp_dbglog(const char *fmt, ...);
/* safe strncpy */

Func ppp_info

void ppp_info(const char *fmt, ...);
/* log a debug message */

Func ppp_notice

void ppp_notice(const char *fmt, ...);
/* log an informational message */

Func ppp_warn

void ppp_warn(const char *fmt, ...);
/* log a notice-level message */

Func ppp_error

void ppp_error(const char *fmt, ...);
/* log a warning message */

Func ppp_fatal

void ppp_fatal(const char *fmt, ...);
/* log an error message */

Func ppp_dump_packet

void ppp_dump_packet(ppp_pcb *pcb, const char *tag, unsigned char *p, int len);


      

Func pppapi_set_default

err_t pppapi_set_default(ppp_pcb *pcb);
/* API for application */

Func pppapi_set_notify_phase_callback

err_t pppapi_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb);


      

Func pppapi_pppos_create

ppp_pcb *pppapi_pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, ppp_link_status_cb_fn link_status_cb, void *ctx_cb);


      

Func pppapi_pppoe_create

ppp_pcb *pppapi_pppoe_create(struct netif *pppif, struct netif *ethif, const char *service_name,
                               const char *concentrator_name, ppp_link_status_cb_fn link_status_cb,
                               void *ctx_cb);


      

Func pppapi_pppol2tp_create

ppp_pcb *pppapi_pppol2tp_create(struct netif *pppif, struct netif *netif, ip_addr_t *ipaddr, u16_t port,
                           const u8_t *secret, u8_t secret_len,
                           ppp_link_status_cb_fn link_status_cb, void *ctx_cb);


      

Func pppapi_connect

err_t pppapi_connect(ppp_pcb *pcb, u16_t holdoff);


      

Func pppapi_listen

err_t pppapi_listen(ppp_pcb *pcb);


      

Func pppapi_close

err_t pppapi_close(ppp_pcb *pcb, u8_t nocarrier);


      

Func pppapi_free

err_t pppapi_free(ppp_pcb *pcb);


      

Func pppapi_ioctl

err_t pppapi_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg);


      

Func pppcrypt_56_to_64_bit_key

void pppcrypt_56_to_64_bit_key(u_char *key, u_char *des_key);


      

Func pppoe_create

ppp_pcb *pppoe_create(struct netif *pppif,
      struct netif *ethif,
      const char *service_name, const char *concentrator_name,
      ppp_link_status_cb_fn link_status_cb, void *ctx_cb);


      

Func pppoe_disc_input

void pppoe_disc_input(struct netif *netif, struct pbuf *p);
/*
 * Functions called from lwIP
 * DO NOT CALL FROM lwIP USER APPLICATION.
 */

Func pppoe_data_input

void pppoe_data_input(struct netif *netif, struct pbuf *p);


      

Func pppol2tp_create

ppp_pcb *pppol2tp_create(struct netif *pppif,
      struct netif *netif, const ip_addr_t *ipaddr, u16_t port,
      const u8_t *secret, u8_t secret_len,
      ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
/* Create a new L2TP session. */

Func pppos_create

ppp_pcb *pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb,
      ppp_link_status_cb_fn link_status_cb, void *ctx_cb);
/* Create a new PPPoS session. */

Func pppos_input_tcpip

err_t pppos_input_tcpip(ppp_pcb *ppp, u8_t *s, int l);
/* Pass received raw characters to PPPoS to be decoded through lwIP TCPIP thread. */

Func pppos_input

void pppos_input(ppp_pcb *ppp, u8_t* data, int len);
/* PPP over Serial: this is the input function to be called for received data. */

Func pppos_input_sys

err_t pppos_input_sys(struct pbuf *p, struct netif *inp);


      

Func upap_authwithpeer

void upap_authwithpeer(ppp_pcb *pcb, const char *user, const char *password);


      

Func upap_authpeer

void upap_authpeer(ppp_pcb *pcb);


      

Func slipif_init

err_t slipif_init(struct netif * netif);


      

Func slipif_poll

void slipif_poll(struct netif *netif);


      

Func slipif_process_rxqueue

void slipif_process_rxqueue(struct netif *netif);


      

Func slipif_received_byte

void slipif_received_byte(struct netif *netif, u8_t data);


      

Func slipif_received_bytes

void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len);


      

Func zepif_init

err_t zepif_init(struct netif *netif);


      

Func tuya_driver_find

void *tuya_driver_find(uint8_t type, uint8_t port);
/**
 * @brief driver find
 * 
 * @param[in] type node type
 * @param[in] port node port
 *
 */

Func tuya_driver_register

int tuya_driver_register(tuya_drv_node_t *node, uint8_t type, uint8_t port);
/**
 * @brief driver register
 * 
 * @param[in] node refer to tuya_drv_node_t
 * @param[in] type node type
 * @param[in] port node port
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_gpio_inout_set

OPERATE_RET tuya_gpio_inout_set(IN CONST TY_GPIO_PORT_E port, IN CONST BOOL_T in);
/**
 * @brief gpio inout set
 * 
 * @param[in] port refer to TY_GPIO_PORT_E
 * @param[in] in TRUE:in,FALSE:out
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_gpio_inout_set_select

OPERATE_RET tuya_gpio_inout_set_select(IN CONST TY_GPIO_PORT_E port,IN CONST BOOL_T in,IN CONST BOOL_T high);
/**
 * @brief gpio inout select
 * 
 * @param[in] port refer to TY_GPIO_PORT_E
 * @param[in] in TRUE:in,FALSE:out
 * @param[in] high TRUE/FALSE
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_gpio_mode_set

OPERATE_RET tuya_gpio_mode_set(IN CONST TY_GPIO_PORT_E port, IN CONST TY_GPIO_MODE_E mode);
/**
 * @brief gpio mode set
 * 
 * @param[in] port refer to TY_GPIO_PORT_E
 * @param[in] mode refer to TY_GPIO_MODE_E
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_gpio_read

INT_T tuya_gpio_read(IN CONST TY_GPIO_PORT_E port);
/**
 * @brief gpio read
 * 
 * @param[in] port refer to TY_GPIO_PORT_E
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_gpio_write

OPERATE_RET tuya_gpio_write(IN CONST TY_GPIO_PORT_E port, IN CONST BOOL_T high);
/**
 * @brief gpio wriet
 * 
 * @param[in] port refer to TY_GPIO_PORT_E
 * @param[in] high TRUE:high,FALSE:low
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_gpio_irq_init

OPERATE_RET tuya_gpio_irq_init(IN CONST TY_GPIO_PORT_E port,IN CONST TY_GPIO_IRQ_CB gpio_irq_cb, IN CONST TY_GPIO_IRQ_TRIG_E trig_type, UINT_T id);
/**
 * @brief gpio irq init
 * 
 * @param[in] port refer to TY_GPIO_PORT_E
 * @param[in] gpio_irq_cb callback
 * @param[in] trig_type refer to TY_GPIO_IRQ_TRIG_E
 * @param[in] id irq number
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_i2s_init

int tuya_i2s_init(tuya_i2s_t *i2s);
/**
 * @brief i2s init
 * 
 * @param[in] i2s refer to tuya_i2s_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_i2s_start

int tuya_i2s_start(tuya_i2s_t *i2s);
/**
 * @brief i2s start
 * 
 * @param[in] i2s refer to tuya_i2s_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_i2s_stop

int tuya_i2s_stop(tuya_i2s_t *i2s);
/**
 * @brief i2s stop
 * 
 * @param[in] i2s refer to tuya_i2s_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_pin_irq_disable

int tuya_pin_irq_disable (tuya_pin_name_t pin);
/**
 * @brief pin irq disable
 * 
 * @param[in] pin refer to tuya_pin_name_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_pwm_frequency_set

int tuya_pwm_frequency_set (tuya_pwm_t *pwm, float frequency);
/**
 * @brief set frequency
 * 
 * @param[in] pwm refer to tuya_pwm_t
 * @param[in] frequency frequency
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_rtc_register

int tuya_rtc_register(tuya_rtc_ops_t *ops);
/**
 * @brief rtc register
 * 
 * @param[in] ops refer to tuya_rtc_ops_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_spi_bus_add_device

int tuya_spi_bus_add_device (tuya_spi_bus_t *spi_bus, tuya_spi_t **spi, tuya_spi_cfg_t *cfg);
/**
 * @brief add device
 * 
 * @param[in] spi_bus refer to tuya_spi_bus_t
 * @param[out] spi refer to tuya_spi_t
 * @param[in] cfg refer to tuya_spi_cfg_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_uart_int_bufsize

int tuya_uart_int_bufsize(tuya_uart_t *uart);
/**
 * @brief uart data size
 * 
 * @param[in] uart refer to tuya_uart_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_uart_read_timeout

int tuya_uart_read_timeout(tuya_uart_t *uart, void *data, uint16_t len, uint32_t timeout);
/**
 * @brief uart read with timeout
 * 
 * @param[in] uart refer to tuya_uart_t
 * @param[out] data read buf
 * @param[in] len read length
 * @param[in] timeout read timeout
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_uart_init

OPERATE_RET ty_uart_init(IN CONST TY_UART_PORT_E port,IN CONST TY_UART_BAUD_E badu,\
                           IN CONST TY_DATA_BIT_E bits,IN CONST TY_PARITY_E parity,\
                           IN CONST TY_STOPBITS_E stop,IN CONST UINT_T bufsz,IN CONST BOOL_T unblock);
/**
 * @brief uart init
 * 
 * @param[in] port refer to TY_UART_PORT_E
 * @param[in] badu refer to TY_UART_BAUD_E
 * @param[in] bits refer to TY_DATA_BIT_E
 * @param[in] parity refer to TY_PARITY_E
 * @param[in] stop refer to TY_STOPBITS_E
 * @param[in] bufsz buf size
 * @param[in] unblock block flag
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_uart_flowctrl_init

OPERATE_RET ty_uart_flowctrl_init(IN CONST TY_UART_PORT_E port, IN CONST TY_UART_BAUD_E badu,
                        IN CONST TY_DATA_BIT_E bits, IN CONST TY_PARITY_E parity,
                        IN CONST TY_STOPBITS_E stop, IN CONST UINT_T bufsz,IN CONST BOOL_T unblock,IN CONST BOOL_T flowctl);
/**
 * @brief uart init
 * 
 * @param[in] port refer to TY_UART_PORT_E
 * @param[in] badu refer to TY_UART_BAUD_E
 * @param[in] bits refer to TY_DATA_BIT_E
 * @param[in] parity refer to TY_PARITY_E
 * @param[in] stop refer to TY_STOPBITS_E
 * @param[in] bufsz buf size
 * @param[in] unblock block flag
 * @param[in] flowctl
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_uart_free

OPERATE_RET ty_uart_free(IN CONST TY_UART_PORT_E port);
/**
 * @brief uart free
 * 
 * @param[in] port refer to TY_UART_PORT_E
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_uart_send_data

VOID ty_uart_send_data(IN CONST TY_UART_PORT_E port,IN CONST BYTE_T *data,IN CONST UINT_T len);
/**
 * @brief uart send data
 * 
 * @param[in] port refer to TY_UART_PORT_E
 * @param[in] data send buf
 * @param[in] len send length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_uart_read_data

UINT_T ty_uart_read_data(IN CONST TY_UART_PORT_E port,OUT BYTE_T *buf,IN CONST UINT_T len);
/**
 * @brief uart read data
 * 
 * @param[in] port refer to TY_UART_PORT_E
 * @param[out] buf read buf
 * @param[in] len read length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_uart_read_data_size

INT_T ty_uart_read_data_size(IN CONST TY_UART_PORT_E port);
/**
 * @brief uart data size
 * 
 * @param[in] port refer to TY_UART_PORT_E
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func direct_connect_tuya_cloud

OPERATE_RET direct_connect_tuya_cloud(IN CONST DIRECT_CON_INPUT_S *p_input);
/**
 * @brief connect tuya cloud
 * 
 * @param[in] p_input connect cloud para
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_direct_connected

UINT8_T mqtt_direct_connected();
/**
 * @brief check if connect mqtt broker
 *
 * @return 0 not connected,else connected
 */

Func tuya_qrcode_active_close

VOID tuya_qrcode_active_close(VOID);


      

Func tuya_qrcode_set_appid

VOID tuya_qrcode_set_appid(CONST CHAR_T *appid);


      

Func tuya_iot_api_pre_handle_register_cb

OPERATE_RET tuya_iot_api_pre_handle_register_cb(IN TUYA_IOT_API_PRE_HANDLE_CBS_S *cbs);
/**
 * @brief tuya_iot_api_pre_handle_register_cb 
 *
 * @param[in] cbs
 *
 * @return OPERATE_RET
 */

Func tuya_iot_get_sdk_info

CHAR_T *tuya_iot_get_sdk_info(VOID);
/**
* @brief tuya_iot_get_sdk_info 
*
* @return sdk information
*/

Func tuya_iot_get_os_adapt_info

CHAR_T *tuya_iot_get_os_adapt_info(VOID_T);
/**
 * @brief tuya_iot_get_os_adapt_info 
 *
 * @return os adapter information
 */

Func tuya_iot_init_params

OPERATE_RET tuya_iot_init_params(IN CONST CHAR_T *fs_storge_path, IN CONST TY_INIT_PARAMS_S *p_param);
/**
 * @brief tuya_iot_init_params 
 * @desc init tuya_iot_sdk
 *
 * @param[in] fs_storge_path: filesystem read write storge path
 *            (if os have no fs,then fs_storge_path is invalid)
 * @param[in] p_param: custom init params
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_kv_flash_init_param

OPERATE_RET tuya_iot_kv_flash_init_param(IN CONST CHAR_T *fs_storge_path);
/**
 * @brief tuya_iot_kv_flash_init_param 
 * @desc init kv flash
 *
 * @param[in] fs_storge_path: filesystem read write storge path
 *            (if os have no fs,then fs_storge_path is invalid)
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_oem_set

VOID tuya_iot_oem_set(IN CONST BOOL_T oem);
/**
 * @brief tuya_iot_oem_set 
 * @desc set oem mode
 *
 * @param[in] oem
 *
 * @return none
 */

Func tuya_iot_set_udf_parameter

OPERATE_RET tuya_iot_set_udf_parameter(IN CONST CHAR_T *udf);
/**
 * @brief tuya_iot_set_udf_parameter 
 * @desc set user defined funtions
 *
 * @param[in] udf: user defined funtions(json), max length: 255
 *
 * @return OPRT_OK: success  Other: fail
 *
 * @note call before init
 */

Func tuya_iot_upload_rst_log_set

VOID tuya_iot_upload_rst_log_set(IN CONST BOOL_T upload);
/**
 * @brief tuya_iot_upload_rst_log_set 
 * @desc set rst log upload mode
 *
 * @param[in] upload
 *
 * @return none
 *
 * @note must call first
 */

Func tuya_iot_ignore_upgrade_set

VOID tuya_iot_ignore_upgrade_set(IN CONST BOOL_T ignore);
/**
 * @brief tuya_iot_ignore_upgrade_set 
 * @desc set rst log upload mode
 *
 * @param[in] ignore
 *
 * @return none
 *
 * @note must call first
 */

Func tuya_iot_mqtt_disconnect

VOID tuya_iot_mqtt_disconnect(VOID);
/**
 * @brief tuya_iot_mqtt_disconnect 
 * @desc force disconnect MQTT 
 *
 * @return none
 *
 * @note must call first
 */

Func tuya_iot_mqtt_restart

VOID tuya_iot_mqtt_restart(VOID);
/**
 * @brief tuya_iot_mqtt_restart 
 * @desc restart MQTT 
 *
 * @return 
 *
 * @note must call first
 */

Func tuya_iot_upgrade_gw_notify

OPERATE_RET tuya_iot_upgrade_gw_notify(IN CONST FW_UG_S *fw,
                                      IN CONST GET_FILE_DATA_CB get_file_cb,\
                                      IN CONST UPGRADE_NOTIFY_CB upgrd_nofity_cb,\
                                      IN CONST PVOID_T pri_data,\
                                      BOOL_T notify, UINT_T download_buf_size);
/**
 * @brief tuya_iot_upgrade_gw_notify 
 * @desc upgrage gateway firmware
 *
 * @param[in] fw: firmware info
 * @param[in] get_file_cb: download content storage callback
 * @param[in] upgrd_nofity_cb: firmware download finish callback
 * @param[in] pri_data: private param of get_file_cb && upgrd_nofity_cb
 * @param[in] notify: notify app the upgrade status
 * @param[in] download_buf_size: max download buffer size when downloading
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_refuse_upgrade

OPERATE_RET tuya_iot_refuse_upgrade(IN CONST FW_UG_S *fw, IN CONST CHAR_T *dev_id);
/**
 * @brief tuya_iot_refuse_upgrade 
 *
 * @param[in] fw
 * @param[in] dev_id
 *
 * @return OPERATE_RET
 */

Func tuya_iot_reset_upgrade_detect_timer

OPERATE_RET tuya_iot_reset_upgrade_detect_timer(IN CONST INT_T time_ms);
/**
 * @brief tuya_iot_reset_upgrade_detect_timer 
 * @desc reset the upgrade detect time
 *
 * @param[in] time_ms: the time you want start the detect 
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_upgrade_dev_notify

OPERATE_RET tuya_iot_upgrade_dev_notify(IN CONST CHAR_T *devid,
                                       IN CONST FW_UG_S *fw, \
                                       IN CONST GET_FILE_DATA_CB get_file_cb,\
                                       IN CONST UPGRADE_NOTIFY_CB upgrd_nofity_cb,\
                                       IN CONST PVOID_T pri_data,\
                                       BOOL_T notify, UINT_T download_buf_size);
/**
 * @brief tuya_iot_upgrade_dev_notify 
 * @desc upgrage sub-device/soc/mcu firmware
 *
 * @param[in] devid: if upgrade sub-device, then devid = sub-device_id
 *                   if upgrade soc/mcu, then devid = NULL
 * @param[in] fw: firmware info
 * @param[in] get_file_cb: download content storage callback
 * @param[in] upgrd_nofity_cb: firmware download finish callback
 * @param[in] pri_data: private param of get_file_cb && upgrd_nofity_cb
 * @param[in] notify
 * @param[in] download_buf_size
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_dev_upgd_progress_rept

OPERATE_RET tuya_iot_dev_upgd_progress_rept(IN CONST UINT_T percent, IN CONST CHAR_T *devid, IN CONST DEV_TYPE_T tp);
/**
 * @brief tuya_iot_dev_upgd_progress_rept 
 *
 * @param[in] percent
 * @param[in] devid
 * @param[in] tp
 *
 * @return OPERATE_RET
 */

Func tuya_iot_dev_upgd_result_report

OPERATE_RET tuya_iot_dev_upgd_result_report(IN CONST CHAR_T *dev_id, IN CONST DEV_TYPE_T type, IN CONST INT_T result);
/**
 * @brief tuya_iot_dev_upgd_result_report 
 *
 * @param[in] dev_id
 * @param[in] type
 * @param[in] result
 *
 * @return OPERATE_RET
 */

Func tuya_iot_regist_dp_rept_cb

OPERATE_RET tuya_iot_regist_dp_rept_cb(IN DP_REPT_HADLE_CB_S* dp_rept_cbs);
/**
 * @brief tuya_iot_regist_dp_rept_cb 
 *
 * @param[in] dp_rept_cbs
 *
 * @return OPERATE_RET
 */

Func dev_report_dp_json_async

OPERATE_RET dev_report_dp_json_async(IN CONST        CHAR_T *dev_id,IN CONST TY_OBJ_DP_S *dp_data,IN CONST UINT_T cnt);
/**
 * @brief dev_report_dp_json_async 
 * @desc report dp info a-synced.
 *
 * @param[in] dev_id: if sub-device, then devid = sub-device_id
 *                if gateway/soc/mcu, then devid = NULL
 * @param[in] dp_data: dp array header
 * @param[in] cnt: dp array count
 *
 * @return OPRT_OK: success  Other: fail
 */

Func dev_report_dp_json_async_force

OPERATE_RET dev_report_dp_json_async_force(IN CONST CHAR_T *dev_id,IN CONST TY_OBJ_DP_S *dp_data,IN CONST UINT_T cnt);
/**
 * @brief dev_report_dp_json_async_force 
 * @desc report dp info a-synced.
 *
 * @param[in] dev_id: if sub-device, then devid = sub-device_id
 *                if gateway/soc/mcu, then devid = NULL
 * @param[in] dp_data: dp array header
 * @param[in] cnt: dp array count
 *
 * @return OPRT_OK: success  Other: fail
 */

Func dev_query_dp_json_async

OPERATE_RET dev_query_dp_json_async(IN CONST CHAR_T *dev_id,IN CONST TY_OBJ_DP_S *dp_data,IN CONST UINT_T cnt);
/**
 * @brief dev_query_dp_json_async 
 * @desc report dp info a-synced.
 *
 * @param[in] dev_id: if sub-device, then devid = sub-device_id
 *                if gateway/soc/mcu, then devid = NULL
 * @param[in] dp_data: dp array header
 * @param[in] cnt: dp array count
 *
 * @return OPRT_OK: success  Other: fail
 */

Func dev_query_dp_json_async_force

OPERATE_RET dev_query_dp_json_async_force(IN CONST CHAR_T *dev_id,IN CONST TY_OBJ_DP_S *dp_data,IN CONST UINT_T cnt);
/**
 * @brief dev_query_dp_json_async_force 
 * @desc report dp info a-synced.
 *
 * @param[in] dev_id: if sub-device, then devid = sub-device_id
 *                if gateway/soc/mcu, then devid = NULL
 * @param[in] dp_data: dp array header
 * @param[in] cnt: dp array count
 *
 * @return OPRT_OK: success  Other: fail
 */

Func dev_report_dp_raw_sync_extend

OPERATE_RET dev_report_dp_raw_sync_extend(IN CONST CHAR_T *dev_id,IN CONST BYTE_T dpid,\
                                                     IN CONST BYTE_T *data,IN CONST UINT_T len,\
                                                     IN CONST UINT_T timeout, IN CONST BOOL_T enable_auto_retrans);
/**
 * @brief dev_report_dp_raw_sync_extend 
 * @desc report dp raw info synced.
 *
 * @param[in] dev_id: if sub-device, then devid = sub-device_id
 *                if gateway/soc/mcu, then devid = NULL
 * @param[in] dpid: raw dp id
 * @param[in] data: raw data
 * @param[in] len: len of raw data
 * @param[in] timeout: function blocks until timeout seconds
 * @param[in] enable_auto_retrans
 *
 * @return OPRT_OK: success  Other: fail
 */

Func dev_report_dp_raw_sync_extend_with_time

OPERATE_RET dev_report_dp_raw_sync_extend_with_time(IN CONST CHAR_T *dev_id,IN CONST BYTE_T dpid,\
                                                   IN CONST BYTE_T *data,IN CONST UINT_T len,\
                                                   IN CONST UINT_T timeout, IN CONST BOOL_T enable_auto_retrans,\
                                                   IN CONST CHAR_T *time_str);
/**
 * @brief dev_report_dp_raw_sync_extend_with_time 
 * @desc report dp raw info synced.
 *
 * @param[in] dev_id: if sub-device, then devid = sub-device_id
 *                if gateway/soc/mcu, then devid = NULL
 * @param[in] dpid: raw dp id
 * @param[in] data: raw data
 * @param[in] len: len of raw data
 * @param[in] timeout: function blocks until timeout seconds
 * @param[in] enable_auto_retrans
 * @param[in] time_str
 *
 * @return OPRT_OK: success  Other: fail
 */

Func dev_report_dp_stat_sync_extend

OPERATE_RET dev_report_dp_stat_sync_extend(IN CONST CHAR_T *dev_id,IN CONST TY_OBJ_DP_S *dp_data,\
                                   IN CONST UINT_T cnt,IN CONST UINT_T timeout, IN CONST BOOL_T enable_auto_retrans);
/**
 * @brief dev_report_dp_stat_sync_extend 
 * @desc: report dp status info synced.
 *        if time_stamp==0, time_stamp = time of msg arrival of the server
 *
 * @param[in] dev_id: if sub-device, then devid = sub-device_id
 *                    if gateway/soc/mcu, then devid = NULL
 * @param[in] dp_data: dp status array header
 * @param[in] cnt: dp status array count
 * @param[in] timeout: function blocks until timeout seconds
 * @param[in] enable_auto_retrans
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_get_wakeup_data

OPERATE_RET tuya_iot_get_wakeup_data(INOUT BYTE_T *wakeup_data_arr, INOUT UINT_T *p_len);
/**
 * @brief tuya_iot_get_wakeup_data 
 * @desc get mqtt wakeup string pattern
 *
 * @param[in/out] wakeup_data_arr: wakeup string arr
 * @param[in/out] p_len: wakeup string len
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_get_heartbeat_data

OPERATE_RET tuya_iot_get_heartbeat_data(INOUT BYTE_T *heartbeat_data_arr, INOUT UINT_T *p_len);
/**
 * @brief tuya_iot_get_heartbeat_data 
 * @desc get mqtt heartbeat string pattern
 *
 * @param[in/out] heartbeat_data_arr: heartbeat string arr
 * @param[in/out] p_len: heartbeat string len
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_get_heartbeat_interval

INT_T tuya_iot_get_heartbeat_interval(VOID);
/**
 * @brief tuya_iot_get_heartbeat_interval 
 * @desc get mqtt heartbeat interval
 *
 * @return interval value
 */

Func tuya_iot_book_wakeup_topic

OPERATE_RET tuya_iot_book_wakeup_topic(VOID);
/**
 * @brief tuya_iot_book_wakeup_topic 
 * @desc unscribe mqtt msg topic and subscribe wakeup topic
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_get_mqtt_socket_fd

INT_T tuya_iot_get_mqtt_socket_fd(VOID);
/**
 * @brief tuya_iot_get_mqtt_socket_fd 
 * @desc get curr mqtt socket fd
 *
 * @return mqtt socket fd
 */

Func tuya_iot_send_custom_mqtt_msg

OPERATE_RET tuya_iot_send_custom_mqtt_msg(IN CONST UINT_T protocol, IN CONST BYTE_T *p_data);
/**
 * @brief tuya_iot_send_custom_mqtt_msg 
 * @desc send a custom protocol mqtt msg
 *
 * @param protocol: mqtt protocol
 * @param p_data: mqtt msg
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_upload_incre_data

OPERATE_RET tuya_iot_upload_incre_data(IN CONST USHORT_T map_id,IN CONST UINT_T offset,IN CONST BYTE_T *pbuffer, IN CONST USHORT_T buf_len);
/**
 * @brief tuya_iot_upload_incre_data 
 *
 * @param[in] map_id: Each map has an Id
 * @param[in] offset: Map data offset
 * @param[in] pbuffer: Map data cache pointer
 * @param[in] buf_len: Map data cache length
 *
 * @return OPERATE_RET
 */

Func tuya_iot_media_data_report

OPERATE_RET tuya_iot_media_data_report(IN CONST FLOW_BODY_ST *dt_body,IN CONST UINT_T timeout);
/**
 * @brief tuya_iot_media_data_report 
 *
 * @param[in] dt_body: media data
 * @param[in] timeout: need report time
 *
 * @return OPERATE_RET
 *
 * @warning please dont use tuya_iot_media_data_report and tuya_iot_media_data_report_v2 in one application
 */

Func tuya_iot_media_data_report_v2

OPERATE_RET tuya_iot_media_data_report_v2(IN CONST FLOW_BODY_V2_ST *dt_body,IN CONST UINT_T timeout);
/**
 * @brief tuya_iot_media_data_report_v2 
 *
 * @param[in] dt_body: media data version 2
 * @param[in] timeout: need report time
 *
 * @return OPERATE_RET
 *
 * @waring please dont use tuya_iot_media_data_report and tuya_iot_media_data_report_v2 in one application
 */

Func tuya_iot_map_cleaner_upload_buffer

OPERATE_RET tuya_iot_map_cleaner_upload_buffer(IN CONST INT_T map_id, IN CONST BYTE_T *buffer, IN CONST UINT_T len, \
                                              IN CONST CHAR_T *cloud_file_name, IN CONST UP_MAP_TYPE_E map_type);
/**
 * @brief tuya_iot_map_cleaner_upload_buffer 
 * @desc sweeper function. upload cleaner map info
 *
 * @param[in] map_id
 * @param[in] buffer
 * @param[in] len
 * @param[in] cloud_file_name
 * @param[in] map_type
 *
 * @return OPERATE_RET
 */

Func tuya_iot_map_cleaner_upload_file

OPERATE_RET tuya_iot_map_cleaner_upload_file(IN CONST INT_T map_id, IN CONST CHAR_T *local_file_name, \
                                            IN CONST CHAR_T *cloud_file_name, IN CONST UP_MAP_TYPE_E map_type);
/**
 * @brief tuya_iot_map_cleaner_upload_file 
 * @desc sweeper function. upload cleaner map info
 *
 * @param[in] map_id
 * @param[in] local_file_name
 * @param[in] cloud_file_name
 * @param[in] map_type
 *
 * @return OPERATE_RET
 */

Func tuya_iot_map_record_upload_buffer

OPERATE_RET tuya_iot_map_record_upload_buffer(IN CONST INT_T map_id, IN CONST BYTE_T *buffer, IN CONST UINT_T len, IN CONST CHAR_T *descript);
/**
 * @brief tuya_iot_map_record_upload_buffer 
 * @desc sweeper function. upload record map info
 *
 * @param[in] map_id
 * @param[in] buffer
 * @param[in] len
 * @param[in] descript
 *
 * @return OPERATE_RET
 */

Func tuya_iot_map_record_upload_buffer_with_filename

OPERATE_RET tuya_iot_map_record_upload_buffer_with_filename(IN CONST INT_T map_id, IN CONST BYTE_T *buffer, IN CONST UINT_T len, IN CONST CHAR_T *cloud_file_name, IN CONST CHAR_T *descript);
/**
 * @brief tuya_iot_map_record_upload_buffer_with_filename 
 * @desc sweeper function. upload record map info
 *
 * @param[in] map_id
 * @param[in] buffer
 * @param[in] len
 * @param[in] cloud_file_name
 * @param[in] descript
 *
 * @return OPERATE_RET
 */

Func tuya_iot_get_gw_id

CHAR_T *tuya_iot_get_gw_id(VOID);
/**
 * @brief tuya_iot_get_gw_id 
 *
 * @return device id
 */

Func tuya_iot_get_region_info

OPERATE_RET tuya_iot_get_region_info(INOUT TY_IOT_REGION_INFO_S *p_region_info);
/**
 * @brief tuya_iot_get_region_info 
 *
 * @param[in/out] p_region_info
 *
 * @return OPERATE_RET
 */

Func tuya_iot_get_custom_cfg

OPERATE_RET tuya_iot_get_custom_cfg(IN CONST TY_CUSTOM_CFG_E type, OUT CHAR_T **pp_cfg_str);
/**
 * @brief tuya_iot_get_custom_cfg 
 *
 * @param[in] type
 * @param[out] pp_cfg_str
 *
 * @return OPERATE_RET
 */

Func tuya_iot_release_custom_cfg

OPERATE_RET tuya_iot_release_custom_cfg(IN CHAR_T *p_cfg_str);
/**
 * @brief tuya_iot_release_custom_cfg 
 *
 * @param[in] p_cfg_str
 *
 * @return OPERATE_RET
 */

Func tuya_iot_get_location_info

OPERATE_RET tuya_iot_get_location_info(INOUT TY_LOCATION_INFO_S *p_location);
/**
 * @brief tuya_iot_get_location_info 
 *
 * @param[in] p_location
 *
 * @return OPERATE_RET
 */

Func tuya_iot_set_log_attr

OPERATE_RET tuya_iot_set_log_attr(IN CONST INT_T log_level);
/**
 * @brief tuya_iot_set_log_attr 
 *
 * @param[in] log_level
 *
 * @return OPERATE_RET
 */

Func tuya_iot_set_log_bool_time

OPERATE_RET tuya_iot_set_log_bool_time(BOOL_T if_ms_level);
/**
 * @brief tuya_iot_set_log_bool_time 
 *
 * @param[in] if_ms_level
 *
 * @return OPERATE_RET
 */

Func tuya_iot_custom_data_report_sync

OPERATE_RET tuya_iot_custom_data_report_sync(IN CONST BYTE_T *data, IN CONST INT_T len, IN CONST CHAR_T *topic, 
                                                       IN CONST BYTE_T qos, IN CONST UINT_T timeout);
/**
 * @brief tuya_iot_custom_data_report_sync 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] topic
 * @param[in] qos
 * @param[in] timeout
 *
 * @return OPERATE_RET
 */

Func tuya_iot_custom_data_report_async

OPERATE_RET tuya_iot_custom_data_report_async(IN CONST BYTE_T *data, IN CONST INT_T len, IN CONST CHAR_T *topic, 
                                                           IN CONST BYTE_T qos, IN CONST UINT_T timeout);
/**
 * @brief tuya_iot_custom_data_report_async 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] topic
 * @param[in] qos
 * @param[in] timeout
 *
 * @return OPERATE_RET
 */

Func tuya_iot_get_active_stat

BYTE_T tuya_iot_get_active_stat(VOID);
/**
 * @brief tuya_iot_get_active_stat 
 *
 * @return 
 */

Func tuya_iot_app_cbs_init

VOID tuya_iot_app_cbs_init(IN CONST TY_IOT_APP_CBS_S *app_cbs);
/**
 * @brief tuya_iot_app_cbs_init 
 *
 * @param[in] app_cbs
 *
 * @return 
 */

Func tuya_iot_dp_low_power_query

OPERATE_RET tuya_iot_dp_low_power_query(IN CONST UCHAR_T *dps, IN CONST UINT_T cnt,
                                   OUT TY_RECV_OBJ_DP_S **obj_dps, OUT TY_RECV_RAW_DP_S **raw_dps);
/**
 * @brief tuya_iot_dp_low_power_query 
 *
 * @param[in] dps: data of DP
 * @param[in] cnt: count of DP
 * @param[out] obj_dps: get object type DP
 * @param[out] raw_dps: get raw type DP
 *
 * @return 
 */

Func tuya_iot_get_third_cloud_ca

void tuya_iot_get_third_cloud_ca(CHAR_T *p_url);
/**
 * @brief according url get third cloud ca 
 * 
 * @param[in] url Third cloud url
 *
 * @return
 */

Func tuya_dev_gen_ra_check

OPERATE_RET tuya_dev_gen_ra_check(OUT BYTE_T RA[TY_DEV_RANDOM_LENGTH],OUT BYTE_T ra_en_hex[TY_DEV_RANDOM_AES_LEN],
  OUT BYTE_T ra_uuid_hmac[TY_DEV_SHA256_DIGEST_SIZE], OUT BYTE_T ra_hmac[TY_DEV_SHA256_DIGEST_SIZE]);
/**
 * @brief tuya_dev_gen_ra_check 
 * @desc dev生成RA,ra_aes,hmac(ra+uuid),hmac(ra),用于三向认证
 *
 * @param[out] RA[TY_DEV_RANDOM_LENGTH]
 * @param[out] ra_en_hex[TY_DEV_RANDOM_AES_LEN]
 * @param[out] ra_uuid_hmac[TY_DEV_SHA256_DIGEST_SIZE]
 * @param[out] ra_hmac[TY_DEV_SHA256_DIGEST_SIZE]
 *
 * @return OPERATE_RET
 */

Func tuya_dev_http_ra_check_exchange

OPERATE_RET tuya_dev_http_ra_check_exchange(IN CONST CHAR_T* uuid, IN CONST BYTE_T* ra_aes_hex, UINT_T ra_aes_hex_len,
   IN CONST BYTE_T* ra_uuid_hmac_hex, UINT_T ra_uuid_hmac_hex_len, OUT BYTE_T* ra_hmac, OUT BYTE_T* rb_aes,
   OUT BYTE_T* rb_hmac, OUT BYTE_T* session_key);
/**
 * @brief tuya_dev_http_ra_check_exchange 
 * @desc gw通过uuid+ra_aes+hmac(ra+uuid)到云端交换ra_hmac,rb_aes
 *
 * @param[in] uuid
 * @param[in] ra_aes_hex
 * @param[in] ra_aes_hex_len
 * @param[in] ra_uuid_hmac_hex
 * @param[in] ra_uuid_hmac_hex_len
 * @param[out] ra_hmac
 * @param[out] rb_aes
 * @param[out] rb_hmac
 * @param[out] session_key
 *
 * @return OPERATE_RET
 */

Func tuya_dev_rarb_session_key_calc

OPERATE_RET tuya_dev_rarb_session_key_calc(IN CONST BYTE_T* auth_key, IN BYTE_T rb_aes[TY_DEV_RANDOM_AES_LEN],
   IN BYTE_T RA[TY_DEV_RANDOM_LENGTH], OUT BYTE_T rb_hmac[TY_DEV_SHA256_DIGEST_SIZE],
   OUT BYTE_T session_key[TY_DEV_SESSION_KEY_LEN]);
/**
 * @brief tuya_dev_rarb_session_key_calc 
 * @desc dev由RA,rb_aes,authkey计算rb_hmac,session_key(16字节)
 *
 * @param[in] auth_key
 * @param[in] rb_aes[TY_DEV_RANDOM_AES_LEN]
 * @param[in] RA[TY_DEV_RANDOM_LENGTH]
 * @param[out] rb_hmac[TY_DEV_SHA256_DIGEST_SIZE]
 * @param[out] session_key[TY_DEV_SESSION_KEY_LEN]
 *
 * @return OPERATE_RET
 */

Func tuya_dev_gen_uuid_hmac

OPERATE_RET tuya_dev_gen_uuid_hmac(OUT BYTE_T uuid_hmac[TY_DEV_SHA256_DIGEST_SIZE]);
/**
 * @brief tuya_dev_gen_uuid_hmac 
 * @desc dev生成hmac(uuid)
 *
 * @param[out] uuid_hmac[TY_DEV_SHA256_DIGEST_SIZE]
 *
 * @return OPERATE_RET
 */

Func tuya_dev_http_relation_exchange

OPERATE_RET tuya_dev_http_relation_exchange(IN CONST CHAR_T* uuid, IN CONST BYTE_T* hmacAuthKey_hex, UINT_T hmacAuthKey_hex_len,
   OUT INT_T *isIndependent, OUT INT_T *isSub, OUT INT_T *isFamily);
/**
 * @brief tuya_dev_http_relation_exchange 
 * @desc gw由uuid+hmac(uuid)到云端交换dev和gw的关系
 *
 * @param uuid
 * @param hmacAuthKey_hex
 * @param hmacAuthKey_hex_len
 * @param isIndependent: 是否独立 1 是 0 否 
 * @param isSub: 是否父子设备 1 是 0 否
 * @param isFamily: 是否同一家庭 1 是  0 否
 *
 * @return OPERATE_RET
 */

Func iot_httpc_common_post_no_remalloc

OPERATE_RET iot_httpc_common_post_no_remalloc(IN CONST CHAR_T *api_name, IN CONST CHAR_T *api_ver,
                                             IN CONST CHAR_T *uuid, IN CONST CHAR_T *devid,
                                             IN CHAR_T *post_data, IN UINT_T data_total_len,
                                             IN CONST CHAR_T *p_head_other,
                                             OUT ty_cJSON **pp_result);
/**
 * @brief iot_httpc_common_post_no_remalloc 
 * @desc http api
 *
 * @param[in] api_name
 * @param[in] api_ver
 * @param[in] uuid
 * @param[in] devid
 * @param[in] post_data
 * @param[in] data_total_len
 * @param[in] p_head_other
 * @param[out] pp_result
 *
 * @return OPERATE_RET
 */

Func iot_httpc_common_post

OPERATE_RET iot_httpc_common_post(IN CONST CHAR_T *api_name, IN CONST CHAR_T *api_ver,
                                 IN CONST CHAR_T *uuid, IN CONST CHAR_T *devid,
                                 IN CHAR_T *post_data,
                                 IN CONST CHAR_T *p_head_other,
                                 OUT ty_cJSON **pp_result);
/**
 * @brief iot_httpc_common_post 
 *
 * @param[in] api_name
 * @param[in] api_ver
 * @param[in] uuid
 * @param[in] devid
 * @param[in] post_data
 * @param[in] p_head_other
 * @param[out] pp_result
 *
 * @return OPERATE_RET
 */

Func iot_httpc_common_post_simple

OPERATE_RET iot_httpc_common_post_simple(IN CONST CHAR_T *api_name, IN CONST CHAR_T *api_ver,
                                        IN CHAR_T *post_data, IN CONST CHAR_T *p_head_other, OUT ty_cJSON **pp_result);
/**
 * @brief iot_httpc_common_post_simple 
 *
 * @param[in] api_name
 * @param[in] api_ver
 * @param[in] post_data
 * @param[in] p_head_other
 * @param[out] pp_result
 *
 * @return OPERATE_RET
 */

Func iot_httpc_download_file

OPERATE_RET iot_httpc_download_file(IN CONST CHAR_T *url,IN CONST UINT_T mlk_buf_len,\
                                 IN CONST IOT_HTTP_GET_FILE_DATA_CB gfd_cb, IN PVOID_T priv_data, \
                                 IN CONST UINT_T total_len, INOUT BYTE_T file_hmac[32]);
/**
 * @brief iot_httpc_download_file 
 *
 * @param[in] url
 * @param[in] mlk_buf_len
 * @param[in] gfd_cb
 * @param[in] priv_data
 * @param[in] total_len
 * @param[in/out] file_hmac[32]
 *
 * @return OPERATE_RET
 */

Func iot_mqc_app_register_cb

OPERATE_RET iot_mqc_app_register_cb(UINT_T mq_pro, iot_mqc_protocol_handler_cb handler);
/**
 * @brief iot_mqc_app_register_cb 
 * @desc 注册mqtt事件回调函数
 *
 * @param[in] mq_pro
 * @param[in] handler
 *
 * @return OPERATE_RET
 */

Func iot_mqc_send_custom_msg

OPERATE_RET iot_mqc_send_custom_msg(IN CONST UINT_T protocol,IN CONST CHAR_T *data,IN CONST BYTE_T qos,\
                                   IN CONST UINT_T to_lmt,IN CONST iot_mqc_publish_result_cb cb,IN VOID *prv_data);
/**
 * @brief iot_mqc_send_custom_msg 
 *
 * @param[in] protocol
 * @param[in] data
 * @param[in] qos
 * @param[in] to_lmt
 * @param[in] cb
 * @param[in] prv_data
 *
 * @return OPERATE_RET
 */

Func iot_wd_common_write

OPERATE_RET iot_wd_common_write(IN CONST CHAR_T *key, IN CONST BYTE_T *value, IN CONST UINT_T len);
/**
 * @brief iot_wd_common_write 
 * @desc wd write
 *
 * @param[in] key
 * @param[in] value
 * @param[in] len
 *
 * @return OPERATE_RET
 */

Func iot_wd_common_read

OPERATE_RET iot_wd_common_read(IN CONST CHAR_T *key, OUT BYTE_T **value, OUT UINT_T *p_len);
/**
 * @brief iot_wd_common_read 
 * @desc wd read
 *
 * @param[in] key
 * @param[out] value
 * @param[out] p_len
 *
 * @return OPERATE_RET
 */

Func iot_wd_common_free_data

OPERATE_RET iot_wd_common_free_data(IN BYTE_T *data);
/**
 * @brief iot_wd_common_free_data 
 * @desc wd free
 *
 * @param[in] data
 *
 * @return OPERATE_RET
 */

Func iot_wd_common_delete

OPERATE_RET iot_wd_common_delete(IN CONST CHAR_T *key);
/**
 * @brief iot_wd_common_delete 
 * @desc wd delete
 *
 * @param[in] key
 *
 * @return OPERATE_RET
 */

Func iot_wd_gw_desc_if_read

OPERATE_RET iot_wd_gw_desc_if_read(OUT VOID *di);
/**
 * @brief iot_wd_gw_desc_if_read 
 * @desc wd read gateway information
 *
 * @param[out] di
 *
 * @return OPERATE_RET
 */

Func iot_wd_gw_write_country_code

OPERATE_RET iot_wd_gw_write_country_code(CHAR_T *country_code);
/**
 * @brief iot_wd_gw_write_country_code 
 * @desc wd write country code
 *
 * @param[in] country_code
 *
 * @return OPERATE_RET
 */

Func iot_wd_utils_serialize

OPERATE_RET iot_wd_utils_serialize(IN CONST IOT_TY_DB_RW_S *rw,IN CONST UINT_T rw_cnt,\
                              OUT CHAR_T **out,OUT UINT_T *out_len);
/**
 * @brief iot_wd_utils_serialize 
 *
 * @param[in] rw
 * @param[in] rw_cnt
 * @param[out] out
 * @param[out] out_len
 *
 * @return OPERATE_RET
 */

Func iot_wd_utils_free_outbuf

OPERATE_RET iot_wd_utils_free_outbuf(IN CHAR_T *out_buf);
/**
 * @brief iot_wd_utils_free_outbuf 
 *
 * @param[out] out_buf
 *
 * @return OPERATE_RET
 */

Func iot_wd_utils_deserialize

OPERATE_RET iot_wd_utils_deserialize(IN CONST CHAR_T *in,INOUT IOT_TY_DB_RW_S *rw,IN CONST UINT_T rw_cnt);
/**
 * @brief iot_wd_utils_deserialize 
 *
 * @param[in] in
 * @param[in] rw
 * @param[in] rw_cnt
 *
 * @return OPERATE_RET
 */

Func iot_gw_user_token_bind

OPERATE_RET iot_gw_user_token_bind(IN CONST CHAR_T *token);
/**
 * @brief iot_gw_user_token_bind 
 *
 * @param[in] token
 *
 * @return OPERATE_RET
 */

Func iot_put_cloud_config

OPERATE_RET iot_put_cloud_config(IN CONST CHAR_T *data);
/**
 * @brief iot_put_cloud_config 
 * @desc the project switches to the release, reporting configuration
 *
 * @param[in] data
 *
 * @return OPERATE_RET
 */

Func iot_wf_gw_unactive_custom_mode

OPERATE_RET iot_wf_gw_unactive_custom_mode(GW_WF_START_MODE wifi_mode);
/**
 * @brief iot_wf_gw_unactive_custom_mode 
 *
 * @param[in] wifi_mode
 *
 * @return OPERATE_RET
 */

Func iot_register_pre_gw_ug_cb

VOID iot_register_pre_gw_ug_cb(IN PRE_GW_UG_INFORM_CB pre_ug_cb);
/**
 * @brief iot_register_pre_gw_ug_cb 
 *
 * @param pre_ug_cb
 *
 * @return none
 */

Func iot_tls_set_ssl_verify

VOID iot_tls_set_ssl_verify(IN CONST INT_T verify_mode);
/**
 * @brief iot_tls_set_ssl_verify 
 *
 * @param[in] verify_mode
 *
 * @return none
 */

Func iot_tls_register_x509_crt_der

INT_T iot_tls_register_x509_crt_der(VOID *p_ctx, UCHAR_T *p_der, UINT_T der_len);
/**
 * @brief iot_tls_register_x509_crt_der 
 * @desc Parse one or more PEM certificates from a buffer and add them to the chained list
 *
 * @param[in] p_ctx
 * @param[in] p_der
 * @param[in] der_len
 *
 * @return result
 */

Func iot_gw_update_versions

OPERATE_RET iot_gw_update_versions(VOID);
/**
 * @brief iot_gw_update_versions 
 *
 * @return OPERATE_RET
 */

Func iot_httpc_raw_post

OPERATE_RET iot_httpc_raw_post(IN CONST CHAR_T *p_url, IN CONST UINT_T data_total_len, INOUT IOT_RAW_HTTP_S *pp_raw_http);
/**
 * @brief iot_httpc_raw_post 
 *
 * @param[in] p_url
 * @param[in] data_total_len
 * @param[in/out] pp_raw_http
 *
 * @return OPERATE_RET
 */

Func iot_httpc_raw_get

OPERATE_RET iot_httpc_raw_get(IN CONST CHAR_T *p_url, INOUT IOT_RAW_HTTP_S *pp_raw_http, IN UINT_T offset, IN UINT_T total_len);
/**
 * @brief iot_httpc_raw_get 
 *
 * @param[in] p_url
 * @param[out] pp_raw_http
 * @param[in] offset
 * @param[in] total_len
 *
 * @return OPERATE_RET
 */

Func iot_httpc_raw_put

OPERATE_RET iot_httpc_raw_put(IN CONST CHAR_T *p_url, IN CONST UINT_T data_total_len, INOUT IOT_RAW_HTTP_S *pp_raw_http);
/**
 * @brief iot_httpc_raw_put 
 *
 * @param[in] p_url
 * @param[in] data_total_len
 * @param[out] pp_raw_http
 *
 * @return OPERATE_RET
 */

Func iot_httpc_raw_write_content

INT_T iot_httpc_raw_write_content(IN IOT_RAW_HTTP_S p_raw_http, IN CONST BYTE_T *buf, IN CONST UINT_T buf_len, BOOL_T chunked);
/**
 * @brief iot_httpc_raw_write_content 
 *
 * @param[in] p_raw_http
 * @param[in] buf
 * @param[in] buf_len
 * @param[in] chunked
 *
 * @return result
 */

Func iot_httpc_raw_read_resp_header

OPERATE_RET iot_httpc_raw_read_resp_header(INOUT IOT_RAW_HTTP_S p_raw_http, OUT INT_T *p_status_code, OUT BOOL_T *p_chunked, OUT UINT_T *p_content_len);
/**
 * @brief iot_httpc_raw_read_resp_header 
 *
 * @param[in/out] p_raw_http
 * @param[out] p_status_code
 * @param[out] p_chunked
 * @param[out] p_content_len
 *
 * @return OPERATE_RET
 */

Func iot_httpc_raw_read_content

INT_T iot_httpc_raw_read_content(IN IOT_RAW_HTTP_S p_raw_http, IN BYTE_T *buf, IN CONST UINT_T buf_len);
/**
 * @brief iot_httpc_raw_read_content 
 *
 * @param[in] p_raw_http
 * @param[in] buf
 * @param[in] buf_len
 *
 * @return result
 */

Func iot_httpc_raw_close

OPERATE_RET iot_httpc_raw_close(IN IOT_RAW_HTTP_S p_raw_http);
/**
 * @brief iot_httpc_raw_close 
 *
 * @param[in] p_raw_http
 *
 * @return OPERATE_RET
 */

Func tuya_iot_put_cloud_config

OPERATE_RET tuya_iot_put_cloud_config(IN CONST CHAR_T *data);
/**
 * @brief tuya_iot_put_cloud_config 
 *
 * @param[in] data
 *
 * @return OPERATE_RET
 */

Func tuya_iot_thing_config_init

OPERATE_RET tuya_iot_thing_config_init(IN THING_CONFIG_SOCKET_CB socket_cb);
/**
 * @brief tuya_iot_thing_config_init 
 *
 * @param[in] socket_cb
 *
 * @return OPERATE_RET
 */

Func tuya_iot_thing_config_start

OPERATE_RET tuya_iot_thing_config_start(IN CONST CHAR_T *ssid, IN CONST CHAR_T *passwd, IN CONST CHAR_T *token, IN CONST UINT_T timeout);
/**
 * @brief tuya_iot_thing_config_start 
 *
 * @param[in] ssid
 * @param[in] passwd
 * @param[in] token
 * @param[in] timeout
 *
 * @return OPERATE_RET
 */

Func tuya_iot_thing_config_stop

VOID tuya_iot_thing_config_stop(VOID);
/**
 * @brief tuya_iot_thing_config_stop 
 *
 * @return none
 */

Func tuya_iot_compare_two_string

BOOL_T tuya_iot_compare_two_string(IN CONST CHAR_T *cString1, IN CONST CHAR_T *cString2);
/**
 * @brief tuya_iot_compare_two_string
 *
 * @param cString1
 * @param cString2
 *
 * @return 
 */

Func iot_special_dp_register_cb

OPERATE_RET iot_special_dp_register_cb(IN iot_special_dp_cb handler);
/**
 * @brief iot_special_dp_register_cb 
 *
 * @param[in] handler
 *
 * @return OPERATE_RET
 */

Func tuya_iot_compare_two_string

BOOL_T tuya_iot_compare_two_string(IN CONST CHAR_T *cString1, IN CONST CHAR_T *cString2);
/**
 * @brief tuya_iot_compare_two_string 
 *
 * @param[in] cString1
 * @param[in] cString2
 *
 * @return 
 */

Func tuya_iot_get_json_safety_string

CHAR_T* tuya_iot_get_json_safety_string(IN CONST CHAR_T *json);
/**
 * @brief tuya_iot_get_json_safety_string 
 * @desc will change the (") to the (\") in json file
 *
 * @param[in] json
 *
 * @return 
 *
 * @note user shoule free memory
 */

Func tuya_iot_set_wf_gw_prod_info

OPERATE_RET tuya_iot_set_wf_gw_prod_info(IN CONST WF_GW_PROD_INFO_S *wf_prod_info);
/**
* @brief tuya_iot_set_wf_gw_prod_info 
*
* @param[in] wf_prod_info
*
* @return OPERATE_RET
*/

Func tuya_iot_set_wf_gw_debug_info

OPERATE_RET tuya_iot_set_wf_gw_debug_info(IN CONST DEBUG_GW_PROD_INFO_S *debug_info);
/**
 * @brief tuya_iot_set_wf_gw_debug_info 
 * @desc safe version set debug information
 *
 * @param debug_info
 *
 * @return OPERATE_RET
 */

Func tuya_iot_wf_timeout_set

VOID tuya_iot_wf_timeout_set(IN CONST UINT_T timeout);
/**
 * @brief tuya_iot_wf_timeout_set 
 * @desc set wifi timeout
 *
 * @param[in] timeout: time in sec
 *
 * @return none
 *
 * @note must call first
 */

Func tuya_iot_wf_dev_init

OPERATE_RET tuya_iot_wf_dev_init(IN CONST GW_WF_CFG_MTHD_SEL cfg, IN CONST GW_WF_START_MODE start_mode,
                               IN CONST TY_IOT_CBS_S *cbs, IN CONST CHAR_T *firmware_key,
                               IN CONST CHAR_T *product_key, IN CONST CHAR_T *wf_sw_ver,IN CONST DEV_TYPE_T tp,
                               IN CONST GW_ATTACH_ATTR_T *attr, IN CONST UINT_T attr_num);
/**
 * @brief tuya_iot_wf_dev_init 
 *
 * @param[in] cfg
 * @param[in] start_mode
 * @param[in] cbs: tuya wifi sdk user callbacks
 * @param[in] firmware_key
 * @param[in] product_key: product key/proudct id,get from tuya open platform
 * @param[in] wf_sw_ver: wifi module software version format:xx.xx.xx (0<=x<=9)
 * @param[in] attr
 * @param[in] attr_num
 *
 * @return OPERATE_RET
 */

Func tuya_iot_wf_mcu_dev_init

OPERATE_RET tuya_iot_wf_mcu_dev_init(IN CONST GW_WF_CFG_MTHD_SEL cfg, IN CONST GW_WF_START_MODE start_mode,
                                    IN CONST TY_IOT_CBS_S *cbs, IN CONST CHAR_T *p_firmware_key,
                                    IN CONST CHAR_T *product_key,IN CONST CHAR_T *wf_sw_ver,IN CONST CHAR_T *mcu_sw_ver);
/**
 * @brief tuya_iot_wf_mcu_dev_init 
 *
 * @param[in] cfg
 * @param[in] start_mode
 * @param[in] cbs: tuya wifi sdk user callbacks
 * @param[in] p_firmware_key
 * @param[in] product_key: product key/proudct id,get from tuya open platform
 * @param[in] wf_sw_ver: wifi module software version format:xx.xx.xx (0<=x<=9)
 * @param[in] mcu_sw_ver: mcu software version format:xx.xx.xx (0<=x<=9)
 *
 * @return OPERATE_RET
 */

Func tuya_iot_wf_soc_dev_init_param

OPERATE_RET tuya_iot_wf_soc_dev_init_param(IN CONST GW_WF_CFG_MTHD_SEL cfg, IN CONST GW_WF_START_MODE start_mode,
                                    IN CONST TY_IOT_CBS_S *cbs,IN CONST CHAR_T *firmware_key,
                                    IN CONST CHAR_T *product_key,IN CONST CHAR_T *wf_sw_ver);
/**
 * @brief tuya_iot_wf_soc_dev_init_param 
 *
 * @param[in] cfg
 * @param[in] start_mode
 * @param[in] cbs: tuya wifi sdk user callbacks,note cbs->dev_ug_cb is useless
 * @param[in] firmware_key
 * @param[in] product_key: product key/proudct id,get from tuya open platform
 * @param[in] wf_sw_ver: wifi module software version format:xx.xx.xx (0<=x<=9)
 *
 * @return OPERATE_RET
 */

Func tuya_iot_reg_get_wf_nw_stat_cb_params

OPERATE_RET tuya_iot_reg_get_wf_nw_stat_cb_params(IN CONST GET_WF_NW_STAT_CB wf_nw_stat_cb, IN CONST INT_T min_interval_s);
/**
 * @brief tuya_iot_reg_get_wf_nw_stat_cb_params 
 *
 * @param wf_nw_stat_cb
 * @param min_interval_s
 *
 * @return 
 */

Func tuya_iot_set_wf_cfg_err_code_cb

OPERATE_RET tuya_iot_set_wf_cfg_err_code_cb(IN CONST WF_NW_CFG_ERR_CODE_CB wf_nw_cfg_err_code_cb);
/**
 * @brief tuya_iot_set_wf_cfg_err_code_cb 
 *
 * @param wf_nw_cfg_err_code_cb
 *
 * @return OPERATE_RET
 */

Func tuya_iot_wf_gw_unactive

OPERATE_RET tuya_iot_wf_gw_unactive(VOID);
/**
 * @brief tuya_iot_wf_gw_unactive 
 *
 * @return OPERATE_RET
 */

Func tuya_iot_wf_gw_reset

OPERATE_RET tuya_iot_wf_gw_reset(VOID);
/**
 * @brief tuya_iot_wf_gw_reset 
 *
 * @return OPERATE_RET
 */

Func tuya_iot_wf_gw_fast_unactive

OPERATE_RET tuya_iot_wf_gw_fast_unactive(IN CONST GW_WF_CFG_MTHD_SEL mthd,IN CONST GW_WF_START_MODE wifi_start_mode);
/**
 * @brief tuya_iot_wf_gw_fast_unactive 
 *
 * @param[in] mthd
 * @param[in] wifi_start_mode
 *
 * @return OPERATE_RET
 */

Func tuya_iot_wf_fast_get_nc_type

OPERATE_RET tuya_iot_wf_fast_get_nc_type(GW_WF_NWC_FAST_STAT_T *nc_type);
/**
 * @brief tuya_iot_wf_fast_get_nc_type 
 *
 * @param[in] nc_type
 *
 * @return OPERATE_RET
 */

Func tuya_iot_set_user_def_ap_if

OPERATE_RET tuya_iot_set_user_def_ap_if(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd);
/**
 * @brief tuya_iot_set_user_def_ap_if 
 *
 * @param[in] ssid
 * @param[in] passwd
 *
 * @return OPERATE_RET
 *
 * @note need call before tuya_iot_wf_xxx_init
 */

Func tuya_iot_get_dev_ap_if

OPERATE_RET tuya_iot_get_dev_ap_if(OUT CHAR_T *ssid,OUT CHAR_T *passwd);
/**
 * @brief tuya_iot_get_dev_ap_if 
 *
 * @param[in] ssid
 * @param[in] passwd
 *
 * @return OPERATE_RET
 *
 * @note need call before tuya_iot_wf_xxx_init
 */

Func tuya_iot_gw_wf_user_cfg

OPERATE_RET tuya_iot_gw_wf_user_cfg(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd,IN CONST CHAR_T *token);
/**
 * @brief tuya_iot_gw_wf_user_cfg 
 *
 * @param[in] ssid
 * @param[in] passwd
 * @param[in] token
 *
 * @return OPERATE_RET
 *
 * @note use to TY_APP_CFG_WF mode
 */

Func tuya_iot_set_max_sta_conn

VOID tuya_iot_set_max_sta_conn(IN CONST UCHAR_T max_conn);
/**
 * @brief tuya_iot_set_max_sta_conn 
 *
 * @param[in] max_conn
 *
 * @return 
 *
 * @note need call before tuya_iot_wf_xxx_init
 */

Func tuya_iot_set_nw_ip

VOID tuya_iot_set_nw_ip(IN CONST CHAR_T* ip, IN CONST CHAR_T* mask, IN CONST CHAR_T* gw);
/**
 * @brief tuya_iot_set_nw_ip 
 *
 * @param[in] ip
 * @param[in] mask
 * @param[in] gw
 *
 * @return none
 *
 * @note need call before tuya_iot_wf_xxx_init
 */

Func tuya_iot_set_gw_prod_info

OPERATE_RET tuya_iot_set_gw_prod_info(IN CONST GW_PROD_INFO_S *prod_info);
/**
 * @brief tuya_iot_set_gw_prod_info 
 * @desc set tuya-sdk product info (wired version)
 *
 * @param prod_info: tuya-sdk product info
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_dev_init

OPERATE_RET tuya_iot_dev_init(IN CONST TY_IOT_CBS_S *cbs, IN CONST CHAR_T *firmware_key,
                               IN CONST CHAR_T *product_key, IN CONST CHAR_T *sw_ver,IN CONST DEV_TYPE_T tp,
                               IN CONST GW_ATTACH_ATTR_T *attr, IN CONST UINT_T attr_num);
/**
 * @brief tuya_iot_dev_init 
 *
 * @param cbs: tuya sdk user callbacks
 * @param firmware_key
 * @param product_key: product key/proudct id,get from tuya open platform
 * @param sw_ver: netlink module software version format:xx.xx.xx (0<=x<=9)
 * @param attr
 * @param attr_num
 *
 * @return OPERATE_RET
 */

Func tuya_iot_mcu_dev_init

OPERATE_RET tuya_iot_mcu_dev_init(IN CONST TY_IOT_CBS_S *cbs,IN CONST CHAR_T *product_key, IN CONST CHAR_T *p_firmware_key,\
                                           IN CONST CHAR_T *sw_ver,IN CONST CHAR_T *mcu_sw_ver);
/**
 * @brief tuya_iot_mcu_dev_init 
 * @desc init tuya-sdk (wired version, [mcu] mode)
 *
 * @param cbs: tuya-sdk user callbacks
 * @param product_key: product key
 * @param p_firmware_key
 * @param sw_ver: netlink module version.format:xx.xx.xx (0<=x<=9)
 * @param mcu_sw_ver: mcu version format:xx.xx.xx (0<=x<=9)
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_soc_init_param

OPERATE_RET tuya_iot_soc_init_param(IN CONST TY_IOT_CBS_S *cbs,IN CONST CHAR_T *product_key,IN CONST CHAR_T *firmware_key,\
                                     IN CONST CHAR_T *sw_ver);
/**
 * @brief tuya_iot_soc_init_param 
 * @desc init tuya-sdk (wired version, [soc] mode)
 *
 * @param cbs: tuya-sdk user callbacks
 * @param product_key: product key
 * @param firmware_key: firmware key
 * @param sw_ver: soc version.format:xx.xx.xx (0<=x<=9)
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_gw_unactive

OPERATE_RET tuya_iot_gw_unactive(VOID);
/**
 * @brief tuya_iot_gw_unactive 
 * @desc unactive this hardware from tuya-cloud
 *
 * @param VOID
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_gw_reset

OPERATE_RET tuya_iot_gw_reset(VOID);
/**
 * @brief tuya_iot_gw_reset 
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_iot_reg_get_nw_stat_cb_params

OPERATE_RET tuya_iot_reg_get_nw_stat_cb_params(IN CONST GET_NW_STAT_CB nw_stat_cb, IN CONST INT_T min_interval_s);
/**
 * @brief tuya_iot_reg_get_nw_stat_cb_params 
 * @desc enable tuya-sdk network check. sdk will check the
 *       network every 1 second. if network change, sdk
 *       will notify by calling nw_stat_cb
 *
 * @param nw_stat_cb: network change callback
 * @param min_interval_s
 *
 * @return OPRT_OK: success  Other: fail
 */

Func tuya_astro_timer_init

int tuya_astro_timer_init(void);
/**
 * @brief astronomy timer init function
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * 
 */

Func tuya_astro_timer_mqc_notify

int tuya_astro_timer_mqc_notify(char *atop, char *ver, ty_cJSON *params);
/**
 * @brief astronomy timer mqtt notify
 *
 * @param[in] atop Atop command
 * @param[in] ver Version
 * @param[in] params Json parameter
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * 
 */

Func tuya_astro_timer_reset

int tuya_astro_timer_reset(void);
/**
 * @brief astronomy timer reset
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * 
 */

Func ty_bt_init_env

OPERATE_RET ty_bt_init_env(IN CONST TY_BT_SDK_PARAM_S *p);
/**
 * @brief Init the running environment for bluetooth.
 *
 * @param[in] p: initial parameters for bluetooth
 *
 * @note This API is used for initializing the running environment for bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_bt_update_param

OPERATE_RET ty_bt_update_param(CHAR_T *product_id, BOOL_T is_oem, TY_BT_SDK_PARAM_S *p_param);
/**
 * @brief Update parameters for bluetooth.
 *
 * @param[in] product_id: product id
 * @param[in] is_oem: if be oem or not
 * @param[in] p_param: parameters
 *
 * @note This API is used for updating parameters for bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_bt_update_local_key

OPERATE_RET ty_bt_update_local_key(UINT8_T* p_buf, UINT8_T len);
/**
 * @brief Update local key
 *
 * @param[in] p_buf: local key
 * @param[in] len: lenth of local key
 *
 * @note This API is used for update local key.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_ble_device_update_adv_para

OPERATE_RET tuya_ble_device_update_adv_para(uint8_t* p_buf, uint8_t bind_state);
/**
 * @brief Update broadcast param for bluetooth
 *
 * @param[in] p_buf: local key
 * @param[in] bind_state: bind state
 *
 * @note This API is used for update broadcast param for bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func bt_netcfg_init

OPERATE_RET bt_netcfg_init(VOID_T);
/**
 * @brief Init network configuration by bluetooth
 *
 * @param VOID
 *
 * @note This API is used for initializing network configuration by bluetooth
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_bt_dp_report

OPERATE_RET ty_bt_dp_report(IN CONST DP_REPT_TYPE_E dp_rept_type, IN CONST VOID_T* data);
/**
 * @brief Report dp by bluetooth
 *
 * @param[in] dp_rept_type: dp report type
 * @param[in] data: dp data
 *
 * @note This API is used for reporting dp data
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_ble_monitor_init

OPERATE_RET tuya_ble_monitor_init(VOID_T);
/**
 * @brief Monitor for bluetooth
 *
 * @param VOID
 *
 * @note This API is used for monitor for bluetooth.
 * if the device connected cloud, start advertisement, otherwise stoo it.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func is_bt_connected

BOOL_T is_bt_connected(VOID_T);
/**
 * @brief Check bluetooth is connected.
 *
 * @param VOID
 *
 * @note This API is used to check whether the bluetooth is connected.
 *
 * @return be connected or not
 */

Func tuya_ble_reg_get_bt_stat_cb

OPERATE_RET tuya_ble_reg_get_bt_stat_cb(IN CONST GET_BT_CONN_STAT_CB bt_conn_stat_cb);
/**
 * @brief Register callback function for getting the connection status of bluetooth
 *
 * @param[in] bt_conn_stat_cb: callback function
 *
 * @note This API is used for registering callback function for getting the connection status of bluetooth
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_set_bt_device_name

OPERATE_RET tuya_set_bt_device_name(CHAR_T* dev_name);
/**
 * @brief Set device name for bluetooth.
 *
 * @param[in] dev_name: device name for bluetooth
 *
 * @note This API is used for setting device name for bluetooth. this API should be called before bluetooth initialized.
 *
 * @return VOID
 */

Func tuya_ble_set_bt_para

VOID_T tuya_ble_set_bt_para(TUYA_BLE_BT_PARA* para);
/**
 * @brief Set parameters for bluetooth.
 *
 * @param[in] para: parameters for bluetooth
 *
 * @note This API is used for setting parameters for bluetooth. this API should be called before bluetooth initialized.
 *
 * @return VOID
 */

Func tuya_ble_init_beacon_key

VOID_T tuya_ble_init_beacon_key(VOID_T);
/**
 * @brief Init beacon key for bluetooth remote control.
 *
 * @param VOID
 *
 * @note This API is used for initialize beacon key for bluetooth remote control.
 * This API is userd for new remote control.
 *
 * @return VOID
 */

Func tuya_ble_save_beacon_key

OPERATE_RET tuya_ble_save_beacon_key(VOID_T);
/**
 * @brief Save beacon key for bluetooth remote control.
 *
 * @param VOID
 *
 * @note This API is used for saving beacon key for bluetooth remote control.
 * This API is userd for new remote control.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_ble_clear_beacon_key

VOID_T tuya_ble_clear_beacon_key(VOID_T);
/**
 * @brief Clear up beacon key for bluetooth remote control.
 *
 * @param VOID
 *
 * @note This API is used for clearing up beacon key for bluetooth remote control.
 * This API is userd for new remote control.
 *
 * @return VOID
 */

Func tuya_ble_clear_rmt_ctrl_info

VOID_T tuya_ble_clear_rmt_ctrl_info(UINT8_T stat);
/**
 * @brief Clear up all flash information of bluetooth remote control.
 *
 * @param VOID
 *
 * @note This API is used for all flash information of bluetooth remote control.
 * This API is userd for new remote control.
 *
 * @return VOID
 */

Func tuya_ble_reg_app_scan_adv_cb

OPERATE_RET tuya_ble_reg_app_scan_adv_cb(TUYA_BLE_APP_SCAN_HANDLE cb);
/**
 * @brief Register callback function for advertisement scanning data processing
 *
 * @param[in] cb: callback function
 *
 * @note This API is used for registering callback function for advertisement scanning data processing
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_ble_reg_app_scan_adv_handle_cbs

OPERATE_RET tuya_ble_reg_app_scan_adv_handle_cbs(TUYA_BLE_SCAN_ADV_HANDLE_CBS* cbs);
/**
 * @brief Register callback function for advertisement scanning data processing
 *
 * @param[in] cbs: callback function
 *
 * @note This API is used for registering callback function for advertisement scanning data processing
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_ble_set_bind_window

VOID_T tuya_ble_set_bind_window(UINT_T time_out);
/**
 * @brief Set timeout window for binding remote controller
 *
 * @param[in] time_out: time out in second, 0: no window
 *
 * @note This API is used for setting timeout window for binding remote controller
 *
 * @return VOID
 */

Func tuya_ble_open_bind_window

VOID_T tuya_ble_open_bind_window(VOID_T);
/**
 * @brief Open window for binding remote controller
 *
 * @param[in] VOID
 *
 * @note This API is used for opening window for binding remote controller
 *
 * @return VOID
 */

Func tuya_ble_set_serv_switch

VOID_T tuya_ble_set_serv_switch(BOOL_T swith);
/**
 * @brief Set enable switch for bluetooth service
 *
 * @param[in] switch: enable switch: TRUE-open, FALSE-close
 *
 * @note This API is used for setting enable switch for bluetooth service, it should be called before sdk initialization.
 *
 * @return VOID
 */

Func tuya_ble_is_serv_opened

BOOL_T tuya_ble_is_serv_opened(VOID_T);
/**
 * @brief Check bluetooth service is available
 *
 * @param VOID
 *
 * @note This API is used to check the bluetooth service is available.
 *
 * @return TRUE enable, FALSE disable
 */

Func gw_cntl_init

OPERATE_RET gw_cntl_init(IN CONST GW_CFG_S *cfg,IN CONST CHAR_T *product_key,IN CONST CHAR_T *firmware_key,
                              IN CONST CHAR_T *sw_ver,IN CONST DEV_TYPE_T tp,IN CONST GW_ATTACH_ATTR_T *attr,IN CONST UINT_T attr_num);
/**
 * @brief IoT device initialization
 * 
 * @param[in] cfg Network configuration, see GW_CFG_S
 * @param[in] product_key KEY of product, assigned by TUYA
 * @param[in] firmware_key KEY of firmware, assigned by TUYA
 * @param[in] sw_ver Software version of fimeware
 * @param[in] attr Attach module attributes
 * @param[in] attr_num Count of attach module
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_wifi_modify_and_conn

OPERATE_RET gw_wifi_modify_and_conn(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd);
/**
 * @brief Set new ssid and password
 * 
 * @param[in] ssid SSID to connect
 * @param[in] passwd Password of AP
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_register_cbs

VOID gw_register_cbs(IN CONST TY_IOT_CBS_S *cbs);
/**
 * @brief Register handlers to gateway
 * 
 * @param[in] cbs Callbacks, see TY_IOT_CBS_S
 */

Func get_gw_dev_cntl

DEV_CNTL_N_S *get_gw_dev_cntl(VOID);
/**
 * @brief Get gateway device cntl
 * 
 * @return Gateway device cntl, see DEV_CNTL_N_S
 */

Func get_dev_cntl

DEV_CNTL_N_S *get_dev_cntl(IN CHAR_T *id);
/**
 * @brief Get device cntl
 * 
 * @param[in] id Device id, NULL indicates gateway
 * 
 * @return Device cntl, see DEV_CNTL_N_S
 */

Func get_gw_auth_status

BOOL_T get_gw_auth_status(VOID);
/**
 * @brief Get gateway's authentication status
 * 
 * @return TRUE if authorized, otherwise return FALSE
 */

Func gw_register_mqc_cb

void gw_register_mqc_cb(void);
/**
 * @brief Register gateway MQTT callback(s)
 */

Func tuya_get_schema

CHAR_T *tuya_get_schema(VOID);
/**
 * @brief Get device schema info
 * 
 * @param[in] dev_id Device id
 * @param[in] dp_num Count of dp
 * @param[out] dp_info DP info
 * 
 * @note Caller shall free the returned memory explictly
 * 
 * @return Schema info, NULL on fail
 */

Func tuya_get_dp_info

OPERATE_RET tuya_get_dp_info(IN CONST CHAR_T *dev_id, INT_T* dp_num, DP_CNTL_S** dp_info);
/**
 * @brief Get device dp info
 * 
 * @param[in] dev_id Device id
 * @param[in] dp_num Count of dp
 * @param[out] dp_info DP info
 * 
 * @note Caller shall free the memory of dp_info explictly
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_get_gpd_type

OPERATE_RET gw_get_gpd_type(IN CONST UINT_T type, OUT GW_PERMIT_DEV_TP_T *gpd);
/**
 * @brief Get device ota channel
 * 
 * @param[in] type Device type
 * @param[out] gpd Device ota channel
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_set_ext_attribute

OPERATE_RET gw_set_ext_attribute(UINT_T attr);
/**
 * @brief Set device extension attribute
 * 
 * @param[in] attr Device extension attribute
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_get_ext_attribute

UINT_T gw_get_ext_attribute(VOID);
/**
 * @brief Get device extension attribute
 * 
 * @return Device extension attribute
 */

Func gw_create_dev_cntl

OPERATE_RET gw_create_dev_cntl(IN CONST CHAR_T * dev_id, IN CONST CHAR_T * sch_json, OUT DEV_CNTL_N_S **dev_cnt_out);
/**
 * @brief Create device cntl instance
 * 
 * @param[in] dev_id Device ID
 * @param[in] sch_json Device schema
 * @param[out] dev_cnt Device cntl
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_destroy_dev_cntl

OPERATE_RET gw_destroy_dev_cntl( IN DEV_CNTL_N_S *dev_cnt);
/**
 * @brief Destroy device cntl instance
 * 
 * @param[in] dev_cnt Device cntl
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_dup_dev_cntl

OPERATE_RET gw_dup_dev_cntl( IN DEV_CNTL_N_S *dev_cnt_src, OUT DEV_CNTL_N_S **dev_cnt_out);
/**
 * @brief Duplicate device cntl
 * 
 * @param[in] dev_cnt_src Original device cntl
 * @param[out] dev_cnt_out New device cntl
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_subdev_dev_cntl_get_register_cb

OPERATE_RET gw_subdev_dev_cntl_get_register_cb(IN subdev_dev_cntl_get_cb cb);
/**
 * @brief Register handler to get sub-device cntl
 * 
 * @param[in] cb Callback to get sub-device cntl
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func devos_set_udf_ignore_upgrade

int devos_set_udf_ignore_upgrade(const BOOL_T is_ignore);
/**
 * @brief Set ignore dp or not when in upgrade state
 * 
 * @param[in] is_ignore Ignore or not
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func devos_get_udf_ignore_upgrade

BOOL_T devos_get_udf_ignore_upgrade();
/**
 * @brief Get ignore dp or not when in upgrade state
 * 
 * @return TRUE on positive, FALSE on negative
 */

Func devos_set_udf_active

int devos_set_udf_active(CHAR_T *active_api, CHAR_T *active_ver);
/**
 * @brief Set customized active info
 * 
 * @param[in] active_api Customized active api name
 * @param[in] active_ver Customized active api version
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func devos_get_udf_active

BOOL_T devos_get_udf_active(CHAR_T **active_api, CHAR_T **active_ver);
/**
 * @brief Get customized active info
 * 
 * @param[out] active_api Customized active api name
 * @param[out] active_ver Customized active api version
 * 
 * @return TRUE on positive, FALSE on negative
 */

Func tuya_devos_activate_init

OPERATE_RET tuya_devos_activate_init(tuya_activate_t *param);
/**
 * @brief Initialize activation module
 * 
 * @param[in] param Init param, see tuya_activate_t
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_devos_activate_start

OPERATE_RET tuya_devos_activate_start(VOID);
/**
 * @brief Start activate process
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_devos_activate_stop

OPERATE_RET tuya_devos_activate_stop(VOID);
/**
 * @brief Stop activate process
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_set_udf

OPERATE_RET gw_set_udf(IN CONST CHAR_T *udf);
/**
 * @brief Set user defined features(udf) for activation
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_get_udf

CHAR_T * gw_get_udf(VOID);
/**
 * @brief Get user defined features(udf) for activation
 * 
 * @return NULL on error
 */

Func gw_active_set_support_election

OPERATE_RET gw_active_set_support_election(BOOL_T enable);
/**
 * @brief Set election enable or not
 * 
 * @param[in] enable election is supported or not
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_active_get_support_election

BOOL_T gw_active_get_support_election(VOID);
/**
 * @brief Get election enable or not
 * 
 * @return TRUE on enable, False on disable
 */

Func gw_active_set_ext_param

OPERATE_RET gw_active_set_ext_param(IN CHAR_T *param);
/**
 * @brief Set extension params for activation
 * 
 * @param[in] param Extension params
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_active_get_ext_param

CHAR_T * gw_active_get_ext_param(VOID);
/**
 * @brief Get extension params for activation
 * 
 * @return NULL on error
 */

Func gw_active_result_parse

OPERATE_RET gw_active_result_parse(ty_cJSON* result, bool isWifiActive);
/**
 * @brief Parse activation result
 * 
 * @param[in] result Json encoded activation result
 * @param[in] isWifiActive Is activated by Wi-Fi or not
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func set_gw_active

VOID set_gw_active(GW_WORK_STAT_T stat);
/**
 * @brief Set activation state
 * 
 * @param[in] stat Work state, see GW_WORK_STAT_T
 */

Func get_gw_active

GW_WORK_STAT_T get_gw_active(VOID);
/**
 * @brief Get activation state
 * 
 * @return Work state, see GW_WORK_STAT_T
 */

Func tuya_iot_dev_activated

OPERATE_RET tuya_iot_dev_activated(VOID);
/**
 * @brief Device is activated, and begin to launch
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_iot_dev_update_attachs

OPERATE_RET tuya_iot_dev_update_attachs(UINT_T attr_num, GW_ATTACH_ATTR_T *attrs);
/**
 * @brief Update versions of all attach modules.
 *
 * @param[in] attr_num Count of attach modules
 * @param[in] attrs Attributes of attach modules
 *
 * @note This API is used for attach modules updating in case of dynamic add/remove/update.
 * Info of main netlink module will also be included when upload.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_iot_dev_set_attach_attr

OPERATE_RET tuya_iot_dev_set_attach_attr(GW_PERMIT_DEV_TP_T tp, GW_ATTACH_ATTR_T * attr);


      

Func tuya_iot_dev_get_attach_attr

OPERATE_RET tuya_iot_dev_get_attach_attr(GW_PERMIT_DEV_TP_T tp, GW_ATTACH_ATTR_T * attr);


      

Func gw_upload_rst_log_set

VOID gw_upload_rst_log_set(IN CONST BOOL_T upload);
/**
 * @brief Enable reset log upload or not
 *
 * @param[in] upload Enable or not
 */

Func gw_oem_set

VOID gw_oem_set(IN CONST BOOL_T oem);
/**
 * @brief Enable oem or not
 *
 * @param[in] oem Enable or not
 */

Func is_gw_oem

BOOL_T is_gw_oem(VOID);
/**
 * @brief Whether oem is enabled or not
 *
 * @return TRUE on positive, FALSE on negative
 */

Func gw_update_versions

OPERATE_RET gw_update_versions(VOID);
/**
 * @brief Force to upload all versions
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_ctrl_write_stride

VOID gw_ctrl_write_stride(VOID);
/**
 * @brief Write stride info
 */

Func gw_ctrl_reset_stride

VOID gw_ctrl_reset_stride(VOID);
/**
 * @brief reset stride info
 */

Func gw_ctrl_update_stride

VOID gw_ctrl_update_stride(VOID);
/**
 * @brief Update stride info
 */

Func tuya_devos_netcfg_init

OPERATE_RET tuya_devos_netcfg_init(tuya_netcfg_t *param);
/**
 * @brief Initialize network configuration module
 * 
 * @param[in] param Init param, see tuya_netcfg_t
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_devos_netcfg_start

OPERATE_RET tuya_devos_netcfg_start(VOID);
/**
 * @brief Start network config
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_devos_netcfg_stop

OPERATE_RET tuya_devos_netcfg_stop(VOID);
/**
 * @brief Stop network config
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_devos_netcfg_validate

OPERATE_RET tuya_devos_netcfg_validate(VOID);
/**
 * @brief Validate network config status
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func set_wf_cfg_timeout

VOID set_wf_cfg_timeout(UINT_T timeout_s);
/**
 * @brief Set Wi-Fi configuration timeout
 * 
 * @param[in] timeout_s Timeout(unit s), default 15 min
 */

Func set_ap_cfg_info

VOID set_ap_cfg_info(WF_AP_CFG_IF_S *cfg);
/**
 * @brief Set information for AP config
 * 
 * @param[in] cfg AP config, see WF_AP_CFG_IF_S
 */

Func gw_write_wf_start_mode

VOID gw_write_wf_start_mode(GW_WF_START_MODE wf_start_mode);
/**
 * @brief Set network start mode
 * 
 * @param[in] wf_start_mode Network start mode, see GW_WF_START_MODE
 */

Func gw_fast_get_nc_type

OPERATE_RET gw_fast_get_nc_type(GW_WF_NWC_FAST_STAT_T *nc_type);
/**
 * @brief Get network configuration type
 * 
 * @param[out] nc_type Network configuration type, see GW_WF_NWC_FAST_STAT_T

 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func set_user_def_ap_if

OPERATE_RET set_user_def_ap_if(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd);
/**
 * @brief Set device AP config
 * 
 * @param[out] ssid SSID to connect
 * @param[out] passwd Password of AP

 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_dev_ap_if

OPERATE_RET get_dev_ap_if(OUT CHAR_T* ssid, OUT CHAR_T* passwd);
/**
 * @brief Get device AP config
 * 
 * @param[out] ssid SSID to connect
 * @param[out] passwd Password of AP

 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func set_max_sta_conn

VOID set_max_sta_conn(IN CONST UCHAR_T max_conn);
/**
 * @brief Set maximum of clients that are allowed to connect this device
 * 
 * @param[in] max_conn Max count
 */

Func set_nw_ip

VOID set_nw_ip(IN CONST CHAR_T* ip, IN CONST CHAR_T* mask, IN CONST CHAR_T* gw);
/**
 * @brief Set device network info
 * 
 * @param[in] ip IP addr.
 * @param[in] gw Gateway addr.
 * @param[in] mask Network mask
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_wf_gw_nw_cfg_err_code

OPERATE_RET get_wf_gw_nw_cfg_err_code(OUT NW_CFG_ERR_CODE_E *nw_cfg_err_code);
/**
 * @brief Get network configuration error code
 * 
 * @param[out] nw_cfg_err_code Error code, see NW_CFG_ERR_CODE_E
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_wifi_user_cfg

OPERATE_RET gw_wifi_user_cfg(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd,IN CONST CHAR_T *token);
/**
 * @brief Configure network with user defined params
 * 
 * @param[in] ssid SSID to connect
 * @param[in] passwd Password of AP
 * @param[in] token The token
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_user_token_bind

OPERATE_RET gw_user_token_bind(IN CONST CHAR_T *token);
/**
 * @brief Set network configuration token
 * 
 * @param[in] token Token got from network configuration
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_reset_nc_type

VOID gw_reset_nc_type(IN CONST GW_WF_CFG_MTHD_SEL mthd,INOUT GW_WORK_STAT_MAG_S *gw_wsm);
/**
 * @brief Reset work state according to network configuration method
 * 
 * @param[in] mthd Network configuration method, see GW_WF_CFG_MTHD_SEL
 * @param[in,out] gw_wsm Work state, see GW_WORK_STAT_MAG_S
 */

Func gw_check_wechat_mode

BOOL_T gw_check_wechat_mode(VOID);
/**
 * @brief Whether in wechat network configuration or not
 * 
 * @return TRUE on positive, FALSE on negative
 */

Func gw_rept_netcfg_type

VOID gw_rept_netcfg_type(AP_CFG_ERR_CODE err_code);
/**
 * @brief Error dispatch when network configuration fail
 * 
 * @param[in] err_code Error code, see AP_CFG_ERR_CODE
 */

Func gw_ble_actived_add_wifi_info

OPERATE_RET gw_ble_actived_add_wifi_info(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd,IN CONST CHAR_T *region,IN CONST CHAR_T *env );
/**
 * @brief Connect Wi-Fi with given ssid and password, together with runtime region and env
 * 
 * @param[in] ssid SSID to connect
 * @param[in] passwd Password of AP
 * @param[in] region Device runtime region
 * @param[in] env Device runtime environment
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tuya_devos_netlink_init(tuya_netlink_t *param);
/**
 * @brief Initialize network linkage module
 * 
 * @param[in] param Init param, see tuya_netlink_t
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tuya_devos_netlink_start(VOID);
/**
 * @brief Start network linkage module
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tuya_devos_netlink_stop(VOID);
/**
 * @brief Stop network linkage module
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tuya_devos_netlink_monitor_enable(VOID);
/**
 * @brief Enable network linkage monitor
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tuya_devos_netlink_monitor_disable(VOID);
/**
 * @brief Disable network linkage monitor
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_base_gw_nw_status

OPERATE_RET get_base_gw_nw_status(OUT GW_BASE_NW_STAT_T *nw_stat);
/**
 * @brief Get device network linkage state
 * 
 * @param[out] nw_stat Linkage state, see GW_BASE_NW_STAT_T
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_wired_wifi_gw_net_mode

VOID get_wired_wifi_gw_net_mode(OUT IOT_GW_NET_TYPE_T *net_mode);
/**
 * @brief Get device network state
 * 
 * @param[out] nw_stat Network state, see IOT_GW_NET_TYPE_T
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_wired_wifi_current_net

VOID get_wired_wifi_current_net(OUT CUR_NET_STATUS_T *current_net);
/**
 * @brief Get network concurrent state
 * 
 * @param[out] nw_stat Concurrent state, see CUR_NET_STATUS_T
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func set_wired_wifi_current_net

VOID set_wired_wifi_current_net(IN CUR_NET_STATUS_T current_net);
/**
 * @brief Set network concurrent state
 * 
 * @param[in] nw_stat Concurrent state, see CUR_NET_STATUS_T
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_base_gw_nw_status

OPERATE_RET get_base_gw_nw_status(OUT GW_BASE_NW_STAT_T *nw_stat);
/**
 * @brief Get device network linkage state
 * 
 * @param[out] nw_stat Linkage state, see GW_BASE_NW_STAT_T
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_gw_nw_status

GW_NW_STAT_T get_gw_nw_status(VOID);
/**
 * @brief Get device network linkage state
 * 
 * @param[out] nw_stat Linkage state, see GW_NW_STAT_T
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_wf_gw_nw_status

OPERATE_RET get_wf_gw_nw_status(OUT GW_WIFI_NW_STAT_E *nw_stat);
/**
 * @brief Get device network state
 * 
 * @param[out] nw_stat Network state, see GW_WIFI_NW_STAT_E
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_wifi_modify_and_conn

OPERATE_RET gw_wifi_modify_and_conn(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd);
/**
 * @brief Connect Wi-Fi with given ssid and password
 * 
 * @param[in] ssid SSID to connect
 * @param[in] passwd Password of AP
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_get_ip

OPERATE_RET gw_get_ip(NW_IP_S *p_ip);
/**
 * @brief Get device IP
 * 
 * @param[out] p_ip Device IP, see NW_IP_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_get_mac

OPERATE_RET gw_get_mac(NW_MAC_S *p_mac);
/**
 * @brief Get device MAC
 * 
 * @param[out] p_mac Device MAC, see NW_MAC_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_get_rssi

OPERATE_RET gw_get_rssi(SCHAR_T *p_rssi);
/**
 * @brief Get device RSSI level
 * 
 * @param[out] p_rssi Device RSSI level, if(*p_rssi == 99) then do't support get RSSI
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_devos_reset_init

OPERATE_RET tuya_devos_reset_init(tuya_reset_t *param);
/**
 * @brief Initialize reset module
 * 
 * @param[in] param See tuya_reset_t
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_fast_unactive

OPERATE_RET gw_fast_unactive(IN CONST GW_WF_CFG_MTHD_SEL mthd,IN CONST GW_WF_START_MODE wifi_start_mode);
/**
 * @brief Faset reset device to register state
 * 
 * @param[in] mthd Wi-Fi netconfig method, see GW_WF_CFG_MTHD_SEL
 * @param[in] wifi_start_mode Wi-Fi start mode, see GW_WF_START_MODE
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_unregister

OPERATE_RET gw_unregister(IN CONST GW_RESET_S *rst_t);
/**
 * @brief Reset device to unregister state
 * 
 * @param[in] rst_t Reset type, see GW_RESET_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_unactive

OPERATE_RET gw_unactive(IN CONST GW_RESET_S *rst_t);
/**
 * @brief Reset device to register state
 * 
 * @param[in] rst_t Reset type, see GW_RESET_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_load_sum_time_zone_tbl

OPERATE_RET gw_load_sum_time_zone_tbl(IN CONST CHAR_T *tm_zone);
/**
 * @brief Load summer timezone talbe
 * 
 * @param[in] tm_zone Summer timezone table
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func gw_dp_flow_ctrl_cfg_proc

CHAR_T* gw_dp_flow_ctrl_cfg_proc(ty_cJSON* result);
/**
 * @brief Parse DP flow control rules
 * 
 * @param[in] result Json encoded flow control rules
 * 
 * @return Buffer of flow control rules, NULL on error
 */

Func tuya_get_serialno

CHAR_T *tuya_get_serialno(VOID);
/**
 * @brief Get serial number
 * 
 * @return Buffer of serial number, NULL on error
 */

Func tuya_cpu_set_lp_mode

VOID tuya_cpu_set_lp_mode(BOOL_T lp_enable);
/**
 * @brief Set CPU lowpower mode
 * 
 * @param[in] lp_enable CPU lowpower is enable or not
 */

Func tuya_cpu_get_lp_mode

BOOL_T tuya_cpu_get_lp_mode(VOID);
/**
 * @brief Get CPU lowpower mode
 * 
 * @return TRUE on lowpower, FALSE on normal
 */

Func ty_init_rtc

OPERATE_RET ty_init_rtc(INT_T timeval);
/**
 * @brief Initialize rtc module
 * 
 * @param[in] timeval Time interval to update local time
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func set_gw_ext_stat

VOID set_gw_ext_stat(IN CONST GW_EXT_STAT_T ext_stat);
/**
 * @brief Set DevOS extension state
 * 
 * @param[in] ext_stat Extension state, see GW_EXT_STAT_T
 */

Func get_gw_ext_stat

GW_EXT_STAT_T get_gw_ext_stat(VOID);
/**
 * @brief Get DevOS extension state
 * 
 * @return Extension state, see GW_EXT_STAT_T
 */

Func gw_register_cbs

VOID gw_register_cbs(IN CONST TY_IOT_CBS_S *cbs);
/**
 * @brief Set DevOS event handlers
 * 
 * @param[in] cbs Handler of event, see TY_IOT_CBS_S
 */

Func wd_gw_base_if_write

OPERATE_RET wd_gw_base_if_write(IN GW_BASE_IF_S *bi);
/**
 * @brief Save base info into storage
 * 
 * @param[in] bi Base info, see GW_BASE_IF_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_base_if_read

OPERATE_RET wd_gw_base_if_read(OUT GW_BASE_IF_S *bi);
/**
 * @brief Read base info from storage
 * 
 * @param[out] bi Base info, see GW_BASE_IF_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_wsm_write

OPERATE_RET wd_gw_wsm_write(IN GW_WORK_STAT_MAG_S *wsm);
/**
 * @brief Save work state info into storage
 * 
 * @param[in] wsm Work state info, see GW_WORK_STAT_MAG_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_wsm_read

OPERATE_RET wd_gw_wsm_read(OUT GW_WORK_STAT_MAG_S *wsm);
/**
 * @brief Read work state info from storage
 * 
 * @param[out] wsm Work state info, see GW_WORK_STAT_MAG_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_desc_if_write

OPERATE_RET wd_gw_desc_if_write(IN GW_DESC_IF_S *di);
/**
 * @brief Save description info into storage
 * 
 * @param[in] ai Description info, see GW_DESC_IF_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_desc_if_read

OPERATE_RET wd_gw_desc_if_read(OUT GW_DESC_IF_S *di);
/**
 * @brief Read description info from storage
 * 
 * @param[out] di Description info, see GW_DESC_IF_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_desc_if_delete

OPERATE_RET wd_gw_desc_if_delete(VOID_T);
/**
 * @brief Delete description info from storage
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_actv_if_write

OPERATE_RET wd_gw_actv_if_write(IN GW_ACTV_IF_S *ai);
/**
 * @brief Save activation info into storage
 * 
 * @param[in] ai Activation info, see GW_ACTV_IF_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_actv_if_read

OPERATE_RET wd_gw_actv_if_read(OUT GW_ACTV_IF_S *ai);
/**
 * @brief Read activation info from storage
 * 
 * @param[in] ai Activation info, see GW_ACTV_IF_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_schema_write

OPERATE_RET wd_gw_schema_write(IN CONST CHAR_T *s_id,IN CONST CHAR_T *schema);
/**
 * @brief Save schema info into storage
 * 
 * @param[in] s_id Schema ID
 * @param[in] schema Schema buffer
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_schema_read

OPERATE_RET wd_gw_schema_read(IN CONST CHAR_T *s_id,OUT CHAR_T **schema);
/**
 * @brief Read schema info from storage
 * 
 * @param[in] s_id Schema ID
 * @param[out] schema Schema buffer
 * 
 * @note Caller shall free schema buffer manualy
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_schema_delete

OPERATE_RET wd_gw_schema_delete(IN CONST CHAR_T *s_id);
/**
 * @brief Delete schema and its version from storage
 * 
 * @param[in] s_id Schema ID
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_schema_write_ver

OPERATE_RET wd_gw_schema_write_ver(IN CONST CHAR_T *s_id,IN CONST CHAR_T *ver);
/**
 * @brief Save schema version into storage
 * 
 * @param[in] s_id Schema ID
 * @param[in] ver Schema version buffer
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_gw_schema_read_ver

OPERATE_RET wd_gw_schema_read_ver(IN CONST CHAR_T *s_id,OUT CHAR_T **ver);
/**
 * @brief Read schema version from storage
 * 
 * @param[in] s_id Schema ID
 * @param[out] ver Schema version buffer
 * 
 * @note Caller shall free schema version buffer manualy
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func smart_frame_init

OPERATE_RET smart_frame_init(VOID);
/**
 * @brief Smart frame init
 *
 * @param VOID
 *
 * @note This API is used for initializing the resource of smart frame
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sf_send_gw_dev_cmd

OPERATE_RET sf_send_gw_dev_cmd(IN SF_GW_DEV_CMD_S *gd_cmd);
/**
 * @brief Send dp command
 *
 * @param[in] gd_cmd: dp command information
 *
 * @note This API is used for sending dp command from mqtt/lan/bt
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sf_start_sync_obj_dp

VOID sf_start_sync_obj_dp(VOID);
/**
 * @brief Start to synchronize dp data
 *
 * @param VOID
 *
 * @note This API is used to start a timer task to synchronize dp data to the cloud/app
 *
 * @return VOID
 */

Func sf_pack_local_obj_dp_data

CHAR_T *sf_pack_local_obj_dp_data(IN DEV_CNTL_N_S *dev_cntl, IN CONST UINT_T max_len, IN CONST BOOL_T addDevId, OUT BOOL_T *p_all_data_packed, BOOL_T reset_flow_ctl, IN CONST BOOL_T is_lan);
/**
 * @brief Packed the local dp data as string in json format
 *
 * @param[in] dev_cntl: device control handle
 * @param[in] max_len: max lenth of the dp string
 * @param[in] addDevId: if add devid or not
 * @param[out] p_all_data_packed: if all dp is packed or not
 * @param[in] reset_flow_ctl: if need reset flow control or not
 * @param[in] is_lan: if be lan or not
 *
 * @note This API is used for packing the local dp data as string in json format
 *
 * @return the dp string in json format
 */

Func sf_get_serial_no

UINT_T sf_get_serial_no(VOID);
/**
 * @brief Get serial number for dp report 
 *
 * @param VOID
 *
 * @note This API is used for getting serial number for dp report 
 *
 * @return the serial number
 */

Func sf_respone_obj_dp_query

OPERATE_RET sf_respone_obj_dp_query(IN CONST ty_cJSON *pCidArr, IN CONST ty_cJSON *pDpIdArr);
/**
 * @brief Response for dp query
 *
 * @param[in] pCidArr: cid in json format
 * @param[in] pDpIdArr: dp id in json format
 *
 * @note This API is used for response for dp query
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sf_dp_data_is_equl

BOOL_T sf_dp_data_is_equl(IN ty_cJSON *dp_cmd);
/**
 * @brief Check the dp data is same
 *
 * @param[in] dp_cmd: dp information in josn format
 *
 * @note This API is used for checking the dp data is same.
 *
 * @return the result whether the dp data is same.
 */

Func sf_special_dp_register_cb

OPERATE_RET sf_special_dp_register_cb(IN sf_special_dp_cb handler);
/**
 * @brief Register special dp callback function
 *
 * @param[in] handler: special dp callback function
 *
 * @note This API is used to register special dp callback function.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sf_dp_low_power_query

OPERATE_RET sf_dp_low_power_query(IN CONST UCHAR_T *dps, IN CONST UINT_T cnt, 
                                          OUT TY_RECV_OBJ_DP_S **obj_dps, OUT TY_RECV_RAW_DP_S **raw_dps);
/**
 * @brief Query dp for low power
 *
 * @param[in] dps: dp string
 * @param[in] cnt: dp count
 * @param[out] obj_dps: dp in object format
 * @param[out] raw_dps: dp in raw format
 *
 * @note This API is used for quering dp for low power
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sf_trans_type_register_cb

OPERATE_RET sf_trans_type_register_cb(IN CONST DP_TRANS_TYPE_T trans, IN sf_trans_type_cb handler);
/**
 * @brief Register callback function for different kind of transport type
 *
 * @param[in] trans: transport type
 * @param[in] handler: callback function
 *
 * @note This API is used for registering callback function for different kind of transport type
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sf_dp_set_delete_null_dp

OPERATE_RET sf_dp_set_delete_null_dp(BOOL_T enable);
/**
 * @brief Set enable switch for deleting null dp 
 *
 * @param[in] enable: enable switch
 *
 * @note This API is used for setting enable switch for deleting null dp.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sf_dp_set_report_timeout

OPERATE_RET sf_dp_set_report_timeout(UINT_T timeout_s);
/**
 * @brief Set default dp report timeout 
 *
 * @param[in] timeout_s: in second
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sf_subdev_register_cb

OPERATE_RET sf_subdev_register_cb(IN SF_SUBDEV_HANDLE_CB_S *cbs);
/**
 * @brief Register callback function for subdevice
 *
 * @param[in] cbs: callback functions
 *
 * @note This API is used for registering  callback function for subdevice
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_print_dp_time

VOID_T ty_print_dp_time(VOID_T);
/**
 * @brief Print the key time for dp report
 *
 * @param VOID
 *
 * @note This API is used to print the key time for dp report
 *
 * @return VOID
 */

Func sf_regist_dp_rept_cb

OPERATE_RET sf_regist_dp_rept_cb(IN DP_REPT_HADLE_CB_S* dp_rept_cbs);
/**
 * @brief Register callback function for dp report
 *
 * @param[in] dp_rept_cbs: callback functions
 *
 * @note This API is used for registering callback function for dp report.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_dp_report

OPERATE_RET ty_dp_report(IN CONST DP_REPT_TYPE_E dp_rept_type, IN VOID_T* dp_rept,IN CONST BOOL_T is_query);
/**
 * @brief Report dp data
 *
 * @param[in] dp_rept_type: dp report type
 * @param[in] dp_rept: dp report data
 * @param[in] is_query: if query interface or not
 *
 * @note This API is used for reporting dp data.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_get_obj_dp_from_json

OPERATE_RET ty_get_obj_dp_from_json(IN CHAR_T *dev_id, IN CONST CHAR_T *json_str, OUT TY_OBJ_DP_S **dp_data, OUT UINT_T *cnt);
/**
 * @brief ty_dp_json_to_obj 
 * @desc transfer json format dp to object
 *
 * @param[in] dev_id: if sub-device, then devid = sub-device_id
 *                if gateway/soc/mcu, then devid = NULL
 * @param[in] json_str: string in json format
 * @param[OUT] dp_data: dp array header
 * @param[OUT] cnt: dp array count
 *
 * @note This API is used to transfer json format dp to object. 
 * Memory of dp_data need to be freed.
 *
 * @return OPRT_OK: success  Other: fail
 */

Func ty_free_obj_dp_data

VOID_T ty_free_obj_dp_data(TY_OBJ_DP_S* dp_data, UINT_T cnt);
/**
 * @brief ty_free_obj_dp_data 
 * @desc free memory of object dp
 *
 * @param[in] dp_data: dp data
 * @param[in] cnt: dp count
 *
 * @note This API is used to free memory of object dp. 
 *
 * @return VOID
 */

Func ty_set_dp_rept_chan

OPERATE_RET ty_set_dp_rept_chan(IN UINT8_T chan[], UINT8_T cnt, BOOL_T only);
/**
 * @brief Set report channel for dp
 *
 * @param[in] chan: array of channel for dp report, refer to TY_DP_REPT_CHAN_TP_T
 * @param[in] cnt: count of array member
 * @param[in] only: report dp on the only first channel
 *
 * @note This API is used for setting report channel for dp. this API should be called before or during device initialization.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_get_dp_rept_chan

UINT8_T* ty_get_dp_rept_chan(UINT8_T* cnt);
/**
 * @brief Get report channel for dp
 *
 * @param[out] cnt: count of array member
 *
 * @note This API is used for getting report channel for dp. this API should be called after device initialization.
 *
 * @return array of dp channels
 */

Func httpc_common_post_no_remalloc

OPERATE_RET httpc_common_post_no_remalloc(IN CONST CHAR_T *api_name, IN CONST CHAR_T *api_ver, IN CONST CHAR_T *uuid, IN CONST CHAR_T *devid, IN CHAR_T *post_data, IN UINT_T data_total_len,IN CONST CHAR_T *p_head_other, OUT ty_cJSON **pp_result);
/**
 * @brief POST HTTP request without memory realloc
 * 
 * @param[in] api_name Name of API
 * @param[in] api_ver Version of API
 * @param[in] uuid UUID of device
 * @param[in] devid ID of device
 * @param[in] post_data Pointer to data
 * @param[in] data_total_len Length of data
 * @param[in] p_head_other Additional header to send
 * @param[out] pp_result Json encoded result
 * 
 * @note Caller ot this API shall ensure data buffer is bigger enough to include data padding
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_common_post

OPERATE_RET httpc_common_post(IN CONST CHAR_T *api_name, IN CONST CHAR_T *api_ver, IN CONST CHAR_T *uuid, IN CONST CHAR_T *devid, IN CHAR_T *post_data, IN CONST CHAR_T *p_head_other, OUT ty_cJSON **pp_result);
/**
 * @brief POST HTTP request
 * 
 * @param[in] api_name Name of API
 * @param[in] api_ver Version of API
 * @param[in] uuid UUID of device
 * @param[in] devid ID of device
 * @param[in] post_data Pointer to data
 * @param[in] p_head_other Additional header to send
 * @param[out] pp_result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_get_timer_cnt

OPERATE_RET http_gw_get_timer_cnt(IN CONST INT_T lastFetchTime, OUT ty_cJSON **result);
/**
 * @brief Get the count of local timers
 * 
 * @param[in] lastFetchTime Last fetch time returned
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_get_timer_content

OPERATE_RET http_gw_get_timer_content(IN CONST INT_T offset, IN CONST INT_T limit, OUT ty_cJSON **result);
/**
 * @brief Get content local timers
 * 
 * @param[in] offset Timer index
 * @param[in] limit Max count of timers
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_gw_extra_erro_code_tranfer

OPERATE_RET httpc_gw_extra_erro_code_tranfer(char *ErroValu);
/**
 * @brief Transfer HTTP error string to error code
 * 
 * @param[in] ErroValu HTTP error state
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_reset

OPERATE_RET http_gw_reset(IN CONST GW_WORK_STAT_T stat);
/**
 * @brief Reset device
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_iot_dns_get_cloud_url

OPERATE_RET http_iot_dns_get_cloud_url(VOID);
/**
 * @brief Retrieve URLs from TUYA IoT DNS service, device will use URLs to interact with
 * TUYA cloud later on
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_iot_dns_get_fast_cloud_url

OPERATE_RET http_iot_dns_get_fast_cloud_url(CHAR_T *env);
/**
 * @brief Retrieve special URLs from TUYA IoT DNS service, device will use URLs to interact with
 * TUYA cloud later on
 * 
 * @param[in] env Device runtime env
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_iot_dns_cache_cloud_url

VOID http_iot_dns_cache_cloud_url(VOID);
/**
 * @brief Load URLs and related Ips of TUYA cloud to DNS cache
 *
 */

Func http_iot_dns_get_host_ip

OPERATE_RET http_iot_dns_get_host_ip(IN CONST CHAR_T *domain, OUT ty_cJSON **result);
/**
 * @brief Use TUYA IoT DNS service to translate domain to ip
 * 
 * @param[in] domain Domain name
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_register_V41

OPERATE_RET http_gw_register_V41(OUT ty_cJSON **result);
/**
 * @brief Register a device on TUYA cloud
 * 
 * @param[out] result Json encoded result
 * 
 * @note This API is deprecated
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_active_v41

OPERATE_RET http_gw_active_v41(OUT ty_cJSON **result);
/**
 * @brief Register and active a device on TUYA cloud
 * 
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_active_mesh

OPERATE_RET http_gw_active_mesh(IN CONST CHAR_T *data, OUT ty_cJSON **result);
/**
 * @brief Dynamic mesh gw Register and active a device on TUYA cloud
 * 
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_update_version_v41

OPERATE_RET http_gw_update_version_v41(VOID);
/**
 * @brief Update versions of device on TUYA cloud
 * 
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_ffs_pre_active

OPERATE_RET http_ffs_pre_active(IN CONST CHAR_T *wss_token, IN CONST CHAR_T*gw_endpoint);
/**
 * @brief Pre-active of FFS netcfg
 * 
 * @param[in] wss_token wss token
 * @param[in] gw_endpoint gateway endpoint
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_download_file

OPERATE_RET http_gw_download_file(IN CONST CHAR_T *url,IN CONST UINT_T mlk_buf_len,\
                                 IN CONST HTTP_GW_GET_FILE_DATA_CB gfd_cb, IN PVOID_T priv_data, \
                                 IN CONST UINT_T total_len, IN CONST BYTE_T *p_key, IN CONST UINT_T key_len, INOUT BYTE_T file_hmac[32]);
/**
 * @brief Download file
 * 
 * @param[in] url URL of the file to download
 * @param[in] mlk_buf_len block size of dowload buffer
 * @param[in] gfd_cb Hander when download file
 * @param[in] priv_data Private data
 * @param[in] total_len Total length of file
 * @param[in] p_key HTTP decode key
 * @param[in] key_len Lenght od decode key
 * @param[in,out] file_hmac HMAC of download file
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wechat_gw_set_cloud_url

OPERATE_RET wechat_gw_set_cloud_url(VOID);


      

Func http_pskkey_get

OPERATE_RET http_pskkey_get(OUT ty_cJSON **result);
/**
 * @brief Retrieve PSK key
 * 
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_put_rst_log

OPERATE_RET http_put_rst_log(VOID);
/**
 * @brief Upload information of device reset to TUYA cloud
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_dynamic_cfg_get

OPERATE_RET http_dynamic_cfg_get(IN CONST HTTP_DYNAMIC_CFG_TYPE type, OUT ty_cJSON **result);
/**
 * @brief Retrieve dynamic config
 * 
 * @param[in] type Defined by HTTP_DYNAMIC_CFG_TYPE
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_dynamic_cfg_ack_v20

OPERATE_RET http_dynamic_cfg_ack_v20(IN CONST CHAR_T* timezone_ackId, IN CONST CHAR_T* rateRule_actId);
/**
 * @brief ACK of dynamic config(some configs need ack to ensure it is handled correctly)
 * 
 * @param[in] timezone_ackId ACK id of timezone
 * @param[in] rateRule_actId ACK id of dp rate rule
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_domain_certs_get

OPERATE_RET httpc_domain_certs_get(OUT ty_cJSON **result, IN CONST CHAR_T *url_msg);
/**
 * @brief Retrieve certs of special domain
 * 
 * @param[in] url_msg Domain name to get certs
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_put_cloud_config

OPERATE_RET http_put_cloud_config(IN CONST CHAR_T *data);
/**
 * @brief Upload config to TUYA cloud
 * 
 * @param[in] data Private data to upload
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_property_save

OPERATE_RET http_gw_property_save(IN CONST CHAR_T *data);
/**
 * @brief Save property to TUYA cloud
 * 
 * @param[in] data Private data to upload
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_dev_sync_check

OPERATE_RET http_gw_dev_sync_check(DEV_SYNC_STATUS_E *p_status);
/**
 * @brief Retrieve device status
 * 
 * @param[out] p_status Device status on TUYA cloud, defined by DEV_SYNC_STATUS_E
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_dev_sync_proc

OPERATE_RET http_gw_dev_sync_proc(VOID_T);
/**
 * @brief Sync device status
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_secure_verify_v20

OPERATE_RET http_secure_verify_v20(IN CONST CHAR_T *chipId, IN CONST CHAR_T *secureCode1, IN CONST CHAR_T *randomA, \
                IN CONST CHAR_T *token, IN CONST CHAR_T *region, OUT ty_cJSON **result);
/**
 * @brief Verify secure chip status
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_iot_certificate_get_v10

OPERATE_RET httpc_iot_certificate_get_v10(OUT cJSON **result,IN CONST CHAR_T *url_msg);
/**
 * @brief Retrieve certs of special domain
 * 
 * @param[in] url_msg Domain name to get certs
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_iot_cloud_storage_encrypt_key_get

OPERATE_RET httpc_iot_cloud_storage_encrypt_key_get(OUT cJSON **result);
/**
 * @brief Retrieve encrypt key of cloud storage
 * 
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_custom_cfg_get

OPERATE_RET http_gw_custom_cfg_get(IN CONST INT_T biztype, OUT ty_cJSON **result);
/**
 * @brief Retrieve customized config
 * 
 * @param[in] biztype Customized key
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_get_active_info

OPERATE_RET http_gw_get_active_info(OUT ty_cJSON **result);
/**
 * @brief Register and active a device on TUYA cloud
 * 
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_gw_location_info_get

OPERATE_RET http_gw_location_info_get(OUT ty_cJSON **result);
/**
 * @brief Retrieve location info
 * 
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_raw_read_resp_header

OPERATE_RET httpc_raw_read_resp_header(INOUT RAW_HTTP_S p_raw_http, OUT INT_T *p_status_code, OUT BOOL_T *p_chunked, OUT UINT_T *p_content_len);
/**
 * @brief Read header of raw HTTP respose
 * 
 * @param[in,out] pp_raw_http Pointer to RAW_HTTP_S
 * @param[out] p_status_code Status code from HTTP response
 * @param[out] p_chunked Data is chunk or not
 * @param[out] p_content_len Total length of response content
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_raw_read_content

INT_T httpc_raw_read_content(IN RAW_HTTP_S p_raw_http, IN BYTE_T *buf, IN CONST UINT_T buf_len);
/**
 * @brief Read content of raw HTTP response
 * 
 * @param[in] pp_raw_http Pointer to RAW_HTTP_S
 * @param[in] buf Pointer of data to write
 * @param[in] buf_len Length of buffer
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_raw_write_content

INT_T httpc_raw_write_content(IN RAW_HTTP_S p_raw_http, IN CONST BYTE_T *buf, IN CONST UINT_T buf_len, BOOL_T chunked);
/**
 * @brief Write raw HTTP request
 * 
 * @param[in] pp_raw_http Pointer to RAW_HTTP_S
 * @param[in] buf Pointer of data to write
 * @param[in] buf_len Length of buffer
 * @param[in] chunked Is chunk enabled
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_raw_close

OPERATE_RET httpc_raw_close(IN RAW_HTTP_S p_raw_http);
/**
 * @brief Close raw HTTP request
 * 
 * @param[in] pp_raw_http Pointer to RAW_HTTP_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_raw_post

OPERATE_RET httpc_raw_post(IN CONST CHAR_T *p_url, IN CONST UINT_T data_total_len, INOUT RAW_HTTP_S *pp_raw_http);
/**
 * @brief Raw HTTP POST request
 * 
 * @param[in] p_url URL to request
 * @param[in] data_total_len Total length of raw request
 * @param[in,out] pp_raw_http Pointer to RAW_HTTP_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_raw_get_with_head

OPERATE_RET httpc_raw_get_with_head(IN CONST CHAR_T *p_url, INOUT RAW_HTTP_S *pp_raw_http,
                           IN UINT_T offset, IN UINT_T total_len,
                           IN HTTP_HEAD_ADD_CB add_head_cb,
                           IN VOID* add_head_data);
/**
 * @brief Raw HTTP GET request
 * 
 * @param[in] p_url URL to request
 * @param[in,out] pp_raw_http Pointer to RAW_HTTP_S
 * @param[in] offset Offset of buffer
 * @param[in] total_len Total length of buffer
 * @param[in] add_head_cb Hook before HTTP request sent, to add more HTTP header
 * @param[in] add_head_data Header data of add_head_cb
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_raw_put

OPERATE_RET httpc_raw_put(IN CONST CHAR_T *p_url, IN CONST UINT_T data_total_len, INOUT RAW_HTTP_S *pp_raw_http);
/**
 * @brief Raw HTTP PUT request
 * 
 * @param[in] p_url URL to request
 * @param[in] data_total_len Total length of raw request
 * @param[in,out] pp_raw_http Pointer to RAW_HTTP_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_get_dev_token_create_v20

OPERATE_RET http_get_dev_token_create_v20(OUT ty_cJSON **result);
/**
 * @brief Retrieve token from cloud
 * 
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_active_url

CHAR_T *http_active_url(VOID);
/**
 * @brief Retrieve active HTTP url of TUYA cloud
 * 
 * @return NULL on error.
 */

Func http_url

CHAR_T *http_url(VOID);
/**
 * @brief Retrieve active HTTP url of TUYA cloud
 * 
 * @return NULL on error.
 */

Func httpc_active_shorturl_get

OPERATE_RET httpc_active_shorturl_get(char *uuid, char *appid, ty_cJSON **result);
/**
 * @brief Retrieve short url of QR active
 * 
 * @param[in] uuid UUID of device
 * @param[in] appid ID of app
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_meta_rpt_v10

OPERATE_RET http_meta_rpt_v10(VOID_T);
/**
 * @brief Meta rpt for fittings management
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_ble_actived_enable_wifi

OPERATE_RET http_ble_actived_enable_wifi(VOID);
/**
 * @brief Enalbe wifi after activated by BLE
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_get_ble_beacon_key

OPERATE_RET tuya_get_ble_beacon_key(OUT CHAR_T **beaconKey);


      

Func http_iot_dns_get_host_ca

OPERATE_RET http_iot_dns_get_host_ca(IN DNS_QUERY_S *dns_arr, IN UINT_T arr_num, OUT ty_cJSON **result);
/**
 * @brief Retrieve IPs and Certs of specific domains
 * 
 * @param[in] dns_arr Array of domains
 * @param[in] arr_num Array size of domains
 * @param[out] result Json encoded result
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_ir_clear_irtime

VOID tuya_ir_clear_irtime(VOID);
/**
 * @brief tuya_ir_clear_irtime 
 *
 * @return none
 */

Func tuya_ir_get_irtime

BOOL_T tuya_ir_get_irtime(USHORT_T data[], USHORT_T data_len);
/**
 * @brief tuya_ir_get_irtime 
 *
 * @param[in] data[]
 * @param[in] data_len
 *
 * @return BOOL_T
 */

Func tuya_ir_encode_head

BOOL_T tuya_ir_encode_head(USHORT_T feq, USHORT_T data[], USHORT_T data_len, CHAR_T *ir_head, USHORT_T ir_head_size);
/**
 * @brief tuya_ir_encode_head 
 *
 * @param[in] feq
 * @param[in] data[]
 * @param[in] data_len
 * @param[in] ir_head
 * @param[in] ir_head_size
 *
 * @return BOOL_T
 */

Func tuya_ir_encode

BOOL_T tuya_ir_encode(BYTE_T framecount, USHORT_T data[], USHORT_T length, CHAR_T *ir_head, USHORT_T ir_head_size, CHAR_T *ir_key, USHORT_T ir_key_size);
/**
 * @brief tuya_ir_encode 
 * @desc encode
 *
 * @param[in] framecount
 * @param[in] data[]
 * @param[in] length
 * @param[in] ir_head
 * @param[in] ir_head_size
 * @param[in] ir_key
 * @param[in] ir_key_size
 *
 * @return BOOL_T
 */

Func tuya_ir_decode

USHORT_T tuya_ir_decode(CHAR_T *head, CHAR_T *key, USHORT_T *decode_buf, USHORT_T buf_size, BYTE_T *framecount, USHORT_T *feq);
/**
 * @brief tuya_ir_decode 
 * @desc decode
 *
 * @param[in] head
 * @param[in] key
 * @param[in] decode_buf
 * @param[in] buf_size
 * @param[in] framecount
 * @param[in] feq
 *
 * @return USHORT_T
 */

Func tuya_ir_control_register

OPERATE_RET tuya_ir_control_register(IN CONST TY_IR_CONTROL_CBS_S *p_ir_cbs);
/**
 * @brief tuya_ir_control_register 
 *
 * @param[in] p_ir_cbs
 *
 * @return OPERATE_RET
 */

Func tuya_ir_study_code_report

OPERATE_RET tuya_ir_study_code_report(IN CONST USHORT_T *p_code, IN CONST UINT_T code_len);
/**
 * @brief tuya_ir_study_code_report 
 *
 * @param[in] p_code
 * @param[in] code_len
 *
 * @return OPERATE_RET
 */

Func tuya_ir_study_error_report

OPERATE_RET tuya_ir_study_error_report(VOID);
/**
 * @brief tuya_ir_study_error_report 
 *
 * @return OPERATE_RET
 */

Func tuya_ir_code_free

OPERATE_RET tuya_ir_code_free(IN TY_IR_CODE_S *ir_code, IN UCHAR_T code_num);
/**
 * @brief tuya_ir_code_free 
 *
 * @param[in] ir_code
 * @param[in] code_num
 *
 * @return OPERATE_RET
 */

Func tuya_ir_study_stat_report

OPERATE_RET tuya_ir_study_stat_report(IN TY_IR_STUDY_CTL_E mode);
/**
 * @brief tuya_ir_study_stat_report 
 *
 * @param[in] mode
 *
 * @return OPERATE_RET
 */

Func tuya_ir_control_register_v20

OPERATE_RET tuya_ir_control_register_v20(IN CONST TY_IR_COMPRESS_CONTROL_CBS_S *p_ir_cbs);
/** 
 * @brief: tuya_ir_control_register_v20
 * @desc: infrared function init v2.0
 *
 * @param[in] p_ir_cbs: callback of infrared emission and studt
 *
 * @return OPERATE_RET
 */

Func tuya_ir_study_fz_compress_report

OPERATE_RET tuya_ir_study_fz_compress_report(IN CHAR_T *dev_id,IN CONST CHAR_T *p_code, IN CONST UINT_T code_len);
/** 
 * @brief: tuya_ir_study_fz_compress_report
 * @desc: infrared study code compress and report
 *
 * @param[in] p_code: infrared study code
 * @param[in] code_num: length of study code 
 *
 * @return OPERATE_RET
 *
 * @note get the infrared code, compressed by tuya_ir_fastlz_compress(), then used tuya_ir_study_fz_compress_report() to report
 */

Func tuya_ir_lib2timecode

OPERATE_RET tuya_ir_lib2timecode(IN CHAR_T *head,IN CHAR_T *key,INOUT TY_IR_CODE_S **timecode);
/** 
 * @brief: tuya_ir_lib2timecode
 * @desc: decode the headkey information to the struct of infrared time code
 *
 * @param[in] head: head information
 * @param[in] key: key information
 *
 * @return OPERATE_RET
 *
 * @note timecode need free memory by tuya_ir_code_free()
 */

Func tuya_ir_code_free_v20

OPERATE_RET tuya_ir_code_free_v20(IN TY_IR_CODE_V20_S *ir_code, IN UCHAR_T code_num);
/** 
 * @brief: tuya_ir_code_free_v20
 * @desc: free the struct of infrared code
 *
 * @param[in] ir_code: point of infrared code struct
 * @param[in] code_num: total of infrared code struct
 *
 * @return OPERATE_RET
 *
 * @note shulule be use the function free memory after infrared emission
 */

Func tuya_ir_sub_attribute_report

OPERATE_RET tuya_ir_sub_attribute_report(IN TY_IR_INIT_TYPE p_type, IN CHAR_T ir_ver, IN CONST CHAR_T *c_devid);
/** 
 * @brief: tuya_ir_sub_attribute_report
 * @desc: Report infrared subdevice properties
 *
 * @param[in] p_type: Infrared coding type
 * @param[in] ir_ver: Infrared version number(default 0x03)
 * @param[in] c_devid: IR child device id
 * @return OPERATE_RET
 */

Func tuya_ir_report_ir_attr

OPERATE_RET tuya_ir_report_ir_attr(TY_IR_INIT_TYPE type);
/** 
 * @brief: tuya_ir_report_ir_attr
 * @desc: Report infrared device attribute
 *
 * @param[in] TY_IR_INIT_TYPE: Infrared encode type

 * @return OPERATE_RET
 */

Func tuya_rf_control_register

OPERATE_RET tuya_rf_control_register(IN CONST TY_RF_CONTROL_CBS_S *p_ir_cbs);
/** 
 * @brief: tuya_rf_control_register
 * @desc: rf function init
 * @param[in]: p_ir_cbs: point of rf cb struct
 * @return: OPERATE_RET
 * @note :none
 */

Func tuya_rf_study_code_report

OPERATE_RET tuya_rf_study_code_report(IN CONST UCHAR_T *p_code,IN CONST UINT_T code_len,IN CONST UINT_T max_len);
/** 
 * @brief: tuya_rf_study_code_report
 * @desc: Report RF learning data
 * @param[in]: p_code: point of rf learn data
 * @param[in]: code_len: Radio frequency learning data length (unit bytes)
 * @param[in]: max_len: point of rf cb struct
 * @return: OPERATE_RET
 * @note :none
 */

Func tuya_rf_study_stat_report

OPERATE_RET tuya_rf_study_stat_report(IN TY_RF_STUDY_CTL_E mode);
/** 
 * @brief: tuya_rf_study_stat_report
 * @desc: Report radio learning status
 * @param[in]: mode: Radio learning state
 * @return: OPERATE_RET
 * @note :none
 */

Func ws_db_ir_type_mqtt_push_flg_write

OPERATE_RET ws_db_ir_type_mqtt_push_flg_write(CHAR_T ir_init_mode);
/**
* @brief ws_db_ir_type_mqtt_push_flg_write 
*
* @param[in] ir_init_mode
*
* @return OPERATE_RET
*/

Func ws_db_ir_type_mqtt_push_flg_read

OPERATE_RET ws_db_ir_type_mqtt_push_flg_read(INOUT CHAR_T **p_data);
/**
 * @brief ws_db_ir_type_mqtt_push_flg_read 
 *
 * @param[in] p_data
 *
 * @return OPERATE_RET
 */

Func ws_db_ir_type_mqtt_push_judge

BOOL_T ws_db_ir_type_mqtt_push_judge(CHAR_T ir_init_mode);
/**
 * @brief ws_db_ir_type_mqtt_push_judge 
 *
 * @param[in] ir_init_mode
 *
 * @return BOOL_T
 */

Func ak_lan_nwc_fin_inform

OPERATE_RET ak_lan_nwc_fin_inform(IN CONST BYTE_T random);
/**
 * @brief lan fin inform
 *
 * @param[in] random pid
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ak_lan_disc_init

OPERATE_RET ak_lan_disc_init(IN CONST CHAR_T* appid,IN CONST CHAR_T* dev_id);
/**
 * @brief lan disc init
 *
 * @param[in] appid pid
 * @param[in] dev_id dev id
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ak_lan_disc_pack_send

OPERATE_RET ak_lan_disc_pack_send(VOID);
/**
 * @brief lan disc package send
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ak_lan_rev_active_task

VOID ak_lan_rev_active_task(PVOID_T pArg);
/**
 * @brief lan disc package send
 *
 * @param[in] pArg argument
 *
 */

Func get_ak_active_status

INT_T get_ak_active_status(VOID);
/**
 * @brief get status
 *
 * @return status
 */

Func tuya_svc_lan_init

OPERATE_RET tuya_svc_lan_init();
/**
 * @brief lan protocol init
 *
 * @param[in] wechat true/false
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_exit

OPERATE_RET tuya_svc_lan_exit(VOID);
/**
 * @brief lan protocol exit
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_disable

OPERATE_RET tuya_svc_lan_disable(VOID);
/**
 * @brief lan protocol diable
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_enable

OPERATE_RET tuya_svc_lan_enable(VOID);
/**
 * @brief lan protocol enable
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_dp_report

OPERATE_RET tuya_svc_lan_dp_report(IN CONST VOID *data, IN CONST UINT_T len);
/**
 * @brief lan dp report
 *
 * @param[in] data data buf
 * @param[in] len buf length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_data_report

OPERATE_RET tuya_svc_lan_data_report(IN CONST UINT_T fr_type, IN CONST UINT_T ret_code,IN CONST BYTE_T *data, IN CONST UINT_T len);
/**
 * @brief lan dp report callback
 *
 * @param[in] fr_type refer to LAN_PRO_HEAD_APP_S
 * @param[in] ret_code refer to LAN_PRO_HEAD_APP_S
 * @param[in] data refer to LAN_PRO_HEAD_APP_S
 * @param[in] len refer to LAN_PRO_HEAD_APP_S
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_disconnect_all

OPERATE_RET tuya_svc_lan_disconnect_all(VOID);
/**
 * @brief disconnect all sockets
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_get_valid_connections

INT_T tuya_svc_lan_get_valid_connections(VOID);
/**
 * @brief get vaild connect count
 *
 * @return vaild count
 */

Func tuya_svc_lan_cfg

OPERATE_RET tuya_svc_lan_cfg(IN CONST Lan_Cfg_e cfg, IN CONST VOID * data);
/**
 * @brief lan configure
 *
 * @param[in] cfg refer to Lan_Cfg_e
 * @param[in] data buf
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_unregister_cb

OPERATE_RET tuya_svc_lan_unregister_cb(IN UINT_T frame_type);
/**
 * @brief unregister callback
 *
 * @param[in] frame_type refer to LAN_PRO_HEAD_APP_S
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_get_valid_connections

INT_T tuya_svc_lan_get_valid_connections(VOID);
/**
 * @brief judge if lan connect
 *
 * @return TRUE/FALSE
 */

Func tuya_svc_lan_register_cb

OPERATE_RET tuya_svc_lan_register_cb(IN UINT_T frame_type, IN lan_cmd_handler_cb handler);
/**
 * @brief register callback
 *
 * @param[in] frame_type refer to LAN_PRO_HEAD_APP_S
 * @param[in] frame_type refer to lan_cmd_handler_cb
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_pro_cntl_register_cb

OPERATE_RET lan_pro_cntl_register_cb(UINT_T frame_type, lan_cmd_handler_cb handler);
/**
 * @brief register callback
 *
 * @param[in] frame_type refer to LAN_PRO_HEAD_APP_S
 * @param[in] frame_type refer to lan_cmd_handler_cb
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_pro_cntl_unregister_cb

OPERATE_RET lan_pro_cntl_unregister_cb(UINT_T frame_type);
/**
 * @brief unregister callback
 *
 * @param[in] frame_type refer to LAN_PRO_HEAD_APP_S
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_get_client_num

UINT_T tuya_svc_lan_get_client_num(VOID);
/**
 * @brief get lan client number
 *
 * @return client number
 */

Func tuya_svc_lan_ext_proto_reg

OPERATE_RET tuya_svc_lan_ext_proto_reg(CONST CHAR_T *ext_lan_pro, lan_ext_protocol_handler_cb handler);
/**
 * @brief Register extend lan protocol
 *
 * @param[in] ext_lan_pro Protocol string
 * @param[in] handler Protocol handler
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_ext_proto_unreg

OPERATE_RET tuya_svc_lan_ext_proto_unreg(CONST CHAR_T *ext_lan_pro);
/**
 * @brief Unregister extend lan protocol
 *
 * @param[in] ext_lan_pro Protocol string
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_ext_proto_uninit

OPERATE_RET tuya_svc_lan_ext_proto_uninit(VOID);
/**
 * @brief uninit extend lan protocol
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_ext_proto_data_report

OPERATE_RET tuya_svc_lan_ext_proto_data_report(IN CONST VOID *data, IN CONST UINT_T len);
/**
 * @brief extend lan protocol data report
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_lan_register_cb

OPERATE_RET tuya_svc_lan_register_cb(IN UINT_T frame_type, IN lan_cmd_handler_cb handler);
/**
 * @brief register callback
 *
 * @param[in] frame_type refer to LAN_PRO_HEAD_APP_S
 * @param[in] frame_type refer to lan_cmd_handler_cb
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func __lan_parse_data

OPERATE_RET __lan_parse_data(IN BYTE_T *data,IN CONST INT_T len,IN CONST BYTE_T *key,OUT CHAR_T **out_data);
/**
 * @brief decrypt data
 * 
 * @param[in] data encry data
 * @param[in] len encry data length
 * @param[in] key decrypt key
 * @param[out] out_data origin data
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func encrpt_lan_msg

OPERATE_RET encrpt_lan_msg(IN CONST BYTE_T *data,IN CONST UINT_T len,OUT BYTE_T **ec_data,OUT UINT_T *ec_len,IN CONST BYTE_T *key);
/**
 * @brief encry lan message
 * 
 * @param[in] data origin data
 * @param[in] len origin data length
 * @param[in] ec_data encode data
 * @param[in] ec_len encode data length
 * @param[in] key encry key
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func __mlp_gw_send_da

BYTE_T *__mlp_gw_send_da(IN CONST UINT_T fr_num,IN CONST UINT_T fr_type,\
                             IN CONST UINT_T ret_code,IN CONST BYTE_T *data,\
                             IN CONST UINT_T len,OUT UINT_T *s_len);
/**
 * @brief lan protocol send data, the date will package 0x55aa
 * 
 * @param[in] fr_num refer to LAN_PRO_HEAD_GW_S
 * @param[in] fr_type refer to LAN_PRO_HEAD_GW_S
 * @param[in] ret_code refer to LAN_PRO_HEAD_GW_S
 * @param[in] data refer to LAN_PRO_HEAD_GW_S
 * @param[in] len refer to LAN_PRO_HEAD_GW_S
 * @param[in] s_len send data length
 *
 * @return send data buf point
 */

Func lan_cluster_init

OPERATE_RET lan_cluster_init(IN CONST     LAN_NODE_S* node);
//集群功能初始化

Func lan_cluster_get_my_node

OPERATE_RET lan_cluster_get_my_node(OUT       LAN_NODE_S* my_node);
//获取我自己的节点信息

Func lan_cluster_reg_state_cb

OPERATE_RET lan_cluster_reg_state_cb(IN        STATE_CHANGE_CALLBACK cb);
//注册集群中自身状态变化回调

Func lan_cluster_get_state

OPERATE_RET lan_cluster_get_state(OUT NODE_CLS_ST_T *state, OUT LAN_NODE_S *master_node);


      

Func lan_cluster_get_master_keepalive_time

VOID lan_cluster_get_master_keepalive_time(OUT TIME_S* ka_time);
//查询master最近一次保活的时间

Func lan_cluster_init_node_master_status

OPERATE_RET lan_cluster_init_node_master_status();
//记录当前master状态的模块初始化

Func lan_cluster_master_confirm_msg_st2json

VOID lan_cluster_master_confirm_msg_st2json(CONST LAN_NODE_S *msg_node, CHAR_T msg_json[MST_CFM_MSG_MAX_LEN]);
//master广播消息结构体和json的互转

Func lan_cluster_master_confirm_msg_json2st

OPERATE_RET lan_cluster_master_confirm_msg_json2st(CONST CHAR_T *msg_json, LAN_NODE_S *msg_node);


      

Func lan_cluster_has_master_cap

BOOL_T lan_cluster_has_master_cap(USHORT_T cap);
//判断cap的值是否有master能力

Func lan_cluster_has_node_cap

BOOL_T lan_cluster_has_node_cap(USHORT_T cap);
//判断cap的值是否有集群节点能力

Func lan_cluster_init_node_state

OPERATE_RET lan_cluster_init_node_state(IN STATE_CHANGE_CALLBACK_REG cb_reg);


      

Func lan_cluster_lan_rpc_master_get_cb

OPERATE_RET lan_cluster_lan_rpc_master_get_cb(LAN_RPC_MASTER_S *master);
//实现查询当前master节点的回调,lanRPC中使用

Func lan_cluster_status_change_inner2out

VOID lan_cluster_status_change_inner2out(NODE_ST_T new_status_in, const LAN_NODE_S *master_node_in, NODE_CLS_ST_T *new_status_out, LAN_NODE_S *master_node_out);
//实现集群内部维护状态到外部使用者感知状态的转换

Func lan_setup_udp_server_socket

OPERATE_RET lan_setup_udp_server_socket(IN INT_T port, OUT INT_T *fd_out);


      

Func lan_cluster_node_ack

OPERATE_RET lan_cluster_node_ack(IN CONST LAN_NODE_ACK_S *node_array, IN UINT_T node_num);
//集群中节点的合法性由上层业务确认后调用

Func lan_cluster_reg_node_cb

OPERATE_RET lan_cluster_reg_node_cb(IN CLS_NODE_CHANGE_CALLBACK cb);
//注册集群中节点状态变化回调,当前是全量

Func lan_cluster_reg_node_single_cb

OPERATE_RET lan_cluster_reg_node_single_cb(IN CLS_NODE_CHANGE_SINGLE_CALLBACK cb);
//注册集群单个节点状态变化回调

Func lan_cluster_find_node

OPERATE_RET lan_cluster_find_node(IN CONST CHAR_T *id);
//查询节点id是否在集群中

Func lan_dev_base_init

OPERATE_RET lan_dev_base_init(IN CONST CHAR_T * dev_id);


      

Func lan_dev_master_cap

BOOL_T lan_dev_master_cap();


      

Func lan_scene_linkage_master_is_alive

BOOL_T lan_scene_linkage_master_is_alive();


      

Func lan_dev_base_set_cap

VOID lan_dev_base_set_cap(IN USHORT_T cap);
/***********************************************************
*************************function define********************
***********************************************************/

Func lan_dev_base_module_init

OPERATE_RET lan_dev_base_module_init(IN CONST CHAR_T * dev_id);


      

Func lan_dev_base_master_on_mqtt_online

VOID lan_dev_base_master_on_mqtt_online(IN BOOL_T online);


      

Func lan_dp_report_need_report

BOOL_T lan_dp_report_need_report(CHAR_T *subdev_id);
//判断该设备的dp点是否需要上报给master. true 需要上报

Func lan_dp_report_add_subdev

OPERATE_RET lan_dp_report_add_subdev(CHAR_T *gw_id, CHAR_T *sub_id);
//设置需要局域网上报给master的子设备

Func lan_msg_reli_trans_init

OPERATE_RET lan_msg_reli_trans_init(LAN_MSG_MOD_INIT_PARAM *init_param);


      

Func lan_msg_get_recv_seq

OPERATE_RET lan_msg_get_recv_seq(IN CONST CHAR_T *id, OUT INT_T *recv_seq);


      

Func lan_msg_set_recv_seq

OPERATE_RET lan_msg_set_recv_seq(IN CONST CHAR_T *id, IN INT_T recv_seq);


      

Func lan_msg_reli_send

OPERATE_RET lan_msg_reli_send(LAN_MSG_RELI_TYPE type, IN CONST CHAR_T *id, IN CONST CHAR_T *send_buf, VOID *cb_param);
//send_buf在函数内部释放

Func lan_msg_add_peer_node

OPERATE_RET lan_msg_add_peer_node(IN CONST CHAR_T *id);


      

Func lan_msg_stop_peer_node

OPERATE_RET lan_msg_stop_peer_node(IN CONST CHAR_T *id);


      

Func lan_msg_del_peer_node

OPERATE_RET lan_msg_del_peer_node(IN CONST CHAR_T *id);


      

Func lan_msg_del_all_peer_node

OPERATE_RET lan_msg_del_all_peer_node();


      

Func lan_msg_peer_node_clear_com_stat

OPERATE_RET lan_msg_peer_node_clear_com_stat(IN CONST CHAR_T *id);


      

Func lan_msg_set_peer_node_com_allow

OPERATE_RET lan_msg_set_peer_node_com_allow(IN CONST CHAR_T *id, BOOL_T allow);


      

Func lan_msg_get_peer_node_com_allow

OPERATE_RET lan_msg_get_peer_node_com_allow(IN CONST CHAR_T *id, BOOL_T *allow);


      

Func lan_msg_attach_on_peer_node_allow

OPERATE_RET lan_msg_attach_on_peer_node_allow(LAN_PEER_NODE_ALLOW func_cb);


      

Func lan_pub_sub_mq_svc_add

OPERATE_RET lan_pub_sub_mq_svc_add(IN CONST LAN_PUB_SUB_MQ_SVC_PARAM_S *param, OUT LAN_PUB_SUB_MQ_SVC_HANDLE* hdl);


      

Func lan_pub_sub_mq_svc_publish

OPERATE_RET lan_pub_sub_mq_svc_publish(IN LAN_PUB_SUB_MQ_SVC_HANDLE hdl, IN CONST VOID * pub_content);


      

Func lan_simple_mq_add_send_service

OPERATE_RET lan_simple_mq_add_send_service(LAN_SMP_MQ_SEND_SVC_PARAM_S *param, LAN_SIMPLE_MQ_SEND_HANDLE *handle);


      

Func lan_simple_mq_send

OPERATE_RET lan_simple_mq_send(LAN_SIMPLE_MQ_SEND_HANDLE handle, IN CONST CHAR_T *peer_id, IN CONST CHAR_T *send_buf, VOID *cb_param);
//如果需要特殊处理,需要在创建 send_service中的参数param 中的func_buf_free指定

Func lan_simple_mq_add_recv_service

OPERATE_RET lan_simple_mq_add_recv_service(LAN_SMP_MQ_RECV_SVC_PARAM_S *param);


      

Func lan_scene_linkage_init

OPERATE_RET lan_scene_linkage_init(IN CONST CHAR_T * dev_id);
//局域网联动模块初始化

Func lan_dp_condition_detect

OPERATE_RET lan_dp_condition_detect(IN CONST CHAR_T *id, IN CONST CHAR_T *dp_cmd);
//dp点变化时,检测局域网联动

Func lan_scene_linkage_on_mqtt_online

VOID lan_scene_linkage_on_mqtt_online(IN BOOL_T online);
//mq上下线

Func actions_set_gw_vid

OPERATE_RET actions_set_gw_vid(IN CHAR_T *gw_vid);


      

Func secne_linkage_parse_alarm

OPERATE_RET secne_linkage_parse_alarm(IN CHAR_T *alarmed_mode, OUT CHAR_T **id_list);


      

Func scene_linkage_reg_on_exe_dp_issue

OPERATE_RET scene_linkage_reg_on_exe_dp_issue(IN SCENE_LINKAGE_ON_EXE_DP_ISSUE on_exe_func);


      

Func gpio_test_enabe

VOID gpio_test_enabe(BOOL_T enable);
/**
 * @brief enable gpio test
 * 
 * @param[in] enable Flag to enable
 *
 */

Func gpio_test_cb

BOOL_T gpio_test_cb(GPIO_TEST_TABLE * table);
/**
 * @brief callback for gpio test
 * 
 * @param[in] table Test content
 *
 * @return TRUE/FLASE
 */

Func gpio_test_all

BOOL_T gpio_test_all(IN CONST CHAR_T *in, OUT CHAR_T *out);


      

Func gpio_test_all

BOOL_T gpio_test_all(VOID) ;


      

Func mf_init

OPERATE_RET mf_init(IN CONST MF_IMPORT_INTF_S *intf,\
                      IN CONST CHAR_T *file_name,IN CONST CHAR_T *file_ver,IN BOOL_T wrMacEn);
/**
 * @brief mf test init fucntion
 * 
 * @param[in] intf mf test configure data
 * @param[in] file_name APP bin name
 * @param[in] file_ver User Software version
 * @param[in] wrMacEn Need wirte MAC or not
 *
 * @note some fireware need write MAC when mf test
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mf_test_is_timeout

BOOL_T mf_test_is_timeout(VOID);
/**
 * @brief judge if mf test is timeout
 *
 * @return TRUE/FALSE
 */

Func mf_user_param_cb_set

VOID mf_user_param_cb_set(MF_USER_PARAM_CB cb);
/**
 * @brief set callback function for product test
 * 
 * @param[in] cb 
 *
 */

Func mf_cmd_product_send

VOID mf_cmd_product_send(IN CONST USHORT_T cmd,IN CONST BYTE_T *data,IN CONST UINT_T len);
/**
 * @brief The entry of product test
 * @param[in] cmd Test command
 * @param[in] data Test data
 * @param[in] len Test data len
 *
 */

Func mf_test_ignore_close_flag

VOID mf_test_ignore_close_flag(VOID);
/**
 * @brief ignore mf test closed flag
 *
 */

Func mf_test_set_thread_priority

VOID mf_test_set_thread_priority(UINT_T pri);
/***********************************************************
*  Function: mf_test_set_thread_priority
*  Input: none
*  Output: none 
*  Return: none
***********************************************************/

Func mf_test_facpin_get

OPERATE_RET mf_test_facpin_get(OUT CHAR_T facpin[20 + 1]);
/**
 * @brief get facpin
 * 
 * @param[out] facpin
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_mf_test_close_if_write

OPERATE_RET wd_mf_test_close_if_write(IN BOOL_T mf_close);
/**
 * @brief close mf test,save the flag in flash
 * 
 * @param[in] mf_close Close flag
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wd_mf_test_close_if_read

BOOL_T wd_mf_test_close_if_read(VOID);
/**
 * @brief read the flag in flash,to check if mf test closed
 *
 * @return TRUE/FLASE
 */

Func autotest_prod_start

OPERATE_RET autotest_prod_start(autotest_prod_cfg_t *cfg);
/*============================ PROTOTYPES ====================================*/

Func prodtest_identify_listen_start

int prodtest_identify_listen_start(char *app_name, char *app_version);


      

Func prodtest_identify_listen_stop

int prodtest_identify_listen_stop(void);


      

Func prodtest_ssid_scan

bool prodtest_ssid_scan(uint32_t timeout);


      

Func prodtest_app_register

int prodtest_app_register(const prodtest_app_cfg_t *app_cfg);


      

Func mqc_app_init

OPERATE_RET mqc_app_init(VOID);
/**
 * @brief  MQTT service initialization, will start after call to mqc_app_start
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_app_start

OPERATE_RET mqc_app_start(BOOL_T enable_time_check);
/**
 * @brief  Start MQTT service
 * 
 * @param[in] enable_time_check Enable replay check or not
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_app_disconnect

VOID mqc_app_disconnect(VOID);
/**
 * @brief  Disconnect MQTT client from broker, will re-connect later
 */

Func mqc_app_quit

OPERATE_RET mqc_app_quit(VOID_T);
/**
 * @brief  Disconnect MQTT client from broker, delete MQTT client thread
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_app_close

VOID mqc_app_close(VOID);
/**
 * @brief Close MQTT client socket fd, will re-connect later
 */

Func get_mqc_conn_stat

BOOL_T get_mqc_conn_stat(VOID);
/**
 * @brief Get MQTT broker connection status
 * 
 * @return TRUE on connected, FALSE on disconnected
 */

Func mqc_very_pcmcd_mcd

OPERATE_RET mqc_very_pcmcd_mcd(IN CONST UINT_T cmd_from,IN CONST UINT_T seq);
/**
 * @brief MQTT data replay check
 * 
 * @param[in] cmd_from Cmd origin
 * @param[in] seq Data sequence
 * 
 * @return OPRT_OK on success. OPRT_SVC_MQTT_CMD_NOT_EXEC on error
 */

Func mqc_dp_report_async

OPERATE_RET mqc_dp_report_async(RFC_DATA_S *rfc_da, IN CONST UINT_T to_lmt, IN CONST MQ_PUB_ASYNC_IFM_CB cb,IN VOID *prv_data);
/**
 * @brief Publish dp report data to MQTT broker
 * 
 * @param[in] rfc_da The data
 * @param[in] to_lmt Timeout to get ACK or else report error (default: 3s)
 * @param[in] cb Callback when ACK got or timeout
 * @param[in] prv_data Private data to callback
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_obj_dp_query

OPERATE_RET mqc_obj_dp_query(RFC_DATA_S *rfc_da);
/**
 * @brief Publish dp query data to MQTT broker
 * 
 * @param[in] rfc_da The data
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_upgd_progress_rept_v41

OPERATE_RET mqc_upgd_progress_rept_v41(IN CONST UINT_T percent,IN CONST CHAR_T *devid, IN CONST DEV_TYPE_T tp);
/**
 * @brief Upload upgrade progress to broker
 * 
 * @param[in] percent Protocol ID, see PRO_XX defined above
 * @param[in] devid Device ID that is in upgrade
 * @param[in] tp OTA channel, see DEV_TYPE_T
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_prot_data_rept_seq

OPERATE_RET mqc_prot_data_rept_seq(IN CONST UINT_T pro,IN CONST CHAR_T *data,IN CONST BYTE_T qos,
                                  IN CONST UINT_T to_lmt,IN CONST MQ_PUB_ASYNC_IFM_CB cb,IN VOID *prv_data);
/**
 * @brief Publish data to MQTT broker asynchronously
 * 
 * @param[in] pro Protocol ID, see PRO_XX defined above
 * @param[in] data The data
 * @param[in] qos Quality of Service (values: 0, 1)
 * @param[in] to_lmt Timeout to get ACK or else report error (default: 3s)
 * @param[in] cb Callback when ACK got or timeout
 * @param[in] prv_data Private data to callback
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_get_wakeup_data

OPERATE_RET mqc_get_wakeup_data(INOUT BYTE_T *wakeup_data_arr, INOUT UINT_T *p_len);
/**
 * @brief Get default wakeup data
 * 
 * @param[in,out] wakeup_data_arr Buffer to wakeup data
 * @param[in,out] p_len Buffer length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_get_heartbeat_data

OPERATE_RET mqc_get_heartbeat_data(INOUT BYTE_T *heartbeat_data_arr, INOUT UINT_T *p_len);
/**
 * @brief Get default heartbeat data
 * 
 * @param[in,out] heartbeat_data_arr Buffer to heartbeat data
 * @param[in,out] p_len Buffer length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_book_wakeup_topic

OPERATE_RET mqc_book_wakeup_topic(VOID);
/**
 * @brief Subcribe a wakeup topic for lowpower device
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_book_additional_topic

OPERATE_RET mqc_book_additional_topic(IN CHAR_T *topic);
/**
 * @brief Subcribe an addition topic
 * 
 * @param[in] topic Topic to subscribe
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_subscribe_multi_topics_ext

OPERATE_RET mqc_subscribe_multi_topics_ext(IN CONST CHAR_T *topics[], IN CONST BYTE_T cnt, MQ_MSG_RECV_CB msg_cb, BOOL_T auto_resub);


      

Func mqc_unsubscribe_multi_topics

OPERATE_RET mqc_unsubscribe_multi_topics(IN CONST CHAR_T *topics[], IN CONST BYTE_T cnt);
/**
 * @brief Unsubcribe multiple topics within one MQTT request
 * 
 * @param[in] topics Array of topics to unsubscribe
 * @param[in] cnt Count of topics to unsubscribe
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_get_alive_time_s

INT_T mqc_get_alive_time_s(VOID);
/**
 * @brief Get MQTT client hearbeat interval
 * 
 * @param[in] hand Handler of MQTT client
 *
 * @return Heartbeat interval (unit sec), -1 on error
 */

Func mqc_get_mqtt_socket_fd

INT_T mqc_get_mqtt_socket_fd(VOID);
/**
 * @brief Get MQTT client socket fd
 *
 * @return MQTT client socket fd on success, -1 on error.
 */

Func mqc_restart

VOID mqc_restart(VOID);
/**
 * @brief Restart MQTT client
 */

Func mqc_get_mqtt_socket_ip

UINT_T mqc_get_mqtt_socket_ip(VOID);
/**
 * @brief Get MQTT client's IP
 *
 * @return UNW_IP_ADDR_T format
 */

Func mqc_send_custom_mqtt_msg

OPERATE_RET mqc_send_custom_mqtt_msg(IN CONST UINT_T protocol, IN CONST BYTE_T *p_data);
/**
 * @brief Publish protocol data to the default topic
 * 
 * @param[in] protocol Protocol ID, see PRO_XX defined above
 * @param[in] p_data The data to be published
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_send_mqtt_msg_with_topic

OPERATE_RET mqc_send_mqtt_msg_with_topic(IN CONST CHAR_T* topic, IN CONST UINT_T protocol, IN CONST BYTE_T *p_data);
/**
 * @brief Publish protocol data to the specific topic
 * 
 * @param[in] topic Destination topic name
 * @param[in] protocol Protocol ID, see PRO_XX defined above
 * @param[in] p_data The data to be published
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_app_register_cb

OPERATE_RET mqc_app_register_cb(UINT_T mq_pro, mqc_protocol_handler_cb handler);
/**
 * @brief Register handler for specific protocol
 * 
 * @param[in] mq_pro Protocol ID, see PRO_XX defined above
 * @param[in] handler Callback when protocol data got
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_media_pub_async

OPERATE_RET mqc_media_pub_async(IN CONST FLOW_BODY_ST *dt_body,
                               IN CONST UINT_T to_lmt, IN CONST MQ_PUB_ASYNC_IFM_CB cb,IN VOID *prv_data);
/**
 * @brief Publish map data to MQTT broker asynchronously
 * 
 * @param[in] dt_body Map data defined by FLOW_BODY_ST
 * @param[in] to_lmt Timeout to get ACK or else report error (default: 3s)
 * @param[in] cb Callback when ACK got or timeout
 * @param[in] prv_data Private data to callback
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_media_pub_sync

OPERATE_RET mqc_media_pub_sync(IN CONST FLOW_BODY_ST *dt_body,IN CONST UINT_T timeout);
/**
 * @brief Publish map data to MQTT broker synchronously
 * 
 * @param[in] dt_body Map data defined by FLOW_BODY_ST
 * @param[in] timeout Timeout to get ACK or else report error
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_media_pub_sync_v2

OPERATE_RET mqc_media_pub_sync_v2(IN CONST FLOW_BODY_V2_ST *dt_body,IN CONST UINT_T timeout);
/**
 * @brief Publish map data to MQTT broker synchronously
 * 
 * @param[in] dt_body Map data defined by FLOW_BODY_V2_ST
 * @param[in] timeout Timeout to get ACK or else report error
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_media_pub_data_sync

OPERATE_RET mqc_media_pub_data_sync(IN CONST USHORT_T map_id,IN CONST UINT_T offset,IN CONST BYTE_T *pbuffer, IN CONST USHORT_T buf_len);
/**
 * @brief Publish map data to MQTT broker synchronously
 * 
 * @param[in] map_id Map ID
 * @param[in] offset Offset
 * @param[in] pbuffer Map data
 * @param[in] buf_len Data length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_custom_pub_async

OPERATE_RET mqc_custom_pub_async(IN CONST BYTE_T *data, IN CONST INT_T len, IN CONST CHAR_T *topic,
                                IN CONST BYTE_T qos, IN CONST UINT_T timeout, IN CONST MQ_PUB_ASYNC_IFM_CB cb,
                                IN VOID *prv_data);
/**
 * @brief Publish customized data to MQTT broker asynchronously
 * 
 * @param[in] data Customized data
 * @param[in] len Data length
 * @param[in] topic Destination topic name
 * @param[in] qos Quality of Service (values: 0, 1)
 * @param[in] timeout Timeout to get ACK or else report error
 * @param[in] cb Callback when ACK got or timeout
 * @param[in] prv_data Private data to callback
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_custom_pub_sync

OPERATE_RET mqc_custom_pub_sync(IN CONST BYTE_T *data, IN CONST INT_T len, IN CONST CHAR_T *topic,
                               IN CONST BYTE_T qos, IN CONST UINT_T timeout);
/**
 * @brief Publish customized data to MQTT broker synchronously
 * 
 * @param[in] data Customized data
 * @param[in] len Data length
 * @param[in] topic Destination topic name
 * @param[in] qos Quality of Service (values: 0, 1)
 * @param[in] timeout Timeout to get ACK or else report error
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_app_reg_ext_proto

OPERATE_RET mqc_app_reg_ext_proto(CONST CHAR_T *sub_mq_pro, mqc_protocol_handler_cb handler);
/**
 * @brief Register APP extension protocol
 * 
 * @param[in] sub_mq_pro APP extension protocol
 * @param[in] handler Hander when extension protocol data got
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_app_unreg_ext_proto

OPERATE_RET mqc_app_unreg_ext_proto(CONST CHAR_T *sub_mq_pro);
/**
 * @brief Unregister APP extension protocol
 * 
 * @param[in] sub_mq_pro APP extension protocol
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_app_ext_proto_data_rept

OPERATE_RET mqc_app_ext_proto_data_rept(CONST CHAR_T *data, CONST BYTE_T qos);
/**
 * @brief Publish APP extension protocol data to MQTT broker
 * 
 * @param[in] data APP extension protocol data
 * @param[in] qos Quality of Service (values: 0, 1)
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_sdk_reg_ext_proto

OPERATE_RET mqc_sdk_reg_ext_proto(CONST CHAR_T *sub_mq_pro, mqc_protocol_handler_cb handler);
/**
 * @brief Register SDK extension protocol
 * 
 * @param[in] sub_mq_pro SDK extension protocol
 * @param[in] handler Hander when extension protocol data got
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_sdk_unreg_ext_proto

OPERATE_RET mqc_sdk_unreg_ext_proto(CONST CHAR_T *sub_mq_pro);
/**
 * @brief Unregister SDK extension protocol
 * 
 * @param[in] sub_mq_pro SDK extension protocol
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_sdk_ext_proto_data_rept

OPERATE_RET mqc_sdk_ext_proto_data_rept(CONST CHAR_T *data, CONST BYTE_T qos);
/**
 * @brief Publish SDK extension protocol data to MQTT broker
 * 
 * @param[in] data SDK extension protocol data
 * @param[in] qos QOS level(only 0/1 )
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_ng_reg_ext_proto

OPERATE_RET mqc_ng_reg_ext_proto(CONST CHAR_T *ext_mq_pro, mqc_protocol_handler_cb handler);
/** 
 *  @brief Register NG extension protocol
 *
 * @param[in] ext_mq_pro NG extension protocol
 * @param[in] handler Hander when extension protocol data got
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_ng_unreg_ext_proto

OPERATE_RET mqc_ng_unreg_ext_proto(IN CONST CHAR_T *ext_mq_pro);
/** 
 * @brief Unregister SDK extension protocol
 *
 * @param[in] ext_mq_pro SDK extension protocol
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_ng_ext_proto_data_rept

OPERATE_RET mqc_ng_ext_proto_data_rept(CONST CHAR_T *data, CONST BYTE_T qos);
/** 
 * @brief Publish NG extension protocol data to MQTT broker
 * @param[in] data NG extension protocol data
 * @param[in] qos QOS level(only 0/1 )
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqc_set_connection_permit_cb

OPERATE_RET mqc_set_connection_permit_cb(mqc_con_permit_cb cb_permit);
/**
 * @brief Set additional hook to check permission for MQTT broker
 * 
 * @param[in] cb_permit Callback when permission is checking
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func netcfg_module_init

int netcfg_module_init(int netcfg_policy, ApSsidPasswd_t pApInfo, bool isApCfg);


      

Func netcfg_module_uninit

int netcfg_module_uninit();


      

Func netcfg_module_register

int netcfg_module_register(int	type, FN_NETCFG_START	start, FN_NETCFG_STOP stop);


      

Func netcfg_module_unregister

int netcfg_module_unregister(int	type);


      

Func netcfg_start

int netcfg_start(int type, FN_NETCFG_CB netcfg_finish_cb, void *args);
/**
 * @brief start netcfg type
 * 
 * @param[in] type netcfg type,refer to netcfg type definitions 
 * @param[in] netcfg_finish_cb callback function when netcfg finished 
 * @param[in] args private data for netcfg_finish_cb
 *
 * @note start netcfg type.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func netcfg_stop

int netcfg_stop(int type);


      

Func netcfg_stop_other_all

int netcfg_stop_other_all(int type);


      

Func netcfg_start_other_all

int netcfg_start_other_all(int type);


      

Func netcfg_set_transporter_switch_interval

int netcfg_set_transporter_switch_interval(int ms_interval);


      

Func WifiNetcfgFrameSnifferCallbackSet

int WifiNetcfgFrameSnifferCallbackSet();
/*共存配网启动时,执行sniffer callback设置*/

Func WifiNetcfgFrameSnifferEnable

int WifiNetcfgFrameSnifferEnable();
/*ez only配网时,使能sniffer*/

Func destroyWifiNetcfgFrameSniffer

void destroyWifiNetcfgFrameSniffer();
/*销毁wifi_netcfg_frame_sniffer实例*/

Func WifiNetcfgFrameSnifferSessionInit

int WifiNetcfgFrameSnifferSessionInit();


      

Func WifiNetcfgFrameSnifferSessionUnInit

int WifiNetcfgFrameSnifferSessionUnInit();


      

Func wifiNetcfgFrameTransporterChannelInitAndStart

int wifiNetcfgFrameTransporterChannelInitAndStart();
/*配网开始时,执行信道初始化*/

Func destroyWifiNetcfgFrameTransporter

void destroyWifiNetcfgFrameTransporter();
/*
	销毁wifi_netcfg_frame_transporter实例,释放内存
*/

Func WifiNetcfgFrameTransporterSessionInit

int WifiNetcfgFrameTransporterSessionInit();
/*配网模块全局初始化,创建并初始化TransporterSession,必须在getTransporter之前调用*/

Func WifiNetcfgFrameTransporterSessionUninit

int WifiNetcfgFrameTransporterSessionUninit();
/*配网模块全局销毁,在配网活动结束之后调用*/

Func tuya_svc_online_log_init

OPERATE_RET tuya_svc_online_log_init(const char *p_env);
/**
 * @brief online log module initialization
 * 
 * @param[in] p_env: the online log enviroment, used to report to cloud 
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h
 */

Func tuya_svc_online_log_active

OPERATE_RET tuya_svc_online_log_active(VOID);
/**
 * @brief online log module activate
 * 
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h
 */

Func tuya_svc_online_log_upload_runstat

OPERATE_RET tuya_svc_online_log_upload_runstat(const char *p_log);
/**
 * @brief upload user runtime status log
 * 
 * @param[in] p_log: the log string 
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h
 */

Func tuya_svc_online_log_upload_realtime

OPERATE_RET tuya_svc_online_log_upload_realtime(const char *p_log);
/**
 * @brief upload user realtime log
 * 
 * @param[in] p_log: the log string 
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h
 */

Func tuya_svc_online_log_upload_custom_seq_log

OPERATE_RET tuya_svc_online_log_upload_custom_seq_log(const char *p_log);
/**
 * @brief upload user sequnence log 
 * 
 * @param[in] p_log: custom sequnence log string  
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h
 */

Func pegasus_frame_malloc

int pegasus_frame_malloc(uint8_t **frame);


      

Func pegasus_frame_free

void pegasus_frame_free(uint8_t *frame);


      

Func pegasus_frame_data_set

uint32_t pegasus_frame_data_set(uint8_t    *frame, 
                               uint32_t   offset, 
                               uint8_t    type, 
                               uint8_t    *data, 
                               uint32_t   len);


      

Func pegasus_frame_crc_set

uint32_t pegasus_frame_crc_set(uint8_t *frame, uint32_t offset);


      

Func pegasus_frame_crc_check

int pegasus_frame_crc_check(uint8_t *frame, int frame_len);


      

Func pegasus_netcfg_init

int pegasus_netcfg_init();


      

Func pegasus_server_mqc_handle

int pegasus_server_mqc_handle(ty_cJSON *root_json);
/*============================ PROTOTYPES ====================================*/

Func pegasus_server_second_start

int pegasus_server_second_start(uint32_t timeout_s);


      

Func pegasus_recv_data_handle_cb

int pegasus_recv_data_handle_cb(void *ptrArgs,uint8_t *buffer, uint16_t length, const int8_t rssi);


      

Func pegasus_server_add_device

int pegasus_server_add_device(char *token, char*uuid);


      

Func tuya_scan_all_ap

int tuya_scan_all_ap(AP_IF_S **ap_ary, uint8_t *num, uint8_t *oui, AP_IF_S **oui_ap);


      

Func pegasus_beacon_info_get

int pegasus_beacon_info_get(uint8_t *buf, uint16_t len, char rssi, AP_IF_S *ap_info);


      

Func pegasus_init

int pegasus_init(IN CONST fnLockChanCb lc_cb, IN CONST FN_NETCFG_CB ncf_cb, ptrWifiNetcfgFrameSniffer_t pSniffer,ptrWifiNetcfgFrameTransporter_t pTransporter);


      

Func pegasus_second_init

int pegasus_second_init(pegasus_second_connect_cb connect_cb, AP_IF_S *pegasus_ap);


      

Func pegasus_uninit

int pegasus_uninit(void);


      

Func parse_data_with_cmd

OPERATE_RET parse_data_with_cmd(IN CONST DP_CMD_TYPE_E cmd, IN BYTE_T *data,IN CONST INT_T len,OUT CHAR_T **out_data);
/**
 * @brief parse data
 *
 * @param[in] cmd refer to DP_CMD_TYPE_E
 * @param[in] data origin data
 * @param[in] len data lemgth
 * @param[out] out_data parse data out
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func pack_data_with_cmd

OPERATE_RET pack_data_with_cmd(IN CONST DP_CMD_TYPE_E cmd,IN CONST CHAR_T *src,\
                              IN CONST UINT_T pro,IN CONST UINT_T num,\
                              OUT BYTE_T **out,OUT UINT_T *out_len);
/**
 * @brief pack data
 *
 * @param[in] cmd refer to DP_CMD_TYPE_E
 * @param[in] src origin data
 * @param[in] pro pro
 * @param[in] num num
 * @param[out] out pack out data
 * @param[out] out_len pack data length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_parse_protocol_data

OPERATE_RET tuya_parse_protocol_data(IN CONST DP_CMD_TYPE_E cmd, IN CONST CHAR_T *pv, IN BYTE_T *data,\
                              IN CONST INT_T len, IN CONST CHAR_T *key, OUT CHAR_T **out_data);
/**
 * @brief parse protocol data
 *
 * @param[in] cmd refer to DP_CMD_TYPE_E
 * @param[in] pv verison
 * @param[in] data origin data
 * @param[in] len data length
 * @param[in] key parse key
 * @param[out] out_data parse out
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_pack_protocol_data

OPERATE_RET tuya_pack_protocol_data(IN CONST DP_CMD_TYPE_E cmd,IN CONST CHAR_T *pv,IN CONST CHAR_T *src,\
                             IN CONST UINT_T pro,IN CONST UINT_T num,IN UINT_T from,IN BYTE_T *key,\
                             OUT CHAR_T **out,OUT UINT_T *out_len);
/**
 * @brief pack protocol data
 *
 * @param[in] cmd refer to DP_CMD_TYPE_E
 * @param[in] pv verison
 * @param[in] src origin data
 * @param[in] pro pro
 * @param[in] num num
 * @param[in] key pack key
 * @param[out] out pack out
 * @param[out] out_len pack out length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cr_and_init_brc_hand

OPERATE_RET cr_and_init_brc_hand(IN BRC_SEND_FUNC send, IN RPC_RECV_CB recv, OUT BRC_HAND_T *hand);
/**
 * @brief init function
 * 
 * @param[in] send refer to BRC_SEND_FUNC
 * @param[in] recv receive callback
 * @param[out] hand refer to BRC_HAND_T
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func brc_data_recv_process

OPERATE_RET brc_data_recv_process(IN BRC_HAND_T        hand,IN CHAR_T *com_key,IN BYTE_T *data,IN UINT_T len,IN UINT8_T* enc_key);
/**
 * @brief data handle
 * 
 * @param[in] hand refer to BRC_HAND_T
 * @param[in] com_key key
 * @param[in] data handle data
 * @param[in] len data length
 * @param[in] enc_key key
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func rpc_client_call_async

OPERATE_RET rpc_client_call_async(IN BRC_HAND_T        hand,
                                 IN CHAR_T            *com_key, 
                                 IN VOID              *input,
                                 IN UINT_T            in_len,
                                 IN UINT_T            timeout,
                                 IN RPC_TRANSFER_CB   cb,
                                 IN VOID              *pri_data,
                                 IN UINT8_T*          enc_key);
/**
 * @brief call async
 * 
 * @param[in] hand refer to BRC_HAND_T
 * @param[in] com_key key
 * @param[in] input input
 * @param[in] in_len input length
 * @param[in] timeout timeout
 * @param[in] cb refer to RPC_TRANSFER_CB
 * @param[in] pri_data callback argument
 * @param[in] enc_key key
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func rpc_serv_respsond_call

OPERATE_RET rpc_serv_respsond_call(IN BRC_HAND_T        hand, 
                                  IN CHAR_T           *com_key,
                                  IN VOID             *input,
                                  IN UINT_T           in_len,
                                  IN USHORT_T         snd_seqno,
                                  IN UINT8_T*         enc_key);
/**
 * @brief respsond call
 * 
 * @param[in] hand refer to BRC_HAND_T
 * @param[in] com_key key
 * @param[in] input input
 * @param[in] in_len input length
 * @param[in] snd_seqno sequence
 * @param[in] enc_key key
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func brc_control

OPERATE_RET brc_control(IN BRC_HAND_T hand, IN UCHAR_T cmd, INOUT VOID *args);
/**
  * @brief base rpc control
  * 
  * @param[in] hand refer to BRC_HAND_T
  * @param[in] cmd control command
  * @param[in] args control argument
  * @param[out] args control argument
  *
  * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
  */

Func msg_free

VOID msg_free(message_t *msg);
/**
 * @brief free msg
 * 
 * @param[in] msg refer to message_t
 *
 */

Func msg_get_packed_size

UINT_T msg_get_packed_size(message_t * msg);
/**
 * @brief get a packed message length
 * 
 * @param[in] msg refer to message_t
 *
 * @return packed length
 */

Func msg_print

VOID msg_print(message_t * msg);
/**
 * @brief dump a message data
 * 
 * @param[in] msg refer to message_t
 *
 */

Func msg_pack

OPERATE_RET msg_pack(message_t *msg, UINT8_T *out, UINT_T *out_size);
/**
 * @brief pack message to stream
 * 
 * @param[in] msg refer to message_t
 * @param[out] out need malloc first by user
 * @param[in] out_size buffer size
 * @param[out] out_size packed size
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_create_request

OPERATE_RET jrpc_create_request(JRPC_MSG_S *msg, UINT8_T *method, INT_T id);
/**
 * @brief create request
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[in] method method
 * @param[in] id node id
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_create_response

OPERATE_RET jrpc_create_response(JRPC_MSG_S *msg, INT_T id);
/**
 * @brief create response
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[in] id node id
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_create_error

OPERATE_RET jrpc_create_error(JRPC_MSG_S *msg, INT_T id, INT_T code, INT8_T *message);
/**
 * @brief create error
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[in] id node id
 * @param[in] code json int
 * @param[in] message json message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_create_notification

OPERATE_RET jrpc_create_notification(JRPC_MSG_S *msg, UINT8_T *method);
/**
 * @brief create notification
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[in] method refer to JRPC_NODE_TYPE_E
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_write_int

OPERATE_RET jrpc_write_int(JRPC_MSG_S *msg, UINT8_T type, UINT8_T *key, INT_T value);
/**
 * @brief write int
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[in] type refer to JRPC_NODE_TYPE_E
 * @param[in] key json key
 * @param[in] value json value
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_write_string

OPERATE_RET jrpc_write_string(JRPC_MSG_S *msg, UINT8_T type, UINT8_T *key, UINT8_T *value);
/**
 * @brief write string
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[in] type refer to JRPC_NODE_TYPE_E
 * @param[in] key json key
 * @param[in] value json value
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_read_int

OPERATE_RET jrpc_read_int(JRPC_MSG_S *msg, UINT8_T type, UINT8_T *key, INT_T *value);
/**
 * @brief read int
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[in] type refer to JRPC_NODE_TYPE_E
 * @param[in] key json key
 * @param[out] value json value
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_read_string

OPERATE_RET jrpc_read_string(JRPC_MSG_S *msg, UINT8_T type, UINT8_T *key, UINT8_T **value);
/**
 * @brief read string
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[in] type refer to JRPC_NODE_TYPE_E
 * @param[in] key json key
 * @param[out] value json value
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_read_method

OPERATE_RET jrpc_read_method(JRPC_MSG_S *msg, UINT8_T **method);
/**
 * @brief read method
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[out] method value
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_read_error

OPERATE_RET jrpc_read_error(JRPC_MSG_S *msg, INT_T *code, UINT8_T **message);
/**
 * @brief read error
 * 
 * @param[in] msg refer to JRPC_MSG_S
 * @param[out] code error code
 * @param[out] message error message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_write_binary

OPERATE_RET jrpc_write_binary(JRPC_MSG_S *msg, UINT8_T type, INT8_T *key, UINT8_T *binary, UINT16_T size);
/**
 * @brief binary write
 * 
 * @param[in] msg refer to LAN_RPC_NODE_OUTPUT_CB
 * @param[in] type refer to JRPC_NODE_TYPE_E
 * @param[in] key json key
 * @param[in] binary write value
 * @param[in] size write size
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_read_binary

OPERATE_RET jrpc_read_binary(JRPC_MSG_S *msg, UINT8_T type, INT8_T *key, UINT8_T **binary, UINT16_T *size);
/**
 * @brief binary read
 * 
 * @param[in] msg refer to LAN_RPC_NODE_OUTPUT_CB
 * @param[in] type refer to JRPC_NODE_TYPE_E
 * @param[in] key json key
 * @param[out] binary read value
 * @param[out] size read size
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func jrpc_delete

VOID jrpc_delete(JRPC_MSG_S *msg);
/**
 * @brief json rpc delete
 * 
 * @param[in] msg refer to JRPC_MSG_S
 *
 */

Func lan_rpc_fd_get

INT_T lan_rpc_fd_get(VOID);
/**
 * @brief get fd
 *
 * @return fd value
 */

Func lan_rpc_node_timeout_check

VOID lan_rpc_node_timeout_check(VOID);
/**
 * @brief check timeout
 * 
 */

Func lan_rpc_node_add

OPERATE_RET lan_rpc_node_add(LAN_RPC_NODE_S *node);
/**
 * @brief node add
 * 
 * @param[in] node node value
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_node_find_by_ip

BOOL_T lan_rpc_node_find_by_ip(UINT_T ip, LAN_RPC_NODE_S *node);
/**
 * @brief found node by ip
 * 
 * @param[in] ip key ip
 * @param[out] node result node
 *
 * @return found TRUE,else false
 */

Func lan_rpc_node_find_ip_by_id

BOOL_T lan_rpc_node_find_ip_by_id(UINT8_T *id, UINT_T *ip);
/**
 * @brief found ip by id
 * 
 * @param[in] id node id
 * @param[out] ip result ip
 *
 * @return found TRUE,else false
 */

Func lan_rpc_node_key_set

OPERATE_RET lan_rpc_node_key_set(UINT8_T *id, UINT8_T *key);
/**
 * @brief node key set
 * 
 * @param[in] id node id
 * @param[in] key key value
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_node_output

OPERATE_RET lan_rpc_node_output(LAN_RPC_NODE_OUTPUT_CB node_output_cb, VOID *arg);
/**
 * @brief node output
 * 
 * @param[in] node_output_cb refer to LAN_RPC_NODE_OUTPUT_CB
 * @param[in] arg argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_session_key_set

OPERATE_RET lan_rpc_session_key_set(UINT8_T *session_key);
/**
 * @brief set session key
 * 
 * @param[in] session_key key value
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_init

OPERATE_RET lan_rpc_init(LAN_RPC_CFG_S *cfg);
/**
 * @brief rpc init
 * 
 * @param[in] cfg refer to LAN_RPC_CFG_S
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_slave_call_sync

OPERATE_RET lan_rpc_slave_call_sync(JRPC_MSG_S *requset, JRPC_MSG_S *result, UINT_T timeout);
/**
 * @brief slave rpc sync
 * 
 * @param[in] requset refer to JRPC_MSG_S
 * @param[in] result refer to JRPC_MSG_S
 * @param[in] timeout timeout
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_master_call_sync

OPERATE_RET lan_rpc_master_call_sync(UINT8_T *id, JRPC_MSG_S *requset, JRPC_MSG_S *result, UINT_T timeout);
/**
 * @brief master rpc sync
 * 
 * @param[in] id node id
 * @param[in] requset refer to JRPC_MSG_S
 * @param[in] result refer to JRPC_MSG_S
 * @param[in] timeout timeout
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_call_async

OPERATE_RET lan_rpc_call_async(UINT8_T *id, JRPC_MSG_S *requset, RPC_RET_CB cb, VOID *cb_param, UINT_T timeout);
/**
 * @brief rpc sync
 * 
 * @param[in] id node id
 * @param[in] requset refer to JRPC_MSG_S
 * @param[in] cb callback function
 * @param[in] cb_param callback argument
 * @param[in] timeout timeout
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_recv

OPERATE_RET lan_rpc_recv(VOID);
/**
 * @brief rpc receive
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func lan_rpc_method_register

OPERATE_RET lan_rpc_method_register(CHAR_T *name, RPC_METHOD_CB cb, VOID *arg);
/**
 * @brief lan rpc method register
 * 
 * @param[in] name key name
 * @param[in] cb callback function
 * @param[in] arg callback argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_rpc_init

OPERATE_RET tuya_rpc_init(TUYA_RPC_S *rpc, RPC_TYPE_E type, UINT8_T *host);
/**
 * @brief tuya udp rpc init
 * 
 * @param[in] rpc  udp rpc description
 * @param[in] type reference to RPC_TYPE_E
 * @param[in] host ip:port
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_rpc_run

OPERATE_RET tuya_rpc_run(TUYA_RPC_S *rpc, UINT_T stack_size, UINT_T prio);
/**
 * @brief create udp rpc task
 * 
 * @param[in] rpc  udp rpc description
 * @param[in] stack_size task size
 * @param[in] prio task prio
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_rpc_method_register

OPERATE_RET tuya_rpc_method_register(TUYA_RPC_S *rpc, CHAR_T *name, RPC_METHOD_CB cb, VOID *arg);
/**
 * @brief udp rpc method register
 * 
 * @param[in] rpc  udp rpc description
 * @param[in] name key name
 * @param[in] cb method callback
 * @param[in] arg callback argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_rpc_call_sync

OPERATE_RET tuya_rpc_call_sync(TUYA_RPC_S *rpc, JRPC_MSG_S *requset, JRPC_MSG_S *result, UINT_T timeout);
/**
 * @brief rpc sync
 * 
 * @param[in] rpc udp rpc description
 * @param[in] requset reference to JRPC_MSG_S
 * @param[in] result reference to JRPC_MSG_S
 * @param[in] timeout 
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_rpc_control

OPERATE_RET tuya_rpc_control(TUYA_RPC_S *rpc, UINT8_T cmd, VOID *arg);
/**
 * @brief rpc control
 * 
 * @param[in] rpc  udp rpc description
 * @param[in] cmd control command
 * @param[in] arg contol argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_operator_get_cucc_stat

OPERATE_RET tuya_operator_get_cucc_stat(TY_CUCC_STAT_INFO_S *p_stat);
/**
 * @brief Get operator(CUCC) state info
 * 
 * @param[in] p_stat State info, see TY_CUCC_STAT_INFO_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_operator_cmcc_reg_params

OPERATE_RET tuya_operator_cmcc_reg_params(IN CONST CHAR_T *p_appkey, IN CONST CHAR_T *p_aeskey,
                                         IN CHAR_T *p_deviceType,IN CHAR_T *p_productToken, UINT_T localport, IN CHAR_T *p_appBinName);
/**
 * @brief Set operator initial params
 * 
 * @param[in] p_appkey Key of application
 * @param[in] p_aeskey AES key
 * @param[in] p_deviceType Device type
 * @param[in] p_productToken Product token
 * @param[in] localport Local port
 * @param[in] p_appBinName Applicaiton bin name
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_operator_upload_manual

OPERATE_RET tuya_operator_upload_manual(IN CONST TY_OPERATOR_INFO_S *p_info, IN CONST BOOL_T async);
/**
 * @brief Upload operator info manually(once a time)
 * 
 * @param[in] p_info Operator info, see TY_OPERATOR_INFO_S
 * @param[in] async Sync or not to upload operator info
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_operator_upload

OPERATE_RET tuya_operator_upload(VOID);
/**
 * @brief Start to upload operator info
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_operator_get_type

OPERATE_RET tuya_operator_get_type(OUT TY_OPERATOR_TYPE_E *p_type);
/**
 * @brief Get current operator type
 * 
 * @param[in] p_type Operator type, see TY_OPERATOR_TYPE_E
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_operator_reset

OPERATE_RET tuya_operator_reset(VOID);
/**
 * @brief Reset saved operator info
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_operator_code_get

OPERATE_RET tuya_operator_code_get(IN CONST CHAR_T *devid, OUT CH_CODE_ST *ch_code);
/**
 * @brief Retrieve operator info
 * 
 * @param[in] dev_id ID of sub-device, or NULL for GW
 * @param[in] ch_code Operator info, see CH_CODE_ST
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_operator_inf_upload

OPERATE_RET tuya_operator_inf_upload(IN CONST CHAR_T *devid, IN CONST CH_CODE_ST *ch_code, IN BOOL_T initial);
/**
 * @brief Upload operator info
 * 
 * @param[in] dev_id ID of sub-device, or NULL for GW
 * @param[in] ch_code Operator info, see CH_CODE_ST
 * @param[in] initial Whether the first time to upload
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_timer_task_init

OPERATE_RET tuya_svc_timer_task_init(UINT_T increase_unit);
/**
 * @brief Init a timer task.
 *
 * @param[in] increase_unit: increase unit
 *
 * @note This API is used for initializing the timer task. 
 * when the task queue is full, it will expand the size with the unit user input. 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_timer_task_reset

OPERATE_RET tuya_svc_timer_task_reset(VOID_T);
/**
 * @brief Reset the timer task.
 *
 * @param VOID
 *
 * @note This API is used to reset the timer task. the resource of timer task will be released. 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_timer_task_clear_db

OPERATE_RET tuya_svc_timer_task_clear_db(VOID_T);
/**
 * @brief Clear up the timer task data in flash.
 *
 * @param VOID
 *
 * @note This API is used to clear up the timer task data in flash.
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_timer_get_task_count

UINT_T tuya_svc_timer_get_task_count(VOID_T);
/**
 * @brief Get the count of timer task.
 *
 * @param VOID
 *
 * @note This API is used for getting the count of timer task.
 * @return the count of timer task.
 */

Func tuya_svc_timer_get_num

UINT_T tuya_svc_timer_get_num(VOID_T);
/**
 * @brief Get the num of timer task.
 *
 * @param VOID
 *
 * @note This API is used for getting the num of timer task.
 * @return the capacity of timer task.
 */

Func tuya_svc_timer_get_capacity

UINT_T tuya_svc_timer_get_capacity(VOID_T);
/**
 * @brief Get the capacity of timer task.
 *
 * @param VOID
 *
 * @note This API is used for getting the capacity of timer task.
 * @return the capacity of timer task.
 */

Func tuya_svc_timer_delete

VOID_T tuya_svc_timer_delete(uint32_t timer_id, BOOL_T update_flash);
/**
 * @brief delete timer task.
 *
 * @param[in] timer_id: timer id
 * @param[in] update_flash: if need update timer to flash
 *
 * @note This API is used for deleting the timer task.
 * @return void
 */

Func tuya_svc_timer_get_data

VOID_T tuya_svc_timer_get_data(uint8_t *timer_data);
/**
 * @brief get timer task data.
 *
 * @param[out] timer_data: timer id and crc32
 *
 * @note This API is used for getting timer task data.
 * @return void
 */

Func tuya_svc_timer_add

VOID_T tuya_svc_timer_add(uint8_t* data, uint16_t len);
/**
 * @brief add timer task.
 *
 * @param[in] data: timer data
 * @param[in] len: data len
 *
 * @note This API is used for adding timer task.
 * @return void
 */

Func ty_schema_upgrade_init

OPERATE_RET ty_schema_upgrade_init(VOID);
/**
 * @brief Initilize schema upgrade framework
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_schema_upgrade_active

OPERATE_RET ty_schema_upgrade_active(VOID);
/**
 * @brief Run schema upgrade framework, workloads registered will be executed
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_schema_upgrade_notify

OPERATE_RET ty_schema_upgrade_notify(CHAR_T *dev_id);
/**
 * @brief Schema upgrade is triggered by MQTT msg
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_schema_upgrade_register

OPERATE_RET ty_schema_upgrade_register(ACTION_CB cb_update, ACTION_CB cb_get);
/**
 * @brief Register schema upgrade workload
 * 
 * @param[in] cb_update Callback to upload schema upload status
 * @param[in] cb_get Callback to retrieve schema from cloud
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_upgrade_init

int tuya_svc_upgrade_init(tuya_upgrade_param_t *ota_param);
/**
 * @brief Initilize firmware upgrade framework
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_upgrade_active

int tuya_svc_upgrade_active(void);
/**
 * @brief Run firmware upgrade framework, workloads registered will be executed
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_upgrade_detect_register

OPERATE_RET tuya_svc_upgrade_detect_register(tuya_upgrade_detect_t *detect);
/**
 * @brief Register a new firmware upgrade workload
 * 
 * @param[in] detect The workload, see tuya_upgrade_detect_t
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_upgrade_register_pre_cb

void tuya_svc_upgrade_register_pre_cb(dev_upgrade_pre_inform_cb pre_ug_cb);
/**
 * @brief Register pre-precess handler to replace the default one
 * 
 * @param[in] pre_ug_cb The new handler
 */

Func tuya_svc_upgrade_register_mq15_cb

void tuya_svc_upgrade_register_mq15_cb(dev_upgrade_mq15_inform_cb mq15_cb);
/**
 * @brief Register process handler for some upgrade type
 * 
 * @param[in] mq15_cb The process handler
 */

Func tuya_svc_upgrade_detect_reset

int tuya_svc_upgrade_detect_reset(const int upgrade_interval);
/**
 * @brief Reset firmware upgrade check interval
 * 
 * @param[in] upgrade_interval Next interval to check(unit sec)
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_upgrade_refuse

int tuya_svc_upgrade_refuse(const FW_UG_S *fw, const char *dev_id);
/**
 * @brief Refuse to download the specific firmware
 * 
 * @param[in] dev_id ID of sub-device, or NULL for GW
 * @param[in] fw Firmware info to download
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_upgrade_result_report

int tuya_svc_upgrade_result_report(const char *dev_id, const DEV_TYPE_T type, const int result);
/**
 * @brief Sync dowload result to cloud
 * 
 * @param[in] dev_id ID of sub-device, or NULL for GW
 * @param[in] tp OTA channel, see DEV_TYPE_T
 * @param[in] result See TI_UPGRD_STAT_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_upgrade_start

int tuya_svc_upgrade_start(const CHAR_T *dev_id,
					   const FW_UG_S *fw,
					   const GET_FILE_DATA_CB get_file_cb,
					   VOID *pri_data,
					   const UPGRADE_NOTIFY_CB upgrd_nofity_cb, 
					   const BOOL_T upload_upgrade_percent, 
					   const UINT_T download_buf_size);
/**
 * @brief Start to download the specific firmware
 * 
 * @param[in] dev_id ID of sub-device, or NULL for GW
 * @param[in] fw Firmware info to download
 * @param[in] get_file_cb Callback to transfer data while downloading
 * @param[in] pri_data Private data
 * @param[in] upgrd_nofity_cb Callback when upgrade complete or error
 * @param[in] upload_upgrade_percent Upload upgrade percent or not
 * @param[in] download_buf_size Buffer size allocated for OTA
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_svc_upgrade_mqtt_notify

OPERATE_RET tuya_svc_upgrade_mqtt_notify(CHAR_T *dev_id, DEV_TYPE_T tp);
/**
* @brief Notify to upgrade immediately like mqtt15
*
* @param[in] dev_id ID of sub-device, or NULL for GW
* @param[in] dev type to upgrade
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_svc_upgrade_ug_info_parse

OPERATE_RET tuya_svc_upgrade_ug_info_parse(ty_cJSON *result, UPGRADE_TYPE_T type, FW_UG_S *ug_info);


      

Func http_device_upgrade_info_get_silent

OPERATE_RET http_device_upgrade_info_get_silent(IN CONST CHAR_T *sub_id, OUT ty_cJSON **result);
/**
 * @brief Retrieve silent upgrade info from cloud
 * 
 * @param[in] sub_id ID of sub-device, or NULL for GW
 * @param[out] result JSON encoded data
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_device_upgrade_info_get

OPERATE_RET http_device_upgrade_info_get(const CHAR_T *dev_id, const DEV_TYPE_T tp, ty_cJSON **result);
/**
 * @brief Retrieve default upgrade info from cloud
 * 
 * @param[in] dev_id ID of sub-device, or NULL for GW
 * @param[in] tp OTA channel, see DEV_TYPE_T
 * @param[out] result JSON encoded data
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_device_upgrade_stat_update

OPERATE_RET http_device_upgrade_stat_update(const CHAR_T *dev_id,const DEV_TYPE_T tp,const BYTE_T status);
/**
 * @brief Sync upgrade status to cloud
 * 
 * @param[in] dev_id ID of sub-device, or NULL for GW
 * @param[in] tp OTA channel, see DEV_TYPE_T
 * @param[in] status Upgrade status, see TI_UPGRD_STAT_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_device_schema_newest_get

OPERATE_RET http_device_schema_newest_get(const char* schemaId, const char* version,
   const char* nodeId, ty_cJSON **result);
/**
 * @brief Retrieve lastest schema from cloud
 * 
 * @param[in] schemaId ID of local schema
 * @param[in] version Version of local schema
 * @param[in] nodeId ID of sub-device, or NULL for GW
 * @param[out] result JSON encoded data
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_device_schema_version_update

OPERATE_RET http_device_schema_version_update(const char* schemaId, const char* version,
   ty_cJSON *nodeIds, const char* result, const char* reason);
/**
 * @brief Sync schema upgrade result to cloud
 * 
 * @param[in] schemaId ID of local schema
 * @param[in] version Version of local schema
 * @param[in] nodeIds IDs of sub-device, or NULL for GW
 * @param[in] result Upgrade result
 * @param[in] result Reason
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_iot_wifi_ffc_init

int tuya_iot_wifi_ffc_init(uint8_t role, ffc_status_cb *status_cb, ffc_recv_cb *recv_cb);
/**
 * @brief ffc init function,must called first
 *
 * @param[in] role master or slaver
 * @param[in] status_cb user status callback
 * @param[in] recv_cb user received callback
 *
 * @return OPRT_OK on success. Others error, please refer to tuya_error_code.h
 *
 */

Func tuya_iot_wifi_ffc_bind

int tuya_iot_wifi_ffc_bind(uint16_t timeout_s);
/**
 * @brief ffc bind function
 *
 * @param[in] timeout_s time out
 *
 * @return OPRT_OK on success. Others error, please refer to tuya_error_code.h
 *
 */

Func tuya_iot_wifi_ffc_unbind

int tuya_iot_wifi_ffc_unbind(uint16_t timeout_s);
/**
 * @brief ffc unbind function
 *
 * @param[in] timeout_s time out
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 *
 */

Func tuya_iot_wifi_ffc_send

int tuya_iot_wifi_ffc_send(uint8_t *data, uint16_t len);
/**
 * @brief ffc send
 *
 * @param[in] data send buf
 * @param[in] len send length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 *
 */

Func tuya_iot_wifi_ffc_control

int tuya_iot_wifi_ffc_control(int flag, void *data);
/**
 * @brief ffc control
 *
 * @param[in] flag control flag
 * @param[in] data control data
 *
 * @return OPRT_OK on success. Others error, please refer to tuya_error_code.h
 *
 */

Func coap_address_equals

int coap_address_equals(const coap_address_t *a, const coap_address_t *b);
/**
 * Compares given address objects @p a and @p b. This function returns @c 1 if
 * addresses are equal, @c 0 otherwise. The parameters @p a and @p b must not be
 * @c NULL;
 */

Func memcpy

memcpy( &dst->addr, &src->addr, src->size );


      

Func coap_is_mcast

int coap_is_mcast(const coap_address_t *a);
/**
 * Checks if given address @p a denotes a multicast address. This function
 * returns @c 1 if @p a is multicast, @c 0 otherwise.
 */

Func coap_remove_async

int coap_remove_async(coap_context_t *context,
                     coap_session_t *session,
                     coap_tid_t id,
                     coap_async_state_t **s);
/**
 * Removes the state object identified by @p id from @p context. The removed
 * object is returned in @p s, if found. Otherwise, @p s is undefined. This
 * function returns @c 1 if the object was removed, @c 0 otherwise. Note that
 * the storage allocated for the stored object is not released by this
 * functions. You will have to call coap_free_async() to do so.
 *
 * @param context The context where the async object is registered.
 * @param session  The session that is used for asynchronous transmissions.
 * @param id      The identifier of the asynchronous transaction.
 * @param s       Will be set to the object identified by @p id after removal.
 *
 * @return        @c 1 if object was removed and @p s updated, or @c 0 if no
 *                object was found with the given id. @p s is valid only if the
 *                return value is @c 1.
 */

Func coap_free_async

void
coap_free_async(coap_async_state_t *state);
/**
 * Releases the memory that was allocated by coap_async_state_init() for the
 * object @p s. The registered application data will be released automatically
 * if COAP_ASYNC_RELEASE_DATA is set.
 *
 * @param state The object to delete.
 */

Func coap_opt_block_num

unsigned int coap_opt_block_num(const coap_opt_t *block_opt);
/**
 * Returns the value of field @c num in the given block option @p block_opt.
 */

Func coap_get_block

int coap_get_block(coap_pdu_t *pdu, uint16_t type, coap_block_t *block);
/**
 * Initializes @p block from @p pdu. @p type must be either COAP_OPTION_BLOCK1
 * or COAP_OPTION_BLOCK2. When option @p type was found in @p pdu, @p block is
 * initialized with values from this option and the function returns the value
 * @c 1. Otherwise, @c 0 is returned.
 *
 * @param pdu   The pdu to search for option @p type.
 * @param type  The option to search for (must be COAP_OPTION_BLOCK1 or
 *              COAP_OPTION_BLOCK2).
 * @param block The block structure to initilize.
 *
 * @return      @c 1 on success, @c 0 otherwise.
 */

Func coap_write_block_opt

int coap_write_block_opt(coap_block_t *block,
                        uint16_t type,
                        coap_pdu_t *pdu,
                        size_t data_length);
/**
 * Writes a block option of type @p type to message @p pdu. If the requested
 * block size is too large to fit in @p pdu, it is reduced accordingly. An
 * exception is made for the final block when less space is required. The actual
 * length of the resource is specified in @p data_length.
 *
 * This function may change *block to reflect the values written to @p pdu. As
 * the function takes into consideration the remaining space @p pdu, no more
 * options should be added after coap_write_block_opt() has returned.
 *
 * @param block       The block structure to use. On return, this object is
 *                    updated according to the values that have been written to
 *                    @p pdu.
 * @param type        COAP_OPTION_BLOCK1 or COAP_OPTION_BLOCK2.
 * @param pdu         The message where the block option should be written.
 * @param data_length The length of the actual data that will be added the @p
 *                    pdu by calling coap_add_block().
 *
 * @return            @c 1 on success, or a negative value on error.
 */

Func coap_add_block

int coap_add_block(coap_pdu_t *pdu,
                  unsigned int len,
                  const uint8_t *data,
                  unsigned int block_num,
                  unsigned char block_szx);
/**
 * Adds the @p block_num block of size 1 << (@p block_szx + 4) from source @p
 * data to @p pdu.
 *
 * @param pdu       The message to add the block.
 * @param len       The length of @p data.
 * @param data      The source data to fill the block with.
 * @param block_num The actual block number.
 * @param block_szx Encoded size of block @p block_number.
 *
 * @return          @c 1 on success, @c 0 otherwise.
 */

Func coap_add_data_blocked_response

void
coap_add_data_blocked_response(struct coap_resource_t *resource,
                              struct coap_session_t *session,
                              coap_pdu_t *request,
                              coap_pdu_t *response,
                              const coap_binary_t *token,
                              uint16_t media_type,
                              int maxage,
                              size_t length,
                              const uint8_t* data);
/**
 * Adds the appropriate part of @p data to the @p response pdu.  If blocks are
 * required, then the appropriate block will be added to the PDU and sent.
 * Adds a ETAG option that is the hash of the entire data if the data is to be
 * split into blocks
 * Used by a GET request handler.
 *
 * @param resource   The resource the data is associated with.
 * @param session    The coap session.
 * @param request    The requesting pdu.
 * @param response   The response pdu.
 * @param token      The token taken from the (original) requesting pdu.
 * @param media_type The format of the data.
 * @param maxage     The maxmimum life of the data. If @c -1, then there
 *                   is no maxage.
 * @param length     The total length of the data.
 * @param data       The entire data block to transmit.
 *
 */

Func coap_dm_add_data_response

void
coap_dm_add_data_response(struct coap_resource_t *resource,
                     struct coap_session_t *session,
                     coap_pdu_t *request,
                     coap_pdu_t *response,
                     const coap_binary_t *token,
                     uint16_t media_type,
                     int maxage,
                     size_t length,
                     const uint8_t* data);


      

Func coap_set_log_level

void coap_set_log_level(coap_log_t level);
/**
 * Sets the log level to the specified value.
 *
 * @param level One of the LOG_* values.
 */

Func coap_set_log_handler

void coap_set_log_handler(coap_log_handler_t handler);
/**
 * Add a custom log callback handler.
 *
 * @param handler The logging handler to use or @p NULL to use default handler.
 */

Func coap_log_impl

void coap_log_impl(coap_log_t level,
             const char *format, ...) __attribute__ ((format(printf, 2, 3)));


      

Func coap_log_impl

void coap_log_impl(coap_log_t level, const char *format, ...);


      

Func coap_set_show_pdu_output

void coap_set_show_pdu_output(int use_fprintf);
/**
 * Defines the output mode for the coap_show_pdu() function.
 *
 * @param use_fprintf @p 1 if the output is to use fprintf() (the default)
 *                    @p 0 if the output is to use coap_log().
 */

Func coap_show_pdu

void coap_show_pdu(coap_log_t level, const coap_pdu_t *pdu);
/**
 * Display the contents of the specified @p pdu.
 * Note: The output method of coap_show_pdu() is dependent on the setting of
 * coap_set_show_pdu_output().
 *
 * @param level The required minimum logging level.
 * @param pdu The PDU to decode.
 */

Func coap_show_tls_version

void coap_show_tls_version(coap_log_t level);
/**
 * Display the current (D)TLS library linked with and built for version.
 *
 * @param level The required minimum logging level.
 */

Func coap_print_addr

size_t coap_print_addr(const struct coap_address_t *address,
                      unsigned char *buffer, size_t size);
/**
 * Print the address into the defined buffer.
 *
 * Internal Function.
 *
 * @param address The address to print.
 * @param buffer The buffer to print into.
 * @param size The size of the buffer to print into.
 *
 * @return The amount written into the buffer.
 */

Func coap_debug_set_packet_loss

int coap_debug_set_packet_loss(const char *loss_level);
/**
 * Set the packet loss level for testing.  This can be in one of two forms.
 *
 * Percentage : 0% to 100%.  Use the specified probability.
 * 0% is send all packets, 100% is drop all packets.
 *
 * List: A comma separated list of numbers or number ranges that are the
 * packets to drop.
 *
 * @param loss_level The defined loss level (percentage or list).
 *
 * @return @c 1 If loss level set, @c 0 if there is an error.
 */

Func coap_debug_send_packet

int coap_debug_send_packet(void);
/**
 * Check to see whether a packet should be sent or not.
 *
 * Internal function
 *
 * @return @c 1 if packet is to be sent, @c 0 if packet is to be dropped.
 */

Func coap_dtls_is_supported

int coap_dtls_is_supported(void);
/**
 * Check whether DTLS is available.
 *
 * @return @c 1 if support for DTLS is enabled, or @c 0 otherwise.
 */

Func coap_tls_is_supported

int coap_tls_is_supported(void);
/**
 * Check whether TLS is available.
 *
 * @return @c 1 if support for TLS is enabled, or @c 0 otherwise.
 */

Func coap_dtls_new_context

void *
coap_dtls_new_context(struct coap_context_t *coap_context);
/**
 * Creates a new DTLS context for the given @p coap_context. This function
 * returns a pointer to a new DTLS context object or @c NULL on error.
 *
 * Internal function.
 *
 * @param coap_context The CoAP context where the DTLS object shall be used.
 *
 * @return A DTLS context object or @c NULL on error.
 */

Func coap_dtls_context_set_psk

int
coap_dtls_context_set_psk(struct coap_context_t *coap_context,
                         const char *identity_hint,
                         coap_dtls_role_t role);


      

Func coap_dtls_context_set_pki

int
coap_dtls_context_set_pki(struct coap_context_t *coap_context,
                         coap_dtls_pki_t *setup_data,
                         coap_dtls_role_t role);


      

Func coap_dtls_context_set_pki_root_cas

int
coap_dtls_context_set_pki_root_cas(struct coap_context_t *coap_context,
                                  const char *ca_file,
                                  const char *ca_dir);


      

Func coap_dtls_context_check_keys_enabled

int coap_dtls_context_check_keys_enabled(struct coap_context_t *coap_context);


      

Func coap_dtls_free_context

void coap_dtls_free_context(void *dtls_context);
/**
 * Releases the storage allocated for @p dtls_context.
 *
 * Internal function.
 *
 * @param dtls_context The DTLS context as returned by coap_dtls_new_context().
 */

Func coap_dtls_new_client_session

void *coap_dtls_new_client_session(coap_session_t *coap_session);
/**
 * Create a new client-side session. This should send a HELLO to the server.
 *
 * Internal function.
 *
 * @param coap_session   The CoAP session.
 *
 * @return Opaque handle to underlying TLS library object containing security
 *         parameters for the session.
*/

Func coap_dtls_new_server_session

void *coap_dtls_new_server_session(coap_session_t *coap_session);
/**
 * Create a new DTLS server-side session.
 * Called after coap_dtls_hello() has returned @c 1, signalling that a validated
 * HELLO was received from a client.
 * This should send a HELLO to the server.
 *
 * Internal function.
 *
 * @param coap_session   The CoAP session.
 *
 * @return Opaque handle to underlying TLS library object containing security
 *         parameters for the DTLS session.
 */

Func coap_dtls_free_session

void coap_dtls_free_session(coap_session_t *coap_session);
/**
 * Terminates the DTLS session (may send an ALERT if necessary) then frees the
 * underlying TLS library object containing security parameters for the session.
 *
 * Internal function.
 *
 * @param coap_session   The CoAP session.
 */

Func coap_dtls_session_update_mtu

void coap_dtls_session_update_mtu(coap_session_t *coap_session);
/**
 * Notify of a change in the CoAP session's MTU, for example after
 * a PMTU update.
 *
 * Internal function.
 *
 * @param coap_session   The CoAP session.
 */

Func coap_dtls_send

int coap_dtls_send(coap_session_t *coap_session,
                  const uint8_t *data,
                  size_t data_len);
/**
 * Send data to a DTLS peer.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 * @param data      pointer to data.
 * @param data_len  Number of bytes to send.
 *
 * @return @c 0 if this would be blocking, @c -1 if there is an error or the
 *         number of cleartext bytes sent.
 */

Func coap_dtls_is_context_timeout

int coap_dtls_is_context_timeout(void);
/**
 * Check if timeout is handled per CoAP session or per CoAP context.
 *
 * Internal function.
 *
 * @return @c 1 of timeout and retransmit is per context, @c 0 if it is
 *         per session.
 */

Func coap_dtls_get_context_timeout

coap_tick_t coap_dtls_get_context_timeout(void *dtls_context);
/**
 * Do all pending retransmits and get next timeout
 *
 * Internal function.
 *
 * @param dtls_context The DTLS context.
 *
 * @return @c 0 if no event is pending or date of the next retransmit.
 */

Func coap_dtls_get_timeout

coap_tick_t coap_dtls_get_timeout(coap_session_t *coap_session);
/**
 * Get next timeout for this session.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 *
 * @return @c 0 If no event is pending or date of the next retransmit.
 */

Func coap_dtls_handle_timeout

void coap_dtls_handle_timeout(coap_session_t *coap_session);
/**
 * Handle a DTLS timeout expiration.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 */

Func coap_dtls_receive

int coap_dtls_receive(coap_session_t *coap_session,
                     const uint8_t *data,
                     size_t data_len);
/**
 * Handling incoming data from a DTLS peer.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 * @param data      Encrypted datagram.
 * @param data_len  Encrypted datagram size.
 *
 * @return Result of coap_handle_dgram on the decrypted CoAP PDU
 *         or @c -1 for error.
 */

Func coap_dtls_hello

int coap_dtls_hello(coap_session_t *coap_session,
                   const uint8_t *data,
                   size_t data_len);
/**
 * Handling client HELLO messages from a new candiate peer.
 * Note that session->tls is empty.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 * @param data      Encrypted datagram.
 * @param data_len  Encrypted datagram size.
 *
 * @return @c 0 if a cookie verification message has been sent, @c 1 if the
 *        HELLO contains a valid cookie and a server session should be created,
 *        @c -1 if the message is invalid.
 */

Func coap_dtls_get_overhead

unsigned int coap_dtls_get_overhead(coap_session_t *coap_session);
/**
 * Get DTLS overhead over cleartext PDUs.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 *
 * @return Maximum number of bytes added by DTLS layer.
 */

Func coap_tls_new_client_session

void *coap_tls_new_client_session(coap_session_t *coap_session, int *connected);
/**
 * Create a new TLS client-side session.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 * @param connected Updated with whether the connection is connected yet or not.
 *                  @c 0 is not connected, @c 1 is connected.
 *
 * @return Opaque handle to underlying TLS library object containing security
 *         parameters for the session.
*/

Func coap_tls_new_server_session

void *coap_tls_new_server_session(coap_session_t *coap_session, int *connected);
/**
 * Create a TLS new server-side session.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 * @param connected Updated with whether the connection is connected yet or not.
 *                  @c 0 is not connected, @c 1 is connected.
 *
 * @return Opaque handle to underlying TLS library object containing security
 *         parameters for the session.
 */

Func coap_tls_free_session

void coap_tls_free_session( coap_session_t *coap_session );
/**
 * Terminates the TLS session (may send an ALERT if necessary) then frees the
 * underlying TLS library object containing security parameters for the session.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 */

Func coap_tls_write

ssize_t coap_tls_write(coap_session_t *coap_session,
                      const uint8_t *data,
                      size_t data_len
                      );
/**
 * Send data to a TLS peer, with implicit flush.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 * @param data      Pointer to data.
 * @param data_len  Number of bytes to send.
 *
 * @return          @c 0 if this should be retried, @c -1 if there is an error
 *                  or the number of cleartext bytes sent.
 */

Func coap_tls_read

ssize_t coap_tls_read(coap_session_t *coap_session,
                     uint8_t *data,
                     size_t data_len
                     );
/**
 * Read some data from a TLS peer.
 *
 * Internal function.
 *
 * @param coap_session The CoAP session.
 * @param data      Pointer to data.
 * @param data_len  Maximum number of bytes to read.
 *
 * @return          @c 0 if this should be retried, @c -1 if there is an error
 *                  or the number of cleartext bytes read.
 */

Func coap_dtls_startup

void coap_dtls_startup(void);
/**
 * Initialize the underlying (D)TLS Library layer.
 *
 * Internal function.
 *
 */

Func coap_dtls_set_log_level

void coap_dtls_set_log_level(int level);
/**
 * @ingroup logging
 * Sets the (D)TLS logging level to the specified @p level.
 * Note: coap_log_level() will influence output if at a specified level.
 *
 * @param level The logging level to use - LOG_*
 */

Func coap_dtls_get_log_level

int coap_dtls_get_log_level(void);
/**
 * @ingroup logging
 * Get the current (D)TLS logging.
 *
 * @return The current log level (one of LOG_*).
 */

Func coap_register_event_handler

void coap_register_event_handler(struct coap_context_t *context,
                           coap_event_handler_t hnd);
/**
 * Registers the function @p hnd as callback for events from the given
 * CoAP context @p context. Any event handler that has previously been
 * registered with @p context will be overwritten by this operation.
 *
 * @param context The CoAP context to register the event handler with.
 * @param hnd     The event handler to be registered.  @c NULL if to be
 *                de-registered.
 */

Func coap_hash_impl

void coap_hash_impl(const unsigned char *s, unsigned int len, coap_key_t h);
/**
 * Calculates a fast hash over the given string @p s of length @p len and stores
 * the result into @p h. Depending on the exact implementation, this function
 * cannot be used as one-way function to check message integrity or simlar.
 *
 * @param s   The string used for hash calculation.
 * @param len The length of @p s.
 * @param h   The result buffer to store the calculated hash key.
 */

Func coap_mfree_endpoint

void coap_mfree_endpoint( struct coap_endpoint_t *ep );


      

Func coap_socket_connect_udp

int
coap_socket_connect_udp(coap_socket_t *sock,
                       const coap_address_t *local_if,
                       const coap_address_t *server,
                       int default_port,
                       coap_address_t *local_addr,
                       coap_address_t *remote_addr);


      

Func coap_socket_bind_udp

int
coap_socket_bind_udp(coap_socket_t *sock,
                    const coap_address_t *listen_addr,
                    coap_address_t *bound_addr );


      

Func coap_socket_connect_tcp1

int
coap_socket_connect_tcp1(coap_socket_t *sock,
                        const coap_address_t *local_if,
                        const coap_address_t *server,
                        int default_port,
                        coap_address_t *local_addr,
                        coap_address_t *remote_addr);


      

Func coap_socket_connect_tcp2

int
coap_socket_connect_tcp2(coap_socket_t *sock,
                        coap_address_t *local_addr,
                        coap_address_t *remote_addr);


      

Func coap_socket_bind_tcp

int
coap_socket_bind_tcp(coap_socket_t *sock,
                    const coap_address_t *listen_addr,
                    coap_address_t *bound_addr);


      

Func coap_socket_accept_tcp

int
coap_socket_accept_tcp(coap_socket_t *server,
                      coap_socket_t *new_client,
                      coap_address_t *local_addr,
                      coap_address_t *remote_addr);


      

Func coap_socket_close

void coap_socket_close(coap_socket_t *sock);


      

Func coap_socket_send

ssize_t
coap_socket_send( coap_socket_t *sock, struct coap_session_t *session,
                 const uint8_t *data, size_t data_len );


      

Func coap_socket_write

ssize_t
coap_socket_write(coap_socket_t *sock, const uint8_t *data, size_t data_len);


      

Func coap_socket_read

ssize_t
coap_socket_read(coap_socket_t *sock, uint8_t *data, size_t data_len);


      

Func coap_socket_send_pdu

ssize_t
coap_socket_send_pdu( coap_socket_t *sock, struct coap_session_t *session,
                     struct coap_pdu_t *pdu );


      

Func coap_network_send

ssize_t coap_network_send( coap_socket_t *sock, const struct coap_session_t *session, const uint8_t *data, size_t datalen );
/**
 * Function interface for data transmission. This function returns the number of
 * bytes that have been transmitted, or a value less than zero on error.
 *
 * @param sock             Socket to send data with
 * @param session          Addressing information for unconnected sockets, or NULL
 * @param data             The data to send.
 * @param datalen          The actual length of @p data.
 *
 * @return                 The number of bytes written on success, or a value
 *                         less than zero on error.
 */

Func coap_network_read

ssize_t coap_network_read( coap_socket_t *sock, struct coap_packet_t *packet );
/**
 * Function interface for reading data. This function returns the number of
 * bytes that have been read, or a value less than zero on error. In case of an
 * error, @p *packet is set to NULL.
 *
 * @param sock   Socket to read data from
 * @param packet Received packet metadata and payload. src and dst should be preset.
 *
 * @return       The number of bytes received on success, or a value less than
 *               zero on error.
 */

Func coap_packet_get_memmapped

void coap_packet_get_memmapped(struct coap_packet_t *packet,
                              unsigned char **address,
                              size_t *length);
/**
 * Given a packet, set msg and msg_len to an address and length of the packet's
 * data in memory.
 * */

Func coap_packet_set_addr

void coap_packet_set_addr( struct coap_packet_t *packet, const coap_address_t *src,
                          const coap_address_t *dst );


      

Func coap_memory_init

void coap_memory_init(void);
/**
 * Initializes libcoap's memory management.
 * This function must be called once before coap_malloc() can be used on
 * constrained devices.
 */

Func coap_malloc_type

void *coap_malloc_type(coap_memory_tag_t type, size_t size);
/**
 * Allocates a chunk of @p size bytes and returns a pointer to the newly
 * allocated memory. The @p type is used to select the appropriate storage
 * container on constrained devices. The storage allocated by coap_malloc_type()
 * must be released with coap_free_type().
 *
 * @param type The type of object to be stored.
 * @param size The number of bytes requested.
 * @return     A pointer to the allocated storage or @c NULL on error.
 */

Func coap_free_type

void coap_free_type(coap_memory_tag_t type, void *p);
/**
 * Releases the memory that was allocated by coap_malloc_type(). The type tag @p
 * type must be the same that was used for allocating the object pointed to by
 * @p .
 *
 * @param type The type of the object to release.
 * @param p    A pointer to memory that was allocated by coap_malloc_type().
 */

Func coap_insert_node

int coap_insert_node(coap_queue_t **queue, coap_queue_t *node);
/**
 * Adds @p node to given @p queue, ordered by variable t in @p node.
 *
 * @param queue Queue to add to.
 * @param node Node entry to add to Queue.
 *
 * @return @c 1 added to queue, @c 0 failure.
 */

Func coap_delete_node

int coap_delete_node(coap_queue_t *node);
/**
 * Destroys specified @p node.
 *
 * @param node Node entry to remove.
 *
 * @return @c 1 node deleted from queue, @c 0 failure.
 */

Func coap_delete_all

void coap_delete_all(coap_queue_t *queue);
/**
 * Removes all items from given @p queue and frees the allocated storage.
 *
 * @param queue The queue to delete.
 */

Func coap_adjust_basetime

unsigned int coap_adjust_basetime(coap_context_t *ctx, coap_tick_t now);
/**
 * Set sendqueue_basetime in the given context object @p ctx to @p now. This
 * function returns the number of elements in the queue head that have timed
 * out.
 */

Func coap_context_set_psk

int coap_context_set_psk( coap_context_t *context, const char *hint,
                          const uint8_t *key, size_t key_len );
/**
 * Set the context's default PSK hint and/or key for a server.
 *
 * @param context The current coap_context_t object.
 * @param hint    The default PSK server hint sent to a client. If @p NULL, PSK
 *                authentication is disabled. Empty string is a valid hint.
 * @param key     The default PSK key. If @p NULL, PSK authentication will fail.
 * @param key_len The default PSK key's length. If @p 0, PSK authentication will
 *                fail.
 *
 * @return @c 1 if successful, else @c 0.
 */

Func coap_context_set_pki

int
coap_context_set_pki(coap_context_t *context,
                    coap_dtls_pki_t *setup_data);
/**
 * Set the context's default PKI information for a server.
 *
 * @param context        The current coap_context_t object.
 * @param setup_data     If @p NULL, PKI authentication will fail. Certificate
 *                       information required.
 *
 * @return @c 1 if successful, else @c 0.
 */

Func coap_context_set_pki_root_cas

int
coap_context_set_pki_root_cas(coap_context_t *context,
                             const char *ca_file,
                             const char *ca_dir);
/**
 * Set the context's default Root CA information for a client or server.
 *
 * @param context        The current coap_context_t object.
 * @param ca_file        If not @p NULL, is the full path name of a PEM encoded
 *                       file containing all the Root CAs to be used.
 * @param ca_dir         If not @p NULL, points to a directory containing PEM
 *                       encoded files containing all the Root CAs to be used.
 *
 * @return @c 1 if successful, else @c 0.
 */

Func coap_context_set_keepalive

void coap_context_set_keepalive(coap_context_t *context, unsigned int seconds);
/**
 * Set the context keepalive timer for sessions.
 * A keepalive message will be sent after if a session has been inactive,
 * i.e. no packet sent or received, for the given number of seconds.
 * For reliable protocols, a PING message will be sent. If a PONG has not
 * been received before the next PING is due to be sent, the session will
 * considered as disconnected.
 *
 * @param context        The coap_context_t object.
 * @param seconds                 Number of seconds for the inactivity timer, or zero
 *                       to disable CoAP-level keepalive messages.
 *
 * @return 1 if successful, else 0
 */

Func coap_free_context

void coap_free_context(coap_context_t *context);
/**
 * CoAP stack context must be released with coap_free_context(). This function
 * clears all entries from the receive queue and send queue and deletes the
 * resources that have been registered with @p context, and frees the attached
 * endpoints.
 *
 * @param context The current coap_context_t object to free off.
 */

Func coap_set_app_data

void coap_set_app_data(coap_context_t *context, void *data);
/**
 * Stores @p data with the given CoAP context. This function
 * overwrites any value that has previously been stored with @p
 * context.
 *
 * @param context The CoAP context.
 * @param data The data to store with wih the context. Note that this data
 *             must be valid during the lifetime of @p context.
 */

Func coap_get_app_data

void *coap_get_app_data(const coap_context_t *context);
/**
 * Returns any application-specific data that has been stored with @p
 * context using the function coap_set_app_data(). This function will
 * return @c NULL if no data has been stored.
 *
 * @param context The CoAP context.
 *
 * @return The data previously stored or @c NULL if not data stored.
 */

Func coap_send_error

coap_tid_t coap_send_error(coap_session_t *session,
                          coap_pdu_t *request,
                          unsigned char code,
                          coap_opt_filter_t opts);
/**
 * Sends an error response with code @p code for request @p request to @p dst.
 * @p opts will be passed to coap_new_error_response() to copy marked options
 * from the request. This function returns the transaction id if the message was
 * sent, or @c COAP_INVALID_TID otherwise.
 *
 * @param session         The CoAP session.
 * @param request         The original request to respond to.
 * @param code            The response code.
 * @param opts            A filter that specifies the options to copy from the
 *                        @p request.
 *
 * @return                The transaction id if the message was sent, or @c
 *                        COAP_INVALID_TID otherwise.
 */

Func coap_send_message_type

coap_tid_t
coap_send_message_type(coap_session_t *session, coap_pdu_t *request, unsigned char type);
/**
 * Helper funktion to create and send a message with @p type (usually ACK or
 * RST). This function returns @c COAP_INVALID_TID when the message was not
 * sent, a valid transaction id otherwise.
 *
 * @param session         The CoAP session.
 * @param request         The request that should be responded to.
 * @param type            Which type to set.
 * @return                transaction id on success or @c COAP_INVALID_TID
 *                        otherwise.
 */

Func coap_send_ack

coap_tid_t coap_send_ack(coap_session_t *session, coap_pdu_t *request);
/**
 * Sends an ACK message with code @c 0 for the specified @p request to @p dst.
 * This function returns the corresponding transaction id if the message was
 * sent or @c COAP_INVALID_TID on error.
 *
 * @param session         The CoAP session.
 * @param request         The request to be acknowledged.
 *
 * @return                The transaction id if ACK was sent or @c
 *                        COAP_INVALID_TID on error.
 */

Func coap_send

coap_tid_t coap_send( coap_session_t *session, coap_pdu_t *pdu );
/**
* Sends a CoAP message to given peer. The memory that is
* allocated by pdu will be released by coap_send().
* The caller must not use the pdu after calling coap_send().
*
* @param session         The CoAP session.
* @param pdu             The CoAP PDU to send.
*
* @return                The message id of the sent message or @c
*                        COAP_INVALID_TID on error.
*/

Func coap_retransmit

coap_tid_t coap_retransmit(coap_context_t *context, coap_queue_t *node);
/**
 * Handles retransmissions of confirmable messages
 *
 * @param context      The CoAP context.
 * @param node         The node to retransmit.
 *
 * @return             The message id of the sent message or @c
 *                     COAP_INVALID_TID on error.
 */

Func coap_write

unsigned int
coap_write(coap_context_t *ctx,
 coap_socket_t *sockets[],
 unsigned int max_sockets,
 unsigned int *num_sockets,
 coap_tick_t now
);


      

Func coap_read

void coap_read(coap_context_t *ctx, coap_tick_t now);
/**
 * For applications with their own message loop, reads all data from the network.
 *
 * @param ctx The CoAP context
 * @param now Current time
 */

Func coap_run_once

int coap_run_once( coap_context_t *ctx, unsigned int timeout_ms );


      

Func coap_handle_dgram

int coap_handle_dgram(coap_context_t *ctx, coap_session_t *session, uint8_t *data, size_t data_len);
/**
 * Parses and interprets a CoAP datagram with context @p ctx. This function
 * returns @c 0 if the datagram was handled, or a value less than zero on
 * error.
 *
 * @param ctx    The current CoAP context.
 * @param session The current CoAP session.
 * @param data The received packet'd data.
 * @param data_len The received packet'd data length.
 *
 * @return       @c 0 if message was handled successfully, or less than zero on
 *               error.
 */

Func coap_handle_event

int coap_handle_event(coap_context_t *context,
                     coap_event_t event,
                     coap_session_t *session);
/**
 * Invokes the event handler of @p context for the given @p event and
 * @p data.
 *
 * @param context The CoAP context whose event handler is to be called.
 * @param event   The event to deliver.
 * @param session The session related to @p event.
 * @return The result from the associated event handler or 0 if none was
 * registered.
 */

Func coap_remove_from_queue

int coap_remove_from_queue(coap_queue_t **queue,
                          coap_session_t *session,
                          coap_tid_t id,
                          coap_queue_t **node);
/**
 * This function removes the element with given @p id from the list given list.
 * If @p id was found, @p node is updated to point to the removed element. Note
 * that the storage allocated by @p node is @b not released. The caller must do
 * this manually using coap_delete_node(). This function returns @c 1 if the
 * element with id @p id was found, @c 0 otherwise. For a return value of @c 0,
 * the contents of @p node is undefined.
 *
 * @param queue The queue to search for @p id.
 * @param session The session to look for.
 * @param id    The transaction id to look for.
 * @param node  If found, @p node is updated to point to the removed node. You
 *              must release the storage pointed to by @p node manually.
 *
 * @return      @c 1 if @p id was found, @c 0 otherwise.
 */

Func coap_wait_ack

coap_tid_t
coap_wait_ack( coap_context_t *context, coap_session_t *session,
              coap_queue_t *node);


      

Func coap_cancel_all_messages

void coap_cancel_all_messages(coap_context_t *context,
                             coap_session_t *session,
                             const uint8_t *token,
                             size_t token_length);
/**
 * Cancels all outstanding messages for session @p session that have the specified
 * token.
 *
 * @param context      The context in use.
 * @param session      Session of the messages to remove.
 * @param token        Message token.
 * @param token_length Actual length of @p token.
 */

Func coap_cancel_session_messages

void
coap_cancel_session_messages(coap_context_t *context,
                            coap_session_t *session,
                            coap_nack_reason_t reason);
/**
* Cancels all outstanding messages for session @p session.
*
* @param context      The context in use.
* @param session      Session of the messages to remove.
* @param reason       The reasion for the session cancellation
*/

Func coap_dispatch

void coap_dispatch(coap_context_t *context, coap_session_t *session,
                  coap_pdu_t *pdu);
/**
 * Dispatches the PDUs from the receive queue in given context.
 */

Func coap_can_exit

int coap_can_exit(coap_context_t *context);
/**
 * Returns 1 if there are no messages to send or to dispatch in the context's
 * queues. */

Func coap_ticks

void coap_ticks(coap_tick_t *);
/**
 * Returns the current value of an internal tick counter. The counter counts \c
 * COAP_TICKS_PER_SECOND ticks every second.
 */

Func coap_option_check_critical

int coap_option_check_critical(coap_context_t *ctx,
                              coap_pdu_t *pdu,
                              coap_opt_filter_t unknown);
/**
 * Verifies that @p pdu contains no unknown critical options. Options must be
 * registered at @p ctx, using the function coap_register_option(). A basic set
 * of options is registered automatically by coap_new_context(). This function
 * returns @c 1 if @p pdu is ok, @c 0 otherwise. The given filter object @p
 * unknown will be updated with the unknown options. As only @c COAP_MAX_OPT
 * options can be signalled this way, remaining options must be examined
 * manually.
 *
 * @code
  coap_opt_filter_t f = COAP_OPT_NONE;
  coap_opt_iterator_t opt_iter;

  if (coap_option_check_critical(ctx, pdu, f) == 0) {
    coap_option_iterator_init(pdu, &opt_iter, f);

    while (coap_option_next(&opt_iter)) {
      if (opt_iter.type & 0x01) {
        ... handle unknown critical option in opt_iter ...
      }
    }
  }
   @endcode
 *
 * @param ctx      The context where all known options are registered.
 * @param pdu      The PDU to check.
 * @param unknown  The output filter that will be updated to indicate the
 *                 unknown critical options found in @p pdu.
 *
 * @return         @c 1 if everything was ok, @c 0 otherwise.
 */

Func coap_calc_timeout

unsigned int coap_calc_timeout(coap_session_t *session, unsigned char r);
/**
 * Calculates the initial timeout based on the session CoAP transmission
 * parameters 'ack_timeout', 'ack_random_factor', and COAP_TICKS_PER_SECOND.
 * The calculation requires 'ack_timeout' and 'ack_random_factor' to be in
 * Qx.FRAC_BITS fixed point notation, whereas the passed parameter @p r
 * is interpreted as the fractional part of a Q0.MAX_BITS random value.
 *
 * @param session session timeout is associated with
 * @param r  random value as fractional part of a Q0.MAX_BITS fixed point
 *           value
 * @return   COAP_TICKS_PER_SECOND * 'ack_timeout' *
 *           (1 + ('ack_random_factor' - 1) * r)
 */

Func coap_session_release

void coap_session_release(coap_session_t *session);
/**
* Decrement reference counter on a session.
* Note that the session may be deleted as a result and should not be used
* after this call.
*
* @param session The CoAP session.
*/

Func coap_session_set_app_data

void coap_session_set_app_data(coap_session_t *session, void *data);
/**
* Stores @p data with the given session. This function overwrites any value
* that has previously been stored with @p session.
*/

Func coap_session_get_app_data

void *coap_session_get_app_data(const coap_session_t *session);
/**
* Returns any application-specific data that has been stored with @p
* session using the function coap_session_set_app_data(). This function will
* return @c NULL if no data has been stored.
*/

Func coap_session_disconnected

void coap_session_disconnected(coap_session_t *session, coap_nack_reason_t reason);
/**
* Notify session that it has failed.
*
* @param session The CoAP session.
* @param reason The reason why the session was disconnected.
*/

Func coap_session_send_csm

void coap_session_send_csm(coap_session_t *session);
/**
* Notify session transport has just connected and CSM exchange can now start.
*
* @param session The CoAP session.
*/

Func coap_session_connected

void coap_session_connected(coap_session_t *session);
/**
* Notify session that it has just connected or reconnected.
*
* @param session The CoAP session.
*/

Func coap_session_set_mtu

void coap_session_set_mtu(coap_session_t *session, unsigned mtu);
/**
* Set the session MTU. This is the maximum message size that can be sent,
* excluding IP and UDP overhead.
*
* @param session The CoAP session.
* @param mtu maximum message size
*/

Func coap_session_max_pdu_size

size_t coap_session_max_pdu_size(const coap_session_t *session);
/**
 * Get maximum acceptable PDU size
 *
 * @param session The CoAP session.
 * @return maximum PDU size, not including header (but including token).
 */

Func coap_session_send

ssize_t coap_session_send(coap_session_t *session,
 const uint8_t *data, size_t datalen);
/**
* Function interface for datagram data transmission. This function returns
* the number of bytes that have been transmitted, or a value less than zero
* on error.
*
* @param session          Session to send data on.
* @param data             The data to send.
* @param datalen          The actual length of @p data.
*
* @return                 The number of bytes written on success, or a value
*                         less than zero on error.
*/

Func coap_session_write

ssize_t coap_session_write(coap_session_t *session,
 const uint8_t *data, size_t datalen);
/**
* Function interface for stream data transmission. This function returns
* the number of bytes that have been transmitted, or a value less than zero
* on error. The number of bytes written may be less than datalen because of
* congestion control.
*
* @param session          Session to send data on.
* @param data             The data to send.
* @param datalen          The actual length of @p data.
*
* @return                 The number of bytes written on success, or a value
*                         less than zero on error.
*/

Func coap_session_send_pdu

ssize_t coap_session_send_pdu(coap_session_t *session, coap_pdu_t *pdu);
/**
* Send a pdu according to the session's protocol. This function returns
* the number of bytes that have been transmitted, or a value less than zero
* on error.
*
* @param session          Session to send pdu on.
* @param pdu              The pdu to send.
*
* @return                 The number of bytes written on success, or a value
*                         less than zero on error.
*/

Func coap_session_delay_pdu

ssize_t
coap_session_delay_pdu(coap_session_t *session, coap_pdu_t *pdu,
                      struct coap_queue_t *node);


      

Func coap_endpoint_set_default_mtu

void coap_endpoint_set_default_mtu(coap_endpoint_t *endpoint, unsigned mtu);
/**
* Set the endpoint's default MTU. This is the maximum message size that can be
* sent, excluding IP and UDP overhead.
*
* @param endpoint The CoAP endpoint.
* @param mtu maximum message size
*/

Func coap_free_endpoint

void coap_free_endpoint(coap_endpoint_t *ep);


      

Func coap_session_free

void coap_session_free(coap_session_t *session);


      

Func coap_session_mfree

void coap_session_mfree(coap_session_t *session);


      

Func coap_session_set_max_retransmit

void coap_session_set_max_retransmit(coap_session_t *session,
                                    unsigned int value);
/**
* Set the CoAP maximum retransmit count before failure
*
* Number of message retransmissions before message sending is stopped
*
* @param session The CoAP session.
* @param value The value to set to. The default is 4 and should not normally
*              get changed.
*/

Func coap_session_set_ack_timeout

void coap_session_set_ack_timeout(coap_session_t *session,
                                 coap_fixed_point_t value);
/**
* Set the CoAP initial ack response timeout before the next re-transmit
*
* Number of seconds when to expect an ACK or a response to an
* outstanding CON message.
*
* @param session The CoAP session.
* @param value The value to set to. The default is 2 and should not normally
*              get changed.
*/

Func coap_session_set_ack_random_factor

void coap_session_set_ack_random_factor(coap_session_t *session,
                                       coap_fixed_point_t value);
/**
* Set the CoAP ack randomize factor
*
* A factor that is used to randomize the wait time before a message
* is retransmitted to prevent synchronization effects.
*
* @param session The CoAP session.
* @param value The value to set to. The default is 1.5 and should not normally
*              get changed.
*/

Func coap_session_get_max_transmit

unsigned int coap_session_get_max_transmit(coap_session_t *session);
/**
* Get the CoAP maximum retransmit before failure
*
* Number of message retransmissions before message sending is stopped
*
* @param session The CoAP session.
*
* @return Current maximum retransmit value
*/

Func coap_session_send_ping

coap_tid_t coap_session_send_ping(coap_session_t *session);
/**
 * Send a ping message for the session.
 * @param session The CoAP session.
 *
 * @return COAP_INVALID_TID if there is an error
 */

Func coap_clock_init

void coap_clock_init(void);
/**
 * Initializes the internal clock.
 */

Func coap_ticks

void coap_ticks(coap_tick_t *t);
/**
 * Sets @p t to the internal time with COAP_TICKS_PER_SECOND resolution.
 */

Func coap_ticks_to_rt

coap_time_t coap_ticks_to_rt(coap_tick_t t);
/**
 * Helper function that converts coap ticks to wallclock time. On POSIX, this
 * function returns the number of seconds since the epoch. On other systems, it
 * may be the calculated number of seconds since last reboot or so.
 *
 * @param t Internal system ticks.
 *
 * @return  The number of seconds that has passed since a specific reference
 *          point (seconds since epoch on POSIX).
 */

Func coap_ticks_from_rt_us

coap_tick_t coap_ticks_from_rt_us(uint64_t t);
/**
* Helper function that converts POSIX wallclock time in us to coap ticks.
*
* @param t POSIX time is us
*
* @return  coap ticks
*/

Func coap_decode_var_bytes

unsigned int coap_decode_var_bytes(const uint8_t *buf, unsigned int length);
/**
 * Decodes multiple-length byte sequences. @p buf points to an input byte
 * sequence of length @p length. Returns the decoded value.
 *
 * @param buf The input byte sequence to decode from
 * @param length The length of the input byte sequence
 *
 * @return      The decoded value
 */

Func coap_encode_var_safe

unsigned int coap_encode_var_safe(uint8_t *buf,
                                 size_t length,
                                 unsigned int value);
/**
 * Encodes multiple-length byte sequences. @p buf points to an output buffer of
 * sufficient length to store the encoded bytes. @p value is the value to
 * encode.
 * Returns the number of bytes used to encode @p value or 0 on error.
 *
 * @param buf    The output buffer to decode into
 * @param length The output buffer size to encode into (must be sufficient)
 * @param value  The value to encode into the buffer
 *
 * @return       The number of bytes used to encode @p value or @c 0 on error.
 */

Func coap_startup

void coap_startup(void);


      

Func coap_cleanup

void coap_cleanup(void);


      

Func LWIP_MEMPOOL

LWIP_MEMPOOL(COAP_CONTEXT, MEMP_NUM_COAPCONTEXT, sizeof(coap_context_t), "COAP_CONTEXT")
LWIP_MEMPOOL(COAP_ENDPOINT, MEMP_NUM_COAPENDPOINT, sizeof(coap_endpoint_t), "COAP_ENDPOINT")
LWIP_MEMPOOL(COAP_PACKET, MEMP_NUM_COAPPACKET, sizeof(coap_packet_t), "COAP_PACKET")
LWIP_MEMPOOL(COAP_NODE, MEMP_NUM_COAPNODE, sizeof(coap_queue_t), "COAP_NODE")
LWIP_MEMPOOL(COAP_PDU, MEMP_NUM_COAPPDU, sizeof(coap_pdu_t), "COAP_PDU")
LWIP_MEMPOOL(COAP_SESSION, MEMP_NUM_COAPSESSION, sizeof(coap_session_t), "COAP_SESSION")
LWIP_MEMPOOL(COAP_subscription, MEMP_NUM_COAP_SUBSCRIPTION, sizeof(coap_subscription_t), "COAP_subscription")
LWIP_MEMPOOL(COAP_RESOURCE, MEMP_NUM_COAPRESOURCE, sizeof(coap_resource_t), "COAP_RESOURCE")
LWIP_MEMPOOL(COAP_RESOURCEATTR, MEMP_NUM_COAPRESOURCEATTR, sizeof(coap_attr_t), "COAP_RESOURCEATTR")
LWIP_MEMPOOL(COAP_OPTLIST, MEMP_NUM_COAPOPTLIST, sizeof(coap_optlist_t)+MEMP_LEN_COAPOPTLIST, "COAP_OPTLIST")
LWIP_MEMPOOL(COAP_STRING, MEMP_NUM_COAPSTRING, sizeof(coap_string_t)+MEMP_LEN_COAPSTRING, "COAP_STRING")



      

Func coap_opt_parse

size_t coap_opt_parse(const coap_opt_t *opt,
                     size_t length,
                     coap_option_t *result);
/**
 * Parses the option pointed to by @p opt into @p result. This function returns
 * the number of bytes that have been parsed, or @c 0 on error. An error is
 * signaled when illegal delta or length values are encountered or when option
 * parsing would result in reading past the option (i.e. beyond opt + length).
 *
 * @param opt    The beginning of the option to parse.
 * @param length The maximum length of @p opt.
 * @param result A pointer to the coap_option_t structure that is filled with
 *               actual values iff coap_opt_parse() > 0.
 * @return       The number of bytes parsed or @c 0 on error.
 */

Func coap_opt_size

size_t coap_opt_size(const coap_opt_t *opt);
/**
 * Returns the size of the given option, taking into account a possible option
 * jump.
 *
 * @param opt An option jump or the beginning of the option.
 * @return    The number of bytes between @p opt and the end of the option
 *            starting at @p opt. In case of an error, this function returns
 *            @c 0 as options need at least one byte storage space.
 */

Func coap_option_filter_set

int coap_option_filter_set(coap_opt_filter_t filter, uint16_t type);
/**
 * Sets the corresponding entry for @p type in @p filter. This
 * function returns @c 1 if bit was set or @c 0 on error (i.e. when
 * the given type does not fit in the filter).
 *
 * @param filter The filter object to change.
 * @param type   The type for which the bit should be set.
 *
 * @return       @c 1 if bit was set, @c 0 otherwise.
 */

Func coap_option_filter_unset

int coap_option_filter_unset(coap_opt_filter_t filter, uint16_t type);
/**
 * Clears the corresponding entry for @p type in @p filter. This
 * function returns @c 1 if bit was set or @c 0 on error (i.e. when
 * the given type does not fit in the filter).
 *
 * @param filter The filter object to change.
 * @param type   The type that should be cleared from the filter.
 *
 * @return       @c 1 if bit was set, @c 0 otherwise.
 */

Func coap_option_filter_get

int coap_option_filter_get(coap_opt_filter_t filter, uint16_t type);
/**
 * Checks if @p type is contained in @p filter. This function returns
 * @c 1 if found, @c 0 if not, or @c -1 on error (i.e. when the given
 * type does not fit in the filter).
 *
 * @param filter The filter object to search.
 * @param type   The type to search for.
 *
 * @return       @c 1 if @p type was found, @c 0 otherwise, or @c -1 on error.
 */

Func coap_opt_setheader

size_t coap_opt_setheader(coap_opt_t *opt,
                         size_t maxlen,
                         uint16_t delta,
                         size_t length);
/**
 * Encodes the given delta and length values into @p opt. This function returns
 * the number of bytes that were required to encode @p delta and @p length or @c
 * 0 on error. Note that the result indicates by how many bytes @p opt must be
 * advanced to encode the option value.
 *
 * @param opt    The option buffer space where @p delta and @p length are
 *               written.
 * @param maxlen The maximum length of @p opt.
 * @param delta  The actual delta value to encode.
 * @param length The actual length value to encode.
 *
 * @return       The number of bytes used or @c 0 on error.
 */

Func coap_opt_encode_size

size_t coap_opt_encode_size(uint16_t delta, size_t length);
/**
 * Compute storage bytes needed for an option with given @p delta and
 * @p length
 *
 * @param delta  The option delta.
 * @param length The option length.
 *
 * @return       The number of bytes required to encode this option.
 */

Func coap_opt_encode

size_t coap_opt_encode(coap_opt_t *opt,
                      size_t n,
                      uint16_t delta,
                      const uint8_t *val,
                      size_t length);
/**
 * Encodes option with given @p delta into @p opt. This function returns the
 * number of bytes written to @p opt or @c 0 on error. This happens especially
 * when @p opt does not provide sufficient space to store the option value,
 * delta, and option jumps when required.
 *
 * @param opt    The option buffer space where @p val is written.
 * @param n      Maximum length of @p opt.
 * @param delta  The option delta.
 * @param val    The option value to copy into @p opt.
 * @param length The actual length of @p val.
 *
 * @return       The number of bytes that have been written to @p opt or @c 0 on
 *               error. The return value will always be less than @p n.
 */

Func coap_add_optlist_pdu

int coap_add_optlist_pdu(coap_pdu_t *pdu, coap_optlist_t** optlist_chain);
/**
 * The current optlist of @p optlist_chain is first sorted (as per RFC7272
 * ordering requirements) and then added to the @p pdu.
 *
 * @param pdu  The pdu to add the options to from the chain list
 * @param optlist_chain The chained list of optlist to add to the pdu
 *
 * @return     @c 1 if succesful or @c 0 if failure;
 */

Func coap_insert_optlist

int coap_insert_optlist(coap_optlist_t **optlist_chain,
                       coap_optlist_t *optlist);
/**
 * Adds @p optlist to the given @p optlist_chain. The optlist_chain variable
 * be set to NULL before the initial call to coap_insert_optlist().
 * The optlist_chain will need to be deleted using coap_delete_optlist()
 * when no longer required.
 *
 * @param optlist_chain The chain to add optlist to
 * @param optlist  The optlist to add to the queue
 *
 * @return         @c 1 if successful, @c 0 otherwise.
 */

Func coap_delete_optlist

void coap_delete_optlist(coap_optlist_t *optlist_chain);
/**
 * Removes all entries from the @p optlist_chain, freeing off their
 * memory usage.
 *
 * @param optlist_chain The optlist chain to remove all the entries from
 */

Func coap_pdu_resize

int coap_pdu_resize(coap_pdu_t *pdu, size_t new_size);
/**
 * Dynamically grows the size of @p pdu to @p new_size. The new size
 * must not exceed the PDU's configure maximum size. On success, this
 * function returns 1, otherwise 0.
 *
 * @param pdu      The PDU to resize.
 * @param new_size The new size in bytes.
 * @return         1 if the operation succeeded, 0 otherwise.
 */

Func coap_pdu_clear

void coap_pdu_clear(coap_pdu_t *pdu, size_t size);
/**
 * Clears any contents from @p pdu and resets @c used_size,
 * and @c data pointers. @c max_size is set to @p size, any
 * other field is set to @c 0. Note that @p pdu must be a valid
 * pointer to a coap_pdu_t object created e.g. by coap_pdu_init().
 */

Func coap_delete_pdu

void coap_delete_pdu(coap_pdu_t *);


      

Func coap_pdu_parse_header_size

size_t coap_pdu_parse_header_size(coap_proto_t proto,
                                const uint8_t *data);
/**
* Interprets @p data to determine the number of bytes in the header.
* This function returns @c 0 on error or a number greater than zero on success.
*
* @param proto  Session's protocol
* @param data   The first byte of raw data to parse as CoAP PDU.
*
* @return       A value greater than zero on success or @c 0 on error.
*/

Func coap_pdu_parse_size

size_t coap_pdu_parse_size(coap_proto_t proto,
                          const uint8_t *data,
                          size_t length);
/**
 * Parses @p data to extract the message size.
 * @p length must be at least coap_pdu_parse_header_size(proto, data).
 * This function returns @c 0 on error or a number greater than zero on success.
 *
 * @param proto  Session's protocol
 * @param data   The raw data to parse as CoAP PDU.
 * @param length The actual size of @p data.
 *
 * @return       A value greater than zero on success or @c 0 on error.
 */

Func coap_pdu_parse_header

int coap_pdu_parse_header(coap_pdu_t *pdu, coap_proto_t proto);


      

Func coap_pdu_parse_opt

int coap_pdu_parse_opt(coap_pdu_t *pdu);
/**
 * Verify consistency in the given CoAP PDU structure and locate the data.
 * This function returns @c 0 on error or a number greater than zero on
 * success.
 * This function only parses the token and options, up to the payload start
 * marker.
 *
 * @param pdu     The PDU structure to.
 *
 * @return       1 on success or @c 0 on error.
 */

Func coap_pdu_parse

int coap_pdu_parse(coap_proto_t proto,
                  const uint8_t *data,
                  size_t length,
                  coap_pdu_t *pdu);
/**
* Parses @p data into the CoAP PDU structure given in @p result.
* The target pdu must be large enough to
* This function returns @c 0 on error or a number greater than zero on success.
*
* @param proto   Session's protocol
* @param data    The raw data to parse as CoAP PDU.
* @param length  The actual size of @p data.
* @param pdu     The PDU structure to fill. Note that the structure must
*                provide space to hold at least the token and options
*                part of the message.
*
* @return       1 on success or @c 0 on error.
*/

Func coap_add_token

int coap_add_token(coap_pdu_t *pdu,
                 size_t len,
                 const uint8_t *data);
/**
 * Adds token of length @p len to @p pdu.
 * Adding the token destroys any following contents of the pdu. Hence options
 * and data must be added after coap_add_token() has been called. In @p pdu,
 * length is set to @p len + @c 4, and max_delta is set to @c 0. This function
 * returns @c 0 on error or a value greater than zero on success.
 *
 * @param pdu  The PDU where the token is to be added.
 * @param len  The length of the new token.
 * @param data The token to add.
 *
 * @return     A value greater than zero on success, or @c 0 on error.
 */

Func coap_add_option

size_t coap_add_option(coap_pdu_t *pdu,
                      uint16_t type,
                      size_t len,
                      const uint8_t *data);
/**
 * Adds option of given type to pdu that is passed as first
 * parameter.
 * coap_add_option() destroys the PDU's data, so coap_add_data() must be called
 * after all options have been added. As coap_add_token() destroys the options
 * following the token, the token must be added before coap_add_option() is
 * called. This function returns the number of bytes written or @c 0 on error.
 */

Func coap_add_option_later

uint8_t *coap_add_option_later(coap_pdu_t *pdu,
                              uint16_t type,
                              size_t len);
/**
 * Adds option of given type to pdu that is passed as first parameter, but does
 * not write a value. It works like coap_add_option with respect to calling
 * sequence (i.e. after token and before data). This function returns a memory
 * address to which the option data has to be written before the PDU can be
 * sent, or @c NULL on error.
 */

Func coap_add_data

int coap_add_data(coap_pdu_t *pdu,
                 size_t len,
                 const uint8_t *data);
/**
 * Adds given data to the pdu that is passed as first parameter. Note that the
 * PDU's data is destroyed by coap_add_option(). coap_add_data() must be called
 * only once per PDU, otherwise the result is undefined.
 */

Func coap_add_data_after

uint8_t *coap_add_data_after(coap_pdu_t *pdu, size_t len);
/**
 * Adds given data to the pdu that is passed as first parameter but does not
 * copyt it. Note that the PDU's data is destroyed by coap_add_option().
 * coap_add_data() must be have been called once for this PDU, otherwise the
 * result is undefined.
 * The actual data must be copied at the returned location.
 */

Func coap_get_data

int coap_get_data(const coap_pdu_t *pdu,
                 size_t *len,
                 uint8_t **data);
/**
 * Retrieves the length and data pointer of specified PDU. Returns 0 on error or
 * 1 if *len and *data have correct values. Note that these values are destroyed
 * with the pdu.
 */

Func coap_pdu_encode_header

size_t coap_pdu_encode_header(coap_pdu_t *pdu, coap_proto_t proto);


      

Func memcpy

memcpy(buf, &v, len);


      

Func memcpy

memcpy(buf, &v, len);


      

Func coap_add_resource

void coap_add_resource(coap_context_t *context, coap_resource_t *resource);
/**
 * Registers the given @p resource for @p context. The resource must have been
 * created by coap_resource_init() or coap_resource_unknown_init(), the
 * storage allocated for the resource will be released by coap_delete_resource().
 *
 * @param context  The context to use.
 * @param resource The resource to store.
 */

Func coap_delete_resource

int coap_delete_resource(coap_context_t *context, coap_resource_t *resource);
/**
 * Deletes a resource identified by @p resource. The storage allocated for that
 * resource is freed, and removed from the context.
 *
 * @param context  The context where the resources are stored.
 * @param resource The resource to delete.
 *
 * @return         @c 1 if the resource was found (and destroyed),
 *                 @c 0 otherwise.
 */

Func coap_delete_all_resources

void coap_delete_all_resources(coap_context_t *context);
/**
 * Deletes all resources from given @p context and frees their storage.
 *
 * @param context The CoAP context with the resources to be deleted.
 */

Func coap_delete_attr

void coap_delete_attr(coap_attr_t *attr);
/**
 * Deletes an attribute.
 * Note: This is for internal use only, as it is not deleted from its chain.
 *
 * @param attr Pointer to a previously created attribute.
 *
 */
coap_print_status_t coap_print_link(const coap_resource_t *resource,
                                   unsigned char *buf,
                                   size_t *len,
                                   size_t *offset);
/**
 * Writes a description of this resource in link-format to given text buffer. @p
 * len must be initialized to the maximum length of @p buf and will be set to
 * the number of characters actually written if successful. This function
 * returns @c 1 on success or @c 0 on error.
 *
 * @param resource The resource to describe.
 * @param buf      The output buffer to write the description to.
 * @param len      Must be initialized to the length of @p buf and
 *                 will be set to the length of the printed link description.
 * @param offset   The offset within the resource description where to
 *                 start writing into @p buf. This is useful for dealing
 *                 with the Block2 option. @p offset is updated during
 *                 output as it is consumed.
 *
 * @return If COAP_PRINT_STATUS_ERROR is set, an error occured. Otherwise,
 *         the lower 28 bits will indicate the number of characters that
 *         have actually been output into @p buffer. The flag
 *         COAP_PRINT_STATUS_TRUNC indicates that the output has been
 *         truncated.
 */

Func coap_register_handler

void coap_register_handler(coap_resource_t *resource,
                          unsigned char method,
                          coap_method_handler_t handler);
/**
 * Registers the specified @p handler as message handler for the request type @p
 * method
 *
 * @param resource The resource for which the handler shall be registered.
 * @param method   The CoAP request method to handle.
 * @param handler  The handler to register with @p resource.
 */

Func coap_touch_observer

void coap_touch_observer(coap_context_t *context,
                        coap_session_t *session,
                        const coap_binary_t *token);
/**
 * Marks an observer as alive.
 *
 * @param context  The CoAP context to use.
 * @param session  The observer's session
 * @param token    The corresponding token that has been used for the
 *                 subscription.
 */

Func coap_delete_observer

int coap_delete_observer(coap_resource_t *resource,
                        coap_session_t *session,
                        const coap_binary_t *token);
/**
 * Removes any subscription for @p observer from @p resource and releases the
 * allocated storage. The result is @c 1 if an observation relationship with @p
 * observer and @p token existed, @c 0 otherwise.
 *
 * @param resource The observed resource.
 * @param session  The observer's session.
 * @param token    The token that identifies this subscription or @c NULL for
 *                 any token.
 * @return         @c 1 if the observer has been deleted, @c 0 otherwise.
 */

Func coap_delete_observers

void coap_delete_observers(coap_context_t *context, coap_session_t *session);
/**
 * Removes any subscription for @p session and releases the allocated storage.
 *
 * @param context  The CoAP context to use.
 * @param session  The observer's session.
 */

Func coap_check_notify

void coap_check_notify(coap_context_t *context);
/**
 * Checks for all known resources, if they are dirty and notifies subscribed
 * observers.
 */

Func coap_print_wellknown

coap_print_status_t coap_print_wellknown(coap_context_t *,
                                        unsigned char *,
                                        size_t *, size_t,
                                        coap_opt_t *);


      

Func coap_handle_failed_notify

void
coap_handle_failed_notify(coap_context_t *,
                         coap_session_t *,
                         const coap_binary_t *);


      

Func coap_resource_notify_observers

int
coap_resource_notify_observers(coap_resource_t *resource,
                              const coap_string_t *query);
/**
 * Initiate the sending of an Observe packet for all observers of @p resource,
 * optionally matching @p query if not NULL
 *
 * @param resource The CoAP resource to use.
 * @param query    The Query to match against or NULL
 *
 * @return         @c 1 if the Observe has been triggered, @c 0 otherwise.
 */

Func coap_delete_string

void coap_delete_string(coap_string_t *string);
/**
 * Deletes the given string and releases any memory allocated.
 *
 * @param string The string to free off.
 */

Func coap_delete_str_const

void coap_delete_str_const(coap_str_const_t *string);
/**
 * Deletes the given const string and releases any memory allocated.
 *
 * @param string The string to free off.
 */

Func coap_subscription_init

void coap_subscription_init(coap_subscription_t *);


      

Func coap_split_uri

int coap_split_uri(const uint8_t *str_var, size_t len, coap_uri_t *uri);
/**
 * Parses a given string into URI components. The identified syntactic
 * components are stored in the result parameter @p uri. Optional URI
 * components that are not specified will be set to { 0, 0 }, except for the
 * port which is set to @c COAP_DEFAULT_PORT. This function returns @p 0 if
 * parsing succeeded, a value less than zero otherwise.
 *
 * @param str_var The string to split up.
 * @param len     The actual length of @p str_var
 * @param uri     The coap_uri_t object to store the result.
 * @return        @c 0 on success, or < 0 on error.
 *
 */

Func coap_split_path

int coap_split_path(const uint8_t *s,
                   size_t length,
                   unsigned char *buf,
                   size_t *buflen);
/**
 * Splits the given URI path into segments. Each segment is preceded
 * by an option pseudo-header with delta-value 0 and the actual length
 * of the respective segment after percent-decoding.
 *
 * @param s      The path string to split.
 * @param length The actual length of @p s.
 * @param buf    Result buffer for parsed segments.
 * @param buflen Maximum length of @p buf. Will be set to the actual number
 *               of bytes written into buf on success.
 *
 * @return       The number of segments created or @c -1 on error.
 */

Func coap_split_query

int coap_split_query(const uint8_t *s,
                    size_t length,
                    unsigned char *buf,
                    size_t *buflen);
/**
 * Splits the given URI query into segments. Each segment is preceded
 * by an option pseudo-header with delta-value 0 and the actual length
 * of the respective query term.
 *
 * @param s      The query string to split.
 * @param length The actual length of @p s.
 * @param buf    Result buffer for parsed segments.
 * @param buflen Maximum length of @p buf. Will be set to the actual number
 *               of bytes written into buf on success.
 *
 * @return       The number of segments created or @c -1 on error.
 *
 * @bug This function does not reserve additional space for delta > 12.
 */

Func ty_coap_server_start

OPERATE_RET ty_coap_server_start(OUT TY_COAP_SERVER_HANLDER *p_handler, IN CONST UINT_T port, ty_coap_init_resource_cb init_res_cb);
/**
 * @brief Create COAP wrapper instance
 * 
 * @param[out] p_handler Handler of COAP wrapper instance
 * @param[in] port Port of COAP server
 * @param[in] init_res_cb Callback after COAP wrapper inited
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_coap_add_resource

OPERATE_RET ty_coap_add_resource(IN TY_COAP_SERVER_HANLDER handler, IN CONST CHAR_T *p_uri, \
                                coap_method_handler_t post_cb, coap_method_handler_t get_cb, \
                                coap_method_handler_t put_cb, coap_method_handler_t delete_cb );
/**
 * @brief Add COAP resource
 * 
 * @param[out] handler Handler of COAP wrapper instance
 * @param[in] p_uri COAP uri
 * @param[in] post_cb Callback when POST
 * @param[in] get_cb Callback when GET
 * @param[in] put_cb Callback when PUT
 * @param[in] delete_cb Callback when DELETE
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_coap_send_custom_msg

OPERATE_RET ty_coap_send_custom_msg(IN TY_COAP_SERVER_HANLDER server_handler,
                                   CHAR_T *url, UCHAR_T upload_mode, UCHAR_T msg_type,
                                   CHAR_T *data, TY_COAP_OPTION_S *option_arr, UINT_T arr_size,
                                   coap_response_handler_t handler);
/**
 * @brief Send COAP msg
 * 
 * @param[in] server_handler Handler created by ty_coap_server_start
 * @param[in] url Coap url
 * @param[in] upload_mode Upload mode
 * @param[in] msg_type Msg type
 * @param[in] data Buffer of data buffer
 * @param[in] option_arr Options list
 * @param[in] arr_size Count of options
 * @param[in] handler Callback when msg recv
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_get_with_head

OPERATE_RET http_inf_client_get_with_head(IN CONST CHAR_T *url,
                               IN CONST HTTP_INF_CB callback,
                               INOUT PVOID_T *pri_data,
                               IN HTTP_HEAD_ADD_CB add_head_cb,
                               IN VOID* add_head_data);
/**
 * @brief This API is used to GET HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] callback Handler of HTTP response
 * @param[in] pri_data Private data used by HTTP request
 * @param[in] add_head_cb Hook before HTTP request sent, to add more HTTP header
 * @param[in] add_head_data Header data of add_head_cb
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_get_file

OPERATE_RET http_inf_client_get_file(IN CONST CHAR_T *url,
                               IN CONST HTTP_INF_CB callback,
                               INOUT PVOID_T *pri_data,
                               IN CONST UINT_T file_offset,
                               IN CONST UINT_T file_size);
/**
 * @brief This API is used to GET HTTP file
 * 
 * @param[in] url URL of HTTP request
 * @param[in] callback Handler of HTTP response
 * @param[in] pri_data Private data used by HTTP request
 * @param[in] file_offset Offset of file content
 * @param[in] file_size Max size to get from file
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_post_field

OPERATE_RET http_inf_client_post_field(IN CONST CHAR_T *url,
                                      IN CONST HTTP_INF_CB callback,
                                      IN CONST BYTE_T *data,
                                      IN CONST UINT_T len,
                                      IN HTTP_HEAD_ADD_CB add_head_cb,
                                      IN VOID* add_head_data,
                                      IN CONST CHAR_T *p_decode_key,
                                      INOUT PVOID_T *pri_data, 
                                      IN CONST http_hdr_field_sel_t field_flags);
/**
 * @brief This API is used to POST HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] callback Handler of HTTP response
 * @param[in] data data of HTTP request
 * @param[in] len length of HTTP request data
 * @param[in] add_head_cb Hook before HTTP request sent, to add more HTTP header
 * @param[in] add_head_data Header data of add_head_cb
 * @param[in] p_decode_key Decode key of HTTP content
 * @param[in] pri_data Private data used by HTTP request
 * @param[in] field_flags The http_hdr_field_sel_t, OR of zero or more flags
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_post_raw_field

OPERATE_RET http_inf_client_post_raw_field(IN CONST CHAR_T *url,
                                  IN CONST UINT_T len,
                                  INOUT HTTP_INF_H_S *p_inf,
                                  IN http_hdr_field_sel_t field_flags);
/**
 * @brief This API is used to POST raw HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] len Max length of HTTP response data
 * @param[in] p_inf Pointer to HTTP_INF_H_S
 * @param[in] field_flags The http_hdr_field_sel_t, OR of zero or more flags
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_get_raw_with_head

OPERATE_RET http_inf_client_get_raw_with_head(IN CONST CHAR_T *url,
                                    INOUT HTTP_INF_H_S *p_inf,
                                   IN UINT_T offset, IN UINT_T total_len,
                                   IN HTTP_HEAD_ADD_CB add_head_cb,
                                   IN VOID* add_head_data);
/**
 * @brief This API is used to GET raw HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] p_inf Pointer to HTTP_INF_H_S
 * @param[in] offset Offset of file content
 * @param[in] total_len Max size to get from file
 * @param[in] add_head_cb Hook before HTTP request sent, to add more HTTP header
 * @param[in] add_head_data Header data of add_head_cb
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_put_raw

OPERATE_RET http_inf_client_put_raw(IN CONST CHAR_T *url,
                                   IN INT_T len,
                                   INOUT HTTP_INF_H_S *p_inf);
/**
 * @brief This API is used to PUT raw HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] len Max length of HTTP response data
 * @param[in] p_inf Pointer to HTTP_INF_H_S
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_write_content_raw

INT_T http_inf_write_content_raw(INOUT HTTP_INF_H_S *p_inf,
                                        IN CONST BYTE_T *p_data,
                                        IN CONST UINT_T len,
                                        BOOL_T chunked );
/**
 * @brief This API is used to write raw HTTP request content
 *
 * @param[in] p_inf Pointer to HTTP_INF_H_S
 * @param[in] p_data Buffer to write of HTTP request
 * @param[in] buf_len Max length of HTTP request data
 * @param[in] chunked Chunk is enabled or not
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_inf_read_header_raw

OPERATE_RET httpc_inf_read_header_raw(INOUT HTTP_INF_H_S *p_inf);
/**
 * @brief This API is used to read raw HTTP response header
 * 
 * @param[in,out] p_inf Pointer to HTTP_INF_H_S
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func httpc_inf_read_content_raw

INT_T httpc_inf_read_content_raw(IN HTTP_INF_H_S *p_inf, IN BYTE_T *buf, IN CONST UINT_T buf_len);
/**
 * @brief This API is used to read raw HTTP response content
 * 
 * @param[in] p_inf Pointer to HTTP_INF_H_S
 * @param[in] buf Buffer to read HTTP response
 * @param[in] buf_len Max length of HTTP response data
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_close_raw

OPERATE_RET http_inf_close_raw(INOUT HTTP_INF_H_S *p_inf);
/**
 * @brief This API is used to close raw HTTP request
 * 
 * @param[in] p_inf Pointer to HTTP_INF_H_S
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_add_head_cb_post

OPERATE_RET http_inf_client_add_head_cb_post(IN CONST char *url,
                             IN CONST HTTP_INF_CB callback,
                             IN CONST BYTE_T *data,
                             IN CONST UINT_T len,
                             IN HTTP_HEAD_ADD_CB add_head_cb,
                             IN VOID* add_head_data,
                             INOUT PVOID_T *pri_data);
/**
 * @brief This API is used to POST HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] callback Handler of HTTP response
 * @param[in] data data of HTTP request
 * @param[in] len length of HTTP request data
 * @param[in] add_head_cb Hook before HTTP request sent, to add more HTTP header
 * @param[in] add_head_data Header data of add_head_cb
 * @param[in] pri_data Private data used by HTTP request
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_put

OPERATE_RET http_inf_client_put(IN CONST CHAR_T *url,
                                   IN CONST HTTP_INF_CB callback,
                                   IN CONST BYTE_T *data,
                                   IN CONST UINT_T len,
                                   IN HTTP_HEAD_ADD_CB add_head_cb,
                                   IN VOID* add_head_data,
                                   INOUT PVOID_T *pri_data);
/**
 * @brief This API is used to PUT HTTP request/response
 * 
 * @param[in] url URL of HTTP request
 * @param[in] callback Handler of HTTP response
 * @param[in] data data of HTTP request
 * @param[in] len length of HTTP request data
 * @param[in] add_head_cb Hook before HTTP request sent, to add more HTTP header
 * @param[in] add_head_data Header data of add_head_cb
 * @param[in] pri_data Private data used by HTTP request
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_inf_client_put_custom_content

OPERATE_RET http_inf_client_put_custom_content(IN CONST CHAR_T *url,
                                              IN CONST HTTP_INF_CB callback,
                                              IN http_custom_content_ctx_s *p_ctx,
                                              IN HTTP_HEAD_ADD_CB add_head_cb, IN VOID* add_head_data,
                                              INOUT PVOID_T *pri_data);
/**
 * @brief This API is used to PUT HTTP request/response with customized content
 * 
 * @param[in] url URL of HTTP request
 * @param[in] callback Handler of HTTP response
 * @param[in] p_ctx Context of HTTP request customized
 * @param[in] add_head_cb Hook before HTTP request sent, to add more HTTP header
 * @param[in] add_head_data Header data of add_head_cb
 * @param[in] pri_data Private data used by HTTP request
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func del_http_url_h

VOID del_http_url_h(IN HTTP_URL_H_S *hu_h);
/**
 * @brief Free url of HTTP request
 * 
 * @param[in] hu_h A pointer that points to the structure returned from the call to create_http_url_h
 *
 */

Func fill_url_head

OPERATE_RET fill_url_head(INOUT HTTP_URL_H_S *hu_h, IN CONST CHAR_T *url_h);
/**
 * @brief Initiaze url of HTTP request
 * 
 * @param[in,out] hu_h A pointer that points to the structure returned from the call to create_http_url_h
 * @param[in] url_h HTTP url
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func fill_url_param

OPERATE_RET fill_url_param(INOUT HTTP_URL_H_S *hu_h, IN CONST CHAR_T *key, IN CONST CHAR_T *value);
/**
 * @brief Add key/value param to HTTP url
 * 
 * @param[in,out] hu_h A pointer that points to the structure returned from the call to create_http_url_h
 * @param[in] key Key to be added to url
 * @param[in] value Value to be added to url
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_reset_session_state

void http_reset_session_state(http_session_t handle);


      

Func http_open_session

int http_open_session(http_session_t *handle,const char *hostname, \
                     int flags,int retry_cnt);
/**
 * Start an HTTP session.
 *
 * @par
 * This API starts a new HTTP session. It will create a socket and
 * then connect to the server given as a parameter.
 *
 * @param[in,out] handle Pointer to a handle for the session. Will be
 * assigned by the callee.
 * @param[in] hostname Host name or IP address.  The hostname should be in
 * the format [http://]hostname[:portno][/path/to/resource]. The fields
 * between the square brackets above are optional. The part specifying
 * the path to resource will be ignored as it is of no use during session
 * setup.
 * @param[in] flags Pass OR of the flags mentioned in enum
 * \ref http_open_flags_t.
 * @param[in] cfg This is a pointer of the type \a
 * tls_init_config_t. Please refer to file wm-tls.h for the structure
 * internals. This pointer will be passed verbatim to the tls API
 * tls_session_init(). \b If TLS (secure connection) is not needed please
 * pass NULL value.
 * @param[in] retry_cnt There are limited sockets available due to memory
 * constraints. A socket creation can fail if all sockets are currently
 * used up. If the socket creation fails, http_open_session() will wait
 * for some time and try to create the socket again for retry_cnt number
 * of times. 0 is default value which lets the SDK decide the count.
 *
 * @return WM_SUCCESS on success
 * @return -WM_E_INVAL if any of the arguments were invalid
 * @return -WM_FAIL if the API was unable to initiate an HTTP session with
 * the server.
 */

Func http_prepare_req

int http_prepare_req(http_session_t handle, const http_req_t *req,
                    http_hdr_field_sel_t field_flags);
/**
 * Prepare the HTTP header for sending to the server.
 *
 * This API will prepare an HTTP request for sending it out through
 * http_send_request(). Calling this API is mandatory before calling
 * http_send_request().
 *
 * @pre http_open_session()
 *
 * @param[in] handle Handle returned from the call to http_open_session()
 * @param[in] req Allocated and initialized \ref http_req_t structure.
 * @param[in] field_flags Bitwise OR of flags of enum \ref
 * http_hdr_field_sel_t as required by the caller.
 *
 * @note The request structure \ref http_req_t needs to be filled before
 * invoking this API.
 * @note The field_flags parameter is a way to request the http client to
 * use default field values for standard fields. If the corresponding bits
 * are not set then the respective fields are not added. The user can add
 * any custom fields including the standard ones using the API
 * http_add_header()
 *
 * @return Standard wmsdk return codes.
 */

Func http_add_header

int http_add_header(http_session_t handle, const http_req_t *req,
                   const char *name, const char *value);
/**
 * Add custom http headers to the partially generated header.
 *
 * This API allows the caller to add custom headers to the partial
 * http header generated by earlier call to http_prepare_req()
 *
 * @note Calling this API is optional and needs to be called only if custom
 * headers (or standard headers with non-default values) are to be added.
 *
 * @pre http_prepare_req()
 *
 * @param[in] handle Handle returned from the call to http_open_session()
 * @param[in] req Structure of the type \ref http_req_t passed earlier to
 * http_prepare_req()
 * @param[in] name The name of the field. e.g User-Agent or
 * If-Modified-Since
 * @param[in] value Value associated with the name given above.
 *
 * @return Standard wmsdk value.
 */

Func http_send_request

int http_send_request(http_session_t handle, const http_req_t * req, int send_content);
/**
 * Perform an HTTP request.
 *
 * This API sends the prepared request header and content if
 * applicable.
 *
 * @note If this API fails and the caller decides to abandon this
 * session altogether it needs to call the API  http_close_session()
 * explicitly. Failure to do this will cause undefined behaviour.
 *
 * @pre http_prepare_req() is mandatory. http_add_header() is optional.
 *
 * @param[in] handle Handle returned from the call to http_open_session()
 * @param[in] req The \ref http_req_t structure filled up with appropriate
 * parameters.
 *
 * @return WM_SUCCESS on success
 * @return -WM_E_IO if failed to send data to network
 * @return -WM_E_INVAL for an invalid arguments.
 */

Func http_get_response_hdr

int http_get_response_hdr(http_session_t handle, http_resp_t ** resp);
/**
 * Get the HTTP response header
 *
 * This API received the response header from the server and parses
 * it. It then populates the \ref http_resp_t structure and returns the
 * pointer to this structure. The structure \ref http_resp_t is allocated by
 * the callee.
 *
 * @par
 * The caller is expected to analyse this information to find out the
 * result of the earlier request sent through API http_send_request(). If
 * the earlier request was HTTP_GET then the caller will need to call the
 * API http_read_content() to read the data sent by the server.
 *
 * @note Calling this API is \a optional. If the caller does not want
 * to read/analyse the header and knows beforehand what to expect, it can
 * directly call http_read_content(). The API http_read_content()
 * will internally read the HTTP response header. However, the API
 * http_read_content() will return an error if the HTTP status code
 * returned is not 200.  If you need to read content in cases where the
 * return status code is other than 200 you need to call
 * http_get_response_hdr() first.
 *
 * @note After invoking this API, it is mandatory to read the entire
 * content using the http_read_content() API, especially in the case
 * of repeat http transaction on the same session handle (interleaved mode).
 * @note If this API fails and the caller decides to abandon this
 * session altogether it needs to call http_close_session()
 * explicitly. Failure to do this will cause undefined behaviour.
 *
 * @pre http_send_request() is called before.
 *
 * @param[in] handle Handle returned from the call to http_new_session()
 * @param[in,out] resp Pointer to a pointer of type \ref http_resp_t .The
 * structure will be allocated by the callee. Note that the caller does
 * \b not need to free the structure allocated and returned from this
 * API. The allocation and free is done by the callee automatically.
 *
 * @return WM_SUCCESS on success
 * @return -WM_FAIL on error
 */

Func http_get_response_hdr_value

int http_get_response_hdr_value(http_session_t handle,
               const char *header_name, char **value);


      

Func http_get_response_hdr_all

int http_get_response_hdr_all(http_session_t handle, http_header_pair_t *arr,
                 int *count);


      

Func http_read_content

int http_read_content(http_session_t handle, void *buf, unsigned int max_len);


      

Func http_parse_URL

int http_parse_URL(const char *URL, char *tmp_buf, int tmp_buf_len,
          parsed_url_t *parsed_url);
/**
 * Parse the given string into URL subcomponents.
 *
 * The hostname string syntax is:
 * [scheme://]hostname[:port][/path_to_resource?query_string#fragment_id]
 * The fields between the square brackets above are optional.
 *
 * @note Buffer management: To free the caller of the task of
 * allocating multiple buffers of arbitrary size to store each of the
 * subcomponents we use the following strategy. This API takes a temporary
 * buffer, allocated (static or dynamic) by the caller to store the
 * subcomponents. The caller needs to allocate this buffer with size equal
 * to (strlen(URL) + 10). When this API returns, the pointers in the
 * parsed_url structure will point to appropriate address in this
 * buffer. The caller may free this buffer after usage of the
 * sub-components is complete. Freeing before that will cause undefined
 * behavior.
 *
 * @param[in] URL Pointer to the string containing the URL. This API
 * will not modify this argument.
 * @param[in] tmp_buf A buffer where the strings will be stored after
 * parsing. Needs to be allocated by the caller and should be of size
 * atleast 10 greater than size of the URL string passed as first
 * argument.
 * @param[in] tmp_buf_len Size of the caller allocated, temporary buffer
 * sent as second argument.
 * @param[in, out] parsed_url Pointer to an allocated structure. The member
 * pointers will point to the appropriate address in the temporary buffer
 * holding the NULL terminated string corresponding to the subcomponent.
 *
 * @return Standard WMSDK return codes.
 */

Func http_lowlevel_read

int http_lowlevel_read(http_session_t handle, void *buf, unsigned maxlen);


      

Func http_lowlevel_write

int http_lowlevel_write(http_session_t handle, const void *buf, unsigned len);


      

Func http_write_standard

int http_write_standard(http_session_t handle, const void *buf, unsigned len);


      

Func httpc_write_chunked

int httpc_write_chunked(http_session_t handle, const char *data, int len);
/**
 * HTTP write chunked
 *
 * This API is used for chunked transfer encoding
 *
 * @note To end the chunked data transfer, this API should be called with
 * len=0, buf may be NULL
 *
 * @param[in] handle Handle retrieved from the call to http_open_session()
 * @param[in] data Pointer to the buffer to be written.
 * @param[in] len The number of bytes to be written.
 *
 * @return WM_SUCCESS is returned on success.
 * @return -WM_E_INVAL is returned in case of invalid parameters.
 * @return -WM_FAIL is returned if session is invalid.
 * @return Standard libc error codes are returned when there are other
 * problems.
 */

Func http_close_session

void http_close_session(http_session_t *handle);
/**
 * Close the session.
 *
 * This API will close the session represented by the given
 * handle. The socket associated with this session will be closed and thus
 * the TCP connection with the server will be terminated. No requests on
 * this same session will succeed after this API is called.
 *
 * @note The response structure \ref http_resp_t returned earlier from
 *  http_get_response_hdr() will be invalid after this call.
 *
 * @param[in] handle Handle returned from the previous call to
 * http_new_session(). The handle will be set to NULL by the callee thus
 * effectively blocking futher requests on the same session handle.
 *
 */

Func http_redirect_limit_set

OPERATE_RET http_redirect_limit_set(IN UINT8_T cnt);
/**
 * @brief This API is used to SET HTTP Redirect Limit Count
 *
 * @param[in] cnt The count of redirect, the max value should <= REDIRECT_CNT_MAX
 *                  Set as zero, means disable http redirect function.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func http_redirect_limit_get

UINT8_T http_redirect_limit_get(void);
/**
 * @brief This API is used to GET HTTP Redirect Limit Count
 *
 * @param[in]
 *
 * @return count of http redirect
 */

Func create_mqtt_hand

OPERATE_RET create_mqtt_hand(IN CONST CHAR_T **domain_tbl,
                            IN CONST BYTE_T domain_num,
                            IN CONST USHORT_T serv_port,
                            IN CONST BOOL_T enable_tls,
                            IN CONST MQ_CLIENT_IF_S *mqc_if,
                            IN CONST USHORT_T s_alive,
                            IN CONST MQ_DATA_RECV_CB recv_cb,
                            IN CONST CHAR_T **wakeup_domain_tbl,
                            IN CONST BYTE_T wakeup_domain_num,
                            IN CONST USHORT_T wakeup_serv_port,
                            OUT MQ_HANDLE *hand);
/**
 * @brief  Create MQTT client instance
 * 
 * @param[in] domain_tbl Domains of MQTT broker
 * @param[in] domain_num Count of domains
 * @param[in] serv_port Port of MQTT broker
 * @param[in] enable_tls TLS is enabled or not
 * @param[in] mqc_if Credentials of MQTT client
 * @param[in] s_alive MQTT hearbeat interval(unit sec), 0 will use the default timeout(60)
 * @param[in] recv_cb Callback when msg recved from broker
 * @param[in] wakeup_domain_tbl Domains of MQTT lowpower broker
 * @param[in] wakeup_domain_num Count of lowpower domains
 * @param[in] wakeup_serv_port Port of lowpower broker
 * @param[out] hand Handler of MQTT client
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_update_auth

OPERATE_RET mqtt_update_auth(IN CONST MQ_HANDLE hand, IN CONST CHAR_T *p_username, IN CONST CHAR_T *p_passwd);
/**
 * @brief  Update crenditials of MQTT client
 * 
 * @param[in] hand Handler of MQTT client
 * @param[in] p_username Username to connect to broker
 * @param[in] p_passwd Password to connect to broker
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_register_cb

OPERATE_RET mqtt_register_cb(IN CONST MQ_HANDLE hand,
                            IN CONST MQ_CONNED_CB conn_cb,
                            IN CONST MQ_DISCONN_CB dis_conn_cb,
                            IN CONST MQ_CONN_DENY_CB conn_deny_cb,
                            IN CONST MQ_PERMIT_CONN_CB permit_conn_cb,
                            IN CONST MQ_UPDATE_AUTH_CB update_auth_cb);
/**
 * @brief  Register event handers of MQTT client
 * 
 * @param[in] hand Handler of MQTT client
 * @param[in] conn_cb Hander when MQTT client is connected to broker
 * @param[in] dis_conn_cb Hander when MQTT client is disconnected to broker
 * @param[in] conn_deny_cb Hander when MQTT client is not permited to connect to broker
 * @param[in] permit_conn_cb Hander to check permission when connect to broker
 * @param[in] update_auth_cb Hander to update authentication
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_client_start

OPERATE_RET mqtt_client_start(IN CONST MQ_HANDLE hand,IN CONST CHAR_T *name);
/**
 * @brief  Connect to broker, MQTT client thread is created
 * 
 * @param[in] hand Handler of MQTT client
 * @param[in] name Name of MQTT thread
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_restart

VOID mqtt_restart(IN CONST MQ_HANDLE hand);
/**
 * @brief  Restart MQTT client
 * 
 * @param[in] hand Handler of MQTT client
 */

Func mqtt_client_quit

OPERATE_RET mqtt_client_quit(IN CONST MQ_HANDLE hand);
/**
 * @brief  Disconnect MQTT client from broker, delete MQTT client thread
 * 
 * @param[in] hand Handler of MQTT client
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func get_mqtt_conn_stat

BOOL_T get_mqtt_conn_stat(IN CONST MQ_HANDLE hand);
/**
 * @brief  Whether MQTT client is connected to broker or not
 * 
 * @param[in] hand Handler of MQTT client
 * 
 * @return TRUE indicates connected to MQTT broker,
 * FALSE indicates disconnected to MQTT broker
 */

Func mq_disconnect

VOID mq_disconnect(IN CONST MQ_HANDLE hand);
/**
 * @brief  Disconnect MQTT client from broker, will re-connect later
 * 
 * @param[in] hand Handler of MQTT client
 */

Func release_mqtt_hand

VOID release_mqtt_hand(IN CONST MQ_HANDLE hand);
/**
 * @brief  Release MQTT client
 * 
 * @param[in] hand Handler of MQTT client
 *
 * @note MQTT client shall be closed before this API invoked
 */

Func mqtt_close

VOID mqtt_close(IN CONST MQ_HANDLE hand);
/**
 * @brief  Close MQTT client socket fd, will re-connect later
 * 
 * @param[in] hand Handler of MQTT client
 */

Func mqtt_publish_async

OPERATE_RET mqtt_publish_async(IN CONST MQ_HANDLE hand,IN CONST CHAR_T *topic,IN CONST BYTE_T qos,
                              IN CONST BYTE_T *data,IN CONST INT_T len,IN CONST UINT_T to_lmt,
                              IN CONST MQ_PUB_ASYNC_IFM_CB cb,IN VOID *prv_data);
/**
 * @brief Publish a msg to the specific MQTT topic with QOS level and timeout handler
 * 
 * @param[in] hand Handler of MQTT client
 * @param[in] topic Topic that the msg will be published
 * @param[in] qos QOS level
 * @param[in] data Buffer of msg content
 * @param[in] len Length of msg content
 * @param[in] to_lmt Timeout(unit sec) of QOS-1 ACK, 0 for the default value(3)
 * @param[in] cb Callback when the msg is published and ACK is recved or timeout
 * @param[in] prv_data Private data
 * 
 * @note if(0 == qos) then to_lmt cb prv_data useless,
 * if(1 == qos) then need wait respond, other qos not support.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_get_socket_fd

INT_T mqtt_get_socket_fd(IN CONST MQ_HANDLE hand);
/**
 * @brief Retrieve MQTT client socket fd
 * 
 * @param[in] hand Handler of MQTT client
 *
 * @return MQTT client socket fd on success, -1 on error.
 */

Func mqtt_get_alive_time_s

INT_T mqtt_get_alive_time_s(IN CONST MQ_HANDLE hand);
/**
 * @brief Retrieve MQTT PING interval
 * 
 * @param[in] hand Handler of MQTT client
 *
 * @return MQTT PING interval(unit sec) on success, -1 on error.
 */

Func mqtt_book_wakeup_topic

OPERATE_RET mqtt_book_wakeup_topic(IN CONST MQ_HANDLE hand,IN CONST CHAR_T *wakeup_topic);
/**
 * @brief Subcribe a wakeup topic for lowpower device
 * 
 * @param[in] hand Handler of MQTT client
 * @param[in] wakeup_topic Topic to subscribe
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_book_additional_topic

OPERATE_RET mqtt_book_additional_topic(IN CONST MQ_HANDLE hand, IN CONST CHAR_T *topic);
/**
 * @brief Subcribe an addition topic
 * 
 * @param[in] hand Handler of MQTT client
 * @param[in] topic Topic to subscribe
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_keep_alive

OPERATE_RET mqtt_keep_alive(IN CONST MQ_HANDLE hand);
/**
 * @brief Send MQTT PING msg immediately
 * 
 * @param[in] hand Handler of MQTT client
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_subscribe_multi_topics

OPERATE_RET mqtt_subscribe_multi_topics(IN CONST MQ_HANDLE hand, IN CONST CHAR_T *topics[], 
                                       IN CONST BYTE_T cnt, MQ_MSG_RECV_CB msg_cb, BOOL_T auto_resub);
/**
 * @brief Subcribe multiple topics within one MQTT request
 * 
 * @param[in] hand Handler of MQTT client
 * @param[in] topics Array of topics to subscribe
 * @param[in] cnt Count of topics to subscribe
 * @param[in] msg_cb Callback when MQTT msgs recv. If msg_cb is NULL, 
 * msgs will transfer to default recv_cb of MQTT client
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mqtt_unsubscribe_multi_topics

OPERATE_RET mqtt_unsubscribe_multi_topics(IN CONST MQ_HANDLE hand, IN CONST CHAR_T *topics[], IN CONST BYTE_T cnt);
/**
 * @brief Unsubcribe multiple topics within one MQTT request
 * 
 * @param[in] hand Handler of MQTT client
 * @param[in] topics Array of topics to unsubscribe
 * @param[in] cnt Count of topics to unsubscribe
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func mbedtls_aes_init

void mbedtls_aes_init( mbedtls_aes_context *ctx );
/**
 * \brief          This function initializes the specified AES context.
 *
 *                 It must be the first API called before using
 *                 the context.
 *
 * \param ctx      The AES context to initialize. This must not be \c NULL.
 */

Func mbedtls_aes_free

void mbedtls_aes_free( mbedtls_aes_context *ctx );
/**
 * \brief          This function releases and clears the specified AES context.
 *
 * \param ctx      The AES context to clear.
 *                 If this is \c NULL, this function does nothing.
 *                 Otherwise, the context must have been at least initialized.
 */

Func mbedtls_aes_xts_init

void mbedtls_aes_xts_init( mbedtls_aes_xts_context *ctx );
/**
 * \brief          This function initializes the specified AES XTS context.
 *
 *                 It must be the first API called before using
 *                 the context.
 *
 * \param ctx      The AES XTS context to initialize. This must not be \c NULL.
 */

Func mbedtls_aes_xts_free

void mbedtls_aes_xts_free( mbedtls_aes_xts_context *ctx );
/**
 * \brief          This function releases and clears the specified AES XTS context.
 *
 * \param ctx      The AES XTS context to clear.
 *                 If this is \c NULL, this function does nothing.
 *                 Otherwise, the context must have been at least initialized.
 */

Func mbedtls_aes_setkey_enc

int mbedtls_aes_setkey_enc( mbedtls_aes_context *ctx, const unsigned char *key,
                   unsigned int keybits );
/**
 * \brief          This function sets the encryption key.
 *
 * \param ctx      The AES context to which the key should be bound.
 *                 It must be initialized.
 * \param key      The encryption key.
 *                 This must be a readable buffer of size \p keybits bits.
 * \param keybits  The size of data passed in bits. Valid options are:
 *                 
  • 128 bits
  • *
  • 192 bits
  • *
  • 256 bits
* * \return \c 0 on success. * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. */

Func mbedtls_aes_setkey_dec

int mbedtls_aes_setkey_dec( mbedtls_aes_context *ctx, const unsigned char *key,
                   unsigned int keybits );
/**
 * \brief          This function sets the decryption key.
 *
 * \param ctx      The AES context to which the key should be bound.
 *                 It must be initialized.
 * \param key      The decryption key.
 *                 This must be a readable buffer of size \p keybits bits.
 * \param keybits  The size of data passed. Valid options are:
 *                 
  • 128 bits
  • *
  • 192 bits
  • *
  • 256 bits
* * \return \c 0 on success. * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. */

Func mbedtls_aes_xts_setkey_enc

int mbedtls_aes_xts_setkey_enc( mbedtls_aes_xts_context *ctx,
                               const unsigned char *key,
                               unsigned int keybits );
/**
 * \brief          This function prepares an XTS context for encryption and
 *                 sets the encryption key.
 *
 * \param ctx      The AES XTS context to which the key should be bound.
 *                 It must be initialized.
 * \param key      The encryption key. This is comprised of the XTS key1
 *                 concatenated with the XTS key2.
 *                 This must be a readable buffer of size \p keybits bits.
 * \param keybits  The size of \p key passed in bits. Valid options are:
 *                 
  • 256 bits (each of key1 and key2 is a 128-bit key)
  • *
  • 512 bits (each of key1 and key2 is a 256-bit key)
* * \return \c 0 on success. * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. */

Func mbedtls_aes_xts_setkey_dec

int mbedtls_aes_xts_setkey_dec( mbedtls_aes_xts_context *ctx,
                               const unsigned char *key,
                               unsigned int keybits );
/**
 * \brief          This function prepares an XTS context for decryption and
 *                 sets the decryption key.
 *
 * \param ctx      The AES XTS context to which the key should be bound.
 *                 It must be initialized.
 * \param key      The decryption key. This is comprised of the XTS key1
 *                 concatenated with the XTS key2.
 *                 This must be a readable buffer of size \p keybits bits.
 * \param keybits  The size of \p key passed in bits. Valid options are:
 *                 
  • 256 bits (each of key1 and key2 is a 128-bit key)
  • *
  • 512 bits (each of key1 and key2 is a 256-bit key)
* * \return \c 0 on success. * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. */

Func mbedtls_aes_crypt_ecb

int mbedtls_aes_crypt_ecb( mbedtls_aes_context *ctx,
                   int mode,
                   const unsigned char input[16],
                   unsigned char output[16] );
/**
 * \brief          This function performs an AES single-block encryption or
 *                 decryption operation.
 *
 *                 It performs the operation defined in the \p mode parameter
 *                 (encrypt or decrypt), on the input data buffer defined in
 *                 the \p input parameter.
 *
 *                 mbedtls_aes_init(), and either mbedtls_aes_setkey_enc() or
 *                 mbedtls_aes_setkey_dec() must be called before the first
 *                 call to this API with the same context.
 *
 * \param ctx      The AES context to use for encryption or decryption.
 *                 It must be initialized and bound to a key.
 * \param mode     The AES operation: #MBEDTLS_AES_ENCRYPT or
 *                 #MBEDTLS_AES_DECRYPT.
 * \param input    The buffer holding the input data.
 *                 It must be readable and at least \c 16 Bytes long.
 * \param output   The buffer where the output data will be written.
 *                 It must be writeable and at least \c 16 Bytes long.

 * \return         \c 0 on success.
 */

Func mbedtls_aes_crypt_cbc

int mbedtls_aes_crypt_cbc( mbedtls_aes_context *ctx,
                   int mode,
                   size_t length,
                   unsigned char iv[16],
                   const unsigned char *input,
                   unsigned char *output );
/**
 * \brief  This function performs an AES-CBC encryption or decryption operation
 *         on full blocks.
 *
 *         It performs the operation defined in the \p mode
 *         parameter (encrypt/decrypt), on the input data buffer defined in
 *         the \p input parameter.
 *
 *         It can be called as many times as needed, until all the input
 *         data is processed. mbedtls_aes_init(), and either
 *         mbedtls_aes_setkey_enc() or mbedtls_aes_setkey_dec() must be called
 *         before the first call to this API with the same context.
 *
 * \note   This function operates on full blocks, that is, the input size
 *         must be a multiple of the AES block size of \c 16 Bytes.
 *
 * \note   Upon exit, the content of the IV is updated so that you can
 *         call the same function again on the next
 *         block(s) of data and get the same result as if it was
 *         encrypted in one call. This allows a "streaming" usage.
 *         If you need to retain the contents of the IV, you should
 *         either save it manually or use the cipher module instead.
 *
 *
 * \param ctx      The AES context to use for encryption or decryption.
 *                 It must be initialized and bound to a key.
 * \param mode     The AES operation: #MBEDTLS_AES_ENCRYPT or
 *                 #MBEDTLS_AES_DECRYPT.
 * \param length   The length of the input data in Bytes. This must be a
 *                 multiple of the block size (\c 16 Bytes).
 * \param iv       Initialization vector (updated after use).
 *                 It must be a readable and writeable buffer of \c 16 Bytes.
 * \param input    The buffer holding the input data.
 *                 It must be readable and of size \p length Bytes.
 * \param output   The buffer holding the output data.
 *                 It must be writeable and of size \p length Bytes.
 *
 * \return         \c 0 on success.
 * \return         #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH
 *                 on failure.
 */

Func mbedtls_aes_crypt_xts

int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx,
                          int mode,
                          size_t length,
                          const unsigned char data_unit[16],
                          const unsigned char *input,
                          unsigned char *output );
/**
 * \brief      This function performs an AES-XTS encryption or decryption
 *             operation for an entire XTS data unit.
 *
 *             AES-XTS encrypts or decrypts blocks based on their location as
 *             defined by a data unit number. The data unit number must be
 *             provided by \p data_unit.
 *
 *             NIST SP 800-38E limits the maximum size of a data unit to 2^20
 *             AES blocks. If the data unit is larger than this, this function
 *             returns #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH.
 *
 * \param ctx          The AES XTS context to use for AES XTS operations.
 *                     It must be initialized and bound to a key.
 * \param mode         The AES operation: #MBEDTLS_AES_ENCRYPT or
 *                     #MBEDTLS_AES_DECRYPT.
 * \param length       The length of a data unit in Bytes. This can be any
 *                     length between 16 bytes and 2^24 bytes inclusive
 *                     (between 1 and 2^20 block cipher blocks).
 * \param data_unit    The address of the data unit encoded as an array of 16
 *                     bytes in little-endian format. For disk encryption, this
 *                     is typically the index of the block device sector that
 *                     contains the data.
 * \param input        The buffer holding the input data (which is an entire
 *                     data unit). This function reads \p length Bytes from \p
 *                     input.
 * \param output       The buffer holding the output data (which is an entire
 *                     data unit). This function writes \p length Bytes to \p
 *                     output.
 *
 * \return             \c 0 on success.
 * \return             #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH if \p length is
 *                     smaller than an AES block in size (16 Bytes) or if \p
 *                     length is larger than 2^20 blocks (16 MiB).
 */

Func mbedtls_aes_crypt_cfb128

int mbedtls_aes_crypt_cfb128( mbedtls_aes_context *ctx,
                      int mode,
                      size_t length,
                      size_t *iv_off,
                      unsigned char iv[16],
                      const unsigned char *input,
                      unsigned char *output );
/**
 * \brief This function performs an AES-CFB128 encryption or decryption
 *        operation.
 *
 *        It performs the operation defined in the \p mode
 *        parameter (encrypt or decrypt), on the input data buffer
 *        defined in the \p input parameter.
 *
 *        For CFB, you must set up the context with mbedtls_aes_setkey_enc(),
 *        regardless of whether you are performing an encryption or decryption
 *        operation, that is, regardless of the \p mode parameter. This is
 *        because CFB mode uses the same key schedule for encryption and
 *        decryption.
 *
 * \note  Upon exit, the content of the IV is updated so that you can
 *        call the same function again on the next
 *        block(s) of data and get the same result as if it was
 *        encrypted in one call. This allows a "streaming" usage.
 *        If you need to retain the contents of the
 *        IV, you must either save it manually or use the cipher
 *        module instead.
 *
 *
 * \param ctx      The AES context to use for encryption or decryption.
 *                 It must be initialized and bound to a key.
 * \param mode     The AES operation: #MBEDTLS_AES_ENCRYPT or
 *                 #MBEDTLS_AES_DECRYPT.
 * \param length   The length of the input data in Bytes.
 * \param iv_off   The offset in IV (updated after use).
 *                 It must point to a valid \c size_t.
 * \param iv       The initialization vector (updated after use).
 *                 It must be a readable and writeable buffer of \c 16 Bytes.
 * \param input    The buffer holding the input data.
 *                 It must be readable and of size \p length Bytes.
 * \param output   The buffer holding the output data.
 *                 It must be writeable and of size \p length Bytes.
 *
 * \return         \c 0 on success.
 */

Func mbedtls_aes_crypt_cfb8

int mbedtls_aes_crypt_cfb8( mbedtls_aes_context *ctx,
                   int mode,
                   size_t length,
                   unsigned char iv[16],
                   const unsigned char *input,
                   unsigned char *output );
/**
 * \brief This function performs an AES-CFB8 encryption or decryption
 *        operation.
 *
 *        It performs the operation defined in the \p mode
 *        parameter (encrypt/decrypt), on the input data buffer defined
 *        in the \p input parameter.
 *
 *        Due to the nature of CFB, you must use the same key schedule for
 *        both encryption and decryption operations. Therefore, you must
 *        use the context initialized with mbedtls_aes_setkey_enc() for
 *        both #MBEDTLS_AES_ENCRYPT and #MBEDTLS_AES_DECRYPT.
 *
 * \note  Upon exit, the content of the IV is updated so that you can
 *        call the same function again on the next
 *        block(s) of data and get the same result as if it was
 *        encrypted in one call. This allows a "streaming" usage.
 *        If you need to retain the contents of the
 *        IV, you should either save it manually or use the cipher
 *        module instead.
 *
 *
 * \param ctx      The AES context to use for encryption or decryption.
 *                 It must be initialized and bound to a key.
 * \param mode     The AES operation: #MBEDTLS_AES_ENCRYPT or
 *                 #MBEDTLS_AES_DECRYPT
 * \param length   The length of the input data.
 * \param iv       The initialization vector (updated after use).
 *                 It must be a readable and writeable buffer of \c 16 Bytes.
 * \param input    The buffer holding the input data.
 *                 It must be readable and of size \p length Bytes.
 * \param output   The buffer holding the output data.
 *                 It must be writeable and of size \p length Bytes.
 *
 * \return         \c 0 on success.
 */

Func mbedtls_aes_crypt_ofb

int mbedtls_aes_crypt_ofb( mbedtls_aes_context *ctx,
                      size_t length,
                      size_t *iv_off,
                      unsigned char iv[16],
                      const unsigned char *input,
                      unsigned char *output );
/**
 * \brief       This function performs an AES-OFB (Output Feedback Mode)
 *              encryption or decryption operation.
 *
 *              For OFB, you must set up the context with
 *              mbedtls_aes_setkey_enc(), regardless of whether you are
 *              performing an encryption or decryption operation. This is
 *              because OFB mode uses the same key schedule for encryption and
 *              decryption.
 *
 *              The OFB operation is identical for encryption or decryption,
 *              therefore no operation mode needs to be specified.
 *
 * \note        Upon exit, the content of iv, the Initialisation Vector, is
 *              updated so that you can call the same function again on the next
 *              block(s) of data and get the same result as if it was encrypted
 *              in one call. This allows a "streaming" usage, by initialising
 *              iv_off to 0 before the first call, and preserving its value
 *              between calls.
 *
 *              For non-streaming use, the iv should be initialised on each call
 *              to a unique value, and iv_off set to 0 on each call.
 *
 *              If you need to retain the contents of the initialisation vector,
 *              you must either save it manually or use the cipher module
 *              instead.
 *
 * \warning     For the OFB mode, the initialisation vector must be unique
 *              every encryption operation. Reuse of an initialisation vector
 *              will compromise security.
 *
 * \param ctx      The AES context to use for encryption or decryption.
 *                 It must be initialized and bound to a key.
 * \param length   The length of the input data.
 * \param iv_off   The offset in IV (updated after use).
 *                 It must point to a valid \c size_t.
 * \param iv       The initialization vector (updated after use).
 *                 It must be a readable and writeable buffer of \c 16 Bytes.
 * \param input    The buffer holding the input data.
 *                 It must be readable and of size \p length Bytes.
 * \param output   The buffer holding the output data.
 *                 It must be writeable and of size \p length Bytes.
 *
 * \return         \c 0 on success.
 */

Func mbedtls_aes_crypt_ctr

int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx,
                      size_t length,
                      size_t *nc_off,
                      unsigned char nonce_counter[16],
                      unsigned char stream_block[16],
                      const unsigned char *input,
                      unsigned char *output );
/**
 * \brief      This function performs an AES-CTR encryption or decryption
 *             operation.
 *
 *             This function performs the operation defined in the \p mode
 *             parameter (encrypt/decrypt), on the input data buffer
 *             defined in the \p input parameter.
 *
 *             Due to the nature of CTR, you must use the same key schedule
 *             for both encryption and decryption operations. Therefore, you
 *             must use the context initialized with mbedtls_aes_setkey_enc()
 *             for both #MBEDTLS_AES_ENCRYPT and #MBEDTLS_AES_DECRYPT.
 *
 * \warning    You must never reuse a nonce value with the same key. Doing so
 *             would void the encryption for the two messages encrypted with
 *             the same nonce and key.
 *
 *             There are two common strategies for managing nonces with CTR:
 *
 *             1. You can handle everything as a single message processed over
 *             successive calls to this function. In that case, you want to
 *             set \p nonce_counter and \p nc_off to 0 for the first call, and
 *             then preserve the values of \p nonce_counter, \p nc_off and \p
 *             stream_block across calls to this function as they will be
 *             updated by this function.
 *
 *             With this strategy, you must not encrypt more than 2**128
 *             blocks of data with the same key.
 *
 *             2. You can encrypt separate messages by dividing the \p
 *             nonce_counter buffer in two areas: the first one used for a
 *             per-message nonce, handled by yourself, and the second one
 *             updated by this function internally.
 *
 *             For example, you might reserve the first 12 bytes for the
 *             per-message nonce, and the last 4 bytes for internal use. In that
 *             case, before calling this function on a new message you need to
 *             set the first 12 bytes of \p nonce_counter to your chosen nonce
 *             value, the last 4 to 0, and \p nc_off to 0 (which will cause \p
 *             stream_block to be ignored). That way, you can encrypt at most
 *             2**96 messages of up to 2**32 blocks each with the same key.
 *
 *             The per-message nonce (or information sufficient to reconstruct
 *             it) needs to be communicated with the ciphertext and must be unique.
 *             The recommended way to ensure uniqueness is to use a message
 *             counter. An alternative is to generate random nonces, but this
 *             limits the number of messages that can be securely encrypted:
 *             for example, with 96-bit random nonces, you should not encrypt
 *             more than 2**32 messages with the same key.
 *
 *             Note that for both stategies, sizes are measured in blocks and
 *             that an AES block is 16 bytes.
 *
 * \warning    Upon return, \p stream_block contains sensitive data. Its
 *             content must not be written to insecure storage and should be
 *             securely discarded as soon as it's no longer needed.
 *
 * \param ctx              The AES context to use for encryption or decryption.
 *                         It must be initialized and bound to a key.
 * \param length           The length of the input data.
 * \param nc_off           The offset in the current \p stream_block, for
 *                         resuming within the current cipher stream. The
 *                         offset pointer should be 0 at the start of a stream.
 *                         It must point to a valid \c size_t.
 * \param nonce_counter    The 128-bit nonce and counter.
 *                         It must be a readable-writeable buffer of \c 16 Bytes.
 * \param stream_block     The saved stream block for resuming. This is
 *                         overwritten by the function.
 *                         It must be a readable-writeable buffer of \c 16 Bytes.
 * \param input            The buffer holding the input data.
 *                         It must be readable and of size \p length Bytes.
 * \param output           The buffer holding the output data.
 *                         It must be writeable and of size \p length Bytes.
 *
 * \return                 \c 0 on success.
 */

Func mbedtls_internal_aes_encrypt

int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx,
                                 const unsigned char input[16],
                                 unsigned char output[16] );
/**
 * \brief           Internal AES block encryption function. This is only
 *                  exposed to allow overriding it using
 *                  \c MBEDTLS_AES_ENCRYPT_ALT.
 *
 * \param ctx       The AES context to use for encryption.
 * \param input     The plaintext block.
 * \param output    The output (ciphertext) block.
 *
 * \return          \c 0 on success.
 */

Func mbedtls_internal_aes_decrypt

int mbedtls_internal_aes_decrypt( mbedtls_aes_context *ctx,
                                 const unsigned char input[16],
                                 unsigned char output[16] );
/**
 * \brief           Internal AES block decryption function. This is only
 *                  exposed to allow overriding it using see
 *                  \c MBEDTLS_AES_DECRYPT_ALT.
 *
 * \param ctx       The AES context to use for decryption.
 * \param input     The ciphertext block.
 * \param output    The output (plaintext) block.
 *
 * \return          \c 0 on success.
 */

Func mbedtls_aes_self_test

int mbedtls_aes_self_test( int verbose );
/**
 * \brief          Checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_aesni_has_support

int mbedtls_aesni_has_support( unsigned int what );
/**
 * \brief          Internal function to detect the AES-NI feature in CPUs.
 *
 * \note           This function is only for internal use by other library
 *                 functions; you must not call it directly.
 *
 * \param what     The feature to detect
 *                 (MBEDTLS_AESNI_AES or MBEDTLS_AESNI_CLMUL)
 *
 * \return         1 if CPU has support for the feature, 0 otherwise
 */

Func mbedtls_aesni_crypt_ecb

int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
                            int mode,
                            const unsigned char input[16],
                            unsigned char output[16] );
/**
 * \brief          Internal AES-NI AES-ECB block encryption and decryption
 *
 * \note           This function is only for internal use by other library
 *                 functions; you must not call it directly.
 *
 * \param ctx      AES context
 * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
 * \param input    16-byte input block
 * \param output   16-byte output block
 *
 * \return         0 on success (cannot fail)
 */

Func mbedtls_aesni_gcm_mult

void mbedtls_aesni_gcm_mult( unsigned char c[16],
                            const unsigned char a[16],
                            const unsigned char b[16] );
/**
 * \brief          Internal GCM multiplication: c = a * b in GF(2^128)
 *
 * \note           This function is only for internal use by other library
 *                 functions; you must not call it directly.
 *
 * \param c        Result
 * \param a        First operand
 * \param b        Second operand
 *
 * \note           Both operands and result are bit strings interpreted as
 *                 elements of GF(2^128) as per the GCM spec.
 */

Func mbedtls_aesni_inverse_key

void mbedtls_aesni_inverse_key( unsigned char *invkey,
                               const unsigned char *fwdkey,
                               int nr );
/**
 * \brief           Internal round key inversion. This function computes
 *                  decryption round keys from the encryption round keys.
 *
 * \note            This function is only for internal use by other library
 *                  functions; you must not call it directly.
 *
 * \param invkey    Round keys for the equivalent inverse cipher
 * \param fwdkey    Original round keys (for encryption)
 * \param nr        Number of rounds (that is, number of round keys minus one)
 */

Func mbedtls_aesni_setkey_enc

int mbedtls_aesni_setkey_enc( unsigned char *rk,
                             const unsigned char *key,
                             size_t bits );
/**
 * \brief           Internal key expansion for encryption
 *
 * \note            This function is only for internal use by other library
 *                  functions; you must not call it directly.
 *
 * \param rk        Destination buffer where the round keys are written
 * \param key       Encryption key
 * \param bits      Key size in bits (must be 128, 192 or 256)
 *
 * \return          0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH
 */

Func mbedtls_arc4_init

void mbedtls_arc4_init( mbedtls_arc4_context *ctx );
/**
 * \brief          Initialize ARC4 context
 *
 * \param ctx      ARC4 context to be initialized
 *
 * \warning        ARC4 is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 *
 */

Func mbedtls_arc4_free

void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
/**
 * \brief          Clear ARC4 context
 *
 * \param ctx      ARC4 context to be cleared
 *
 * \warning        ARC4 is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 *
 */

Func mbedtls_arc4_setup

void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
                unsigned int keylen );
/**
 * \brief          ARC4 key schedule
 *
 * \param ctx      ARC4 context to be setup
 * \param key      the secret key
 * \param keylen   length of the key, in bytes
 *
 * \warning        ARC4 is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 *
 */

Func mbedtls_arc4_crypt

int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
               unsigned char *output );
/**
 * \brief          ARC4 cipher function
 *
 * \param ctx      ARC4 context
 * \param length   length of the input data
 * \param input    buffer holding the input data
 * \param output   buffer for the output data
 *
 * \return         0 if successful
 *
 * \warning        ARC4 is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 *
 */

Func mbedtls_arc4_self_test

int mbedtls_arc4_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 *
 * \warning        ARC4 is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 *
 */

Func mbedtls_aria_init

void mbedtls_aria_init( mbedtls_aria_context *ctx );
/**
 * \brief          This function initializes the specified ARIA context.
 *
 *                 It must be the first API called before using
 *                 the context.
 *
 * \param ctx      The ARIA context to initialize. This must not be \c NULL.
 */

Func mbedtls_aria_free

void mbedtls_aria_free( mbedtls_aria_context *ctx );
/**
 * \brief          This function releases and clears the specified ARIA context.
 *
 * \param ctx      The ARIA context to clear. This may be \c NULL, in which
 *                 case this function returns immediately. If it is not \c NULL,
 *                 it must point to an initialized ARIA context.
 */

Func mbedtls_aria_setkey_enc

int mbedtls_aria_setkey_enc( mbedtls_aria_context *ctx,
                            const unsigned char *key,
                            unsigned int keybits );
/**
 * \brief          This function sets the encryption key.
 *
 * \param ctx      The ARIA context to which the key should be bound.
 *                 This must be initialized.
 * \param key      The encryption key. This must be a readable buffer
 *                 of size \p keybits Bits.
 * \param keybits  The size of \p key in Bits. Valid options are:
 *                 
  • 128 bits
  • *
  • 192 bits
  • *
  • 256 bits
* * \return \c 0 on success. * \return A negative error code on failure. */

Func mbedtls_aria_setkey_dec

int mbedtls_aria_setkey_dec( mbedtls_aria_context *ctx,
                            const unsigned char *key,
                            unsigned int keybits );
/**
 * \brief          This function sets the decryption key.
 *
 * \param ctx      The ARIA context to which the key should be bound.
 *                 This must be initialized.
 * \param key      The decryption key. This must be a readable buffer
 *                 of size \p keybits Bits.
 * \param keybits  The size of data passed. Valid options are:
 *                 
  • 128 bits
  • *
  • 192 bits
  • *
  • 256 bits
* * \return \c 0 on success. * \return A negative error code on failure. */

Func mbedtls_aria_crypt_ecb

int mbedtls_aria_crypt_ecb( mbedtls_aria_context *ctx,
                           const unsigned char input[MBEDTLS_ARIA_BLOCKSIZE],
                           unsigned char output[MBEDTLS_ARIA_BLOCKSIZE] );
/**
 * \brief          This function performs an ARIA single-block encryption or
 *                 decryption operation.
 *
 *                 It performs encryption or decryption (depending on whether
 *                 the key was set for encryption on decryption) on the input
 *                 data buffer defined in the \p input parameter.
 *
 *                 mbedtls_aria_init(), and either mbedtls_aria_setkey_enc() or
 *                 mbedtls_aria_setkey_dec() must be called before the first
 *                 call to this API with the same context.
 *
 * \param ctx      The ARIA context to use for encryption or decryption.
 *                 This must be initialized and bound to a key.
 * \param input    The 16-Byte buffer holding the input data.
 * \param output   The 16-Byte buffer holding the output data.

 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_aria_crypt_cbc

int mbedtls_aria_crypt_cbc( mbedtls_aria_context *ctx,
                           int mode,
                           size_t length,
                           unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE],
                           const unsigned char *input,
                           unsigned char *output );
/**
 * \brief  This function performs an ARIA-CBC encryption or decryption operation
 *         on full blocks.
 *
 *         It performs the operation defined in the \p mode
 *         parameter (encrypt/decrypt), on the input data buffer defined in
 *         the \p input parameter.
 *
 *         It can be called as many times as needed, until all the input
 *         data is processed. mbedtls_aria_init(), and either
 *         mbedtls_aria_setkey_enc() or mbedtls_aria_setkey_dec() must be called
 *         before the first call to this API with the same context.
 *
 * \note   This function operates on aligned blocks, that is, the input size
 *         must be a multiple of the ARIA block size of 16 Bytes.
 *
 * \note   Upon exit, the content of the IV is updated so that you can
 *         call the same function again on the next
 *         block(s) of data and get the same result as if it was
 *         encrypted in one call. This allows a "streaming" usage.
 *         If you need to retain the contents of the IV, you should
 *         either save it manually or use the cipher module instead.
 *
 *
 * \param ctx      The ARIA context to use for encryption or decryption.
 *                 This must be initialized and bound to a key.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_ARIA_ENCRYPT for encryption, or
 *                 #MBEDTLS_ARIA_DECRYPT for decryption.
 * \param length   The length of the input data in Bytes. This must be a
 *                 multiple of the block size (16 Bytes).
 * \param iv       Initialization vector (updated after use).
 *                 This must be a readable buffer of size 16 Bytes.
 * \param input    The buffer holding the input data. This must
 *                 be a readable buffer of length \p length Bytes.
 * \param output   The buffer holding the output data. This must
 *                 be a writable buffer of length \p length Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_aria_crypt_cfb128

int mbedtls_aria_crypt_cfb128( mbedtls_aria_context *ctx,
                              int mode,
                              size_t length,
                              size_t *iv_off,
                              unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE],
                              const unsigned char *input,
                              unsigned char *output );
/**
 * \brief This function performs an ARIA-CFB128 encryption or decryption
 *        operation.
 *
 *        It performs the operation defined in the \p mode
 *        parameter (encrypt or decrypt), on the input data buffer
 *        defined in the \p input parameter.
 *
 *        For CFB, you must set up the context with mbedtls_aria_setkey_enc(),
 *        regardless of whether you are performing an encryption or decryption
 *        operation, that is, regardless of the \p mode parameter. This is
 *        because CFB mode uses the same key schedule for encryption and
 *        decryption.
 *
 * \note  Upon exit, the content of the IV is updated so that you can
 *        call the same function again on the next
 *        block(s) of data and get the same result as if it was
 *        encrypted in one call. This allows a "streaming" usage.
 *        If you need to retain the contents of the
 *        IV, you must either save it manually or use the cipher
 *        module instead.
 *
 *
 * \param ctx      The ARIA context to use for encryption or decryption.
 *                 This must be initialized and bound to a key.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_ARIA_ENCRYPT for encryption, or
 *                 #MBEDTLS_ARIA_DECRYPT for decryption.
 * \param length   The length of the input data \p input in Bytes.
 * \param iv_off   The offset in IV (updated after use).
 *                 This must not be larger than 15.
 * \param iv       The initialization vector (updated after use).
 *                 This must be a readable buffer of size 16 Bytes.
 * \param input    The buffer holding the input data. This must
 *                 be a readable buffer of length \p length Bytes.
 * \param output   The buffer holding the output data. This must
 *                 be a writable buffer of length \p length Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_aria_crypt_ctr

int mbedtls_aria_crypt_ctr( mbedtls_aria_context *ctx,
                           size_t length,
                           size_t *nc_off,
                           unsigned char nonce_counter[MBEDTLS_ARIA_BLOCKSIZE],
                           unsigned char stream_block[MBEDTLS_ARIA_BLOCKSIZE],
                           const unsigned char *input,
                           unsigned char *output );
/**
 * \brief      This function performs an ARIA-CTR encryption or decryption
 *             operation.
 *
 *             This function performs the operation defined in the \p mode
 *             parameter (encrypt/decrypt), on the input data buffer
 *             defined in the \p input parameter.
 *
 *             Due to the nature of CTR, you must use the same key schedule
 *             for both encryption and decryption operations. Therefore, you
 *             must use the context initialized with mbedtls_aria_setkey_enc()
 *             for both #MBEDTLS_ARIA_ENCRYPT and #MBEDTLS_ARIA_DECRYPT.
 *
 * \warning    You must never reuse a nonce value with the same key. Doing so
 *             would void the encryption for the two messages encrypted with
 *             the same nonce and key.
 *
 *             There are two common strategies for managing nonces with CTR:
 *
 *             1. You can handle everything as a single message processed over
 *             successive calls to this function. In that case, you want to
 *             set \p nonce_counter and \p nc_off to 0 for the first call, and
 *             then preserve the values of \p nonce_counter, \p nc_off and \p
 *             stream_block across calls to this function as they will be
 *             updated by this function.
 *
 *             With this strategy, you must not encrypt more than 2**128
 *             blocks of data with the same key.
 *
 *             2. You can encrypt separate messages by dividing the \p
 *             nonce_counter buffer in two areas: the first one used for a
 *             per-message nonce, handled by yourself, and the second one
 *             updated by this function internally.
 *
 *             For example, you might reserve the first 12 bytes for the
 *             per-message nonce, and the last 4 bytes for internal use. In that
 *             case, before calling this function on a new message you need to
 *             set the first 12 bytes of \p nonce_counter to your chosen nonce
 *             value, the last 4 to 0, and \p nc_off to 0 (which will cause \p
 *             stream_block to be ignored). That way, you can encrypt at most
 *             2**96 messages of up to 2**32 blocks each with the same key.
 *
 *             The per-message nonce (or information sufficient to reconstruct
 *             it) needs to be communicated with the ciphertext and must be unique.
 *             The recommended way to ensure uniqueness is to use a message
 *             counter. An alternative is to generate random nonces, but this
 *             limits the number of messages that can be securely encrypted:
 *             for example, with 96-bit random nonces, you should not encrypt
 *             more than 2**32 messages with the same key.
 *
 *             Note that for both stategies, sizes are measured in blocks and
 *             that an ARIA block is 16 bytes.
 *
 * \warning    Upon return, \p stream_block contains sensitive data. Its
 *             content must not be written to insecure storage and should be
 *             securely discarded as soon as it's no longer needed.
 *
 * \param ctx              The ARIA context to use for encryption or decryption.
 *                         This must be initialized and bound to a key.
 * \param length           The length of the input data \p input in Bytes.
 * \param nc_off           The offset in Bytes in the current \p stream_block,
 *                         for resuming within the current cipher stream. The
 *                         offset pointer should be \c 0 at the start of a
 *                         stream. This must not be larger than \c 15 Bytes.
 * \param nonce_counter    The 128-bit nonce and counter. This must point to
 *                         a read/write buffer of length \c 16 bytes.
 * \param stream_block     The saved stream block for resuming. This must
 *                         point to a read/write buffer of length \c 16 bytes.
 *                         This is overwritten by the function.
 * \param input            The buffer holding the input data. This must
 *                         be a readable buffer of length \p length Bytes.
 * \param output           The buffer holding the output data. This must
 *                         be a writable buffer of length \p length Bytes.
 *
 * \return                 \c 0 on success.
 * \return                 A negative error code on failure.
 */

Func mbedtls_aria_self_test

int mbedtls_aria_self_test( int verbose );
/**
 * \brief          Checkup routine.
 *
 * \return         \c 0 on success, or \c 1 on failure.
 */

Func mbedtls_asn1_get_len

int mbedtls_asn1_get_len( unsigned char **p,
                 const unsigned char *end,
                 size_t *len );
/**
 * \brief       Get the length of an ASN.1 element.
 *              Updates the pointer to immediately behind the length.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param len   The variable that will receive the value
 *
 * \return      0 if successful, MBEDTLS_ERR_ASN1_OUT_OF_DATA on reaching
 *              end of data, MBEDTLS_ERR_ASN1_INVALID_LENGTH if length is
 *              unparseable.
 */

Func mbedtls_asn1_get_tag

int mbedtls_asn1_get_tag( unsigned char **p,
                 const unsigned char *end,
                 size_t *len, int tag );
/**
 * \brief       Get the tag and length of the tag. Check for the requested tag.
 *              Updates the pointer to immediately behind the tag and length.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param len   The variable that will receive the length
 * \param tag   The expected tag
 *
 * \return      0 if successful, MBEDTLS_ERR_ASN1_UNEXPECTED_TAG if tag did
 *              not match requested tag, or another specific ASN.1 error code.
 */

Func mbedtls_asn1_get_bool

int mbedtls_asn1_get_bool( unsigned char **p,
                  const unsigned char *end,
                  int *val );
/**
 * \brief       Retrieve a boolean ASN.1 tag and its value.
 *              Updates the pointer to immediately behind the full tag.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param val   The variable that will receive the value
 *
 * \return      0 if successful or a specific ASN.1 error code.
 */

Func mbedtls_asn1_get_int

int mbedtls_asn1_get_int( unsigned char **p,
                 const unsigned char *end,
                 int *val );
/**
 * \brief       Retrieve an integer ASN.1 tag and its value.
 *              Updates the pointer to immediately behind the full tag.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param val   The variable that will receive the value
 *
 * \return      0 if successful or a specific ASN.1 error code.
 */

Func mbedtls_asn1_get_bitstring

int mbedtls_asn1_get_bitstring( unsigned char **p, const unsigned char *end,
                       mbedtls_asn1_bitstring *bs);
/**
 * \brief       Retrieve a bitstring ASN.1 tag and its value.
 *              Updates the pointer to immediately behind the full tag.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param bs    The variable that will receive the value
 *
 * \return      0 if successful or a specific ASN.1 error code.
 */

Func mbedtls_asn1_get_bitstring_null

int mbedtls_asn1_get_bitstring_null( unsigned char **p, const unsigned char *end,
                            size_t *len );
/**
 * \brief       Retrieve a bitstring ASN.1 tag without unused bits and its
 *              value.
 *              Updates the pointer to the beginning of the bit/octet string.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param len   Length of the actual bit/octect string in bytes
 *
 * \return      0 if successful or a specific ASN.1 error code.
 */

Func mbedtls_asn1_get_sequence_of

int mbedtls_asn1_get_sequence_of( unsigned char **p,
                         const unsigned char *end,
                         mbedtls_asn1_sequence *cur,
                         int tag);
/**
 * \brief       Parses and splits an ASN.1 "SEQUENCE OF "
 *              Updated the pointer to immediately behind the full sequence tag.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param cur   First variable in the chain to fill
 * \param tag   Type of sequence
 *
 * \return      0 if successful or a specific ASN.1 error code.
 */

Func mbedtls_asn1_get_mpi

int mbedtls_asn1_get_mpi( unsigned char **p,
                 const unsigned char *end,
                 mbedtls_mpi *X );
/**
 * \brief       Retrieve a MPI value from an integer ASN.1 tag.
 *              Updates the pointer to immediately behind the full tag.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param X     The MPI that will receive the value
 *
 * \return      0 if successful or a specific ASN.1 or MPI error code.
 */

Func mbedtls_asn1_get_alg

int mbedtls_asn1_get_alg( unsigned char **p,
                 const unsigned char *end,
                 mbedtls_asn1_buf *alg, mbedtls_asn1_buf *params );
/**
 * \brief       Retrieve an AlgorithmIdentifier ASN.1 sequence.
 *              Updates the pointer to immediately behind the full
 *              AlgorithmIdentifier.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param alg   The buffer to receive the OID
 * \param params The buffer to receive the params (if any)
 *
 * \return      0 if successful or a specific ASN.1 or MPI error code.
 */

Func mbedtls_asn1_get_alg_null

int mbedtls_asn1_get_alg_null( unsigned char **p,
                      const unsigned char *end,
                      mbedtls_asn1_buf *alg );
/**
 * \brief       Retrieve an AlgorithmIdentifier ASN.1 sequence with NULL or no
 *              params.
 *              Updates the pointer to immediately behind the full
 *              AlgorithmIdentifier.
 *
 * \param p     The position in the ASN.1 data
 * \param end   End of data
 * \param alg   The buffer to receive the OID
 *
 * \return      0 if successful or a specific ASN.1 or MPI error code.
 */

Func mbedtls_asn1_free_named_data

void mbedtls_asn1_free_named_data( mbedtls_asn1_named_data *entry );
/**
 * \brief       Free a mbedtls_asn1_named_data entry
 *
 * \param entry The named data entry to free
 */

Func mbedtls_asn1_free_named_data_list

void mbedtls_asn1_free_named_data_list( mbedtls_asn1_named_data **head );
/**
 * \brief       Free all entries in a mbedtls_asn1_named_data list
 *              Head will be set to NULL
 *
 * \param head  Pointer to the head of the list of named data entries to free
 */

Func mbedtls_asn1_write_len

int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start,
                           size_t len );
/**
 * \brief           Write a length field in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param len       The length value to write.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_tag

int mbedtls_asn1_write_tag( unsigned char **p, unsigned char *start,
                           unsigned char tag );
/**
 * \brief           Write an ASN.1 tag in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param tag       The tag to write.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_raw_buffer

int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
                                  const unsigned char *buf, size_t size );
/**
 * \brief           Write raw buffer data.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param buf       The data buffer to write.
 * \param size      The length of the data buffer.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_mpi

int mbedtls_asn1_write_mpi( unsigned char **p, unsigned char *start,
                           const mbedtls_mpi *X );
/**
 * \brief           Write a arbitrary-precision number (#MBEDTLS_ASN1_INTEGER)
 *                  in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param X         The MPI to write.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_null

int mbedtls_asn1_write_null( unsigned char **p, unsigned char *start );
/**
 * \brief           Write a NULL tag (#MBEDTLS_ASN1_NULL) with zero data
 *                  in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_oid

int mbedtls_asn1_write_oid( unsigned char **p, unsigned char *start,
                           const char *oid, size_t oid_len );
/**
 * \brief           Write an OID tag (#MBEDTLS_ASN1_OID) and data
 *                  in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param oid       The OID to write.
 * \param oid_len   The length of the OID.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_algorithm_identifier

int mbedtls_asn1_write_algorithm_identifier( unsigned char **p,
                                            unsigned char *start,
                                            const char *oid, size_t oid_len,
                                            size_t par_len );
/**
 * \brief           Write an AlgorithmIdentifier sequence in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param oid       The OID of the algorithm to write.
 * \param oid_len   The length of the algorithm's OID.
 * \param par_len   The length of the parameters, which must be already written.
 *                  If 0, NULL parameters are added
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_bool

int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start,
                            int boolean );
/**
 * \brief           Write a boolean tag (#MBEDTLS_ASN1_BOOLEAN) and value
 *                  in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param boolean   The boolean value to write, either \c 0 or \c 1.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_int

int mbedtls_asn1_write_int( unsigned char **p, unsigned char *start, int val );
/**
 * \brief           Write an int tag (#MBEDTLS_ASN1_INTEGER) and value
 *                  in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param val       The integer value to write.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_asn1_write_tagged_string

int mbedtls_asn1_write_tagged_string( unsigned char **p, unsigned char *start,
                                     int tag, const char *text,
                                     size_t text_len );
/**
 * \brief           Write a string in ASN.1 format using a specific
 *                  string encoding tag.

 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param tag       The string encoding tag to write, e.g.
 *                  #MBEDTLS_ASN1_UTF8_STRING.
 * \param text      The string to write.
 * \param text_len  The length of \p text in bytes (which might
 *                  be strictly larger than the number of characters).
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_asn1_write_printable_string

int mbedtls_asn1_write_printable_string( unsigned char **p,
                                        unsigned char *start,
                                        const char *text, size_t text_len );
/**
 * \brief           Write a string in ASN.1 format using the PrintableString
 *                  string encoding tag (#MBEDTLS_ASN1_PRINTABLE_STRING).
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param text      The string to write.
 * \param text_len  The length of \p text in bytes (which might
 *                  be strictly larger than the number of characters).
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_asn1_write_utf8_string

int mbedtls_asn1_write_utf8_string( unsigned char **p, unsigned char *start,
                                   const char *text, size_t text_len );
/**
 * \brief           Write a UTF8 string in ASN.1 format using the UTF8String
 *                  string encoding tag (#MBEDTLS_ASN1_PRINTABLE_STRING).
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param text      The string to write.
 * \param text_len  The length of \p text in bytes (which might
 *                  be strictly larger than the number of characters).
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_asn1_write_ia5_string

int mbedtls_asn1_write_ia5_string( unsigned char **p, unsigned char *start,
                                  const char *text, size_t text_len );
/**
 * \brief           Write a string in ASN.1 format using the IA5String
 *                  string encoding tag (#MBEDTLS_ASN1_IA5_STRING).
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param text      The string to write.
 * \param text_len  The length of \p text in bytes (which might
 *                  be strictly larger than the number of characters).
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_asn1_write_bitstring

int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start,
                                 const unsigned char *buf, size_t bits );
/**
 * \brief           Write a bitstring tag (#MBEDTLS_ASN1_BIT_STRING) and
 *                  value in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param buf       The bitstring to write.
 * \param bits      The total number of bits in the bitstring.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_asn1_write_octet_string

int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start,
                                    const unsigned char *buf, size_t size );
/**
 * \brief           Write an octet string tag (#MBEDTLS_ASN1_OCTET_STRING)
 *                  and value in ASN.1 format.
 *
 * \note            This function works backwards in data buffer.
 *
 * \param p         The reference to the current position pointer.
 * \param start     The start of the buffer, for bounds-checking.
 * \param buf       The buffer holding the data to write.
 * \param size      The length of the data buffer \p buf.
 *
 * \return          The number of bytes written to \p p on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_base64_encode

int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen,
                  const unsigned char *src, size_t slen );
/**
 * \brief          Encode a buffer into base64 format
 *
 * \param dst      destination buffer
 * \param dlen     size of the destination buffer
 * \param olen     number of bytes written
 * \param src      source buffer
 * \param slen     amount of data to be encoded
 *
 * \return         0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL.
 *                 *olen is always updated to reflect the amount
 *                 of data that has (or would have) been written.
 *                 If that length cannot be represented, then no data is
 *                 written to the buffer and *olen is set to the maximum
 *                 length representable as a size_t.
 *
 * \note           Call this function with dlen = 0 to obtain the
 *                 required buffer size in *olen
 */

Func mbedtls_base64_decode

int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen,
                  const unsigned char *src, size_t slen );
/**
 * \brief          Decode a base64-formatted buffer
 *
 * \param dst      destination buffer (can be NULL for checking size)
 * \param dlen     size of the destination buffer
 * \param olen     number of bytes written
 * \param src      source buffer
 * \param slen     amount of data to be decoded
 *
 * \return         0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or
 *                 MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is
 *                 not correct. *olen is always updated to reflect the amount
 *                 of data that has (or would have) been written.
 *
 * \note           Call this function with *dst = NULL or dlen = 0 to obtain
 *                 the required buffer size in *olen
 */

Func mbedtls_base64_self_test

int mbedtls_base64_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Func mbedtls_mpi_init

void mbedtls_mpi_init( mbedtls_mpi *X );
/**
 * \brief           Initialize an MPI context.
 *
 *                  This makes the MPI ready to be set or freed,
 *                  but does not define a value for the MPI.
 *
 * \param X         The MPI context to initialize. This must not be \c NULL.
 */

Func mbedtls_mpi_free

void mbedtls_mpi_free( mbedtls_mpi *X );
/**
 * \brief          This function frees the components of an MPI context.
 *
 * \param X        The MPI context to be cleared. This may be \c NULL,
 *                 in which case this function is a no-op. If it is
 *                 not \c NULL, it must point to an initialized MPI.
 */

Func mbedtls_mpi_grow

int mbedtls_mpi_grow( mbedtls_mpi *X, size_t nblimbs );
/**
 * \brief          Enlarge an MPI to the specified number of limbs.
 *
 * \note           This function does nothing if the MPI is
 *                 already large enough.
 *
 * \param X        The MPI to grow. It must be initialized.
 * \param nblimbs  The target number of limbs.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         Another negative error code on other kinds of failure.
 */

Func mbedtls_mpi_shrink

int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs );
/**
 * \brief          This function resizes an MPI downwards, keeping at least the
 *                 specified number of limbs.
 *
 *                 If \c X is smaller than \c nblimbs, it is resized up
 *                 instead.
 *
 * \param X        The MPI to shrink. This must point to an initialized MPI.
 * \param nblimbs  The minimum number of limbs to keep.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed
 *                 (this can only happen when resizing up).
 * \return         Another negative error code on other kinds of failure.
 */

Func mbedtls_mpi_copy

int mbedtls_mpi_copy( mbedtls_mpi *X, const mbedtls_mpi *Y );
/**
 * \brief          Make a copy of an MPI.
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param Y        The source MPI. This must point to an initialized MPI.
 *
 * \note           The limb-buffer in the destination MPI is enlarged
 *                 if necessary to hold the value in the source MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         Another negative error code on other kinds of failure.
 */

Func mbedtls_mpi_swap

void mbedtls_mpi_swap( mbedtls_mpi *X, mbedtls_mpi *Y );
/**
 * \brief          Swap the contents of two MPIs.
 *
 * \param X        The first MPI. It must be initialized.
 * \param Y        The second MPI. It must be initialized.
 */

Func mbedtls_mpi_safe_cond_assign

int mbedtls_mpi_safe_cond_assign( mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign );
/**
 * \brief          Perform a safe conditional copy of MPI which doesn't
 *                 reveal whether the condition was true or not.
 *
 * \param X        The MPI to conditionally assign to. This must point
 *                 to an initialized MPI.
 * \param Y        The MPI to be assigned from. This must point to an
 *                 initialized MPI.
 * \param assign   The condition deciding whether to perform the
 *                 assignment or not. Possible values:
 *                 * \c 1: Perform the assignment `X = Y`.
 *                 * \c 0: Keep the original value of \p X.
 *
 * \note           This function is equivalent to
 *                      `if( assign ) mbedtls_mpi_copy( X, Y );`
 *                 except that it avoids leaking any information about whether
 *                 the assignment was done or not (the above code may leak
 *                 information through branch prediction and/or memory access
 *                 patterns analysis).
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         Another negative error code on other kinds of failure.
 */

Func mbedtls_mpi_safe_cond_swap

int mbedtls_mpi_safe_cond_swap( mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char assign );
/**
 * \brief          Perform a safe conditional swap which doesn't
 *                 reveal whether the condition was true or not.
 *
 * \param X        The first MPI. This must be initialized.
 * \param Y        The second MPI. This must be initialized.
 * \param assign   The condition deciding whether to perform
 *                 the swap or not. Possible values:
 *                 * \c 1: Swap the values of \p X and \p Y.
 *                 * \c 0: Keep the original values of \p X and \p Y.
 *
 * \note           This function is equivalent to
 *                      if( assign ) mbedtls_mpi_swap( X, Y );
 *                 except that it avoids leaking any information about whether
 *                 the assignment was done or not (the above code may leak
 *                 information through branch prediction and/or memory access
 *                 patterns analysis).
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         Another negative error code on other kinds of failure.
 *
 */

Func mbedtls_mpi_lset

int mbedtls_mpi_lset( mbedtls_mpi *X, mbedtls_mpi_sint z );
/**
 * \brief          Store integer value in MPI.
 *
 * \param X        The MPI to set. This must be initialized.
 * \param z        The value to use.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         Another negative error code on other kinds of failure.
 */

Func mbedtls_mpi_get_bit

int mbedtls_mpi_get_bit( const mbedtls_mpi *X, size_t pos );
/**
 * \brief          Get a specific bit from an MPI.
 *
 * \param X        The MPI to query. This must be initialized.
 * \param pos      Zero-based index of the bit to query.
 *
 * \return         \c 0 or \c 1 on success, depending on whether bit \c pos
 *                 of \c X is unset or set.
 * \return         A negative error code on failure.
 */

Func mbedtls_mpi_set_bit

int mbedtls_mpi_set_bit( mbedtls_mpi *X, size_t pos, unsigned char val );
/**
 * \brief          Modify a specific bit in an MPI.
 *
 * \note           This function will grow the target MPI if necessary to set a
 *                 bit to \c 1 in a not yet existing limb. It will not grow if
 *                 the bit should be set to \c 0.
 *
 * \param X        The MPI to modify. This must be initialized.
 * \param pos      Zero-based index of the bit to modify.
 * \param val      The desired value of bit \c pos: \c 0 or \c 1.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         Another negative error code on other kinds of failure.
 */

Func mbedtls_mpi_lsb

size_t mbedtls_mpi_lsb( const mbedtls_mpi *X );
/**
 * \brief          Return the number of bits of value \c 0 before the
 *                 least significant bit of value \c 1.
 *
 * \note           This is the same as the zero-based index of
 *                 the least significant bit of value \c 1.
 *
 * \param X        The MPI to query.
 *
 * \return         The number of bits of value \c 0 before the least significant
 *                 bit of value \c 1 in \p X.
 */

Func mbedtls_mpi_bitlen

size_t mbedtls_mpi_bitlen( const mbedtls_mpi *X );
/**
 * \brief          Return the number of bits up to and including the most
 *                 significant bit of value \c 1.
 *
 * * \note         This is same as the one-based index of the most
 *                 significant bit of value \c 1.
 *
 * \param X        The MPI to query. This must point to an initialized MPI.
 *
 * \return         The number of bits up to and including the most
 *                 significant bit of value \c 1.
 */

Func mbedtls_mpi_size

size_t mbedtls_mpi_size( const mbedtls_mpi *X );
/**
 * \brief          Return the total size of an MPI value in bytes.
 *
 * \param X        The MPI to use. This must point to an initialized MPI.
 *
 * \note           The value returned by this function may be less than
 *                 the number of bytes used to store \p X internally.
 *                 This happens if and only if there are trailing bytes
 *                 of value zero.
 *
 * \return         The least number of bytes capable of storing
 *                 the absolute value of \p X.
 */

Func mbedtls_mpi_read_string

int mbedtls_mpi_read_string( mbedtls_mpi *X, int radix, const char *s );
/**
 * \brief          Import an MPI from an ASCII string.
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param radix    The numeric base of the input string.
 * \param s        Null-terminated string buffer.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_mpi_write_string

int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix,
                             char *buf, size_t buflen, size_t *olen );
/**
 * \brief          Export an MPI to an ASCII string.
 *
 * \param X        The source MPI. This must point to an initialized MPI.
 * \param radix    The numeric base of the output string.
 * \param buf      The buffer to write the string to. This must be writable
 *                 buffer of length \p buflen Bytes.
 * \param buflen   The available size in Bytes of \p buf.
 * \param olen     The address at which to store the length of the string
 *                 written, including the  final \c NULL byte. This must
 *                 not be \c NULL.
 *
 * \note           You can call this function with `buflen == 0` to obtain the
 *                 minimum required buffer size in `*olen`.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if the target buffer \p buf
 *                 is too small to hold the value of \p X in the desired base.
 *                 In this case, `*olen` is nonetheless updated to contain the
 *                 size of \p buf required for a successful call.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_read_file

int mbedtls_mpi_read_file( mbedtls_mpi *X, int radix, FILE *fin );
/**
 * \brief          Read an MPI from a line in an opened file.
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param radix    The numeric base of the string representation used
 *                 in the source line.
 * \param fin      The input file handle to use. This must not be \c NULL.
 *
 * \note           On success, this function advances the file stream
 *                 to the end of the current line or to EOF.
 *
 *                 The function returns \c 0 on an empty line.
 *
 *                 Leading whitespaces are ignored, as is a
 *                 '0x' prefix for radix \c 16.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if the file read buffer
 *                 is too small.
 * \return         Another negative error code on failure.
 */

Func mbedtls_mpi_write_file

int mbedtls_mpi_write_file( const char *p, const mbedtls_mpi *X,
                           int radix, FILE *fout );
/**
 * \brief          Export an MPI into an opened file.
 *
 * \param p        A string prefix to emit prior to the MPI data.
 *                 For example, this might be a label, or "0x" when
 *                 printing in base \c 16. This may be \c NULL if no prefix
 *                 is needed.
 * \param X        The source MPI. This must point to an initialized MPI.
 * \param radix    The numeric base to be used in the emitted string.
 * \param fout     The output file handle. This may be \c NULL, in which case
 *                 the output is written to \c stdout.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_mpi_read_binary

int mbedtls_mpi_read_binary( mbedtls_mpi *X, const unsigned char *buf,
                            size_t buflen );
/**
 * \brief          Import an MPI from unsigned big endian binary data.
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param buf      The input buffer. This must be a readable buffer of length
 *                 \p buflen Bytes.
 * \param buflen   The length of the input buffer \p p in Bytes.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_write_binary

int mbedtls_mpi_write_binary( const mbedtls_mpi *X, unsigned char *buf,
                             size_t buflen );
/**
 * \brief          Export an MPI into unsigned big endian binary data
 *                 of fixed size.
 *
 * \param X        The source MPI. This must point to an initialized MPI.
 * \param buf      The output buffer. This must be a writable buffer of length
 *                 \p buflen Bytes.
 * \param buflen   The size of the output buffer \p buf in Bytes.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p buf isn't
 *                 large enough to hold the value of \p X.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_shift_l

int mbedtls_mpi_shift_l( mbedtls_mpi *X, size_t count );
/**
 * \brief          Perform a left-shift on an MPI: X <<= count
 *
 * \param X        The MPI to shift. This must point to an initialized MPI.
 * \param count    The number of bits to shift by.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_shift_r

int mbedtls_mpi_shift_r( mbedtls_mpi *X, size_t count );
/**
 * \brief          Perform a right-shift on an MPI: X >>= count
 *
 * \param X        The MPI to shift. This must point to an initialized MPI.
 * \param count    The number of bits to shift by.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_cmp_abs

int mbedtls_mpi_cmp_abs( const mbedtls_mpi *X, const mbedtls_mpi *Y );
/**
 * \brief          Compare the absolute values of two MPIs.
 *
 * \param X        The left-hand MPI. This must point to an initialized MPI.
 * \param Y        The right-hand MPI. This must point to an initialized MPI.
 *
 * \return         \c 1 if `|X|` is greater than `|Y|`.
 * \return         \c -1 if `|X|` is lesser than `|Y|`.
 * \return         \c 0 if `|X|` is equal to `|Y|`.
 */

Func mbedtls_mpi_cmp_mpi

int mbedtls_mpi_cmp_mpi( const mbedtls_mpi *X, const mbedtls_mpi *Y );
/**
 * \brief          Compare two MPIs.
 *
 * \param X        The left-hand MPI. This must point to an initialized MPI.
 * \param Y        The right-hand MPI. This must point to an initialized MPI.
 *
 * \return         \c 1 if \p X is greater than \p Y.
 * \return         \c -1 if \p X is lesser than \p Y.
 * \return         \c 0 if \p X is equal to \p Y.
 */

Func mbedtls_mpi_cmp_int

int mbedtls_mpi_cmp_int( const mbedtls_mpi *X, mbedtls_mpi_sint z );
/**
 * \brief          Compare an MPI with an integer.
 *
 * \param X        The left-hand MPI. This must point to an initialized MPI.
 * \param z        The integer value to compare \p X to.
 *
 * \return         \c 1 if \p X is greater than \p z.
 * \return         \c -1 if \p X is lesser than \p z.
 * \return         \c 0 if \p X is equal to \p z.
 */

Func mbedtls_mpi_add_abs

int mbedtls_mpi_add_abs( mbedtls_mpi *X, const mbedtls_mpi *A,
                        const mbedtls_mpi *B );
/**
 * \brief          Perform an unsigned addition of MPIs: X = |A| + |B|
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The first summand. This must point to an initialized MPI.
 * \param B        The second summand. This must point to an initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_sub_abs

int mbedtls_mpi_sub_abs( mbedtls_mpi *X, const mbedtls_mpi *A,
                        const mbedtls_mpi *B );
/**
 * \brief          Perform an unsigned subtraction of MPIs: X = |A| - |B|
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The minuend. This must point to an initialized MPI.
 * \param B        The subtrahend. This must point to an initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_NEGATIVE_VALUE if \p B is greater than \p A.
 * \return         Another negative error code on different kinds of failure.
 *
 */

Func mbedtls_mpi_add_mpi

int mbedtls_mpi_add_mpi( mbedtls_mpi *X, const mbedtls_mpi *A,
                        const mbedtls_mpi *B );
/**
 * \brief          Perform a signed addition of MPIs: X = A + B
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The first summand. This must point to an initialized MPI.
 * \param B        The second summand. This must point to an initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_sub_mpi

int mbedtls_mpi_sub_mpi( mbedtls_mpi *X, const mbedtls_mpi *A,
                        const mbedtls_mpi *B );
/**
 * \brief          Perform a signed subtraction of MPIs: X = A - B
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The minuend. This must point to an initialized MPI.
 * \param B        The subtrahend. This must point to an initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_add_int

int mbedtls_mpi_add_int( mbedtls_mpi *X, const mbedtls_mpi *A,
                        mbedtls_mpi_sint b );
/**
 * \brief          Perform a signed addition of an MPI and an integer: X = A + b
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The first summand. This must point to an initialized MPI.
 * \param b        The second summand.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_sub_int

int mbedtls_mpi_sub_int( mbedtls_mpi *X, const mbedtls_mpi *A,
                        mbedtls_mpi_sint b );
/**
 * \brief          Perform a signed subtraction of an MPI and an integer:
 *                 X = A - b
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The minuend. This must point to an initialized MPI.
 * \param b        The subtrahend.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_mul_mpi

int mbedtls_mpi_mul_mpi( mbedtls_mpi *X, const mbedtls_mpi *A,
                        const mbedtls_mpi *B );
/**
 * \brief          Perform a multiplication of two MPIs: X = A * B
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The first factor. This must point to an initialized MPI.
 * \param B        The second factor. This must point to an initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 *
 */

Func mbedtls_mpi_mul_int

int mbedtls_mpi_mul_int( mbedtls_mpi *X, const mbedtls_mpi *A,
                        mbedtls_mpi_uint b );
/**
 * \brief          Perform a multiplication of an MPI with an unsigned integer:
 *                 X = A * b
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The first factor. This must point to an initialized MPI.
 * \param b        The second factor.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 *
 */

Func mbedtls_mpi_div_mpi

int mbedtls_mpi_div_mpi( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A,
                        const mbedtls_mpi *B );
/**
 * \brief          Perform a division with remainder of two MPIs:
 *                 A = Q * B + R
 *
 * \param Q        The destination MPI for the quotient.
 *                 This may be \c NULL if the value of the
 *                 quotient is not needed.
 * \param R        The destination MPI for the remainder value.
 *                 This may be \c NULL if the value of the
 *                 remainder is not needed.
 * \param A        The dividend. This must point to an initialized MPi.
 * \param B        The divisor. This must point to an initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p B equals zero.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_div_int

int mbedtls_mpi_div_int( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A,
                        mbedtls_mpi_sint b );
/**
 * \brief          Perform a division with remainder of an MPI by an integer:
 *                 A = Q * b + R
 *
 * \param Q        The destination MPI for the quotient.
 *                 This may be \c NULL if the value of the
 *                 quotient is not needed.
 * \param R        The destination MPI for the remainder value.
 *                 This may be \c NULL if the value of the
 *                 remainder is not needed.
 * \param A        The dividend. This must point to an initialized MPi.
 * \param b        The divisor.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p b equals zero.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_mod_mpi

int mbedtls_mpi_mod_mpi( mbedtls_mpi *R, const mbedtls_mpi *A,
                        const mbedtls_mpi *B );
/**
 * \brief          Perform a modular reduction. R = A mod B
 *
 * \param R        The destination MPI for the residue value.
 *                 This must point to an initialized MPI.
 * \param A        The MPI to compute the residue of.
 *                 This must point to an initialized MPI.
 * \param B        The base of the modular reduction.
 *                 This must point to an initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p B equals zero.
 * \return         #MBEDTLS_ERR_MPI_NEGATIVE_VALUE if \p B is negative.
 * \return         Another negative error code on different kinds of failure.
 *
 */

Func mbedtls_mpi_mod_int

int mbedtls_mpi_mod_int( mbedtls_mpi_uint *r, const mbedtls_mpi *A,
                        mbedtls_mpi_sint b );
/**
 * \brief          Perform a modular reduction with respect to an integer.
 *                 r = A mod b
 *
 * \param r        The address at which to store the residue.
 *                 This must not be \c NULL.
 * \param A        The MPI to compute the residue of.
 *                 This must point to an initialized MPi.
 * \param b        The integer base of the modular reduction.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p b equals zero.
 * \return         #MBEDTLS_ERR_MPI_NEGATIVE_VALUE if \p b is negative.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_exp_mod

int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A,
                        const mbedtls_mpi *E, const mbedtls_mpi *N,
                        mbedtls_mpi *_RR );
/**
 * \brief          Perform a sliding-window exponentiation: X = A^E mod N
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The base of the exponentiation.
 *                 This must point to an initialized MPI.
 * \param E        The exponent MPI. This must point to an initialized MPI.
 * \param N        The base for the modular reduction. This must point to an
 *                 initialized MPI.
 * \param _RR      A helper MPI depending solely on \p N which can be used to
 *                 speed-up multiple modular exponentiations for the same value
 *                 of \p N. This may be \c NULL. If it is not \c NULL, it must
 *                 point to an initialized MPI. If it hasn't been used after
 *                 the call to mbedtls_mpi_init(), this function will compute
 *                 the helper value and store it in \p _RR for reuse on
 *                 subsequent calls to this function. Otherwise, the function
 *                 will assume that \p _RR holds the helper value set by a
 *                 previous call to mbedtls_mpi_exp_mod(), and reuse it.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \c N is negative or
 *                 even, or if \c E is negative.
 * \return         Another negative error code on different kinds of failures.
 *
 */

Func mbedtls_mpi_fill_random

int mbedtls_mpi_fill_random( mbedtls_mpi *X, size_t size,
                    int (*f_rng)(void *, unsigned char *, size_t),
                    void *p_rng );
/**
 * \brief          Fill an MPI with a number of random bytes.
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param size     The number of random bytes to generate.
 * \param f_rng    The RNG function to use. This must not be \c NULL.
 * \param p_rng    The RNG parameter to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng doesn't need a context argument.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on failure.
 *
 * \note           The bytes obtained from the RNG are interpreted
 *                 as a big-endian representation of an MPI; this can
 *                 be relevant in applications like deterministic ECDSA.
 */

Func mbedtls_mpi_gcd

int mbedtls_mpi_gcd( mbedtls_mpi *G, const mbedtls_mpi *A,
                    const mbedtls_mpi *B );
/**
 * \brief          Compute the greatest common divisor: G = gcd(A, B)
 *
 * \param G        The destination MPI. This must point to an initialized MPI.
 * \param A        The first operand. This must point to an initialized MPI.
 * \param B        The second operand. This must point to an initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         Another negative error code on different kinds of failure.
 */

Func mbedtls_mpi_inv_mod

int mbedtls_mpi_inv_mod( mbedtls_mpi *X, const mbedtls_mpi *A,
                        const mbedtls_mpi *N );
/**
 * \brief          Compute the modular inverse: X = A^-1 mod N
 *
 * \param X        The destination MPI. This must point to an initialized MPI.
 * \param A        The MPI to calculate the modular inverse of. This must point
 *                 to an initialized MPI.
 * \param N        The base of the modular inversion. This must point to an
 *                 initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p N is less than
 *                 or equal to one.
 * \return         #MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if \p has no modular inverse
 *                 with respect to \p N.
 */

Func mbedtls_mpi_is_prime_ext

int mbedtls_mpi_is_prime_ext( const mbedtls_mpi *X, int rounds,
                             int (*f_rng)(void *, unsigned char *, size_t),
                             void *p_rng );
/**
 * \brief          Miller-Rabin primality test.
 *
 * \warning        If \p X is potentially generated by an adversary, for example
 *                 when validating cryptographic parameters that you didn't
 *                 generate yourself and that are supposed to be prime, then
 *                 \p rounds should be at least the half of the security
 *                 strength of the cryptographic algorithm. On the other hand,
 *                 if \p X is chosen uniformly or non-adversially (as is the
 *                 case when mbedtls_mpi_gen_prime calls this function), then
 *                 \p rounds can be much lower.
 *
 * \param X        The MPI to check for primality.
 *                 This must point to an initialized MPI.
 * \param rounds   The number of bases to perform the Miller-Rabin primality
 *                 test for. The probability of returning 0 on a composite is
 *                 at most 2-2*\p rounds.
 * \param f_rng    The RNG function to use. This must not be \c NULL.
 * \param p_rng    The RNG parameter to be passed to \p f_rng.
 *                 This may be \c NULL if \p f_rng doesn't use
 *                 a context parameter.
 *
 * \return         \c 0 if successful, i.e. \p X is probably prime.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if \p X is not prime.
 * \return         Another negative error code on other kinds of failure.
 */

Func mbedtls_mpi_gen_prime

int mbedtls_mpi_gen_prime( mbedtls_mpi *X, size_t nbits, int flags,
                  int (*f_rng)(void *, unsigned char *, size_t),
                  void *p_rng );
/**
 * \brief          Generate a prime number.
 *
 * \param X        The destination MPI to store the generated prime in.
 *                 This must point to an initialized MPi.
 * \param nbits    The required size of the destination MPI in bits.
 *                 This must be between \c 3 and #MBEDTLS_MPI_MAX_BITS.
 * \param flags    A mask of flags of type #mbedtls_mpi_gen_prime_flag_t.
 * \param f_rng    The RNG function to use. This must not be \c NULL.
 * \param p_rng    The RNG parameter to be passed to \p f_rng.
 *                 This may be \c NULL if \p f_rng doesn't use
 *                 a context parameter.
 *
 * \return         \c 0 if successful, in which case \p X holds a
 *                 probably prime number.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if `nbits` is not between
 *                 \c 3 and #MBEDTLS_MPI_MAX_BITS.
 */

Func mbedtls_mpi_self_test

int mbedtls_mpi_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Func mbedtls_blowfish_init

void mbedtls_blowfish_init( mbedtls_blowfish_context *ctx );
/**
 * \brief          Initialize a Blowfish context.
 *
 * \param ctx      The Blowfish context to be initialized.
 *                 This must not be \c NULL.
 */

Func mbedtls_blowfish_free

void mbedtls_blowfish_free( mbedtls_blowfish_context *ctx );
/**
 * \brief          Clear a Blowfish context.
 *
 * \param ctx      The Blowfish context to be cleared.
 *                 This may be \c NULL, in which case this function
 *                 returns immediately. If it is not \c NULL, it must
 *                 point to an initialized Blowfish context.
 */

Func mbedtls_blowfish_setkey

int mbedtls_blowfish_setkey( mbedtls_blowfish_context *ctx, const unsigned char *key,
                    unsigned int keybits );
/**
 * \brief          Perform a Blowfish key schedule operation.
 *
 * \param ctx      The Blowfish context to perform the key schedule on.
 * \param key      The encryption key. This must be a readable buffer of
 *                 length \p keybits Bits.
 * \param keybits  The length of \p key in Bits. This must be between
 *                 \c 32 and \c 448 and a multiple of \c 8.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_blowfish_crypt_ecb

int mbedtls_blowfish_crypt_ecb( mbedtls_blowfish_context *ctx,
                       int mode,
                       const unsigned char input[MBEDTLS_BLOWFISH_BLOCKSIZE],
                       unsigned char output[MBEDTLS_BLOWFISH_BLOCKSIZE] );
/**
 * \brief          Perform a Blowfish-ECB block encryption/decryption operation.
 *
 * \param ctx      The Blowfish context to use. This must be initialized
 *                 and bound to a key.
 * \param mode     The mode of operation. Possible values are
 *                 #MBEDTLS_BLOWFISH_ENCRYPT for encryption, or
 *                 #MBEDTLS_BLOWFISH_DECRYPT for decryption.
 * \param input    The input block. This must be a readable buffer
 *                 of size \c 8 Bytes.
 * \param output   The output block. This must be a writable buffer
 *                 of size \c 8 Bytes.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_blowfish_crypt_cbc

int mbedtls_blowfish_crypt_cbc( mbedtls_blowfish_context *ctx,
                       int mode,
                       size_t length,
                       unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE],
                       const unsigned char *input,
                       unsigned char *output );
/**
 * \brief          Perform a Blowfish-CBC buffer encryption/decryption operation.
 *
 * \note           Upon exit, the content of the IV is updated so that you can
 *                 call the function same function again on the following
 *                 block(s) of data and get the same result as if it was
 *                 encrypted in one call. This allows a "streaming" usage.
 *                 If on the other hand you need to retain the contents of the
 *                 IV, you should either save it manually or use the cipher
 *                 module instead.
 *
 * \param ctx      The Blowfish context to use. This must be initialized
 *                 and bound to a key.
 * \param mode     The mode of operation. Possible values are
 *                 #MBEDTLS_BLOWFISH_ENCRYPT for encryption, or
 *                 #MBEDTLS_BLOWFISH_DECRYPT for decryption.
 * \param length   The length of the input data in Bytes. This must be
 *                 multiple of \c 8.
 * \param iv       The initialization vector. This must be a read/write buffer
 *                 of length \c 8 Bytes. It is updated by this function.
 * \param input    The input data. This must be a readable buffer of length
 *                 \p length Bytes.
 * \param output   The output data. This must be a writable buffer of length
 *                 \p length Bytes.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_blowfish_crypt_cfb64

int mbedtls_blowfish_crypt_cfb64( mbedtls_blowfish_context *ctx,
                         int mode,
                         size_t length,
                         size_t *iv_off,
                         unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE],
                         const unsigned char *input,
                         unsigned char *output );
/**
 * \brief          Perform a Blowfish CFB buffer encryption/decryption operation.
 *
 * \note           Upon exit, the content of the IV is updated so that you can
 *                 call the function same function again on the following
 *                 block(s) of data and get the same result as if it was
 *                 encrypted in one call. This allows a "streaming" usage.
 *                 If on the other hand you need to retain the contents of the
 *                 IV, you should either save it manually or use the cipher
 *                 module instead.
 *
 * \param ctx      The Blowfish context to use. This must be initialized
 *                 and bound to a key.
 * \param mode     The mode of operation. Possible values are
 *                 #MBEDTLS_BLOWFISH_ENCRYPT for encryption, or
 *                 #MBEDTLS_BLOWFISH_DECRYPT for decryption.
 * \param length   The length of the input data in Bytes.
 * \param iv_off   The offset in the initialiation vector.
 *                 The value pointed to must be smaller than \c 8 Bytes.
 *                 It is updated by this function to support the aforementioned
 *                 streaming usage.
 * \param iv       The initialization vector. This must be a read/write buffer
 *                 of size \c 8 Bytes. It is updated after use.
 * \param input    The input data. This must be a readable buffer of length
 *                 \p length Bytes.
 * \param output   The output data. This must be a writable buffer of length
 *                 \p length Bytes.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_blowfish_crypt_ctr

int mbedtls_blowfish_crypt_ctr( mbedtls_blowfish_context *ctx,
                       size_t length,
                       size_t *nc_off,
                       unsigned char nonce_counter[MBEDTLS_BLOWFISH_BLOCKSIZE],
                       unsigned char stream_block[MBEDTLS_BLOWFISH_BLOCKSIZE],
                       const unsigned char *input,
                       unsigned char *output );
/**
 * \brief      Perform a Blowfish-CTR buffer encryption/decryption operation.
 *
 * \warning    You must never reuse a nonce value with the same key. Doing so
 *             would void the encryption for the two messages encrypted with
 *             the same nonce and key.
 *
 *             There are two common strategies for managing nonces with CTR:
 *
 *             1. You can handle everything as a single message processed over
 *             successive calls to this function. In that case, you want to
 *             set \p nonce_counter and \p nc_off to 0 for the first call, and
 *             then preserve the values of \p nonce_counter, \p nc_off and \p
 *             stream_block across calls to this function as they will be
 *             updated by this function.
 *
 *             With this strategy, you must not encrypt more than 2**64
 *             blocks of data with the same key.
 *
 *             2. You can encrypt separate messages by dividing the \p
 *             nonce_counter buffer in two areas: the first one used for a
 *             per-message nonce, handled by yourself, and the second one
 *             updated by this function internally.
 *
 *             For example, you might reserve the first 4 bytes for the
 *             per-message nonce, and the last 4 bytes for internal use. In that
 *             case, before calling this function on a new message you need to
 *             set the first 4 bytes of \p nonce_counter to your chosen nonce
 *             value, the last 4 to 0, and \p nc_off to 0 (which will cause \p
 *             stream_block to be ignored). That way, you can encrypt at most
 *             2**32 messages of up to 2**32 blocks each with the same key.
 *
 *             The per-message nonce (or information sufficient to reconstruct
 *             it) needs to be communicated with the ciphertext and must be unique.
 *             The recommended way to ensure uniqueness is to use a message
 *             counter.
 *
 *             Note that for both stategies, sizes are measured in blocks and
 *             that a Blowfish block is 8 bytes.
 *
 * \warning    Upon return, \p stream_block contains sensitive data. Its
 *             content must not be written to insecure storage and should be
 *             securely discarded as soon as it's no longer needed.
 *
 * \param ctx           The Blowfish context to use. This must be initialized
 *                      and bound to a key.
 * \param length        The length of the input data in Bytes.
 * \param nc_off        The offset in the current stream_block (for resuming
 *                      within current cipher stream). The offset pointer
 *                      should be \c 0 at the start of a stream and must be
 *                      smaller than \c 8. It is updated by this function.
 * \param nonce_counter The 64-bit nonce and counter. This must point to a
 *                      read/write buffer of length \c 8 Bytes.
 * \param stream_block  The saved stream-block for resuming. This must point to
 *                      a read/write buffer of length \c 8 Bytes.
 * \param input         The input data. This must be a readable buffer of
 *                      length \p length Bytes.
 * \param output        The output data. This must be a writable buffer of
 *                      length \p length Bytes.
 *
 * \return              \c 0 if successful.
 * \return              A negative error code on failure.
 */

Func mbedtls_camellia_init

void mbedtls_camellia_init( mbedtls_camellia_context *ctx );
/**
 * \brief          Initialize a CAMELLIA context.
 *
 * \param ctx      The CAMELLIA context to be initialized.
 *                 This must not be \c NULL.
 */

Func mbedtls_camellia_free

void mbedtls_camellia_free( mbedtls_camellia_context *ctx );
/**
 * \brief          Clear a CAMELLIA context.
 *
 * \param ctx      The CAMELLIA context to be cleared. This may be \c NULL,
 *                 in which case this function returns immediately. If it is not
 *                 \c NULL, it must be initialized.
 */

Func mbedtls_camellia_setkey_enc

int mbedtls_camellia_setkey_enc( mbedtls_camellia_context *ctx,
                                const unsigned char *key,
                                unsigned int keybits );
/**
 * \brief          Perform a CAMELLIA key schedule operation for encryption.
 *
 * \param ctx      The CAMELLIA context to use. This must be initialized.
 * \param key      The encryption key to use. This must be a readable buffer
 *                 of size \p keybits Bits.
 * \param keybits  The length of \p key in Bits. This must be either \c 128,
 *                 \c 192 or \c 256.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_camellia_setkey_dec

int mbedtls_camellia_setkey_dec( mbedtls_camellia_context *ctx,
                                const unsigned char *key,
                                unsigned int keybits );
/**
 * \brief          Perform a CAMELLIA key schedule operation for decryption.
 *
 * \param ctx      The CAMELLIA context to use. This must be initialized.
 * \param key      The decryption key. This must be a readable buffer
 *                 of size \p keybits Bits.
 * \param keybits  The length of \p key in Bits. This must be either \c 128,
 *                 \c 192 or \c 256.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_camellia_crypt_ecb

int mbedtls_camellia_crypt_ecb( mbedtls_camellia_context *ctx,
                   int mode,
                   const unsigned char input[16],
                   unsigned char output[16] );
/**
 * \brief          Perform a CAMELLIA-ECB block encryption/decryption operation.
 *
 * \param ctx      The CAMELLIA context to use. This must be initialized
 *                 and bound to a key.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
 * \param input    The input block. This must be a readable buffer
 *                 of size \c 16 Bytes.
 * \param output   The output block. This must be a writable buffer
 *                 of size \c 16 Bytes.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_camellia_crypt_cbc

int mbedtls_camellia_crypt_cbc( mbedtls_camellia_context *ctx,
                   int mode,
                   size_t length,
                   unsigned char iv[16],
                   const unsigned char *input,
                   unsigned char *output );
/**
 * \brief          Perform a CAMELLIA-CBC buffer encryption/decryption operation.
 *
 * \note           Upon exit, the content of the IV is updated so that you can
 *                 call the function same function again on the following
 *                 block(s) of data and get the same result as if it was
 *                 encrypted in one call. This allows a "streaming" usage.
 *                 If on the other hand you need to retain the contents of the
 *                 IV, you should either save it manually or use the cipher
 *                 module instead.
 *
 * \param ctx      The CAMELLIA context to use. This must be initialized
 *                 and bound to a key.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
 * \param length   The length in Bytes of the input data \p input.
 *                 This must be a multiple of \c 16 Bytes.
 * \param iv       The initialization vector. This must be a read/write buffer
 *                 of length \c 16 Bytes. It is updated to allow streaming
 *                 use as explained above.
 * \param input    The buffer holding the input data. This must point to a
 *                 readable buffer of length \p length Bytes.
 * \param output   The buffer holding the output data. This must point to a
 *                 writable buffer of length \p length Bytes.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_camellia_crypt_cfb128

int mbedtls_camellia_crypt_cfb128( mbedtls_camellia_context *ctx,
                      int mode,
                      size_t length,
                      size_t *iv_off,
                      unsigned char iv[16],
                      const unsigned char *input,
                      unsigned char *output );
/**
 * \brief          Perform a CAMELLIA-CFB128 buffer encryption/decryption
 *                 operation.
 *
 * \note           Due to the nature of CFB mode, you should use the same
 *                 key for both encryption and decryption. In particular, calls
 *                 to this function should be preceded by a key-schedule via
 *                 mbedtls_camellia_setkey_enc() regardless of whether \p mode
 *                 is #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
 *
 * \note           Upon exit, the content of the IV is updated so that you can
 *                 call the function same function again on the following
 *                 block(s) of data and get the same result as if it was
 *                 encrypted in one call. This allows a "streaming" usage.
 *                 If on the other hand you need to retain the contents of the
 *                 IV, you should either save it manually or use the cipher
 *                 module instead.
 *
 * \param ctx      The CAMELLIA context to use. This must be initialized
 *                 and bound to a key.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
 * \param length   The length of the input data \p input. Any value is allowed.
 * \param iv_off   The current offset in the IV. This must be smaller
 *                 than \c 16 Bytes. It is updated after this call to allow
 *                 the aforementioned streaming usage.
 * \param iv       The initialization vector. This must be a read/write buffer
 *                 of length \c 16 Bytes. It is updated after this call to
 *                 allow the aforementioned streaming usage.
 * \param input    The buffer holding the input data. This must be a readable
 *                 buffer of size \p length Bytes.
 * \param output   The buffer to hold the output data. This must be a writable
 *                 buffer of length \p length Bytes.
 *
 * \return         \c 0 if successful.
 * \return         A negative error code on failure.
 */

Func mbedtls_camellia_crypt_ctr

int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx,
                      size_t length,
                      size_t *nc_off,
                      unsigned char nonce_counter[16],
                      unsigned char stream_block[16],
                      const unsigned char *input,
                      unsigned char *output );
/**
 * \brief      Perform a CAMELLIA-CTR buffer encryption/decryption operation.
 *
 * *note       Due to the nature of CTR mode, you should use the same
 *             key for both encryption and decryption. In particular, calls
 *             to this function should be preceded by a key-schedule via
 *             mbedtls_camellia_setkey_enc() regardless of whether \p mode
 *             is #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT.
 *
 * \warning    You must never reuse a nonce value with the same key. Doing so
 *             would void the encryption for the two messages encrypted with
 *             the same nonce and key.
 *
 *             There are two common strategies for managing nonces with CTR:
 *
 *             1. You can handle everything as a single message processed over
 *             successive calls to this function. In that case, you want to
 *             set \p nonce_counter and \p nc_off to 0 for the first call, and
 *             then preserve the values of \p nonce_counter, \p nc_off and \p
 *             stream_block across calls to this function as they will be
 *             updated by this function.
 *
 *             With this strategy, you must not encrypt more than 2**128
 *             blocks of data with the same key.
 *
 *             2. You can encrypt separate messages by dividing the \p
 *             nonce_counter buffer in two areas: the first one used for a
 *             per-message nonce, handled by yourself, and the second one
 *             updated by this function internally.
 *
 *             For example, you might reserve the first \c 12 Bytes for the
 *             per-message nonce, and the last \c 4 Bytes for internal use.
 *             In that case, before calling this function on a new message you
 *             need to set the first \c 12 Bytes of \p nonce_counter to your
 *             chosen nonce value, the last four to \c 0, and \p nc_off to \c 0
 *             (which will cause \p stream_block to be ignored). That way, you
 *             can encrypt at most \c 2**96 messages of up to \c 2**32 blocks
 *             each  with the same key.
 *
 *             The per-message nonce (or information sufficient to reconstruct
 *             it) needs to be communicated with the ciphertext and must be
 *             unique. The recommended way to ensure uniqueness is to use a
 *             message counter. An alternative is to generate random nonces,
 *             but this limits the number of messages that can be securely
 *             encrypted: for example, with 96-bit random nonces, you should
 *             not encrypt more than 2**32 messages with the same key.
 *
 *             Note that for both stategies, sizes are measured in blocks and
 *             that a CAMELLIA block is \c 16 Bytes.
 *
 * \warning    Upon return, \p stream_block contains sensitive data. Its
 *             content must not be written to insecure storage and should be
 *             securely discarded as soon as it's no longer needed.
 *
 * \param ctx           The CAMELLIA context to use. This must be initialized
 *                      and bound to a key.
 * \param length        The length of the input data \p input in Bytes.
 *                      Any value is allowed.
 * \param nc_off        The offset in the current \p stream_block (for resuming
 *                      within current cipher stream). The offset pointer to
 *                      should be \c 0 at the start of a stream. It is updated
 *                      at the end of this call.
 * \param nonce_counter The 128-bit nonce and counter. This must be a read/write
 *                      buffer of length \c 16 Bytes.
 * \param stream_block  The saved stream-block for resuming. This must be a
 *                      read/write buffer of length \c 16 Bytes.
 * \param input         The input data stream. This must be a readable buffer of
 *                      size \p length Bytes.
 * \param output        The output data stream. This must be a writable buffer
 *                      of size \p length Bytes.
 *
 * \return              \c 0 if successful.
 * \return              A negative error code on failure.
 */

Func mbedtls_camellia_self_test

int mbedtls_camellia_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Func mbedtls_ccm_init

void mbedtls_ccm_init( mbedtls_ccm_context *ctx );
/**
 * \brief           This function initializes the specified CCM context,
 *                  to make references valid, and prepare the context
 *                  for mbedtls_ccm_setkey() or mbedtls_ccm_free().
 *
 * \param ctx       The CCM context to initialize. This must not be \c NULL.
 */

Func mbedtls_ccm_setkey

int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx,
                       mbedtls_cipher_id_t cipher,
                       const unsigned char *key,
                       unsigned int keybits );
/**
 * \brief           This function initializes the CCM context set in the
 *                  \p ctx parameter and sets the encryption key.
 *
 * \param ctx       The CCM context to initialize. This must be an initialized
 *                  context.
 * \param cipher    The 128-bit block cipher to use.
 * \param key       The encryption key. This must not be \c NULL.
 * \param keybits   The key size in bits. This must be acceptable by the cipher.
 *
 * \return          \c 0 on success.
 * \return          A CCM or cipher-specific error code on failure.
 */

Func mbedtls_ccm_free

void mbedtls_ccm_free( mbedtls_ccm_context *ctx );
/**
 * \brief   This function releases and clears the specified CCM context
 *          and underlying cipher sub-context.
 *
 * \param ctx       The CCM context to clear. If this is \c NULL, the function
 *                  has no effect. Otherwise, this must be initialized.
 */

Func mbedtls_ccm_encrypt_and_tag

int mbedtls_ccm_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length,
                        const unsigned char *iv, size_t iv_len,
                        const unsigned char *add, size_t add_len,
                        const unsigned char *input, unsigned char *output,
                        unsigned char *tag, size_t tag_len );
/**
 * \brief           This function encrypts a buffer using CCM.
 *
 * \note            The tag is written to a separate buffer. To concatenate
 *                  the \p tag with the \p output, as done in RFC-3610:
 *                  Counter with CBC-MAC (CCM), use
 *                  \p tag = \p output + \p length, and make sure that the
 *                  output buffer is at least \p length + \p tag_len wide.
 *
 * \param ctx       The CCM context to use for encryption. This must be
 *                  initialized and bound to a key.
 * \param length    The length of the input data in Bytes.
 * \param iv        The initialization vector (nonce). This must be a readable
 *                  buffer of at least \p iv_len Bytes.
 * \param iv_len    The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12,
 *                  or 13. The length L of the message length field is
 *                  15 - \p iv_len.
 * \param add       The additional data field. If \p add_len is greater than
 *                  zero, \p add must be a readable buffer of at least that
 *                  length.
 * \param add_len   The length of additional data in Bytes.
 *                  This must be less than `2^16 - 2^8`.
 * \param input     The buffer holding the input data. If \p length is greater
 *                  than zero, \p input must be a readable buffer of at least
 *                  that length.
 * \param output    The buffer holding the output data. If \p length is greater
 *                  than zero, \p output must be a writable buffer of at least
 *                  that length.
 * \param tag       The buffer holding the authentication field. This must be a
 *                  readable buffer of at least \p tag_len Bytes.
 * \param tag_len   The length of the authentication field to generate in Bytes:
 *                  4, 6, 8, 10, 12, 14 or 16.
 *
 * \return          \c 0 on success.
 * \return          A CCM or cipher-specific error code on failure.
 */

Func mbedtls_ccm_star_encrypt_and_tag

int mbedtls_ccm_star_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length,
                        const unsigned char *iv, size_t iv_len,
                        const unsigned char *add, size_t add_len,
                        const unsigned char *input, unsigned char *output,
                        unsigned char *tag, size_t tag_len );
/**
 * \brief           This function encrypts a buffer using CCM*.
 *
 * \note            The tag is written to a separate buffer. To concatenate
 *                  the \p tag with the \p output, as done in RFC-3610:
 *                  Counter with CBC-MAC (CCM), use
 *                  \p tag = \p output + \p length, and make sure that the
 *                  output buffer is at least \p length + \p tag_len wide.
 *
 * \note            When using this function in a variable tag length context,
 *                  the tag length has to be encoded into the \p iv passed to
 *                  this function.
 *
 * \param ctx       The CCM context to use for encryption. This must be
 *                  initialized and bound to a key.
 * \param length    The length of the input data in Bytes.
 * \param iv        The initialization vector (nonce). This must be a readable
 *                  buffer of at least \p iv_len Bytes.
 * \param iv_len    The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12,
 *                  or 13. The length L of the message length field is
 *                  15 - \p iv_len.
 * \param add       The additional data field. This must be a readable buffer of
 *                  at least \p add_len Bytes.
 * \param add_len   The length of additional data in Bytes.
 *                  This must be less than 2^16 - 2^8.
 * \param input     The buffer holding the input data. If \p length is greater
 *                  than zero, \p input must be a readable buffer of at least
 *                  that length.
 * \param output    The buffer holding the output data. If \p length is greater
 *                  than zero, \p output must be a writable buffer of at least
 *                  that length.
 * \param tag       The buffer holding the authentication field. This must be a
 *                  readable buffer of at least \p tag_len Bytes.
 * \param tag_len   The length of the authentication field to generate in Bytes:
 *                  0, 4, 6, 8, 10, 12, 14 or 16.
 *
 * \warning         Passing \c 0 as \p tag_len means that the message is no
 *                  longer authenticated.
 *
 * \return          \c 0 on success.
 * \return          A CCM or cipher-specific error code on failure.
 */

Func mbedtls_ccm_auth_decrypt

int mbedtls_ccm_auth_decrypt( mbedtls_ccm_context *ctx, size_t length,
                     const unsigned char *iv, size_t iv_len,
                     const unsigned char *add, size_t add_len,
                     const unsigned char *input, unsigned char *output,
                     const unsigned char *tag, size_t tag_len );
/**
 * \brief           This function performs a CCM authenticated decryption of a
 *                  buffer.
 *
 * \param ctx       The CCM context to use for decryption. This must be
 *                  initialized and bound to a key.
 * \param length    The length of the input data in Bytes.
 * \param iv        The initialization vector (nonce). This must be a readable
 *                  buffer of at least \p iv_len Bytes.
 * \param iv_len    The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12,
 *                  or 13. The length L of the message length field is
 *                  15 - \p iv_len.
 * \param add       The additional data field. This must be a readable buffer
 *                  of at least that \p add_len Bytes..
 * \param add_len   The length of additional data in Bytes.
 *                  This must be less than 2^16 - 2^8.
 * \param input     The buffer holding the input data. If \p length is greater
 *                  than zero, \p input must be a readable buffer of at least
 *                  that length.
 * \param output    The buffer holding the output data. If \p length is greater
 *                  than zero, \p output must be a writable buffer of at least
 *                  that length.
 * \param tag       The buffer holding the authentication field. This must be a
 *                  readable buffer of at least \p tag_len Bytes.
 * \param tag_len   The length of the authentication field to generate in Bytes:
 *                  4, 6, 8, 10, 12, 14 or 16.
 *
 * \return          \c 0 on success. This indicates that the message is authentic.
 * \return          #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match.
 * \return          A cipher-specific error code on calculation failure.
 */

Func mbedtls_ccm_star_auth_decrypt

int mbedtls_ccm_star_auth_decrypt( mbedtls_ccm_context *ctx, size_t length,
                     const unsigned char *iv, size_t iv_len,
                     const unsigned char *add, size_t add_len,
                     const unsigned char *input, unsigned char *output,
                     const unsigned char *tag, size_t tag_len );
/**
 * \brief           This function performs a CCM* authenticated decryption of a
 *                  buffer.
 *
 * \note            When using this function in a variable tag length context,
 *                  the tag length has to be decoded from \p iv and passed to
 *                  this function as \p tag_len. (\p tag needs to be adjusted
 *                  accordingly.)
 *
 * \param ctx       The CCM context to use for decryption. This must be
 *                  initialized and bound to a key.
 * \param length    The length of the input data in Bytes.
 * \param iv        The initialization vector (nonce). This must be a readable
 *                  buffer of at least \p iv_len Bytes.
 * \param iv_len    The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12,
 *                  or 13. The length L of the message length field is
 *                  15 - \p iv_len.
 * \param add       The additional data field. This must be a readable buffer of
 *                  at least that \p add_len Bytes.
 * \param add_len   The length of additional data in Bytes.
 *                  This must be less than 2^16 - 2^8.
 * \param input     The buffer holding the input data. If \p length is greater
 *                  than zero, \p input must be a readable buffer of at least
 *                  that length.
 * \param output    The buffer holding the output data. If \p length is greater
 *                  than zero, \p output must be a writable buffer of at least
 *                  that length.
 * \param tag       The buffer holding the authentication field. This must be a
 *                  readable buffer of at least \p tag_len Bytes.
 * \param tag_len   The length of the authentication field in Bytes.
 *                  0, 4, 6, 8, 10, 12, 14 or 16.
 *
 * \warning         Passing \c 0 as \p tag_len means that the message is nos
 *                  longer authenticated.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match.
 * \return          A cipher-specific error code on calculation failure.
 */

Func mbedtls_ccm_self_test

int mbedtls_ccm_self_test( int verbose );
/**
 * \brief          The CCM checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_chacha20_init

void mbedtls_chacha20_init( mbedtls_chacha20_context *ctx );
/**
 * \brief           This function initializes the specified ChaCha20 context.
 *
 *                  It must be the first API called before using
 *                  the context.
 *
 *                  It is usually followed by calls to
 *                  \c mbedtls_chacha20_setkey() and
 *                  \c mbedtls_chacha20_starts(), then one or more calls to
 *                  to \c mbedtls_chacha20_update(), and finally to
 *                  \c mbedtls_chacha20_free().
 *
 * \param ctx       The ChaCha20 context to initialize.
 *                  This must not be \c NULL.
 */

Func mbedtls_chacha20_free

void mbedtls_chacha20_free( mbedtls_chacha20_context *ctx );
/**
 * \brief           This function releases and clears the specified
 *                  ChaCha20 context.
 *
 * \param ctx       The ChaCha20 context to clear. This may be \c NULL,
 *                  in which case this function is a no-op. If it is not
 *                  \c NULL, it must point to an initialized context.
 *
 */

Func mbedtls_chacha20_setkey

int mbedtls_chacha20_setkey( mbedtls_chacha20_context *ctx,
                            const unsigned char key[32] );
/**
 * \brief           This function sets the encryption/decryption key.
 *
 * \note            After using this function, you must also call
 *                  \c mbedtls_chacha20_starts() to set a nonce before you
 *                  start encrypting/decrypting data with
 *                  \c mbedtls_chacha_update().
 *
 * \param ctx       The ChaCha20 context to which the key should be bound.
 *                  It must be initialized.
 * \param key       The encryption/decryption key. This must be \c 32 Bytes
 *                  in length.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if ctx or key is NULL.
 */

Func mbedtls_chacha20_starts

int mbedtls_chacha20_starts( mbedtls_chacha20_context* ctx,
                            const unsigned char nonce[12],
                            uint32_t counter );
/**
 * \brief           This function sets the nonce and initial counter value.
 *
 * \note            A ChaCha20 context can be re-used with the same key by
 *                  calling this function to change the nonce.
 *
 * \warning         You must never use the same nonce twice with the same key.
 *                  This would void any confidentiality guarantees for the
 *                  messages encrypted with the same nonce and key.
 *
 * \param ctx       The ChaCha20 context to which the nonce should be bound.
 *                  It must be initialized and bound to a key.
 * \param nonce     The nonce. This must be \c 12 Bytes in size.
 * \param counter   The initial counter value. This is usually \c 0.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if ctx or nonce is
 *                  NULL.
 */

Func mbedtls_chacha20_update

int mbedtls_chacha20_update( mbedtls_chacha20_context *ctx,
                            size_t size,
                            const unsigned char *input,
                            unsigned char *output );
/**
 * \brief           This function encrypts or decrypts data.
 *
 *                  Since ChaCha20 is a stream cipher, the same operation is
 *                  used for encrypting and decrypting data.
 *
 * \note            The \p input and \p output pointers must either be equal or
 *                  point to non-overlapping buffers.
 *
 * \note            \c mbedtls_chacha20_setkey() and
 *                  \c mbedtls_chacha20_starts() must be called at least once
 *                  to setup the context before this function can be called.
 *
 * \note            This function can be called multiple times in a row in
 *                  order to encrypt of decrypt data piecewise with the same
 *                  key and nonce.
 *
 * \param ctx       The ChaCha20 context to use for encryption or decryption.
 *                  It must be initialized and bound to a key and nonce.
 * \param size      The length of the input data in Bytes.
 * \param input     The buffer holding the input data.
 *                  This pointer can be \c NULL if `size == 0`.
 * \param output    The buffer holding the output data.
 *                  This must be able to hold \p size Bytes.
 *                  This pointer can be \c NULL if `size == 0`.
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_chacha20_crypt

int mbedtls_chacha20_crypt( const unsigned char key[32],
                           const unsigned char nonce[12],
                           uint32_t counter,
                           size_t size,
                           const unsigned char* input,
                           unsigned char* output );
/**
 * \brief           This function encrypts or decrypts data with ChaCha20 and
 *                  the given key and nonce.
 *
 *                  Since ChaCha20 is a stream cipher, the same operation is
 *                  used for encrypting and decrypting data.
 *
 * \warning         You must never use the same (key, nonce) pair more than
 *                  once. This would void any confidentiality guarantees for
 *                  the messages encrypted with the same nonce and key.
 *
 * \note            The \p input and \p output pointers must either be equal or
 *                  point to non-overlapping buffers.
 *
 * \param key       The encryption/decryption key.
 *                  This must be \c 32 Bytes in length.
 * \param nonce     The nonce. This must be \c 12 Bytes in size.
 * \param counter   The initial counter value. This is usually \c 0.
 * \param size      The length of the input data in Bytes.
 * \param input     The buffer holding the input data.
 *                  This pointer can be \c NULL if `size == 0`.
 * \param output    The buffer holding the output data.
 *                  This must be able to hold \p size Bytes.
 *                  This pointer can be \c NULL if `size == 0`.
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_chacha20_self_test

int mbedtls_chacha20_self_test( int verbose );
/**
 * \brief           The ChaCha20 checkup routine.
 *
 * \return          \c 0 on success.
 * \return          \c 1 on failure.
 */

Func mbedtls_chachapoly_init

void mbedtls_chachapoly_init( mbedtls_chachapoly_context *ctx );
/**
 * \brief           This function initializes the specified ChaCha20-Poly1305 context.
 *
 *                  It must be the first API called before using
 *                  the context. It must be followed by a call to
 *                  \c mbedtls_chachapoly_setkey() before any operation can be
 *                  done, and to \c mbedtls_chachapoly_free() once all
 *                  operations with that context have been finished.
 *
 *                  In order to encrypt or decrypt full messages at once, for
 *                  each message you should make a single call to
 *                  \c mbedtls_chachapoly_crypt_and_tag() or
 *                  \c mbedtls_chachapoly_auth_decrypt().
 *
 *                  In order to encrypt messages piecewise, for each
 *                  message you should make a call to
 *                  \c mbedtls_chachapoly_starts(), then 0 or more calls to
 *                  \c mbedtls_chachapoly_update_aad(), then 0 or more calls to
 *                  \c mbedtls_chachapoly_update(), then one call to
 *                  \c mbedtls_chachapoly_finish().
 *
 * \warning         Decryption with the piecewise API is discouraged! Always
 *                  use \c mbedtls_chachapoly_auth_decrypt() when possible!
 *
 *                  If however this is not possible because the data is too
 *                  large to fit in memory, you need to:
 *
 *                  - call \c mbedtls_chachapoly_starts() and (if needed)
 *                  \c mbedtls_chachapoly_update_aad() as above,
 *                  - call \c mbedtls_chachapoly_update() multiple times and
 *                  ensure its output (the plaintext) is NOT used in any other
 *                  way than placing it in temporary storage at this point,
 *                  - call \c mbedtls_chachapoly_finish() to compute the
 *                  authentication tag and compared it in constant time to the
 *                  tag received with the ciphertext.
 *
 *                  If the tags are not equal, you must immediately discard
 *                  all previous outputs of \c mbedtls_chachapoly_update(),
 *                  otherwise you can now safely use the plaintext.
 *
 * \param ctx       The ChachaPoly context to initialize. Must not be \c NULL.
 */

Func mbedtls_chachapoly_free

void mbedtls_chachapoly_free( mbedtls_chachapoly_context *ctx );
/**
 * \brief           This function releases and clears the specified
 *                  ChaCha20-Poly1305 context.
 *
 * \param ctx       The ChachaPoly context to clear. This may be \c NULL, in which
 *                  case this function is a no-op.
 */

Func mbedtls_chachapoly_setkey

int mbedtls_chachapoly_setkey( mbedtls_chachapoly_context *ctx,
                              const unsigned char key[32] );
/**
 * \brief           This function sets the ChaCha20-Poly1305
 *                  symmetric encryption key.
 *
 * \param ctx       The ChaCha20-Poly1305 context to which the key should be
 *                  bound. This must be initialized.
 * \param key       The \c 256 Bit (\c 32 Bytes) key.
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_chachapoly_starts

int mbedtls_chachapoly_starts( mbedtls_chachapoly_context *ctx,
                              const unsigned char nonce[12],
                              mbedtls_chachapoly_mode_t mode );
/**
 * \brief           This function starts a ChaCha20-Poly1305 encryption or
 *                  decryption operation.
 *
 * \warning         You must never use the same nonce twice with the same key.
 *                  This would void any confidentiality and authenticity
 *                  guarantees for the messages encrypted with the same nonce
 *                  and key.
 *
 * \note            If the context is being used for AAD only (no data to
 *                  encrypt or decrypt) then \p mode can be set to any value.
 *
 * \warning         Decryption with the piecewise API is discouraged, see the
 *                  warning on \c mbedtls_chachapoly_init().
 *
 * \param ctx       The ChaCha20-Poly1305 context. This must be initialized
 *                  and bound to a key.
 * \param nonce     The nonce/IV to use for the message.
 *                  This must be a redable buffer of length \c 12 Bytes.
 * \param mode      The operation to perform: #MBEDTLS_CHACHAPOLY_ENCRYPT or
 *                  #MBEDTLS_CHACHAPOLY_DECRYPT (discouraged, see warning).
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_chachapoly_update_aad

int mbedtls_chachapoly_update_aad( mbedtls_chachapoly_context *ctx,
                                  const unsigned char *aad,
                                  size_t aad_len );
/**
 * \brief           This function feeds additional data to be authenticated
 *                  into an ongoing ChaCha20-Poly1305 operation.
 *
 *                  The Additional Authenticated Data (AAD), also called
 *                  Associated Data (AD) is only authenticated but not
 *                  encrypted nor included in the encrypted output. It is
 *                  usually transmitted separately from the ciphertext or
 *                  computed locally by each party.
 *
 * \note            This function is called before data is encrypted/decrypted.
 *                  I.e. call this function to process the AAD before calling
 *                  \c mbedtls_chachapoly_update().
 *
 *                  You may call this function multiple times to process
 *                  an arbitrary amount of AAD. It is permitted to call
 *                  this function 0 times, if no AAD is used.
 *
 *                  This function cannot be called any more if data has
 *                  been processed by \c mbedtls_chachapoly_update(),
 *                  or if the context has been finished.
 *
 * \warning         Decryption with the piecewise API is discouraged, see the
 *                  warning on \c mbedtls_chachapoly_init().
 *
 * \param ctx       The ChaCha20-Poly1305 context. This must be initialized
 *                  and bound to a key.
 * \param aad_len   The length in Bytes of the AAD. The length has no
 *                  restrictions.
 * \param aad       Buffer containing the AAD.
 *                  This pointer can be \c NULL if `aad_len == 0`.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA
 *                  if \p ctx or \p aad are NULL.
 * \return          #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE
 *                  if the operations has not been started or has been
 *                  finished, or if the AAD has been finished.
 */

Func mbedtls_chachapoly_update

int mbedtls_chachapoly_update( mbedtls_chachapoly_context *ctx,
                              size_t len,
                              const unsigned char *input,
                              unsigned char *output );
/**
 * \brief           Thus function feeds data to be encrypted or decrypted
 *                  into an on-going ChaCha20-Poly1305
 *                  operation.
 *
 *                  The direction (encryption or decryption) depends on the
 *                  mode that was given when calling
 *                  \c mbedtls_chachapoly_starts().
 *
 *                  You may call this function multiple times to process
 *                  an arbitrary amount of data. It is permitted to call
 *                  this function 0 times, if no data is to be encrypted
 *                  or decrypted.
 *
 * \warning         Decryption with the piecewise API is discouraged, see the
 *                  warning on \c mbedtls_chachapoly_init().
 *
 * \param ctx       The ChaCha20-Poly1305 context to use. This must be initialized.
 * \param len       The length (in bytes) of the data to encrypt or decrypt.
 * \param input     The buffer containing the data to encrypt or decrypt.
 *                  This pointer can be \c NULL if `len == 0`.
 * \param output    The buffer to where the encrypted or decrypted data is
 *                  written. This must be able to hold \p len bytes.
 *                  This pointer can be \c NULL if `len == 0`.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE
 *                  if the operation has not been started or has been
 *                  finished.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_chachapoly_finish

int mbedtls_chachapoly_finish( mbedtls_chachapoly_context *ctx,
                              unsigned char mac[16] );
/**
 * \brief           This function finished the ChaCha20-Poly1305 operation and
 *                  generates the MAC (authentication tag).
 *
 * \param ctx       The ChaCha20-Poly1305 context to use. This must be initialized.
 * \param mac       The buffer to where the 128-bit (16 bytes) MAC is written.
 *
 * \warning         Decryption with the piecewise API is discouraged, see the
 *                  warning on \c mbedtls_chachapoly_init().
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE
 *                  if the operation has not been started or has been
 *                  finished.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_chachapoly_encrypt_and_tag

int mbedtls_chachapoly_encrypt_and_tag( mbedtls_chachapoly_context *ctx,
                                       size_t length,
                                       const unsigned char nonce[12],
                                       const unsigned char *aad,
                                       size_t aad_len,
                                       const unsigned char *input,
                                       unsigned char *output,
                                       unsigned char tag[16] );
/**
 * \brief           This function performs a complete ChaCha20-Poly1305
 *                  authenticated encryption with the previously-set key.
 *
 * \note            Before using this function, you must set the key with
 *                  \c mbedtls_chachapoly_setkey().
 *
 * \warning         You must never use the same nonce twice with the same key.
 *                  This would void any confidentiality and authenticity
 *                  guarantees for the messages encrypted with the same nonce
 *                  and key.
 *
 * \param ctx       The ChaCha20-Poly1305 context to use (holds the key).
 *                  This must be initialized.
 * \param length    The length (in bytes) of the data to encrypt or decrypt.
 * \param nonce     The 96-bit (12 bytes) nonce/IV to use.
 * \param aad       The buffer containing the additional authenticated
 *                  data (AAD). This pointer can be \c NULL if `aad_len == 0`.
 * \param aad_len   The length (in bytes) of the AAD data to process.
 * \param input     The buffer containing the data to encrypt or decrypt.
 *                  This pointer can be \c NULL if `ilen == 0`.
 * \param output    The buffer to where the encrypted or decrypted data
 *                  is written. This pointer can be \c NULL if `ilen == 0`.
 * \param tag       The buffer to where the computed 128-bit (16 bytes) MAC
 *                  is written. This must not be \c NULL.
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_chachapoly_auth_decrypt

int mbedtls_chachapoly_auth_decrypt( mbedtls_chachapoly_context *ctx,
                                    size_t length,
                                    const unsigned char nonce[12],
                                    const unsigned char *aad,
                                    size_t aad_len,
                                    const unsigned char tag[16],
                                    const unsigned char *input,
                                    unsigned char *output );
/**
 * \brief           This function performs a complete ChaCha20-Poly1305
 *                  authenticated decryption with the previously-set key.
 *
 * \note            Before using this function, you must set the key with
 *                  \c mbedtls_chachapoly_setkey().
 *
 * \param ctx       The ChaCha20-Poly1305 context to use (holds the key).
 * \param length    The length (in Bytes) of the data to decrypt.
 * \param nonce     The \c 96 Bit (\c 12 bytes) nonce/IV to use.
 * \param aad       The buffer containing the additional authenticated data (AAD).
 *                  This pointer can be \c NULL if `aad_len == 0`.
 * \param aad_len   The length (in bytes) of the AAD data to process.
 * \param tag       The buffer holding the authentication tag.
 *                  This must be a readable buffer of length \c 16 Bytes.
 * \param input     The buffer containing the data to decrypt.
 *                  This pointer can be \c NULL if `ilen == 0`.
 * \param output    The buffer to where the decrypted data is written.
 *                  This pointer can be \c NULL if `ilen == 0`.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED
 *                  if the data was not authentic.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_chachapoly_self_test

int mbedtls_chachapoly_self_test( int verbose );
/**
 * \brief           The ChaCha20-Poly1305 checkup routine.
 *
 * \return          \c 0 on success.
 * \return          \c 1 on failure.
 */

Func mbedtls_cipher_init

void mbedtls_cipher_init( mbedtls_cipher_context_t *ctx );
/**
 * \brief               This function initializes a \p cipher_context as NONE.
 *
 * \param ctx           The context to be initialized. This must not be \c NULL.
 */

Func mbedtls_cipher_free

void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx );
/**
 * \brief               This function frees and clears the cipher-specific
 *                      context of \p ctx. Freeing \p ctx itself remains the
 *                      responsibility of the caller.
 *
 * \param ctx           The context to be freed. If this is \c NULL, the
 *                      function has no effect, otherwise this must point to an
 *                      initialized context.
 */

Func mbedtls_cipher_setup

int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx,
                         const mbedtls_cipher_info_t *cipher_info );
/**
 * \brief               This function initializes and fills the cipher-context
 *                      structure with the appropriate values. It also clears
 *                      the structure.
 *
 * \param ctx           The context to initialize. This must be initialized.
 * \param cipher_info   The cipher to use.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                      parameter-verification failure.
 * \return              #MBEDTLS_ERR_CIPHER_ALLOC_FAILED if allocation of the
 *                      cipher-specific context fails.
 *
 * \internal Currently, the function also clears the structure.
 * In future versions, the caller will be required to call
 * mbedtls_cipher_init() on the structure first.
 */

Func mbedtls_cipher_setkey

int mbedtls_cipher_setkey( mbedtls_cipher_context_t *ctx,
                          const unsigned char *key,
                          int key_bitlen,
                          const mbedtls_operation_t operation );
/**
 * \brief               This function sets the key to use with the given context.
 *
 * \param ctx           The generic cipher context. This must be initialized and
 *                      bound to a cipher information structure.
 * \param key           The key to use. This must be a readable buffer of at
 *                      least \p key_bitlen Bits.
 * \param key_bitlen    The key length to use, in Bits.
 * \param operation     The operation that the key will be used for:
 *                      #MBEDTLS_ENCRYPT or #MBEDTLS_DECRYPT.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                      parameter-verification failure.
 * \return              A cipher-specific error code on failure.
 */

Func mbedtls_cipher_set_padding_mode

int mbedtls_cipher_set_padding_mode( mbedtls_cipher_context_t *ctx,
                                    mbedtls_cipher_padding_t mode );
/**
 * \brief               This function sets the padding mode, for cipher modes
 *                      that use padding.
 *
 *                      The default passing mode is PKCS7 padding.
 *
 * \param ctx           The generic cipher context. This must be initialized and
 *                      bound to a cipher information structure.
 * \param mode          The padding mode.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE
 *                      if the selected padding mode is not supported.
 * \return              #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA if the cipher mode
 *                      does not support padding.
 */

Func mbedtls_cipher_set_iv

int mbedtls_cipher_set_iv( mbedtls_cipher_context_t *ctx,
                          const unsigned char *iv,
                          size_t iv_len );
/**
 * \brief           This function sets the initialization vector (IV)
 *                  or nonce.
 *
 * \note            Some ciphers do not use IVs nor nonce. For these
 *                  ciphers, this function has no effect.
 *
 * \param ctx       The generic cipher context. This must be initialized and
 *                  bound to a cipher information structure.
 * \param iv        The IV to use, or NONCE_COUNTER for CTR-mode ciphers. This
 *                  must be a readable buffer of at least \p iv_len Bytes.
 * \param iv_len    The IV length for ciphers with variable-size IV.
 *                  This parameter is discarded by ciphers with fixed-size IV.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                  parameter-verification failure.
 */

Func mbedtls_cipher_reset

int mbedtls_cipher_reset( mbedtls_cipher_context_t *ctx );
/**
 * \brief         This function resets the cipher state.
 *
 * \param ctx     The generic cipher context. This must be initialized.
 *
 * \return        \c 0 on success.
 * \return        #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                parameter-verification failure.
 */

Func mbedtls_cipher_update_ad

int mbedtls_cipher_update_ad( mbedtls_cipher_context_t *ctx,
                     const unsigned char *ad, size_t ad_len );
/**
 * \brief               This function adds additional data for AEAD ciphers.
 *                      Currently supported with GCM and ChaCha20+Poly1305.
 *                      This must be called exactly once, after
 *                      mbedtls_cipher_reset().
 *
 * \param ctx           The generic cipher context. This must be initialized.
 * \param ad            The additional data to use. This must be a readable
 *                      buffer of at least \p ad_len Bytes.
 * \param ad_len        the Length of \p ad Bytes.
 *
 * \return              \c 0 on success.
 * \return              A specific error code on failure.
 */

Func mbedtls_cipher_update

int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *input,
                  size_t ilen, unsigned char *output, size_t *olen );
/**
 * \brief               The generic cipher update function. It encrypts or
 *                      decrypts using the given cipher context. Writes as
 *                      many block-sized blocks of data as possible to output.
 *                      Any data that cannot be written immediately is either
 *                      added to the next block, or flushed when
 *                      mbedtls_cipher_finish() is called.
 *                      Exception: For MBEDTLS_MODE_ECB, expects a single block
 *                      in size. For example, 16 Bytes for AES.
 *
 * \note                If the underlying cipher is used in GCM mode, all calls
 *                      to this function, except for the last one before
 *                      mbedtls_cipher_finish(), must have \p ilen as a
 *                      multiple of the block size of the cipher.
 *
 * \param ctx           The generic cipher context. This must be initialized and
 *                      bound to a key.
 * \param input         The buffer holding the input data. This must be a
 *                      readable buffer of at least \p ilen Bytes.
 * \param ilen          The length of the input data.
 * \param output        The buffer for the output data. This must be able to
 *                      hold at least `ilen + block_size`. This must not be the
 *                      same buffer as \p input.
 * \param olen          The length of the output data, to be updated with the
 *                      actual number of Bytes written. This must not be
 *                      \c NULL.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                      parameter-verification failure.
 * \return              #MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE on an
 *                      unsupported mode for a cipher.
 * \return              A cipher-specific error code on failure.
 */

Func mbedtls_cipher_finish

int mbedtls_cipher_finish( mbedtls_cipher_context_t *ctx,
                  unsigned char *output, size_t *olen );
/**
 * \brief               The generic cipher finalization function. If data still
 *                      needs to be flushed from an incomplete block, the data
 *                      contained in it is padded to the size of
 *                      the last block, and written to the \p output buffer.
 *
 * \param ctx           The generic cipher context. This must be initialized and
 *                      bound to a key.
 * \param output        The buffer to write data to. This needs to be a writable
 *                      buffer of at least \p block_size Bytes.
 * \param olen          The length of the data written to the \p output buffer.
 *                      This may not be \c NULL.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                      parameter-verification failure.
 * \return              #MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED on decryption
 *                      expecting a full block but not receiving one.
 * \return              #MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding
 *                      while decrypting.
 * \return              A cipher-specific error code on failure.
 */

Func mbedtls_cipher_write_tag

int mbedtls_cipher_write_tag( mbedtls_cipher_context_t *ctx,
                     unsigned char *tag, size_t tag_len );
/**
 * \brief               This function writes a tag for AEAD ciphers.
 *                      Currently supported with GCM and ChaCha20+Poly1305.
 *                      This must be called after mbedtls_cipher_finish().
 *
 * \param ctx           The generic cipher context. This must be initialized,
 *                      bound to a key, and have just completed a cipher
 *                      operation through mbedtls_cipher_finish() the tag for
 *                      which should be written.
 * \param tag           The buffer to write the tag to. This must be a writable
 *                      buffer of at least \p tag_len Bytes.
 * \param tag_len       The length of the tag to write.
 *
 * \return              \c 0 on success.
 * \return              A specific error code on failure.
 */

Func mbedtls_cipher_check_tag

int mbedtls_cipher_check_tag( mbedtls_cipher_context_t *ctx,
                     const unsigned char *tag, size_t tag_len );
/**
 * \brief               This function checks the tag for AEAD ciphers.
 *                      Currently supported with GCM and ChaCha20+Poly1305.
 *                      This must be called after mbedtls_cipher_finish().
 *
 * \param ctx           The generic cipher context. This must be initialized.
 * \param tag           The buffer holding the tag. This must be a readable
 *                      buffer of at least \p tag_len Bytes.
 * \param tag_len       The length of the tag to check.
 *
 * \return              \c 0 on success.
 * \return              A specific error code on failure.
 */

Func mbedtls_cipher_crypt

int mbedtls_cipher_crypt( mbedtls_cipher_context_t *ctx,
                 const unsigned char *iv, size_t iv_len,
                 const unsigned char *input, size_t ilen,
                 unsigned char *output, size_t *olen );
/**
 * \brief               The generic all-in-one encryption/decryption function,
 *                      for all ciphers except AEAD constructs.
 *
 * \param ctx           The generic cipher context. This must be initialized.
 * \param iv            The IV to use, or NONCE_COUNTER for CTR-mode ciphers.
 *                      This must be a readable buffer of at least \p iv_len
 *                      Bytes.
 * \param iv_len        The IV length for ciphers with variable-size IV.
 *                      This parameter is discarded by ciphers with fixed-size
 *                      IV.
 * \param input         The buffer holding the input data. This must be a
 *                      readable buffer of at least \p ilen Bytes.
 * \param ilen          The length of the input data in Bytes.
 * \param output        The buffer for the output data. This must be able to
 *                      hold at least `ilen + block_size`. This must not be the
 *                      same buffer as \p input.
 * \param olen          The length of the output data, to be updated with the
 *                      actual number of Bytes written. This must not be
 *                      \c NULL.
 *
 * \note                Some ciphers do not use IVs nor nonce. For these
 *                      ciphers, use \p iv = NULL and \p iv_len = 0.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                      parameter-verification failure.
 * \return              #MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED on decryption
 *                      expecting a full block but not receiving one.
 * \return              #MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding
 *                      while decrypting.
 * \return              A cipher-specific error code on failure.
 */

Func mbedtls_cipher_auth_encrypt

int mbedtls_cipher_auth_encrypt( mbedtls_cipher_context_t *ctx,
                        const unsigned char *iv, size_t iv_len,
                        const unsigned char *ad, size_t ad_len,
                        const unsigned char *input, size_t ilen,
                        unsigned char *output, size_t *olen,
                        unsigned char *tag, size_t tag_len );
/**
 * \brief               The generic autenticated encryption (AEAD) function.
 *
 * \param ctx           The generic cipher context. This must be initialized and
 *                      bound to a key.
 * \param iv            The IV to use, or NONCE_COUNTER for CTR-mode ciphers.
 *                      This must be a readable buffer of at least \p iv_len
 *                      Bytes.
 * \param iv_len        The IV length for ciphers with variable-size IV.
 *                      This parameter is discarded by ciphers with fixed-size IV.
 * \param ad            The additional data to authenticate. This must be a
 *                      readable buffer of at least \p ad_len Bytes.
 * \param ad_len        The length of \p ad.
 * \param input         The buffer holding the input data. This must be a
 *                      readable buffer of at least \p ilen Bytes.
 * \param ilen          The length of the input data.
 * \param output        The buffer for the output data. This must be able to
 *                      hold at least \p ilen Bytes.
 * \param olen          The length of the output data, to be updated with the
 *                      actual number of Bytes written. This must not be
 *                      \c NULL.
 * \param tag           The buffer for the authentication tag. This must be a
 *                      writable buffer of at least \p tag_len Bytes.
 * \param tag_len       The desired length of the authentication tag.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                      parameter-verification failure.
 * \return              A cipher-specific error code on failure.
 */

Func mbedtls_cipher_auth_decrypt

int mbedtls_cipher_auth_decrypt( mbedtls_cipher_context_t *ctx,
                        const unsigned char *iv, size_t iv_len,
                        const unsigned char *ad, size_t ad_len,
                        const unsigned char *input, size_t ilen,
                        unsigned char *output, size_t *olen,
                        const unsigned char *tag, size_t tag_len );
/**
 * \brief               The generic autenticated decryption (AEAD) function.
 *
 * \note                If the data is not authentic, then the output buffer
 *                      is zeroed out to prevent the unauthentic plaintext being
 *                      used, making this interface safer.
 *
 * \param ctx           The generic cipher context. This must be initialized and
 *                      and bound to a key.
 * \param iv            The IV to use, or NONCE_COUNTER for CTR-mode ciphers.
 *                      This must be a readable buffer of at least \p iv_len
 *                      Bytes.
 * \param iv_len        The IV length for ciphers with variable-size IV.
 *                      This parameter is discarded by ciphers with fixed-size IV.
 * \param ad            The additional data to be authenticated. This must be a
 *                      readable buffer of at least \p ad_len Bytes.
 * \param ad_len        The length of \p ad.
 * \param input         The buffer holding the input data. This must be a
 *                      readable buffer of at least \p ilen Bytes.
 * \param ilen          The length of the input data.
 * \param output        The buffer for the output data.
 *                      This must be able to hold at least \p ilen Bytes.
 * \param olen          The length of the output data, to be updated with the
 *                      actual number of Bytes written. This must not be
 *                      \c NULL.
 * \param tag           The buffer holding the authentication tag. This must be
 *                      a readable buffer of at least \p tag_len Bytes.
 * \param tag_len       The length of the authentication tag.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
 *                      parameter-verification failure.
 * \return              #MBEDTLS_ERR_CIPHER_AUTH_FAILED if data is not authentic.
 * \return              A cipher-specific error code on failure.
 */

Func mbedtls_cipher_cmac_starts

int mbedtls_cipher_cmac_starts( mbedtls_cipher_context_t *ctx,
                               const unsigned char *key, size_t keybits );
/**
 * \brief               This function sets the CMAC key, and prepares to authenticate
 *                      the input data.
 *                      Must be called with an initialized cipher context.
 *
 * \param ctx           The cipher context used for the CMAC operation, initialized
 *                      as one of the following types: MBEDTLS_CIPHER_AES_128_ECB,
 *                      MBEDTLS_CIPHER_AES_192_ECB, MBEDTLS_CIPHER_AES_256_ECB,
 *                      or MBEDTLS_CIPHER_DES_EDE3_ECB.
 * \param key           The CMAC key.
 * \param keybits       The length of the CMAC key in bits.
 *                      Must be supported by the cipher.
 *
 * \return              \c 0 on success.
 * \return              A cipher-specific error code on failure.
 */

Func mbedtls_cipher_cmac_update

int mbedtls_cipher_cmac_update( mbedtls_cipher_context_t *ctx,
                               const unsigned char *input, size_t ilen );
/**
 * \brief               This function feeds an input buffer into an ongoing CMAC
 *                      computation.
 *
 *                      It is called between mbedtls_cipher_cmac_starts() or
 *                      mbedtls_cipher_cmac_reset(), and mbedtls_cipher_cmac_finish().
 *                      Can be called repeatedly.
 *
 * \param ctx           The cipher context used for the CMAC operation.
 * \param input         The buffer holding the input data.
 * \param ilen          The length of the input data.
 *
 * \return             \c 0 on success.
 * \return             #MBEDTLS_ERR_MD_BAD_INPUT_DATA
 *                     if parameter verification fails.
 */

Func mbedtls_cipher_cmac_finish

int mbedtls_cipher_cmac_finish( mbedtls_cipher_context_t *ctx,
                               unsigned char *output );
/**
 * \brief               This function finishes the CMAC operation, and writes
 *                      the result to the output buffer.
 *
 *                      It is called after mbedtls_cipher_cmac_update().
 *                      It can be followed by mbedtls_cipher_cmac_reset() and
 *                      mbedtls_cipher_cmac_update(), or mbedtls_cipher_free().
 *
 * \param ctx           The cipher context used for the CMAC operation.
 * \param output        The output buffer for the CMAC checksum result.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_MD_BAD_INPUT_DATA
 *                      if parameter verification fails.
 */

Func mbedtls_cipher_cmac_reset

int mbedtls_cipher_cmac_reset( mbedtls_cipher_context_t *ctx );
/**
 * \brief               This function prepares the authentication of another
 *                      message with the same key as the previous CMAC
 *                      operation.
 *
 *                      It is called after mbedtls_cipher_cmac_finish()
 *                      and before mbedtls_cipher_cmac_update().
 *
 * \param ctx           The cipher context used for the CMAC operation.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_MD_BAD_INPUT_DATA
 *                      if parameter verification fails.
 */

Func mbedtls_cipher_cmac

int mbedtls_cipher_cmac( const mbedtls_cipher_info_t *cipher_info,
                        const unsigned char *key, size_t keylen,
                        const unsigned char *input, size_t ilen,
                        unsigned char *output );
/**
 * \brief               This function calculates the full generic CMAC
 *                      on the input buffer with the provided key.
 *
 *                      The function allocates the context, performs the
 *                      calculation, and frees the context.
 *
 *                      The CMAC result is calculated as
 *                      output = generic CMAC(cmac key, input buffer).
 *
 *
 * \param cipher_info   The cipher information.
 * \param key           The CMAC key.
 * \param keylen        The length of the CMAC key in bits.
 * \param input         The buffer holding the input data.
 * \param ilen          The length of the input data.
 * \param output        The buffer for the generic CMAC result.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_MD_BAD_INPUT_DATA
 *                      if parameter verification fails.
 */

Func mbedtls_aes_cmac_prf_128

int mbedtls_aes_cmac_prf_128( const unsigned char *key, size_t key_len,
                             const unsigned char *input, size_t in_len,
                             unsigned char output[16] );
/**
 * \brief           This function implements the AES-CMAC-PRF-128 pseudorandom
 *                  function, as defined in
 *                  RFC-4615: The Advanced Encryption Standard-Cipher-based
 *                  Message Authentication Code-Pseudo-Random Function-128
 *                  (AES-CMAC-PRF-128) Algorithm for the Internet Key
 *                  Exchange Protocol (IKE).
 *
 * \param key       The key to use.
 * \param key_len   The key length in Bytes.
 * \param input     The buffer holding the input data.
 * \param in_len    The length of the input data in Bytes.
 * \param output    The buffer holding the generated 16 Bytes of
 *                  pseudorandom output.
 *
 * \return          \c 0 on success.
 */

Func mbedtls_cmac_self_test

int mbedtls_cmac_self_test( int verbose );
/**
 * \brief          The CMAC checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_ctr_drbg_init

void mbedtls_ctr_drbg_init( mbedtls_ctr_drbg_context *ctx );
/**
 * \brief               This function initializes the CTR_DRBG context,
 *                      and prepares it for mbedtls_ctr_drbg_seed()
 *                      or mbedtls_ctr_drbg_free().
 *
 * \param ctx           The CTR_DRBG context to initialize.
 */

Func mbedtls_ctr_drbg_seed

int mbedtls_ctr_drbg_seed( mbedtls_ctr_drbg_context *ctx,
                  int (*f_entropy)(void *, unsigned char *, size_t),
                  void *p_entropy,
                  const unsigned char *custom,
                  size_t len );
/**
 * \brief               This function seeds and sets up the CTR_DRBG
 *                      entropy source for future reseeds.
 *
 * \note Personalization data can be provided in addition to the more generic
 *       entropy source, to make this instantiation as unique as possible.
 *
 * \param ctx           The CTR_DRBG context to seed.
 * \param f_entropy     The entropy callback, taking as arguments the
 *                      \p p_entropy context, the buffer to fill, and the
                        length of the buffer.
 * \param p_entropy     The entropy context.
 * \param custom        Personalization data, that is device-specific
                        identifiers. Can be NULL.
 * \param len           The length of the personalization data.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on failure.
 */

Func mbedtls_ctr_drbg_free

void mbedtls_ctr_drbg_free( mbedtls_ctr_drbg_context *ctx );
/**
 * \brief               This function clears CTR_CRBG context data.
 *
 * \param ctx           The CTR_DRBG context to clear.
 */

Func mbedtls_ctr_drbg_set_prediction_resistance

void mbedtls_ctr_drbg_set_prediction_resistance( mbedtls_ctr_drbg_context *ctx,
                                        int resistance );
/**
 * \brief               This function turns prediction resistance on or off.
 *                      The default value is off.
 *
 * \note                If enabled, entropy is gathered at the beginning of
 *                      every call to mbedtls_ctr_drbg_random_with_add().
 *                      Only use this if your entropy source has sufficient
 *                      throughput.
 *
 * \param ctx           The CTR_DRBG context.
 * \param resistance    #MBEDTLS_CTR_DRBG_PR_ON or #MBEDTLS_CTR_DRBG_PR_OFF.
 */

Func mbedtls_ctr_drbg_set_entropy_len

void mbedtls_ctr_drbg_set_entropy_len( mbedtls_ctr_drbg_context *ctx,
                              size_t len );
/**
 * \brief               This function sets the amount of entropy grabbed on each
 *                      seed or reseed. The default value is
 *                      #MBEDTLS_CTR_DRBG_ENTROPY_LEN.
 *
 * \param ctx           The CTR_DRBG context.
 * \param len           The amount of entropy to grab.
 */

Func mbedtls_ctr_drbg_set_reseed_interval

void mbedtls_ctr_drbg_set_reseed_interval( mbedtls_ctr_drbg_context *ctx,
                                  int interval );
/**
 * \brief               This function sets the reseed interval.
 *                      The default value is #MBEDTLS_CTR_DRBG_RESEED_INTERVAL.
 *
 * \param ctx           The CTR_DRBG context.
 * \param interval      The reseed interval.
 */

Func mbedtls_ctr_drbg_reseed

int mbedtls_ctr_drbg_reseed( mbedtls_ctr_drbg_context *ctx,
                    const unsigned char *additional, size_t len );
/**
 * \brief               This function reseeds the CTR_DRBG context, that is
 *                      extracts data from the entropy source.
 *
 * \param ctx           The CTR_DRBG context.
 * \param additional    Additional data to add to the state. Can be NULL.
 * \param len           The length of the additional data.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on failure.
 */

Func mbedtls_ctr_drbg_update_ret

int mbedtls_ctr_drbg_update_ret( mbedtls_ctr_drbg_context *ctx,
                                const unsigned char *additional,
                                size_t add_len );
/**
 * \brief              This function updates the state of the CTR_DRBG context.
 *
 * \param ctx          The CTR_DRBG context.
 * \param additional   The data to update the state with.
 * \param add_len      Length of \p additional in bytes. This must be at
 *                     most #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT.
 *
 * \return             \c 0 on success.
 * \return             #MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG if
 *                     \p add_len is more than
 *                     #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT.
 * \return             An error from the underlying AES cipher on failure.
 */

Func mbedtls_ctr_drbg_random_with_add

int mbedtls_ctr_drbg_random_with_add( void *p_rng,
                             unsigned char *output, size_t output_len,
                             const unsigned char *additional, size_t add_len );
/**
 * \brief   This function updates a CTR_DRBG instance with additional
 *          data and uses it to generate random data.
 *
 * \note    The function automatically reseeds if the reseed counter is exceeded.
 *
 * \param p_rng         The CTR_DRBG context. This must be a pointer to a
 *                      #mbedtls_ctr_drbg_context structure.
 * \param output        The buffer to fill.
 * \param output_len    The length of the buffer.
 * \param additional    Additional data to update. Can be NULL.
 * \param add_len       The length of the additional data.
 *
 * \return    \c 0 on success.
 * \return    #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED or
 *            #MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG on failure.
 */

Func mbedtls_ctr_drbg_random

int mbedtls_ctr_drbg_random( void *p_rng,
                    unsigned char *output, size_t output_len );
/**
 * \brief   This function uses CTR_DRBG to generate random data.
 *
 * \note    The function automatically reseeds if the reseed counter is exceeded.
 *
 * \param p_rng         The CTR_DRBG context. This must be a pointer to a
 *                      #mbedtls_ctr_drbg_context structure.
 * \param output        The buffer to fill.
 * \param output_len    The length of the buffer.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED or
 *                      #MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG on failure.
 */

Func mbedtls_ctr_drbg_write_seed_file

int mbedtls_ctr_drbg_write_seed_file( mbedtls_ctr_drbg_context *ctx, const char *path );
/**
 * \brief               This function writes a seed file.
 *
 * \param ctx           The CTR_DRBG context.
 * \param path          The name of the file.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR on file error.
 * \return              #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on
 *                      failure.
 */

Func mbedtls_ctr_drbg_update_seed_file

int mbedtls_ctr_drbg_update_seed_file( mbedtls_ctr_drbg_context *ctx, const char *path );
/**
 * \brief               This function reads and updates a seed file. The seed
 *                      is added to this instance.
 *
 * \param ctx           The CTR_DRBG context.
 * \param path          The name of the file.
 *
 * \return              \c 0 on success.
 * \return              #MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR on file error.
 * \return              #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED or
 *                      #MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG on failure.
 */

Func mbedtls_ctr_drbg_self_test

int mbedtls_ctr_drbg_self_test( int verbose );
/**
 * \brief               The CTR_DRBG checkup routine.
 *
 * \return              \c 0 on success.
 * \return              \c 1 on failure.
 */

Func mbedtls_ctr_drbg_seed_entropy_len

int mbedtls_ctr_drbg_seed_entropy_len( mbedtls_ctr_drbg_context *,
                              int (*)(void *, unsigned char *, size_t), void *,
                              const unsigned char *, size_t, size_t );
/* Internal functions (do not call directly) */

Func mbedtls_debug_set_threshold

void mbedtls_debug_set_threshold( int threshold );
/**
 * \brief   Set the threshold error level to handle globally all debug output.
 *          Debug messages that have a level over the threshold value are
 *          discarded.
 *          (Default value: 0 = No debug )
 *
 * \param threshold     theshold level of messages to filter on. Messages at a
 *                      higher level will be discarded.
 *                          - Debug levels
 *                              - 0 No debug
 *                              - 1 Error
 *                              - 2 State change
 *                              - 3 Informational
 *                              - 4 Verbose
 */

Func mbedtls_debug_print_msg

void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level,
                             const char *file, int line,
                             const char *format, ... );
/**
 * \brief    Print a message to the debug output. This function is always used
 *          through the MBEDTLS_SSL_DEBUG_MSG() macro, which supplies the ssl
 *          context, file and line number parameters.
 *
 * \param ssl       SSL context
 * \param level     error level of the debug message
 * \param file      file the message has occurred in
 * \param line      line number the message has occurred at
 * \param format    format specifier, in printf format
 * \param ...       variables used by the format specifier
 *
 * \attention       This function is intended for INTERNAL usage within the
 *                  library only.
 */

Func mbedtls_debug_print_ret

void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level,
                     const char *file, int line,
                     const char *text, int ret );
/**
 * \brief   Print the return value of a function to the debug output. This
 *          function is always used through the MBEDTLS_SSL_DEBUG_RET() macro,
 *          which supplies the ssl context, file and line number parameters.
 *
 * \param ssl       SSL context
 * \param level     error level of the debug message
 * \param file      file the error has occurred in
 * \param line      line number the error has occurred in
 * \param text      the name of the function that returned the error
 * \param ret       the return code value
 *
 * \attention       This function is intended for INTERNAL usage within the
 *                  library only.
 */

Func mbedtls_debug_print_buf

void mbedtls_debug_print_buf( const mbedtls_ssl_context *ssl, int level,
                     const char *file, int line, const char *text,
                     const unsigned char *buf, size_t len );
/**
 * \brief   Output a buffer of size len bytes to the debug output. This function
 *          is always used through the MBEDTLS_SSL_DEBUG_BUF() macro,
 *          which supplies the ssl context, file and line number parameters.
 *
 * \param ssl       SSL context
 * \param level     error level of the debug message
 * \param file      file the error has occurred in
 * \param line      line number the error has occurred in
 * \param text      a name or label for the buffer being dumped. Normally the
 *                  variable or buffer name
 * \param buf       the buffer to be outputted
 * \param len       length of the buffer
 *
 * \attention       This function is intended for INTERNAL usage within the
 *                  library only.
 */

Func mbedtls_debug_print_mpi

void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level,
                     const char *file, int line,
                     const char *text, const mbedtls_mpi *X );
/**
 * \brief   Print a MPI variable to the debug output. This function is always
 *          used through the MBEDTLS_SSL_DEBUG_MPI() macro, which supplies the
 *          ssl context, file and line number parameters.
 *
 * \param ssl       SSL context
 * \param level     error level of the debug message
 * \param file      file the error has occurred in
 * \param line      line number the error has occurred in
 * \param text      a name or label for the MPI being output. Normally the
 *                  variable name
 * \param X         the MPI variable
 *
 * \attention       This function is intended for INTERNAL usage within the
 *                  library only.
 */

Func mbedtls_debug_print_ecp

void mbedtls_debug_print_ecp( const mbedtls_ssl_context *ssl, int level,
                     const char *file, int line,
                     const char *text, const mbedtls_ecp_point *X );
/**
 * \brief   Print an ECP point to the debug output. This function is always
 *          used through the MBEDTLS_SSL_DEBUG_ECP() macro, which supplies the
 *          ssl context, file and line number parameters.
 *
 * \param ssl       SSL context
 * \param level     error level of the debug message
 * \param file      file the error has occurred in
 * \param line      line number the error has occurred in
 * \param text      a name or label for the ECP point being output. Normally the
 *                  variable name
 * \param X         the ECP point
 *
 * \attention       This function is intended for INTERNAL usage within the
 *                  library only.
 */

Func mbedtls_debug_print_crt

void mbedtls_debug_print_crt( const mbedtls_ssl_context *ssl, int level,
                     const char *file, int line,
                     const char *text, const mbedtls_x509_crt *crt );
/**
 * \brief   Print a X.509 certificate structure to the debug output. This
 *          function is always used through the MBEDTLS_SSL_DEBUG_CRT() macro,
 *          which supplies the ssl context, file and line number parameters.
 *
 * \param ssl       SSL context
 * \param level     error level of the debug message
 * \param file      file the error has occurred in
 * \param line      line number the error has occurred in
 * \param text      a name or label for the certificate being output
 * \param crt       X.509 certificate structure
 *
 * \attention       This function is intended for INTERNAL usage within the
 *                  library only.
 */

Func mbedtls_debug_printf_ecdh

void mbedtls_debug_printf_ecdh( const mbedtls_ssl_context *ssl, int level,
                               const char *file, int line,
                               const mbedtls_ecdh_context *ecdh,
                               mbedtls_debug_ecdh_attr attr );
/**
 * \brief   Print a field of the ECDH structure in the SSL context to the debug
 *          output. This function is always used through the
 *          MBEDTLS_SSL_DEBUG_ECDH() macro, which supplies the ssl context, file
 *          and line number parameters.
 *
 * \param ssl       SSL context
 * \param level     error level of the debug message
 * \param file      file the error has occurred in
 * \param line      line number the error has occurred in
 * \param ecdh      the ECDH context
 * \param attr      the identifier of the attribute being output
 *
 * \attention       This function is intended for INTERNAL usage within the
 *                  library only.
 */

Func mbedtls_des_init

void mbedtls_des_init( mbedtls_des_context *ctx );
/**
 * \brief          Initialize DES context
 *
 * \param ctx      DES context to be initialized
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des_free

void mbedtls_des_free( mbedtls_des_context *ctx );
/**
 * \brief          Clear DES context
 *
 * \param ctx      DES context to be cleared
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des3_init

void mbedtls_des3_init( mbedtls_des3_context *ctx );
/**
 * \brief          Initialize Triple-DES context
 *
 * \param ctx      DES3 context to be initialized
 */

Func mbedtls_des3_free

void mbedtls_des3_free( mbedtls_des3_context *ctx );
/**
 * \brief          Clear Triple-DES context
 *
 * \param ctx      DES3 context to be cleared
 */

Func mbedtls_des_key_set_parity

void mbedtls_des_key_set_parity( unsigned char key[MBEDTLS_DES_KEY_SIZE] );
/**
 * \brief          Set key parity on the given key to odd.
 *
 *                 DES keys are 56 bits long, but each byte is padded with
 *                 a parity bit to allow verification.
 *
 * \param key      8-byte secret key
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des_key_check_key_parity

int mbedtls_des_key_check_key_parity( const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
/**
 * \brief          Check that key parity on the given key is odd.
 *
 *                 DES keys are 56 bits long, but each byte is padded with
 *                 a parity bit to allow verification.
 *
 * \param key      8-byte secret key
 *
 * \return         0 is parity was ok, 1 if parity was not correct.
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des_key_check_weak

int mbedtls_des_key_check_weak( const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
/**
 * \brief          Check that key is not a weak or semi-weak DES key
 *
 * \param key      8-byte secret key
 *
 * \return         0 if no weak key was found, 1 if a weak key was identified.
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des_setkey_enc

int mbedtls_des_setkey_enc( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
/**
 * \brief          DES key schedule (56-bit, encryption)
 *
 * \param ctx      DES context to be initialized
 * \param key      8-byte secret key
 *
 * \return         0
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des_setkey_dec

int mbedtls_des_setkey_dec( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
/**
 * \brief          DES key schedule (56-bit, decryption)
 *
 * \param ctx      DES context to be initialized
 * \param key      8-byte secret key
 *
 * \return         0
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des3_set2key_enc

int mbedtls_des3_set2key_enc( mbedtls_des3_context *ctx,
                     const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] );
/**
 * \brief          Triple-DES key schedule (112-bit, encryption)
 *
 * \param ctx      3DES context to be initialized
 * \param key      16-byte secret key
 *
 * \return         0
 */

Func mbedtls_des3_set2key_dec

int mbedtls_des3_set2key_dec( mbedtls_des3_context *ctx,
                     const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] );
/**
 * \brief          Triple-DES key schedule (112-bit, decryption)
 *
 * \param ctx      3DES context to be initialized
 * \param key      16-byte secret key
 *
 * \return         0
 */

Func mbedtls_des3_set3key_enc

int mbedtls_des3_set3key_enc( mbedtls_des3_context *ctx,
                     const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] );
/**
 * \brief          Triple-DES key schedule (168-bit, encryption)
 *
 * \param ctx      3DES context to be initialized
 * \param key      24-byte secret key
 *
 * \return         0
 */

Func mbedtls_des3_set3key_dec

int mbedtls_des3_set3key_dec( mbedtls_des3_context *ctx,
                     const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] );
/**
 * \brief          Triple-DES key schedule (168-bit, decryption)
 *
 * \param ctx      3DES context to be initialized
 * \param key      24-byte secret key
 *
 * \return         0
 */

Func mbedtls_des_crypt_ecb

int mbedtls_des_crypt_ecb( mbedtls_des_context *ctx,
                   const unsigned char input[8],
                   unsigned char output[8] );
/**
 * \brief          DES-ECB block encryption/decryption
 *
 * \param ctx      DES context
 * \param input    64-bit input block
 * \param output   64-bit output block
 *
 * \return         0 if successful
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des_crypt_cbc

int mbedtls_des_crypt_cbc( mbedtls_des_context *ctx,
                   int mode,
                   size_t length,
                   unsigned char iv[8],
                   const unsigned char *input,
                   unsigned char *output );
/**
 * \brief          DES-CBC buffer encryption/decryption
 *
 * \note           Upon exit, the content of the IV is updated so that you can
 *                 call the function same function again on the following
 *                 block(s) of data and get the same result as if it was
 *                 encrypted in one call. This allows a "streaming" usage.
 *                 If on the other hand you need to retain the contents of the
 *                 IV, you should either save it manually or use the cipher
 *                 module instead.
 *
 * \param ctx      DES context
 * \param mode     MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT
 * \param length   length of the input data
 * \param iv       initialization vector (updated after use)
 * \param input    buffer holding the input data
 * \param output   buffer holding the output data
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des3_crypt_ecb

int mbedtls_des3_crypt_ecb( mbedtls_des3_context *ctx,
                    const unsigned char input[8],
                    unsigned char output[8] );
/**
 * \brief          3DES-ECB block encryption/decryption
 *
 * \param ctx      3DES context
 * \param input    64-bit input block
 * \param output   64-bit output block
 *
 * \return         0 if successful
 */

Func mbedtls_des3_crypt_cbc

int mbedtls_des3_crypt_cbc( mbedtls_des3_context *ctx,
                    int mode,
                    size_t length,
                    unsigned char iv[8],
                    const unsigned char *input,
                    unsigned char *output );
/**
 * \brief          3DES-CBC buffer encryption/decryption
 *
 * \note           Upon exit, the content of the IV is updated so that you can
 *                 call the function same function again on the following
 *                 block(s) of data and get the same result as if it was
 *                 encrypted in one call. This allows a "streaming" usage.
 *                 If on the other hand you need to retain the contents of the
 *                 IV, you should either save it manually or use the cipher
 *                 module instead.
 *
 * \param ctx      3DES context
 * \param mode     MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT
 * \param length   length of the input data
 * \param iv       initialization vector (updated after use)
 * \param input    buffer holding the input data
 * \param output   buffer holding the output data
 *
 * \return         0 if successful, or MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH
 */

Func mbedtls_des_setkey

void mbedtls_des_setkey( uint32_t SK[32],
                        const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
/**
 * \brief          Internal function for key expansion.
 *                 (Only exposed to allow overriding it,
 *                 see MBEDTLS_DES_SETKEY_ALT)
 *
 * \param SK       Round keys
 * \param key      Base key
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Func mbedtls_des_self_test

int mbedtls_des_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Func mbedtls_dhm_init

void mbedtls_dhm_init( mbedtls_dhm_context *ctx );
/**
 * \brief          This function initializes the DHM context.
 *
 * \param ctx      The DHM context to initialize.
 */

Func mbedtls_dhm_read_params

int mbedtls_dhm_read_params( mbedtls_dhm_context *ctx,
                            unsigned char **p,
                            const unsigned char *end );
/**
 * \brief          This function parses the DHM parameters in a
 *                 TLS ServerKeyExchange handshake message
 *                 (DHM modulus, generator, and public key).
 *
 * \note           In a TLS handshake, this is the how the client
 *                 sets up its DHM context from the server's public
 *                 DHM key material.
 *
 * \param ctx      The DHM context to use. This must be initialized.
 * \param p        On input, *p must be the start of the input buffer.
 *                 On output, *p is updated to point to the end of the data
 *                 that has been read. On success, this is the first byte
 *                 past the end of the ServerKeyExchange parameters.
 *                 On error, this is the point at which an error has been
 *                 detected, which is usually not useful except to debug
 *                 failures.
 * \param end      The end of the input buffer.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_DHM_XXX error code on failure.
 */

Func mbedtls_dhm_make_params

int mbedtls_dhm_make_params( mbedtls_dhm_context *ctx, int x_size,
                    unsigned char *output, size_t *olen,
                    int (*f_rng)(void *, unsigned char *, size_t),
                    void *p_rng );
/**
 * \brief          This function generates a DHM key pair and exports its
 *                 public part together with the DHM parameters in the format
 *                 used in a TLS ServerKeyExchange handshake message.
 *
 * \note           This function assumes that the DHM parameters \c ctx->P
 *                 and \c ctx->G have already been properly set. For that, use
 *                 mbedtls_dhm_set_group() below in conjunction with
 *                 mbedtls_mpi_read_binary() and mbedtls_mpi_read_string().
 *
 * \note           In a TLS handshake, this is the how the server generates
 *                 and exports its DHM key material.
 *
 * \param ctx      The DHM context to use. This must be initialized
 *                 and have the DHM parameters set. It may or may not
 *                 already have imported the peer's public key.
 * \param x_size   The private key size in Bytes.
 * \param olen     The address at which to store the number of Bytes
 *                 written on success. This must not be \c NULL.
 * \param output   The destination buffer. This must be a writable buffer of
 *                 sufficient size to hold the reduced binary presentation of
 *                 the modulus, the generator and the public key, each wrapped
 *                 with a 2-byte length field. It is the responsibility of the
 *                 caller to ensure that enough space is available. Refer to
 *                 mbedtls_mpi_size() to computing the byte-size of an MPI.
 * \param f_rng    The RNG function. Must not be \c NULL.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng doesn't need a context parameter.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_DHM_XXX error code on failure.
 */

Func mbedtls_dhm_set_group

int mbedtls_dhm_set_group( mbedtls_dhm_context *ctx,
                          const mbedtls_mpi *P,
                          const mbedtls_mpi *G );
/**
 * \brief          This function sets the prime modulus and generator.
 *
 * \note           This function can be used to set \c ctx->P, \c ctx->G
 *                 in preparation for mbedtls_dhm_make_params().
 *
 * \param ctx      The DHM context to configure. This must be initialized.
 * \param P        The MPI holding the DHM prime modulus. This must be
 *                 an initialized MPI.
 * \param G        The MPI holding the DHM generator. This must be an
 *                 initialized MPI.
 *
 * \return         \c 0 if successful.
 * \return         An \c MBEDTLS_ERR_DHM_XXX error code on failure.
 */

Func mbedtls_dhm_read_public

int mbedtls_dhm_read_public( mbedtls_dhm_context *ctx,
                    const unsigned char *input, size_t ilen );
/**
 * \brief          This function imports the raw public value of the peer.
 *
 * \note           In a TLS handshake, this is the how the server imports
 *                 the Client's public DHM key.
 *
 * \param ctx      The DHM context to use. This must be initialized and have
 *                 its DHM parameters set, e.g. via mbedtls_dhm_set_group().
 *                 It may or may not already have generated its own private key.
 * \param input    The input buffer containing the \c G^Y value of the peer.
 *                 This must be a readable buffer of size \p ilen Bytes.
 * \param ilen     The size of the input buffer \p input in Bytes.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_DHM_XXX error code on failure.
 */

Func mbedtls_dhm_make_public

int mbedtls_dhm_make_public( mbedtls_dhm_context *ctx, int x_size,
                    unsigned char *output, size_t olen,
                    int (*f_rng)(void *, unsigned char *, size_t),
                    void *p_rng );
/**
 * \brief          This function creates a DHM key pair and exports
 *                 the raw public key in big-endian format.
 *
 * \note           The destination buffer is always fully written
 *                 so as to contain a big-endian representation of G^X mod P.
 *                 If it is larger than \c ctx->len, it is padded accordingly
 *                 with zero-bytes at the beginning.
 *
 * \param ctx      The DHM context to use. This must be initialized and
 *                 have the DHM parameters set. It may or may not already
 *                 have imported the peer's public key.
 * \param x_size   The private key size in Bytes.
 * \param output   The destination buffer. This must be a writable buffer of
 *                 size \p olen Bytes.
 * \param olen     The length of the destination buffer. This must be at least
 *                 equal to `ctx->len` (the size of \c P).
 * \param f_rng    The RNG function. This must not be \c NULL.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be \c NULL
 *                 if \p f_rng doesn't need a context argument.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_DHM_XXX error code on failure.
 */

Func mbedtls_dhm_calc_secret

int mbedtls_dhm_calc_secret( mbedtls_dhm_context *ctx,
                    unsigned char *output, size_t output_size, size_t *olen,
                    int (*f_rng)(void *, unsigned char *, size_t),
                    void *p_rng );
/**
 * \brief          This function derives and exports the shared secret
 *                 \c (G^Y)^X mod \c P.
 *
 * \note           If \p f_rng is not \c NULL, it is used to blind the input as
 *                 a countermeasure against timing attacks. Blinding is used
 *                 only if our private key \c X is re-used, and not used
 *                 otherwise. We recommend always passing a non-NULL
 *                 \p f_rng argument.
 *
 * \param ctx           The DHM context to use. This must be initialized
 *                      and have its own private key generated and the peer's
 *                      public key imported.
 * \param output        The buffer to write the generated shared key to. This
 *                      must be a writable buffer of size \p output_size Bytes.
 * \param output_size   The size of the destination buffer. This must be at
 *                      least the size of \c ctx->len (the size of \c P).
 * \param olen          On exit, holds the actual number of Bytes written.
 * \param f_rng         The RNG function, for blinding purposes. This may
 *                      b \c NULL if blinding isn't needed.
 * \param p_rng         The RNG context. This may be \c NULL if \p f_rng
 *                      doesn't need a context argument.
 *
 * \return              \c 0 on success.
 * \return              An \c MBEDTLS_ERR_DHM_XXX error code on failure.
 */

Func mbedtls_dhm_free

void mbedtls_dhm_free( mbedtls_dhm_context *ctx );
/**
 * \brief          This function frees and clears the components
 *                 of a DHM context.
 *
 * \param ctx      The DHM context to free and clear. This may be \c NULL,
 *                 in which case this function is a no-op. If it is not \c NULL,
 *                 it must point to an initialized DHM context.
 */

Func mbedtls_dhm_parse_dhm

int mbedtls_dhm_parse_dhm( mbedtls_dhm_context *dhm, const unsigned char *dhmin,
                          size_t dhminlen );
/**
 * \brief             This function parses DHM parameters in PEM or DER format.
 *
 * \param dhm         The DHM context to import the DHM parameters into.
 *                    This must be initialized.
 * \param dhmin       The input buffer. This must be a readable buffer of
 *                    length \p dhminlen Bytes.
 * \param dhminlen    The size of the input buffer \p dhmin, including the
 *                    terminating \c NULL Byte for PEM data.
 *
 * \return            \c 0 on success.
 * \return            An \c MBEDTLS_ERR_DHM_XXX or \c MBEDTLS_ERR_PEM_XXX error
 *                    code on failure.
 */

Func mbedtls_dhm_parse_dhmfile

int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path );
/**
 * \brief          This function loads and parses DHM parameters from a file.
 *
 * \param dhm      The DHM context to load the parameters to.
 *                 This must be initialized.
 * \param path     The filename to read the DHM parameters from.
 *                 This must not be \c NULL.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_DHM_XXX or \c MBEDTLS_ERR_PEM_XXX
 *                 error code on failure.
 */

Func mbedtls_dhm_self_test

int mbedtls_dhm_self_test( int verbose );
/**
 * \brief          The DMH checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_ecdh_gen_public

int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q,
                    int (*f_rng)(void *, unsigned char *, size_t),
                    void *p_rng );
/**
 * \brief           This function generates an ECDH keypair on an elliptic
 *                  curve.
 *
 *                  This function performs the first of two core computations
 *                  implemented during the ECDH key exchange. The second core
 *                  computation is performed by mbedtls_ecdh_compute_shared().
 *
 * \see             ecp.h
 *
 * \param grp       The ECP group to use. This must be initialized and have
 *                  domain parameters loaded, for example through
 *                  mbedtls_ecp_load() or mbedtls_ecp_tls_read_group().
 * \param d         The destination MPI (private key).
 *                  This must be initialized.
 * \param Q         The destination point (public key).
 *                  This must be initialized.
 * \param f_rng     The RNG function to use. This must not be \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may be
 *                  \c NULL in case \p f_rng doesn't need a context argument.
 *
 * \return          \c 0 on success.
 * \return          Another \c MBEDTLS_ERR_ECP_XXX or
 *                  \c MBEDTLS_MPI_XXX error code on failure.
 */

Func mbedtls_ecdh_compute_shared

int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z,
                        const mbedtls_ecp_point *Q, const mbedtls_mpi *d,
                        int (*f_rng)(void *, unsigned char *, size_t),
                        void *p_rng );
/**
 * \brief           This function computes the shared secret.
 *
 *                  This function performs the second of two core computations
 *                  implemented during the ECDH key exchange. The first core
 *                  computation is performed by mbedtls_ecdh_gen_public().
 *
 * \see             ecp.h
 *
 * \note            If \p f_rng is not NULL, it is used to implement
 *                  countermeasures against side-channel attacks.
 *                  For more information, see mbedtls_ecp_mul().
 *
 * \param grp       The ECP group to use. This must be initialized and have
 *                  domain parameters loaded, for example through
 *                  mbedtls_ecp_load() or mbedtls_ecp_tls_read_group().
 * \param z         The destination MPI (shared secret).
 *                  This must be initialized.
 * \param Q         The public key from another party.
 *                  This must be initialized.
 * \param d         Our secret exponent (private key).
 *                  This must be initialized.
 * \param f_rng     The RNG function. This may be \c NULL if randomization
 *                  of intermediate results during the ECP computations is
 *                  not needed (discouraged). See the documentation of
 *                  mbedtls_ecp_mul() for more.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may be
 *                  \c NULL if \p f_rng is \c NULL or doesn't need a
 *                  context argument.
 *
 * \return          \c 0 on success.
 * \return          Another \c MBEDTLS_ERR_ECP_XXX or
 *                  \c MBEDTLS_MPI_XXX error code on failure.
 */

Func mbedtls_ecdh_init

void mbedtls_ecdh_init( mbedtls_ecdh_context *ctx );
/**
 * \brief           This function initializes an ECDH context.
 *
 * \param ctx       The ECDH context to initialize. This must not be \c NULL.
 */

Func mbedtls_ecdh_setup

int mbedtls_ecdh_setup( mbedtls_ecdh_context *ctx,
                       mbedtls_ecp_group_id grp_id );
/**
 * \brief           This function sets up the ECDH context with the information
 *                  given.
 *
 *                  This function should be called after mbedtls_ecdh_init() but
 *                  before mbedtls_ecdh_make_params(). There is no need to call
 *                  this function before mbedtls_ecdh_read_params().
 *
 *                  This is the first function used by a TLS server for ECDHE
 *                  ciphersuites.
 *
 * \param ctx       The ECDH context to set up. This must be initialized.
 * \param grp_id    The group id of the group to set up the context for.
 *
 * \return          \c 0 on success.
 */

Func mbedtls_ecdh_free

void mbedtls_ecdh_free( mbedtls_ecdh_context *ctx );
/**
 * \brief           This function frees a context.
 *
 * \param ctx       The context to free. This may be \c NULL, in which
 *                  case this function does nothing. If it is not \c NULL,
 *                  it must point to an initialized ECDH context.
 */

Func mbedtls_ecdh_make_params

int mbedtls_ecdh_make_params( mbedtls_ecdh_context *ctx, size_t *olen,
                     unsigned char *buf, size_t blen,
                     int (*f_rng)(void *, unsigned char *, size_t),
                     void *p_rng );
/**
 * \brief           This function generates an EC key pair and exports its
 *                  in the format used in a TLS ServerKeyExchange handshake
 *                  message.
 *
 *                  This is the second function used by a TLS server for ECDHE
 *                  ciphersuites. (It is called after mbedtls_ecdh_setup().)
 *
 * \see             ecp.h
 *
 * \param ctx       The ECDH context to use. This must be initialized
 *                  and bound to a group, for example via mbedtls_ecdh_setup().
 * \param olen      The address at which to store the number of Bytes written.
 * \param buf       The destination buffer. This must be a writable buffer of
 *                  length \p blen Bytes.
 * \param blen      The length of the destination buffer \p buf in Bytes.
 * \param f_rng     The RNG function to use. This must not be \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may be
 *                  \c NULL in case \p f_rng doesn't need a context argument.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 * \return          Another \c MBEDTLS_ERR_ECP_XXX error code on failure.
 */

Func mbedtls_ecdh_read_params

int mbedtls_ecdh_read_params( mbedtls_ecdh_context *ctx,
                             const unsigned char **buf,
                             const unsigned char *end );
/**
 * \brief           This function parses the ECDHE parameters in a
 *                  TLS ServerKeyExchange handshake message.
 *
 * \note            In a TLS handshake, this is the how the client
 *                  sets up its ECDHE context from the server's public
 *                  ECDHE key material.
 *
 * \see             ecp.h
 *
 * \param ctx       The ECDHE context to use. This must be initialized.
 * \param buf       On input, \c *buf must be the start of the input buffer.
 *                  On output, \c *buf is updated to point to the end of the
 *                  data that has been read. On success, this is the first byte
 *                  past the end of the ServerKeyExchange parameters.
 *                  On error, this is the point at which an error has been
 *                  detected, which is usually not useful except to debug
 *                  failures.
 * \param end       The end of the input buffer.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX error code on failure.
 *
 */

Func mbedtls_ecdh_get_params

int mbedtls_ecdh_get_params( mbedtls_ecdh_context *ctx,
                            const mbedtls_ecp_keypair *key,
                            mbedtls_ecdh_side side );
/**
 * \brief           This function sets up an ECDH context from an EC key.
 *
 *                  It is used by clients and servers in place of the
 *                  ServerKeyEchange for static ECDH, and imports ECDH
 *                  parameters from the EC key information of a certificate.
 *
 * \see             ecp.h
 *
 * \param ctx       The ECDH context to set up. This must be initialized.
 * \param key       The EC key to use. This must be initialized.
 * \param side      Defines the source of the key. Possible values are:
 *                  - #MBEDTLS_ECDH_OURS: The key is ours.
 *                  - #MBEDTLS_ECDH_THEIRS: The key is that of the peer.
 *
 * \return          \c 0 on success.
 * \return          Another \c MBEDTLS_ERR_ECP_XXX error code on failure.
 *
 */

Func mbedtls_ecdh_make_public

int mbedtls_ecdh_make_public( mbedtls_ecdh_context *ctx, size_t *olen,
                     unsigned char *buf, size_t blen,
                     int (*f_rng)(void *, unsigned char *, size_t),
                     void *p_rng );
/**
 * \brief           This function generates a public key and exports it
 *                  as a TLS ClientKeyExchange payload.
 *
 *                  This is the second function used by a TLS client for ECDH(E)
 *                  ciphersuites.
 *
 * \see             ecp.h
 *
 * \param ctx       The ECDH context to use. This must be initialized
 *                  and bound to a group, the latter usually by
 *                  mbedtls_ecdh_read_params().
 * \param olen      The address at which to store the number of Bytes written.
 *                  This must not be \c NULL.
 * \param buf       The destination buffer. This must be a writable buffer
 *                  of length \p blen Bytes.
 * \param blen      The size of the destination buffer \p buf in Bytes.
 * \param f_rng     The RNG function to use. This must not be \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may be
 *                  \c NULL in case \p f_rng doesn't need a context argument.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 * \return          Another \c MBEDTLS_ERR_ECP_XXX error code on failure.
 */

Func mbedtls_ecdh_read_public

int mbedtls_ecdh_read_public( mbedtls_ecdh_context *ctx,
                             const unsigned char *buf, size_t blen );
/**
 * \brief       This function parses and processes the ECDHE payload of a
 *              TLS ClientKeyExchange message.
 *
 *              This is the third function used by a TLS server for ECDH(E)
 *              ciphersuites. (It is called after mbedtls_ecdh_setup() and
 *              mbedtls_ecdh_make_params().)
 *
 * \see         ecp.h
 *
 * \param ctx   The ECDH context to use. This must be initialized
 *              and bound to a group, for example via mbedtls_ecdh_setup().
 * \param buf   The pointer to the ClientKeyExchange payload. This must
 *              be a readable buffer of length \p blen Bytes.
 * \param blen  The length of the input buffer \p buf in Bytes.
 *
 * \return      \c 0 on success.
 * \return      An \c MBEDTLS_ERR_ECP_XXX error code on failure.
 */

Func mbedtls_ecdh_calc_secret

int mbedtls_ecdh_calc_secret( mbedtls_ecdh_context *ctx, size_t *olen,
                     unsigned char *buf, size_t blen,
                     int (*f_rng)(void *, unsigned char *, size_t),
                     void *p_rng );
/**
 * \brief           This function derives and exports the shared secret.
 *
 *                  This is the last function used by both TLS client
 *                  and servers.
 *
 * \note            If \p f_rng is not NULL, it is used to implement
 *                  countermeasures against side-channel attacks.
 *                  For more information, see mbedtls_ecp_mul().
 *
 * \see             ecp.h

 * \param ctx       The ECDH context to use. This must be initialized
 *                  and have its own private key generated and the peer's
 *                  public key imported.
 * \param olen      The address at which to store the total number of
 *                  Bytes written on success. This must not be \c NULL.
 * \param buf       The buffer to write the generated shared key to. This
 *                  must be a writable buffer of size \p blen Bytes.
 * \param blen      The length of the destination buffer \p buf in Bytes.
 * \param f_rng     The RNG function, for blinding purposes. This may
 *                  b \c NULL if blinding isn't needed.
 * \param p_rng     The RNG context. This may be \c NULL if \p f_rng
 *                  doesn't need a context argument.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 * \return          Another \c MBEDTLS_ERR_ECP_XXX error code on failure.
 */

Func mbedtls_ecdh_enable_restart

void mbedtls_ecdh_enable_restart( mbedtls_ecdh_context *ctx );
/**
 * \brief           This function enables restartable EC computations for this
 *                  context.  (Default: disabled.)
 *
 * \see             \c mbedtls_ecp_set_max_ops()
 *
 * \note            It is not possible to safely disable restartable
 *                  computations once enabled, except by free-ing the context,
 *                  which cancels possible in-progress operations.
 *
 * \param ctx       The ECDH context to use. This must be initialized.
 */

Func mbedtls_ecdsa_sign

int mbedtls_ecdsa_sign( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s,
               const mbedtls_mpi *d, const unsigned char *buf, size_t blen,
               int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
 * \brief           This function computes the ECDSA signature of a
 *                  previously-hashed message.
 *
 * \note            The deterministic version implemented in
 *                  mbedtls_ecdsa_sign_det() is usually preferred.
 *
 * \note            If the bitlength of the message hash is larger than the
 *                  bitlength of the group order, then the hash is truncated
 *                  as defined in Standards for Efficient Cryptography Group
 *                  (SECG): SEC1 Elliptic Curve Cryptography, section
 *                  4.1.3, step 5.
 *
 * \see             ecp.h
 *
 * \param grp       The context for the elliptic curve to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param r         The MPI context in which to store the first part
 *                  the signature. This must be initialized.
 * \param s         The MPI context in which to store the second part
 *                  the signature. This must be initialized.
 * \param d         The private signing key. This must be initialized.
 * \param buf       The content to be signed. This is usually the hash of
 *                  the original data to be signed. This must be a readable
 *                  buffer of length \p blen Bytes. It may be \c NULL if
 *                  \p blen is zero.
 * \param blen      The length of \p buf in Bytes.
 * \param f_rng     The RNG function. This must not be \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may be
 *                  \c NULL if \p f_rng doesn't need a context parameter.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX
 *                  or \c MBEDTLS_MPI_XXX error code on failure.
 */

Func mbedtls_ecdsa_sign_det

int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r,
                           mbedtls_mpi *s, const mbedtls_mpi *d,
                           const unsigned char *buf, size_t blen,
                           mbedtls_md_type_t md_alg );
/**
 * \brief           This function computes the ECDSA signature of a
 *                  previously-hashed message, deterministic version.
 *
 *                  For more information, see RFC-6979: Deterministic
 *                  Usage of the Digital Signature Algorithm (DSA) and Elliptic
 *                  Curve Digital Signature Algorithm (ECDSA).
 *
 * \note            If the bitlength of the message hash is larger than the
 *                  bitlength of the group order, then the hash is truncated as
 *                  defined in Standards for Efficient Cryptography Group
 *                  (SECG): SEC1 Elliptic Curve Cryptography, section
 *                  4.1.3, step 5.
 *
 * \see             ecp.h
 *
 * \param grp       The context for the elliptic curve to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param r         The MPI context in which to store the first part
 *                  the signature. This must be initialized.
 * \param s         The MPI context in which to store the second part
 *                  the signature. This must be initialized.
 * \param d         The private signing key. This must be initialized
 *                  and setup, for example through mbedtls_ecp_gen_privkey().
 * \param buf       The hashed content to be signed. This must be a readable
 *                  buffer of length \p blen Bytes. It may be \c NULL if
 *                  \p blen is zero.
 * \param blen      The length of \p buf in Bytes.
 * \param md_alg    The hash algorithm used to hash the original data.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX
 *                  error code on failure.
 */

Func mbedtls_ecdsa_verify

int mbedtls_ecdsa_verify( mbedtls_ecp_group *grp,
                         const unsigned char *buf, size_t blen,
                         const mbedtls_ecp_point *Q, const mbedtls_mpi *r,
                         const mbedtls_mpi *s);
/**
 * \brief           This function verifies the ECDSA signature of a
 *                  previously-hashed message.
 *
 * \note            If the bitlength of the message hash is larger than the
 *                  bitlength of the group order, then the hash is truncated as
 *                  defined in Standards for Efficient Cryptography Group
 *                  (SECG): SEC1 Elliptic Curve Cryptography, section
 *                  4.1.4, step 3.
 *
 * \see             ecp.h
 *
 * \param grp       The ECP group to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param buf       The hashed content that was signed. This must be a readable
 *                  buffer of length \p blen Bytes. It may be \c NULL if
 *                  \p blen is zero.
 * \param blen      The length of \p buf in Bytes.
 * \param Q         The public key to use for verification. This must be
 *                  initialized and setup.
 * \param r         The first integer of the signature.
 *                  This must be initialized.
 * \param s         The second integer of the signature.
 *                  This must be initialized.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the signature
 *                  is invalid.
 * \return          An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX
 *                  error code on failure for any other reason.
 */

Func mbedtls_ecdsa_write_signature

int mbedtls_ecdsa_write_signature( mbedtls_ecdsa_context *ctx,
                                  mbedtls_md_type_t md_alg,
                          const unsigned char *hash, size_t hlen,
                          unsigned char *sig, size_t *slen,
                          int (*f_rng)(void *, unsigned char *, size_t),
                          void *p_rng );
/**
 * \brief           This function computes the ECDSA signature and writes it
 *                  to a buffer, serialized as defined in RFC-4492:
 *                  Elliptic Curve Cryptography (ECC) Cipher Suites for
 *                  Transport Layer Security (TLS).
 *
 * \warning         It is not thread-safe to use the same context in
 *                  multiple threads.
 *
 * \note            The deterministic version is used if
 *                  #MBEDTLS_ECDSA_DETERMINISTIC is defined. For more
 *                  information, see RFC-6979: Deterministic Usage
 *                  of the Digital Signature Algorithm (DSA) and Elliptic
 *                  Curve Digital Signature Algorithm (ECDSA).
 *
 * \note            If the bitlength of the message hash is larger than the
 *                  bitlength of the group order, then the hash is truncated as
 *                  defined in Standards for Efficient Cryptography Group
 *                  (SECG): SEC1 Elliptic Curve Cryptography, section
 *                  4.1.3, step 5.
 *
 * \see             ecp.h
 *
 * \param ctx       The ECDSA context to use. This must be initialized
 *                  and have a group and private key bound to it, for example
 *                  via mbedtls_ecdsa_genkey() or mbedtls_ecdsa_from_keypair().
 * \param md_alg    The message digest that was used to hash the message.
 * \param hash      The message hash to be signed. This must be a readable
 *                  buffer of length \p blen Bytes.
 * \param hlen      The length of the hash \p hash in Bytes.
 * \param sig       The buffer to which to write the signature. This must be a
 *                  writable buffer of length at least twice as large as the
 *                  size of the curve used, plus 9. For example, 73 Bytes if
 *                  a 256-bit curve is used. A buffer length of
 *                  #MBEDTLS_ECDSA_MAX_LEN is always safe.
 * \param slen      The address at which to store the actual length of
 *                  the signature written. Must not be \c NULL.
 * \param f_rng     The RNG function. This must not be \c NULL if
 *                  #MBEDTLS_ECDSA_DETERMINISTIC is unset. Otherwise,
 *                  it is unused and may be set to \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may be
 *                  \c NULL if \p f_rng is \c NULL or doesn't use a context.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX, \c MBEDTLS_ERR_MPI_XXX or
 *                  \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_ecdsa_write_signature_restartable

int mbedtls_ecdsa_write_signature_restartable( mbedtls_ecdsa_context *ctx,
                          mbedtls_md_type_t md_alg,
                          const unsigned char *hash, size_t hlen,
                          unsigned char *sig, size_t *slen,
                          int (*f_rng)(void *, unsigned char *, size_t),
                          void *p_rng,
                          mbedtls_ecdsa_restart_ctx *rs_ctx );
/**
 * \brief           This function computes the ECDSA signature and writes it
 *                  to a buffer, in a restartable way.
 *
 * \see             \c mbedtls_ecdsa_write_signature()
 *
 * \note            This function is like \c mbedtls_ecdsa_write_signature()
 *                  but it can return early and restart according to the limit
 *                  set with \c mbedtls_ecp_set_max_ops() to reduce blocking.
 *
 * \param ctx       The ECDSA context to use. This must be initialized
 *                  and have a group and private key bound to it, for example
 *                  via mbedtls_ecdsa_genkey() or mbedtls_ecdsa_from_keypair().
 * \param md_alg    The message digest that was used to hash the message.
 * \param hash      The message hash to be signed. This must be a readable
 *                  buffer of length \p blen Bytes.
 * \param hlen      The length of the hash \p hash in Bytes.
 * \param sig       The buffer to which to write the signature. This must be a
 *                  writable buffer of length at least twice as large as the
 *                  size of the curve used, plus 9. For example, 73 Bytes if
 *                  a 256-bit curve is used. A buffer length of
 *                  #MBEDTLS_ECDSA_MAX_LEN is always safe.
 * \param slen      The address at which to store the actual length of
 *                  the signature written. Must not be \c NULL.
 * \param f_rng     The RNG function. This must not be \c NULL if
 *                  #MBEDTLS_ECDSA_DETERMINISTIC is unset. Otherwise,
 *                  it is unused and may be set to \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may be
 *                  \c NULL if \p f_rng is \c NULL or doesn't use a context.
 * \param rs_ctx    The restart context to use. This may be \c NULL to disable
 *                  restarting. If it is not \c NULL, it must point to an
 *                  initialized restart context.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 * \return          Another \c MBEDTLS_ERR_ECP_XXX, \c MBEDTLS_ERR_MPI_XXX or
 *                  \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_ecdsa_write_signature_det

int mbedtls_ecdsa_write_signature_det( mbedtls_ecdsa_context *ctx,
                              const unsigned char *hash, size_t hlen,
                              unsigned char *sig, size_t *slen,
                              mbedtls_md_type_t md_alg ) MBEDTLS_DEPRECATED;
/**
 * \brief           This function computes an ECDSA signature and writes
 *                  it to a buffer, serialized as defined in RFC-4492:
 *                  Elliptic Curve Cryptography (ECC) Cipher Suites for
 *                  Transport Layer Security (TLS).
 *
 *                  The deterministic version is defined in RFC-6979:
 *                  Deterministic Usage of the Digital Signature Algorithm (DSA)
 *                  and Elliptic Curve Digital Signature Algorithm (ECDSA).
 *
 * \warning         It is not thread-safe to use the same context in
 *                  multiple threads.
 *
 * \note            If the bitlength of the message hash is larger than the
 *                  bitlength of the group order, then the hash is truncated as
 *                  defined in Standards for Efficient Cryptography Group
 *                  (SECG): SEC1 Elliptic Curve Cryptography, section
 *                  4.1.3, step 5.
 *
 * \see             ecp.h
 *
 * \deprecated      Superseded by mbedtls_ecdsa_write_signature() in
 *                  Mbed TLS version 2.0 and later.
 *
 * \param ctx       The ECDSA context to use. This must be initialized
 *                  and have a group and private key bound to it, for example
 *                  via mbedtls_ecdsa_genkey() or mbedtls_ecdsa_from_keypair().
 * \param hash      The message hash to be signed. This must be a readable
 *                  buffer of length \p blen Bytes.
 * \param hlen      The length of the hash \p hash in Bytes.
 * \param sig       The buffer to which to write the signature. This must be a
 *                  writable buffer of length at least twice as large as the
 *                  size of the curve used, plus 9. For example, 73 Bytes if
 *                  a 256-bit curve is used. A buffer length of
 *                  #MBEDTLS_ECDSA_MAX_LEN is always safe.
 * \param slen      The address at which to store the actual length of
 *                  the signature written. Must not be \c NULL.
 * \param md_alg    The message digest that was used to hash the message.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX, \c MBEDTLS_ERR_MPI_XXX or
 *                  \c MBEDTLS_ERR_ASN1_XXX error code on failure.
 */

Func mbedtls_ecdsa_read_signature

int mbedtls_ecdsa_read_signature( mbedtls_ecdsa_context *ctx,
                         const unsigned char *hash, size_t hlen,
                         const unsigned char *sig, size_t slen );
/**
 * \brief           This function reads and verifies an ECDSA signature.
 *
 * \note            If the bitlength of the message hash is larger than the
 *                  bitlength of the group order, then the hash is truncated as
 *                  defined in Standards for Efficient Cryptography Group
 *                  (SECG): SEC1 Elliptic Curve Cryptography, section
 *                  4.1.4, step 3.
 *
 * \see             ecp.h
 *
 * \param ctx       The ECDSA context to use. This must be initialized
 *                  and have a group and public key bound to it.
 * \param hash      The message hash that was signed. This must be a readable
 *                  buffer of length \p size Bytes.
 * \param hlen      The size of the hash \p hash.
 * \param sig       The signature to read and verify. This must be a readable
 *                  buffer of length \p slen Bytes.
 * \param slen      The size of \p sig in Bytes.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if signature is invalid.
 * \return          #MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH if there is a valid
 *                  signature in \p sig, but its length is less than \p siglen.
 * \return          An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_ERR_MPI_XXX
 *                  error code on failure for any other reason.
 */

Func mbedtls_ecdsa_read_signature_restartable

int mbedtls_ecdsa_read_signature_restartable( mbedtls_ecdsa_context *ctx,
                         const unsigned char *hash, size_t hlen,
                         const unsigned char *sig, size_t slen,
                         mbedtls_ecdsa_restart_ctx *rs_ctx );
/**
 * \brief           This function reads and verifies an ECDSA signature,
 *                  in a restartable way.
 *
 * \see             \c mbedtls_ecdsa_read_signature()
 *
 * \note            This function is like \c mbedtls_ecdsa_read_signature()
 *                  but it can return early and restart according to the limit
 *                  set with \c mbedtls_ecp_set_max_ops() to reduce blocking.
 *
 * \param ctx       The ECDSA context to use. This must be initialized
 *                  and have a group and public key bound to it.
 * \param hash      The message hash that was signed. This must be a readable
 *                  buffer of length \p size Bytes.
 * \param hlen      The size of the hash \p hash.
 * \param sig       The signature to read and verify. This must be a readable
 *                  buffer of length \p slen Bytes.
 * \param slen      The size of \p sig in Bytes.
 * \param rs_ctx    The restart context to use. This may be \c NULL to disable
 *                  restarting. If it is not \c NULL, it must point to an
 *                  initialized restart context.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if signature is invalid.
 * \return          #MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH if there is a valid
 *                  signature in \p sig, but its length is less than \p siglen.
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 * \return          Another \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_ERR_MPI_XXX
 *                  error code on failure for any other reason.
 */

Func mbedtls_ecdsa_genkey

int mbedtls_ecdsa_genkey( mbedtls_ecdsa_context *ctx, mbedtls_ecp_group_id gid,
                 int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
 * \brief          This function generates an ECDSA keypair on the given curve.
 *
 * \see            ecp.h
 *
 * \param ctx      The ECDSA context to store the keypair in.
 *                 This must be initialized.
 * \param gid      The elliptic curve to use. One of the various
 *                 \c MBEDTLS_ECP_DP_XXX macros depending on configuration.
 * \param f_rng    The RNG function to use. This must not be \c NULL.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng doesn't need a context argument.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_ECP_XXX code on failure.
 */

Func mbedtls_ecdsa_from_keypair

int mbedtls_ecdsa_from_keypair( mbedtls_ecdsa_context *ctx,
                               const mbedtls_ecp_keypair *key );
/**
 * \brief           This function sets up an ECDSA context from an EC key pair.
 *
 * \see             ecp.h
 *
 * \param ctx       The ECDSA context to setup. This must be initialized.
 * \param key       The EC key to use. This must be initialized and hold
 *                  a private-public key pair or a public key. In the former
 *                  case, the ECDSA context may be used for signature creation
 *                  and verification after this call. In the latter case, it
 *                  may be used for signature verification.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX code on failure.
 */

Func mbedtls_ecdsa_init

void mbedtls_ecdsa_init( mbedtls_ecdsa_context *ctx );
/**
 * \brief           This function initializes an ECDSA context.
 *
 * \param ctx       The ECDSA context to initialize.
 *                  This must not be \c NULL.
 */

Func mbedtls_ecdsa_free

void mbedtls_ecdsa_free( mbedtls_ecdsa_context *ctx );
/**
 * \brief           This function frees an ECDSA context.
 *
 * \param ctx       The ECDSA context to free. This may be \c NULL,
 *                  in which case this function does nothing. If it
 *                  is not \c NULL, it must be initialized.
 */

Func mbedtls_ecdsa_restart_init

void mbedtls_ecdsa_restart_init( mbedtls_ecdsa_restart_ctx *ctx );
/**
 * \brief           Initialize a restart context.
 *
 * \param ctx       The restart context to initialize.
 *                  This must not be \c NULL.
 */

Func mbedtls_ecdsa_restart_free

void mbedtls_ecdsa_restart_free( mbedtls_ecdsa_restart_ctx *ctx );
/**
 * \brief           Free the components of a restart context.
 *
 * \param ctx       The restart context to free. This may be \c NULL,
 *                  in which case this function does nothing. If it
 *                  is not \c NULL, it must be initialized.
 */

Func mbedtls_ecjpake_init

void mbedtls_ecjpake_init( mbedtls_ecjpake_context *ctx );
/**
 * \brief           Initialize an ECJPAKE context.
 *
 * \param ctx       The ECJPAKE context to initialize.
 *                  This must not be \c NULL.
 */

Func mbedtls_ecjpake_setup

int mbedtls_ecjpake_setup( mbedtls_ecjpake_context *ctx,
                          mbedtls_ecjpake_role role,
                          mbedtls_md_type_t hash,
                          mbedtls_ecp_group_id curve,
                          const unsigned char *secret,
                          size_t len );
/**
 * \brief           Set up an ECJPAKE context for use.
 *
 * \note            Currently the only values for hash/curve allowed by the
 *                  standard are #MBEDTLS_MD_SHA256/#MBEDTLS_ECP_DP_SECP256R1.
 *
 * \param ctx       The ECJPAKE context to set up. This must be initialized.
 * \param role      The role of the caller. This must be either
 *                  #MBEDTLS_ECJPAKE_CLIENT or #MBEDTLS_ECJPAKE_SERVER.
 * \param hash      The identifier of the hash function to use,
 *                  for example #MBEDTLS_MD_SHA256.
 * \param curve     The identifier of the elliptic curve to use,
 *                  for example #MBEDTLS_ECP_DP_SECP256R1.
 * \param secret    The pre-shared secret (passphrase). This must be
 *                  a readable buffer of length \p len Bytes. It need
 *                  only be valid for the duration of this call.
 * \param len       The length of the pre-shared secret \p secret.
 *
 * \return          \c 0 if successful.
 * \return          A negative error code on failure.
 */

Func mbedtls_ecjpake_check

int mbedtls_ecjpake_check( const mbedtls_ecjpake_context *ctx );
/**
 * \brief           Check if an ECJPAKE context is ready for use.
 *
 * \param ctx       The ECJPAKE context to check. This must be
 *                  initialized.
 *
 * \return          \c 0 if the context is ready for use.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA otherwise.
 */

Func mbedtls_ecjpake_write_round_one

int mbedtls_ecjpake_write_round_one( mbedtls_ecjpake_context *ctx,
                           unsigned char *buf, size_t len, size_t *olen,
                           int (*f_rng)(void *, unsigned char *, size_t),
                           void *p_rng );
/**
 * \brief           Generate and write the first round message
 *                  (TLS: contents of the Client/ServerHello extension,
 *                  excluding extension type and length bytes).
 *
 * \param ctx       The ECJPAKE context to use. This must be
 *                  initialized and set up.
 * \param buf       The buffer to write the contents to. This must be a
 *                  writable buffer of length \p len Bytes.
 * \param len       The length of \p buf in Bytes.
 * \param olen      The address at which to store the total number
 *                  of Bytes written to \p buf. This must not be \c NULL.
 * \param f_rng     The RNG function to use. This must not be \c NULL.
 * \param p_rng     The RNG parameter to be passed to \p f_rng. This
 *                  may be \c NULL if \p f_rng doesn't use a context.
 *
 * \return          \c 0 if successful.
 * \return          A negative error code on failure.
 */

Func mbedtls_ecjpake_read_round_one

int mbedtls_ecjpake_read_round_one( mbedtls_ecjpake_context *ctx,
                                   const unsigned char *buf,
                                   size_t len );
/**
 * \brief           Read and process the first round message
 *                  (TLS: contents of the Client/ServerHello extension,
 *                  excluding extension type and length bytes).
 *
 * \param ctx       The ECJPAKE context to use. This must be initialized
 *                  and set up.
 * \param buf       The buffer holding the first round message. This must
 *                  be a readable buffer of length \p len Bytes.
 * \param len       The length in Bytes of \p buf.
 *
 * \return          \c 0 if successful.
 * \return          A negative error code on failure.
 */

Func mbedtls_ecjpake_write_round_two

int mbedtls_ecjpake_write_round_two( mbedtls_ecjpake_context *ctx,
                           unsigned char *buf, size_t len, size_t *olen,
                           int (*f_rng)(void *, unsigned char *, size_t),
                           void *p_rng );
/**
 * \brief           Generate and write the second round message
 *                  (TLS: contents of the Client/ServerKeyExchange).
 *
 * \param ctx       The ECJPAKE context to use. This must be initialized,
 *                  set up, and already have performed round one.
 * \param buf       The buffer to write the round two contents to.
 *                  This must be a writable buffer of length \p len Bytes.
 * \param len       The size of \p buf in Bytes.
 * \param olen      The address at which to store the total number of Bytes
 *                  written to \p buf. This must not be \c NULL.
 * \param f_rng     The RNG function to use. This must not be \c NULL.
 * \param p_rng     The RNG parameter to be passed to \p f_rng. This
 *                  may be \c NULL if \p f_rng doesn't use a context.
 *
 * \return          \c 0 if successful.
 * \return          A negative error code on failure.
 */

Func mbedtls_ecjpake_read_round_two

int mbedtls_ecjpake_read_round_two( mbedtls_ecjpake_context *ctx,
                                   const unsigned char *buf,
                                   size_t len );
/**
 * \brief           Read and process the second round message
 *                  (TLS: contents of the Client/ServerKeyExchange).
 *
 * \param ctx       The ECJPAKE context to use. This must be initialized
 *                  and set up and already have performed round one.
 * \param buf       The buffer holding the second round message. This must
 *                  be a readable buffer of length \p len Bytes.
 * \param len       The length in Bytes of \p buf.
 *
 * \return          \c 0 if successful.
 * \return          A negative error code on failure.
 */

Func mbedtls_ecjpake_derive_secret

int mbedtls_ecjpake_derive_secret( mbedtls_ecjpake_context *ctx,
                           unsigned char *buf, size_t len, size_t *olen,
                           int (*f_rng)(void *, unsigned char *, size_t),
                           void *p_rng );
/**
 * \brief           Derive the shared secret
 *                  (TLS: Pre-Master Secret).
 *
 * \param ctx       The ECJPAKE context to use. This must be initialized,
 *                  set up and have performed both round one and two.
 * \param buf       The buffer to write the derived secret to. This must
 *                  be a writable buffer of length \p len Bytes.
 * \param len       The length of \p buf in Bytes.
 * \param olen      The address at which to store the total number of Bytes
 *                  written to \p buf. This must not be \c NULL.
 * \param f_rng     The RNG function to use. This must not be \c NULL.
 * \param p_rng     The RNG parameter to be passed to \p f_rng. This
 *                  may be \c NULL if \p f_rng doesn't use a context.
 *
 * \return          \c 0 if successful.
 * \return          A negative error code on failure.
 */

Func mbedtls_ecjpake_free

void mbedtls_ecjpake_free( mbedtls_ecjpake_context *ctx );
/**
 * \brief           This clears an ECJPAKE context and frees any
 *                  embedded data structure.
 *
 * \param ctx       The ECJPAKE context to free. This may be \c NULL,
 *                  in which case this function does nothing. If it is not
 *                  \c NULL, it must point to an initialized ECJPAKE context.
 */

Func mbedtls_ecjpake_self_test

int mbedtls_ecjpake_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if a test failed
 */

Func mbedtls_ecp_check_budget

int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp,
                             mbedtls_ecp_restart_ctx *rs_ctx,
                             unsigned ops );
/**
 * \brief           Internal; for restartable functions in other modules.
 *                  Check and update basic ops budget.
 *
 * \param grp       Group structure
 * \param rs_ctx    Restart context
 * \param ops       Number of basic ops to do
 *
 * \return          \c 0 if doing \p ops basic ops is still allowed,
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS otherwise.
 */

Func mbedtls_ecp_set_max_ops

void mbedtls_ecp_set_max_ops( unsigned max_ops );
/**
 * \brief           Set the maximum number of basic operations done in a row.
 *
 *                  If more operations are needed to complete a computation,
 *                  #MBEDTLS_ERR_ECP_IN_PROGRESS will be returned by the
 *                  function performing the computation. It is then the
 *                  caller's responsibility to either call again with the same
 *                  parameters until it returns 0 or an error code; or to free
 *                  the restart context if the operation is to be aborted.
 *
 *                  It is strictly required that all input parameters and the
 *                  restart context be the same on successive calls for the
 *                  same operation, but output parameters need not be the
 *                  same; they must not be used until the function finally
 *                  returns 0.
 *
 *                  This only applies to functions whose documentation
 *                  mentions they may return #MBEDTLS_ERR_ECP_IN_PROGRESS (or
 *                  #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS for functions in the
 *                  SSL module). For functions that accept a "restart context"
 *                  argument, passing NULL disables restart and makes the
 *                  function equivalent to the function with the same name
 *                  with \c _restartable removed. For functions in the ECDH
 *                  module, restart is disabled unless the function accepts
 *                  an "ECDH context" argument and
 *                  mbedtls_ecdh_enable_restart() was previously called on
 *                  that context. For function in the SSL module, restart is
 *                  only enabled for specific sides and key exchanges
 *                  (currently only for clients and ECDHE-ECDSA).
 *
 * \param max_ops   Maximum number of basic operations done in a row.
 *                  Default: 0 (unlimited).
 *                  Lower (non-zero) values mean ECC functions will block for
 *                  a lesser maximum amount of time.
 *
 * \note            A "basic operation" is defined as a rough equivalent of a
 *                  multiplication in GF(p) for the NIST P-256 curve.
 *                  As an indication, with default settings, a scalar
 *                  multiplication (full run of \c mbedtls_ecp_mul()) is:
 *                  - about 3300 basic operations for P-256
 *                  - about 9400 basic operations for P-384
 *
 * \note            Very low values are not always respected: sometimes
 *                  functions need to block for a minimum number of
 *                  operations, and will do so even if max_ops is set to a
 *                  lower value.  That minimum depends on the curve size, and
 *                  can be made lower by decreasing the value of
 *                  \c MBEDTLS_ECP_WINDOW_SIZE.  As an indication, here is the
 *                  lowest effective value for various curves and values of
 *                  that parameter (w for short):
 *                          w=6     w=5     w=4     w=3     w=2
 *                  P-256   208     208     160     136     124
 *                  P-384   682     416     320     272     248
 *                  P-521  1364     832     640     544     496
 *
 * \note            This setting is currently ignored by Curve25519.
 */

Func mbedtls_ecp_restart_is_enabled

int mbedtls_ecp_restart_is_enabled( void );
/**
 * \brief           Check if restart is enabled (max_ops != 0)
 *
 * \return          \c 0 if \c max_ops == 0 (restart disabled)
 * \return          \c 1 otherwise (restart enabled)
 */

Func mbedtls_ecp_point_init

void mbedtls_ecp_point_init( mbedtls_ecp_point *pt );
/**
 * \brief           This function initializes a point as zero.
 *
 * \param pt        The point to initialize.
 */

Func mbedtls_ecp_group_init

void mbedtls_ecp_group_init( mbedtls_ecp_group *grp );
/**
 * \brief           This function initializes an ECP group context
 *                  without loading any domain parameters.
 *
 * \note            After this function is called, domain parameters
 *                  for various ECP groups can be loaded through the
 *                  mbedtls_ecp_group_load() or mbedtls_ecp_tls_read_group()
 *                  functions.
 */

Func mbedtls_ecp_keypair_init

void mbedtls_ecp_keypair_init( mbedtls_ecp_keypair *key );
/**
 * \brief           This function initializes a key pair as an invalid one.
 *
 * \param key       The key pair to initialize.
 */

Func mbedtls_ecp_point_free

void mbedtls_ecp_point_free( mbedtls_ecp_point *pt );
/**
 * \brief           This function frees the components of a point.
 *
 * \param pt        The point to free.
 */

Func mbedtls_ecp_group_free

void mbedtls_ecp_group_free( mbedtls_ecp_group *grp );
/**
 * \brief           This function frees the components of an ECP group.
 *
 * \param grp       The group to free. This may be \c NULL, in which
 *                  case this function returns immediately. If it is not
 *                  \c NULL, it must point to an initialized ECP group.
 */

Func mbedtls_ecp_keypair_free

void mbedtls_ecp_keypair_free( mbedtls_ecp_keypair *key );
/**
 * \brief           This function frees the components of a key pair.
 *
 * \param key       The key pair to free. This may be \c NULL, in which
 *                  case this function returns immediately. If it is not
 *                  \c NULL, it must point to an initialized ECP key pair.
 */

Func mbedtls_ecp_restart_init

void mbedtls_ecp_restart_init( mbedtls_ecp_restart_ctx *ctx );
/**
 * \brief           Initialize a restart context.
 *
 * \param ctx       The restart context to initialize. This must
 *                  not be \c NULL.
 */

Func mbedtls_ecp_restart_free

void mbedtls_ecp_restart_free( mbedtls_ecp_restart_ctx *ctx );
/**
 * \brief           Free the components of a restart context.
 *
 * \param ctx       The restart context to free. This may be \c NULL, in which
 *                  case this function returns immediately. If it is not
 *                  \c NULL, it must point to an initialized restart context.
 */

Func mbedtls_ecp_copy

int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q );
/**
 * \brief           This function copies the contents of point \p Q into
 *                  point \p P.
 *
 * \param P         The destination point. This must be initialized.
 * \param Q         The source point. This must be initialized.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
 * \return          Another negative error code for other kinds of failure.
 */

Func mbedtls_ecp_group_copy

int mbedtls_ecp_group_copy( mbedtls_ecp_group *dst,
                           const mbedtls_ecp_group *src );
/**
 * \brief           This function copies the contents of group \p src into
 *                  group \p dst.
 *
 * \param dst       The destination group. This must be initialized.
 * \param src       The source group. This must be initialized.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_set_zero

int mbedtls_ecp_set_zero( mbedtls_ecp_point *pt );
/**
 * \brief           This function sets a point to the point at infinity.
 *
 * \param pt        The point to set. This must be initialized.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_is_zero

int mbedtls_ecp_is_zero( mbedtls_ecp_point *pt );
/**
 * \brief           This function checks if a point is the point at infinity.
 *
 * \param pt        The point to test. This must be initialized.
 *
 * \return          \c 1 if the point is zero.
 * \return          \c 0 if the point is non-zero.
 * \return          A negative error code on failure.
 */

Func mbedtls_ecp_point_cmp

int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P,
                          const mbedtls_ecp_point *Q );
/**
 * \brief           This function compares two points.
 *
 * \note            This assumes that the points are normalized. Otherwise,
 *                  they may compare as "not equal" even if they are.
 *
 * \param P         The first point to compare. This must be initialized.
 * \param Q         The second point to compare. This must be initialized.
 *
 * \return          \c 0 if the points are equal.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the points are not equal.
 */

Func mbedtls_ecp_point_read_string

int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix,
                          const char *x, const char *y );
/**
 * \brief           This function imports a non-zero point from two ASCII
 *                  strings.
 *
 * \param P         The destination point. This must be initialized.
 * \param radix     The numeric base of the input.
 * \param x         The first affine coordinate, as a null-terminated string.
 * \param y         The second affine coordinate, as a null-terminated string.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_MPI_XXX error code on failure.
 */

Func mbedtls_ecp_point_write_binary

int mbedtls_ecp_point_write_binary( const mbedtls_ecp_group *grp, const mbedtls_ecp_point *P,
                           int format, size_t *olen,
                           unsigned char *buf, size_t buflen );
/**
 * \brief           This function exports a point into unsigned binary data.
 *
 * \param grp       The group to which the point should belong.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param P         The point to export. This must be initialized.
 * \param format    The point format. This must be either
 *                  #MBEDTLS_ECP_PF_COMPRESSED or #MBEDTLS_ECP_PF_UNCOMPRESSED.
 * \param olen      The address at which to store the length of
 *                  the output in Bytes. This must not be \c NULL.
 * \param buf       The output buffer. This must be a writable buffer
 *                  of length \p buflen Bytes.
 * \param buflen    The length of the output buffer \p buf in Bytes.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL if the output buffer
 *                  is too small to hold the point.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_point_read_binary

int mbedtls_ecp_point_read_binary( const mbedtls_ecp_group *grp,
                                  mbedtls_ecp_point *P,
                                  const unsigned char *buf, size_t ilen );
/**
 * \brief           This function imports a point from unsigned binary data.
 *
 * \note            This function does not check that the point actually
 *                  belongs to the given group, see mbedtls_ecp_check_pubkey()
 *                  for that.
 *
 * \param grp       The group to which the point should belong.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param P         The destination context to import the point to.
 *                  This must be initialized.
 * \param buf       The input buffer. This must be a readable buffer
 *                  of length \p ilen Bytes.
 * \param ilen      The length of the input buffer \p buf in Bytes.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the input is invalid.
 * \return          #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
 * \return          #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the point format
 *                  is not implemented.
 */

Func mbedtls_ecp_tls_read_point

int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp,
                               mbedtls_ecp_point *pt,
                               const unsigned char **buf, size_t len );
/**
 * \brief           This function imports a point from a TLS ECPoint record.
 *
 * \note            On function return, \p *buf is updated to point immediately
 *                  after the ECPoint record.
 *
 * \param grp       The ECP group to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param pt        The destination point.
 * \param buf       The address of the pointer to the start of the input buffer.
 * \param len       The length of the buffer.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_MPI_XXX error code on initialization
 *                  failure.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid.
 */

Func mbedtls_ecp_tls_write_point

int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp,
                                const mbedtls_ecp_point *pt,
                                int format, size_t *olen,
                                unsigned char *buf, size_t blen );
/**
 * \brief           This function exports a point as a TLS ECPoint record
 *                  defined in RFC 4492, Section 5.4.
 *
 * \param grp       The ECP group to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param pt        The point to be exported. This must be initialized.
 * \param format    The point format to use. This must be either
 *                  #MBEDTLS_ECP_PF_COMPRESSED or #MBEDTLS_ECP_PF_UNCOMPRESSED.
 * \param olen      The address at which to store the length in Bytes
 *                  of the data written.
 * \param buf       The target buffer. This must be a writable buffer of
 *                  length \p blen Bytes.
 * \param blen      The length of the target buffer \p buf in Bytes.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the input is invalid.
 * \return          #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL if the target buffer
 *                  is too small to hold the exported point.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_group_load

int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id );
/**
 * \brief           This function sets up an ECP group context
 *                  from a standardized set of domain parameters.
 *
 * \note            The index should be a value of the NamedCurve enum,
 *                  as defined in RFC-4492: Elliptic Curve Cryptography
 *                  (ECC) Cipher Suites for Transport Layer Security (TLS),
 *                  usually in the form of an \c MBEDTLS_ECP_DP_XXX macro.
 *
 * \param grp       The group context to setup. This must be initialized.
 * \param id        The identifier of the domain parameter set to load.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if \p id doesn't
 *                  correspond to a known group.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_tls_read_group

int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp,
                               const unsigned char **buf, size_t len );
/**
 * \brief           This function sets up an ECP group context from a TLS
 *                  ECParameters record as defined in RFC 4492, Section 5.4.
 *
 * \note            The read pointer \p buf is updated to point right after
 *                  the ECParameters record on exit.
 *
 * \param grp       The group context to setup. This must be initialized.
 * \param buf       The address of the pointer to the start of the input buffer.
 * \param len       The length of the input buffer \c *buf in Bytes.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid.
 * \return          #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the group is not
 *                  recognized.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_tls_read_group_id

int mbedtls_ecp_tls_read_group_id( mbedtls_ecp_group_id *grp,
                                  const unsigned char **buf,
                                  size_t len );
/**
 * \brief           This function extracts an elliptic curve group ID from a
 *                  TLS ECParameters record as defined in RFC 4492, Section 5.4.
 *
 * \note            The read pointer \p buf is updated to point right after
 *                  the ECParameters record on exit.
 *
 * \param grp       The address at which to store the group id.
 *                  This must not be \c NULL.
 * \param buf       The address of the pointer to the start of the input buffer.
 * \param len       The length of the input buffer \c *buf in Bytes.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid.
 * \return          #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the group is not
 *                  recognized.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_tls_write_group

int mbedtls_ecp_tls_write_group( const mbedtls_ecp_group *grp,
                                size_t *olen,
                                unsigned char *buf, size_t blen );
/**
 * \brief           This function exports an elliptic curve as a TLS
 *                  ECParameters record as defined in RFC 4492, Section 5.4.
 *
 * \param grp       The ECP group to be exported.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param olen      The address at which to store the number of Bytes written.
 *                  This must not be \c NULL.
 * \param buf       The buffer to write to. This must be a writable buffer
 *                  of length \p blen Bytes.
 * \param blen      The length of the output buffer \p buf in Bytes.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL if the output
 *                  buffer is too small to hold the exported group.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_mul

int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
            const mbedtls_mpi *m, const mbedtls_ecp_point *P,
            int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
 * \brief           This function performs a scalar multiplication of a point
 *                  by an integer: \p R = \p m * \p P.
 *
 *                  It is not thread-safe to use same group in multiple threads.
 *
 * \note            To prevent timing attacks, this function
 *                  executes the exact same sequence of base-field
 *                  operations for any valid \p m. It avoids any if-branch or
 *                  array index depending on the value of \p m.
 *
 * \note            If \p f_rng is not NULL, it is used to randomize
 *                  intermediate results to prevent potential timing attacks
 *                  targeting these results. We recommend always providing
 *                  a non-NULL \p f_rng. The overhead is negligible.
 *
 * \param grp       The ECP group to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param R         The point in which to store the result of the calculation.
 *                  This must be initialized.
 * \param m         The integer by which to multiply. This must be initialized.
 * \param P         The point to multiply. This must be initialized.
 * \param f_rng     The RNG function. This may be \c NULL if randomization
 *                  of intermediate results isn't desired (discouraged).
 * \param p_rng     The RNG context to be passed to \p p_rng.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_INVALID_KEY if \p m is not a valid private
 *                  key, or \p P is not a valid public key.
 * \return          #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_mul_restartable

int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
            const mbedtls_mpi *m, const mbedtls_ecp_point *P,
            int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
            mbedtls_ecp_restart_ctx *rs_ctx );
/**
 * \brief           This function performs multiplication of a point by
 *                  an integer: \p R = \p m * \p P in a restartable way.
 *
 * \see             mbedtls_ecp_mul()
 *
 * \note            This function does the same as \c mbedtls_ecp_mul(), but
 *                  it can return early and restart according to the limit set
 *                  with \c mbedtls_ecp_set_max_ops() to reduce blocking.
 *
 * \param grp       The ECP group to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param R         The point in which to store the result of the calculation.
 *                  This must be initialized.
 * \param m         The integer by which to multiply. This must be initialized.
 * \param P         The point to multiply. This must be initialized.
 * \param f_rng     The RNG function. This may be \c NULL if randomization
 *                  of intermediate results isn't desired (discouraged).
 * \param p_rng     The RNG context to be passed to \p p_rng.
 * \param rs_ctx    The restart context (NULL disables restart).
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_INVALID_KEY if \p m is not a valid private
 *                  key, or \p P is not a valid public key.
 * \return          #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_muladd

int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
            const mbedtls_mpi *m, const mbedtls_ecp_point *P,
            const mbedtls_mpi *n, const mbedtls_ecp_point *Q );
/**
 * \brief           This function performs multiplication and addition of two
 *                  points by integers: \p R = \p m * \p P + \p n * \p Q
 *
 *                  It is not thread-safe to use same group in multiple threads.
 *
 * \note            In contrast to mbedtls_ecp_mul(), this function does not
 *                  guarantee a constant execution flow and timing.
 *
 * \param grp       The ECP group to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param R         The point in which to store the result of the calculation.
 *                  This must be initialized.
 * \param m         The integer by which to multiply \p P.
 *                  This must be initialized.
 * \param P         The point to multiply by \p m. This must be initialized.
 * \param n         The integer by which to multiply \p Q.
 *                  This must be initialized.
 * \param Q         The point to be multiplied by \p n.
 *                  This must be initialized.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_INVALID_KEY if \p m or \p n are not
 *                  valid private keys, or \p P or \p Q are not valid public
 *                  keys.
 * \return          #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_muladd_restartable

int mbedtls_ecp_muladd_restartable(
            mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
            const mbedtls_mpi *m, const mbedtls_ecp_point *P,
            const mbedtls_mpi *n, const mbedtls_ecp_point *Q,
            mbedtls_ecp_restart_ctx *rs_ctx );
/**
 * \brief           This function performs multiplication and addition of two
 *                  points by integers: \p R = \p m * \p P + \p n * \p Q in a
 *                  restartable way.
 *
 * \see             \c mbedtls_ecp_muladd()
 *
 * \note            This function works the same as \c mbedtls_ecp_muladd(),
 *                  but it can return early and restart according to the limit
 *                  set with \c mbedtls_ecp_set_max_ops() to reduce blocking.
 *
 * \param grp       The ECP group to use.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param R         The point in which to store the result of the calculation.
 *                  This must be initialized.
 * \param m         The integer by which to multiply \p P.
 *                  This must be initialized.
 * \param P         The point to multiply by \p m. This must be initialized.
 * \param n         The integer by which to multiply \p Q.
 *                  This must be initialized.
 * \param Q         The point to be multiplied by \p n.
 *                  This must be initialized.
 * \param rs_ctx    The restart context (NULL disables restart).
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_ECP_INVALID_KEY if \p m or \p n are not
 *                  valid private keys, or \p P or \p Q are not valid public
 *                  keys.
 * \return          #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_check_pubkey

int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp,
                             const mbedtls_ecp_point *pt );
/**
 * \brief           This function checks that a point is a valid public key
 *                  on this curve.
 *
 *                  It only checks that the point is non-zero, has
 *                  valid coordinates and lies on the curve. It does not verify
 *                  that it is indeed a multiple of \p G. This additional
 *                  check is computationally more expensive, is not required
 *                  by standards, and should not be necessary if the group
 *                  used has a small cofactor. In particular, it is useless for
 *                  the NIST groups which all have a cofactor of 1.
 *
 * \note            This function uses bare components rather than an
 *                  ::mbedtls_ecp_keypair structure, to ease use with other
 *                  structures, such as ::mbedtls_ecdh_context or
 *                  ::mbedtls_ecdsa_context.
 *
 * \param grp       The ECP group the point should belong to.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param pt        The point to check. This must be initialized.
 *
 * \return          \c 0 if the point is a valid public key.
 * \return          #MBEDTLS_ERR_ECP_INVALID_KEY if the point is not
 *                  a valid public key for the given curve.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_check_privkey

int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp,
                              const mbedtls_mpi *d );
/**
 * \brief           This function checks that an \p mbedtls_mpi is a
 *                  valid private key for this curve.
 *
 * \note            This function uses bare components rather than an
 *                  ::mbedtls_ecp_keypair structure to ease use with other
 *                  structures, such as ::mbedtls_ecdh_context or
 *                  ::mbedtls_ecdsa_context.
 *
 * \param grp       The ECP group the private key should belong to.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param d         The integer to check. This must be initialized.
 *
 * \return          \c 0 if the point is a valid private key.
 * \return          #MBEDTLS_ERR_ECP_INVALID_KEY if the point is not a valid
 *                  private key for the given curve.
 * \return          Another negative error code on other kinds of failure.
 */

Func mbedtls_ecp_gen_privkey

int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp,
                    mbedtls_mpi *d,
                    int (*f_rng)(void *, unsigned char *, size_t),
                    void *p_rng );
/**
 * \brief           This function generates a private key.
 *
 * \param grp       The ECP group to generate a private key for.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param d         The destination MPI (secret part). This must be initialized.
 * \param f_rng     The RNG function. This must not be \c NULL.
 * \param p_rng     The RNG parameter to be passed to \p f_rng. This may be
 *                  \c NULL if \p f_rng doesn't need a context argument.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code
 *                  on failure.
 */

Func mbedtls_ecp_gen_keypair_base

int mbedtls_ecp_gen_keypair_base( mbedtls_ecp_group *grp,
                                 const mbedtls_ecp_point *G,
                                 mbedtls_mpi *d, mbedtls_ecp_point *Q,
                                 int (*f_rng)(void *, unsigned char *, size_t),
                                 void *p_rng );
/**
 * \brief           This function generates a keypair with a configurable base
 *                  point.
 *
 * \note            This function uses bare components rather than an
 *                  ::mbedtls_ecp_keypair structure to ease use with other
 *                  structures, such as ::mbedtls_ecdh_context or
 *                  ::mbedtls_ecdsa_context.
 *
 * \param grp       The ECP group to generate a key pair for.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param G         The base point to use. This must be initialized
 *                  and belong to \p grp. It replaces the default base
 *                  point \c grp->G used by mbedtls_ecp_gen_keypair().
 * \param d         The destination MPI (secret part).
 *                  This must be initialized.
 * \param Q         The destination point (public part).
 *                  This must be initialized.
 * \param f_rng     The RNG function. This must not be \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may
 *                  be \c NULL if \p f_rng doesn't need a context argument.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code
 *                  on failure.
 */

Func mbedtls_ecp_gen_keypair

int mbedtls_ecp_gen_keypair( mbedtls_ecp_group *grp, mbedtls_mpi *d,
                            mbedtls_ecp_point *Q,
                            int (*f_rng)(void *, unsigned char *, size_t),
                            void *p_rng );
/**
 * \brief           This function generates an ECP keypair.
 *
 * \note            This function uses bare components rather than an
 *                  ::mbedtls_ecp_keypair structure to ease use with other
 *                  structures, such as ::mbedtls_ecdh_context or
 *                  ::mbedtls_ecdsa_context.
 *
 * \param grp       The ECP group to generate a key pair for.
 *                  This must be initialized and have group parameters
 *                  set, for example through mbedtls_ecp_group_load().
 * \param d         The destination MPI (secret part).
 *                  This must be initialized.
 * \param Q         The destination point (public part).
 *                  This must be initialized.
 * \param f_rng     The RNG function. This must not be \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may
 *                  be \c NULL if \p f_rng doesn't need a context argument.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code
 *                  on failure.
 */

Func mbedtls_ecp_gen_key

int mbedtls_ecp_gen_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
                        int (*f_rng)(void *, unsigned char *, size_t),
                        void *p_rng );
/**
 * \brief           This function generates an ECP key.
 *
 * \param grp_id    The ECP group identifier.
 * \param key       The destination key. This must be initialized.
 * \param f_rng     The RNG function to use. This must not be \c NULL.
 * \param p_rng     The RNG context to be passed to \p f_rng. This may
 *                  be \c NULL if \p f_rng doesn't need a context argument.
 *
 * \return          \c 0 on success.
 * \return          An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code
 *                  on failure.
 */

Func mbedtls_ecp_check_pub_priv

int mbedtls_ecp_check_pub_priv( const mbedtls_ecp_keypair *pub,
                               const mbedtls_ecp_keypair *prv );
/**
 * \brief           This function checks that the keypair objects
 *                  \p pub and \p prv have the same group and the
 *                  same public point, and that the private key in
 *                  \p prv is consistent with the public key.
 *
 * \param pub       The keypair structure holding the public key. This
 *                  must be initialized. If it contains a private key, that
 *                  part is ignored.
 * \param prv       The keypair structure holding the full keypair.
 *                  This must be initialized.
 *
 * \return          \c 0 on success, meaning that the keys are valid and match.
 * \return          #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the keys are invalid or do not match.
 * \return          An \c MBEDTLS_ERR_ECP_XXX or an \c MBEDTLS_ERR_MPI_XXX
 *                  error code on calculation failure.
 */

Func mbedtls_ecp_self_test

int mbedtls_ecp_self_test( int verbose );
/**
 * \brief          The ECP checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_internal_ecp_init

int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp );
/**
 * \brief           Initialise the Elliptic Curve Point module extension.
 *
 *                  If mbedtls_internal_ecp_grp_capable returns true for a
 *                  group, this function has to be able to initialise the
 *                  module for it.
 *
 *                  This module can be a driver to a crypto hardware
 *                  accelerator, for which this could be an initialise function.
 *
 * \param grp       The pointer to the group the module needs to be
 *                  initialised for.
 *
 * \return          0 if successful.
 */

Func mbedtls_internal_ecp_free

void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp );
/**
 * \brief           Frees and deallocates the Elliptic Curve Point module
 *                  extension.
 *
 * \param grp       The pointer to the group the module was initialised for.
 */

Func mbedtls_internal_ecp_randomize_jac

int mbedtls_internal_ecp_randomize_jac( const mbedtls_ecp_group *grp,
       mbedtls_ecp_point *pt, int (*f_rng)(void *, unsigned char *, size_t),
       void *p_rng );
/**
 * \brief           Randomize jacobian coordinates:
 *                  (X, Y, Z) -> (l^2 X, l^3 Y, l Z) for random l.
 *
 * \param grp       Pointer to the group representing the curve.
 *
 * \param pt        The point on the curve to be randomised, given with Jacobian
 *                  coordinates.
 *
 * \param f_rng     A function pointer to the random number generator.
 *
 * \param p_rng     A pointer to the random number generator state.
 *
 * \return          0 if successful.
 */

Func mbedtls_internal_ecp_add_mixed

int mbedtls_internal_ecp_add_mixed( const mbedtls_ecp_group *grp,
       mbedtls_ecp_point *R, const mbedtls_ecp_point *P,
       const mbedtls_ecp_point *Q );
/**
 * \brief           Addition: R = P + Q, mixed affine-Jacobian coordinates.
 *
 *                  The coordinates of Q must be normalized (= affine),
 *                  but those of P don't need to. R is not normalized.
 *
 *                  This function is used only as a subrutine of
 *                  ecp_mul_comb().
 *
 *                  Special cases: (1) P or Q is zero, (2) R is zero,
 *                      (3) P == Q.
 *                  None of these cases can happen as intermediate step in
 *                  ecp_mul_comb():
 *                      - at each step, P, Q and R are multiples of the base
 *                      point, the factor being less than its order, so none of
 *                      them is zero;
 *                      - Q is an odd multiple of the base point, P an even
 *                      multiple, due to the choice of precomputed points in the
 *                      modified comb method.
 *                  So branches for these cases do not leak secret information.
 *
 *                  We accept Q->Z being unset (saving memory in tables) as
 *                  meaning 1.
 *
 *                  Cost in field operations if done by [5] 3.22:
 *                      1A := 8M + 3S
 *
 * \param grp       Pointer to the group representing the curve.
 *
 * \param R         Pointer to a point structure to hold the result.
 *
 * \param P         Pointer to the first summand, given with Jacobian
 *                  coordinates
 *
 * \param Q         Pointer to the second summand, given with affine
 *                  coordinates.
 *
 * \return          0 if successful.
 */

Func mbedtls_internal_ecp_double_jac

int mbedtls_internal_ecp_double_jac( const mbedtls_ecp_group *grp,
       mbedtls_ecp_point *R, const mbedtls_ecp_point *P );


      

Func mbedtls_internal_ecp_normalize_jac_many

int mbedtls_internal_ecp_normalize_jac_many( const mbedtls_ecp_group *grp,
       mbedtls_ecp_point *T[], size_t t_len );


      

Func mbedtls_internal_ecp_normalize_jac

int mbedtls_internal_ecp_normalize_jac( const mbedtls_ecp_group *grp,
       mbedtls_ecp_point *pt );


      

Func mbedtls_internal_ecp_double_add_mxz

int mbedtls_internal_ecp_double_add_mxz( const mbedtls_ecp_group *grp,
       mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P,
       const mbedtls_ecp_point *Q, const mbedtls_mpi *d );


      

Func mbedtls_internal_ecp_randomize_mxz

int mbedtls_internal_ecp_randomize_mxz( const mbedtls_ecp_group *grp,
       mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t),
       void *p_rng );


      

Func mbedtls_internal_ecp_normalize_mxz

int mbedtls_internal_ecp_normalize_mxz( const mbedtls_ecp_group *grp,
       mbedtls_ecp_point *P );


      

Func mbedtls_entropy_init

void mbedtls_entropy_init( mbedtls_entropy_context *ctx );
/**
 * \brief           Initialize the context
 *
 * \param ctx       Entropy context to initialize
 */

Func mbedtls_entropy_free

void mbedtls_entropy_free( mbedtls_entropy_context *ctx );
/**
 * \brief           Free the data in the context
 *
 * \param ctx       Entropy context to free
 */

Func mbedtls_entropy_add_source

int mbedtls_entropy_add_source( mbedtls_entropy_context *ctx,
                       mbedtls_entropy_f_source_ptr f_source, void *p_source,
                       size_t threshold, int strong );
/**
 * \brief           Adds an entropy source to poll
 *                  (Thread-safe if MBEDTLS_THREADING_C is enabled)
 *
 * \param ctx       Entropy context
 * \param f_source  Entropy function
 * \param p_source  Function data
 * \param threshold Minimum required from source before entropy is released
 *                  ( with mbedtls_entropy_func() ) (in bytes)
 * \param strong    MBEDTLS_ENTROPY_SOURCE_STRONG or
 *                  MBEDTLS_ENTROPY_SOURCE_WEAK.
 *                  At least one strong source needs to be added.
 *                  Weaker sources (such as the cycle counter) can be used as
 *                  a complement.
 *
 * \return          0 if successful or MBEDTLS_ERR_ENTROPY_MAX_SOURCES
 */

Func mbedtls_entropy_gather

int mbedtls_entropy_gather( mbedtls_entropy_context *ctx );
/**
 * \brief           Trigger an extra gather poll for the accumulator
 *                  (Thread-safe if MBEDTLS_THREADING_C is enabled)
 *
 * \param ctx       Entropy context
 *
 * \return          0 if successful, or MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
 */

Func mbedtls_entropy_func

int mbedtls_entropy_func( void *data, unsigned char *output, size_t len );
/**
 * \brief           Retrieve entropy from the accumulator
 *                  (Maximum length: MBEDTLS_ENTROPY_BLOCK_SIZE)
 *                  (Thread-safe if MBEDTLS_THREADING_C is enabled)
 *
 * \param data      Entropy context
 * \param output    Buffer to fill
 * \param len       Number of bytes desired, must be at most MBEDTLS_ENTROPY_BLOCK_SIZE
 *
 * \return          0 if successful, or MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
 */

Func mbedtls_entropy_update_manual

int mbedtls_entropy_update_manual( mbedtls_entropy_context *ctx,
                          const unsigned char *data, size_t len );
/**
 * \brief           Add data to the accumulator manually
 *                  (Thread-safe if MBEDTLS_THREADING_C is enabled)
 *
 * \param ctx       Entropy context
 * \param data      Data to add
 * \param len       Length of data
 *
 * \return          0 if successful
 */

Func mbedtls_entropy_update_nv_seed

int mbedtls_entropy_update_nv_seed( mbedtls_entropy_context *ctx );
/**
 * \brief           Trigger an update of the seed file in NV by using the
 *                  current entropy pool.
 *
 * \param ctx       Entropy context
 *
 * \return          0 if successful
 */

Func mbedtls_entropy_write_seed_file

int mbedtls_entropy_write_seed_file( mbedtls_entropy_context *ctx, const char *path );
/**
 * \brief               Write a seed file
 *
 * \param ctx           Entropy context
 * \param path          Name of the file
 *
 * \return              0 if successful,
 *                      MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR on file error, or
 *                      MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
 */

Func mbedtls_entropy_update_seed_file

int mbedtls_entropy_update_seed_file( mbedtls_entropy_context *ctx, const char *path );
/**
 * \brief               Read and update a seed file. Seed is added to this
 *                      instance. No more than MBEDTLS_ENTROPY_MAX_SEED_SIZE bytes are
 *                      read from the seed file. The rest is ignored.
 *
 * \param ctx           Entropy context
 * \param path          Name of the file
 *
 * \return              0 if successful,
 *                      MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR on file error,
 *                      MBEDTLS_ERR_ENTROPY_SOURCE_FAILED
 */

Func mbedtls_entropy_self_test

int mbedtls_entropy_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 *                 This module self-test also calls the entropy self-test,
 *                 mbedtls_entropy_source_self_test();
 *
 * \return         0 if successful, or 1 if a test failed
 */

Func mbedtls_entropy_source_self_test

int mbedtls_entropy_source_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 *                 Verifies the integrity of the hardware entropy source
 *                 provided by the function 'mbedtls_hardware_poll()'.
 *
 *                 Note this is the only hardware entropy source that is known
 *                 at link time, and other entropy sources configured
 *                 dynamically at runtime by the function
 *                 mbedtls_entropy_add_source() will not be tested.
 *
 * \return         0 if successful, or 1 if a test failed
 */

Func mbedtls_null_entropy_poll

int mbedtls_null_entropy_poll( void *data,
                               unsigned char *output, size_t len, size_t *olen );


      

Func mbedtls_platform_entropy_poll

int mbedtls_platform_entropy_poll( void *data,
                          unsigned char *output, size_t len, size_t *olen );
/**
 * \brief           Platform-specific entropy poll callback
 */

Func mbedtls_havege_poll

int mbedtls_havege_poll( void *data,
                unsigned char *output, size_t len, size_t *olen );
/**
 * \brief           HAVEGE based entropy poll callback
 *
 * Requires an HAVEGE state as its data pointer.
 */

Func mbedtls_hardclock_poll

int mbedtls_hardclock_poll( void *data,
                   unsigned char *output, size_t len, size_t *olen );
/**
 * \brief           mbedtls_timing_hardclock-based entropy poll callback
 */

Func mbedtls_hardware_poll

int mbedtls_hardware_poll( void *data,
                          unsigned char *output, size_t len, size_t *olen );
/**
 * \brief           Entropy poll callback for a hardware source
 *
 * \warning         This is not provided by mbed TLS!
 *                  See \c MBEDTLS_ENTROPY_HARDWARE_ALT in config.h.
 *
 * \note            This must accept NULL as its first argument.
 */

Func mbedtls_nv_seed_poll

int mbedtls_nv_seed_poll( void *data,
                         unsigned char *output, size_t len, size_t *olen );
/**
 * \brief           Entropy poll callback for a non-volatile seed file
 *
 * \note            This must accept NULL as its first argument.
 */

Func mbedtls_strerror

void mbedtls_strerror( int errnum, char *buffer, size_t buflen );
/**
 * \brief Translate a mbed TLS error code into a string representation,
 *        Result is truncated if necessary and always includes a terminating
 *        null byte.
 *
 * \param errnum    error code
 * \param buffer    buffer to place representation in
 * \param buflen    length of the buffer
 */

Func mbedtls_gcm_init

void mbedtls_gcm_init( mbedtls_gcm_context *ctx );
/**
 * \brief           This function initializes the specified GCM context,
 *                  to make references valid, and prepares the context
 *                  for mbedtls_gcm_setkey() or mbedtls_gcm_free().
 *
 *                  The function does not bind the GCM context to a particular
 *                  cipher, nor set the key. For this purpose, use
 *                  mbedtls_gcm_setkey().
 *
 * \param ctx       The GCM context to initialize. This must not be \c NULL.
 */

Func mbedtls_gcm_setkey

int mbedtls_gcm_setkey( mbedtls_gcm_context *ctx,
                       mbedtls_cipher_id_t cipher,
                       const unsigned char *key,
                       unsigned int keybits );
/**
 * \brief           This function associates a GCM context with a
 *                  cipher algorithm and a key.
 *
 * \param ctx       The GCM context. This must be initialized.
 * \param cipher    The 128-bit block cipher to use.
 * \param key       The encryption key. This must be a readable buffer of at
 *                  least \p keybits bits.
 * \param keybits   The key size in bits. Valid options are:
 *                  
  • 128 bits
  • *
  • 192 bits
  • *
  • 256 bits
* * \return \c 0 on success. * \return A cipher-specific error code on failure. */

Func mbedtls_gcm_crypt_and_tag

int mbedtls_gcm_crypt_and_tag( mbedtls_gcm_context *ctx,
                      int mode,
                      size_t length,
                      const unsigned char *iv,
                      size_t iv_len,
                      const unsigned char *add,
                      size_t add_len,
                      const unsigned char *input,
                      unsigned char *output,
                      size_t tag_len,
                      unsigned char *tag );
/**
 * \brief           This function performs GCM encryption or decryption of a buffer.
 *
 * \note            For encryption, the output buffer can be the same as the
 *                  input buffer. For decryption, the output buffer cannot be
 *                  the same as input buffer. If the buffers overlap, the output
 *                  buffer must trail at least 8 Bytes behind the input buffer.
 *
 * \warning         When this function performs a decryption, it outputs the
 *                  authentication tag and does not verify that the data is
 *                  authentic. You should use this function to perform encryption
 *                  only. For decryption, use mbedtls_gcm_auth_decrypt() instead.
 *
 * \param ctx       The GCM context to use for encryption or decryption. This
 *                  must be initialized.
 * \param mode      The operation to perform:
 *                  - #MBEDTLS_GCM_ENCRYPT to perform authenticated encryption.
 *                    The ciphertext is written to \p output and the
 *                    authentication tag is written to \p tag.
 *                  - #MBEDTLS_GCM_DECRYPT to perform decryption.
 *                    The plaintext is written to \p output and the
 *                    authentication tag is written to \p tag.
 *                    Note that this mode is not recommended, because it does
 *                    not verify the authenticity of the data. For this reason,
 *                    you should use mbedtls_gcm_auth_decrypt() instead of
 *                    calling this function in decryption mode.
 * \param length    The length of the input data, which is equal to the length
 *                  of the output data.
 * \param iv        The initialization vector. This must be a readable buffer of
 *                  at least \p iv_len Bytes.
 * \param iv_len    The length of the IV.
 * \param add       The buffer holding the additional data. This must be of at
 *                  least that size in Bytes.
 * \param add_len   The length of the additional data.
 * \param input     The buffer holding the input data. If \p length is greater
 *                  than zero, this must be a readable buffer of at least that
 *                  size in Bytes.
 * \param output    The buffer for holding the output data. If \p length is greater
 *                  than zero, this must be a writable buffer of at least that
 *                  size in Bytes.
 * \param tag_len   The length of the tag to generate.
 * \param tag       The buffer for holding the tag. This must be a readable
 *                  buffer of at least \p tag_len Bytes.
 *
 * \return          \c 0 if the encryption or decryption was performed
 *                  successfully. Note that in #MBEDTLS_GCM_DECRYPT mode,
 *                  this does not indicate that the data is authentic.
 * \return          #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths or pointers are
 *                  not valid or a cipher-specific error code if the encryption
 *                  or decryption failed.
 */

Func mbedtls_gcm_auth_decrypt

int mbedtls_gcm_auth_decrypt( mbedtls_gcm_context *ctx,
                     size_t length,
                     const unsigned char *iv,
                     size_t iv_len,
                     const unsigned char *add,
                     size_t add_len,
                     const unsigned char *tag,
                     size_t tag_len,
                     const unsigned char *input,
                     unsigned char *output );
/**
 * \brief           This function performs a GCM authenticated decryption of a
 *                  buffer.
 *
 * \note            For decryption, the output buffer cannot be the same as
 *                  input buffer. If the buffers overlap, the output buffer
 *                  must trail at least 8 Bytes behind the input buffer.
 *
 * \param ctx       The GCM context. This must be initialized.
 * \param length    The length of the ciphertext to decrypt, which is also
 *                  the length of the decrypted plaintext.
 * \param iv        The initialization vector. This must be a readable buffer
 *                  of at least \p iv_len Bytes.
 * \param iv_len    The length of the IV.
 * \param add       The buffer holding the additional data. This must be of at
 *                  least that size in Bytes.
 * \param add_len   The length of the additional data.
 * \param tag       The buffer holding the tag to verify. This must be a
 *                  readable buffer of at least \p tag_len Bytes.
 * \param tag_len   The length of the tag to verify.
 * \param input     The buffer holding the ciphertext. If \p length is greater
 *                  than zero, this must be a readable buffer of at least that
 *                  size.
 * \param output    The buffer for holding the decrypted plaintext. If \p length
 *                  is greater than zero, this must be a writable buffer of at
 *                  least that size.
 *
 * \return          \c 0 if successful and authenticated.
 * \return          #MBEDTLS_ERR_GCM_AUTH_FAILED if the tag does not match.
 * \return          #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths or pointers are
 *                  not valid or a cipher-specific error code if the decryption
 *                  failed.
 */

Func mbedtls_gcm_starts

int mbedtls_gcm_starts( mbedtls_gcm_context *ctx,
               int mode,
               const unsigned char *iv,
               size_t iv_len,
               const unsigned char *add,
               size_t add_len );
/**
 * \brief           This function starts a GCM encryption or decryption
 *                  operation.
 *
 * \param ctx       The GCM context. This must be initialized.
 * \param mode      The operation to perform: #MBEDTLS_GCM_ENCRYPT or
 *                  #MBEDTLS_GCM_DECRYPT.
 * \param iv        The initialization vector. This must be a readable buffer of
 *                  at least \p iv_len Bytes.
 * \param iv_len    The length of the IV.
 * \param add       The buffer holding the additional data, or \c NULL
 *                  if \p add_len is \c 0.
 * \param add_len   The length of the additional data. If \c 0,
 *                  \p add may be \c NULL.
 *
 * \return          \c 0 on success.
 */

Func mbedtls_gcm_update

int mbedtls_gcm_update( mbedtls_gcm_context *ctx,
               size_t length,
               const unsigned char *input,
               unsigned char *output );
/**
 * \brief           This function feeds an input buffer into an ongoing GCM
 *                  encryption or decryption operation.
 *
 *    `             The function expects input to be a multiple of 16
 *                  Bytes. Only the last call before calling
 *                  mbedtls_gcm_finish() can be less than 16 Bytes.
 *
 * \note            For decryption, the output buffer cannot be the same as
 *                  input buffer. If the buffers overlap, the output buffer
 *                  must trail at least 8 Bytes behind the input buffer.
 *
 * \param ctx       The GCM context. This must be initialized.
 * \param length    The length of the input data. This must be a multiple of
 *                  16 except in the last call before mbedtls_gcm_finish().
 * \param input     The buffer holding the input data. If \p length is greater
 *                  than zero, this must be a readable buffer of at least that
 *                  size in Bytes.
 * \param output    The buffer for holding the output data. If \p length is
 *                  greater than zero, this must be a writable buffer of at
 *                  least that size in Bytes.
 *
 * \return         \c 0 on success.
 * \return         #MBEDTLS_ERR_GCM_BAD_INPUT on failure.
 */

Func mbedtls_gcm_finish

int mbedtls_gcm_finish( mbedtls_gcm_context *ctx,
               unsigned char *tag,
               size_t tag_len );
/**
 * \brief           This function finishes the GCM operation and generates
 *                  the authentication tag.
 *
 *                  It wraps up the GCM stream, and generates the
 *                  tag. The tag can have a maximum length of 16 Bytes.
 *
 * \param ctx       The GCM context. This must be initialized.
 * \param tag       The buffer for holding the tag. This must be a readable
 *                  buffer of at least \p tag_len Bytes.
 * \param tag_len   The length of the tag to generate. This must be at least
 *                  four.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_GCM_BAD_INPUT on failure.
 */

Func mbedtls_gcm_free

void mbedtls_gcm_free( mbedtls_gcm_context *ctx );
/**
 * \brief           This function clears a GCM context and the underlying
 *                  cipher sub-context.
 *
 * \param ctx       The GCM context to clear. If this is \c NULL, the call has
 *                  no effect. Otherwise, this must be initialized.
 */

Func mbedtls_gcm_self_test

int mbedtls_gcm_self_test( int verbose );
/**
 * \brief          The GCM checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_havege_init

void mbedtls_havege_init( mbedtls_havege_state *hs );
/**
 * \brief          HAVEGE initialization
 *
 * \param hs       HAVEGE state to be initialized
 */

Func mbedtls_havege_free

void mbedtls_havege_free( mbedtls_havege_state *hs );
/**
 * \brief          Clear HAVEGE state
 *
 * \param hs       HAVEGE state to be cleared
 */

Func mbedtls_havege_random

int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len );
/**
 * \brief          HAVEGE rand function
 *
 * \param p_rng    A HAVEGE state
 * \param output   Buffer to fill
 * \param len      Length of buffer
 *
 * \return         0
 */

Func mbedtls_hkdf

int mbedtls_hkdf( const mbedtls_md_info_t *md, const unsigned char *salt,
                 size_t salt_len, const unsigned char *ikm, size_t ikm_len,
                 const unsigned char *info, size_t info_len,
                 unsigned char *okm, size_t okm_len );
/**
 *  \brief  This is the HMAC-based Extract-and-Expand Key Derivation Function
 *          (HKDF).
 *
 *  \param  md        A hash function; md.size denotes the length of the hash
 *                    function output in bytes.
 *  \param  salt      An optional salt value (a non-secret random value);
 *                    if the salt is not provided, a string of all zeros of
 *                    md.size length is used as the salt.
 *  \param  salt_len  The length in bytes of the optional \p salt.
 *  \param  ikm       The input keying material.
 *  \param  ikm_len   The length in bytes of \p ikm.
 *  \param  info      An optional context and application specific information
 *                    string. This can be a zero-length string.
 *  \param  info_len  The length of \p info in bytes.
 *  \param  okm       The output keying material of \p okm_len bytes.
 *  \param  okm_len   The length of the output keying material in bytes. This
 *                    must be less than or equal to 255 * md.size bytes.
 *
 *  \return 0 on success.
 *  \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid.
 *  \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying
 *          MD layer.
 */

Func mbedtls_hkdf_extract

int mbedtls_hkdf_extract( const mbedtls_md_info_t *md,
                         const unsigned char *salt, size_t salt_len,
                         const unsigned char *ikm, size_t ikm_len,
                         unsigned char *prk );
/**
 *  \brief  Take the input keying material \p ikm and extract from it a
 *          fixed-length pseudorandom key \p prk.
 *
 *  \warning    This function should only be used if the security of it has been
 *              studied and established in that particular context (eg. TLS 1.3
 *              key schedule). For standard HKDF security guarantees use
 *              \c mbedtls_hkdf instead.
 *
 *  \param       md        A hash function; md.size denotes the length of the
 *                         hash function output in bytes.
 *  \param       salt      An optional salt value (a non-secret random value);
 *                         if the salt is not provided, a string of all zeros
 *                         of md.size length is used as the salt.
 *  \param       salt_len  The length in bytes of the optional \p salt.
 *  \param       ikm       The input keying material.
 *  \param       ikm_len   The length in bytes of \p ikm.
 *  \param[out]  prk       A pseudorandom key of at least md.size bytes.
 *
 *  \return 0 on success.
 *  \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid.
 *  \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying
 *          MD layer.
 */

Func mbedtls_hkdf_expand

int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
                        size_t prk_len, const unsigned char *info,
                        size_t info_len, unsigned char *okm, size_t okm_len );
/**
 *  \brief  Expand the supplied \p prk into several additional pseudorandom
 *          keys, which is the output of the HKDF.
 *
 *  \warning    This function should only be used if the security of it has been
 *              studied and established in that particular context (eg. TLS 1.3
 *              key schedule). For standard HKDF security guarantees use
 *              \c mbedtls_hkdf instead.
 *
 *  \param  md        A hash function; md.size denotes the length of the hash
 *                    function output in bytes.
 *  \param  prk       A pseudorandom key of at least md.size bytes. \p prk is
 *                    usually the output from the HKDF extract step.
 *  \param  prk_len   The length in bytes of \p prk.
 *  \param  info      An optional context and application specific information
 *                    string. This can be a zero-length string.
 *  \param  info_len  The length of \p info in bytes.
 *  \param  okm       The output keying material of \p okm_len bytes.
 *  \param  okm_len   The length of the output keying material in bytes. This
 *                    must be less than or equal to 255 * md.size bytes.
 *
 *  \return 0 on success.
 *  \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid.
 *  \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying
 *          MD layer.
 */

Func mbedtls_hmac_drbg_init

void mbedtls_hmac_drbg_init( mbedtls_hmac_drbg_context *ctx );
/**
 * \brief               HMAC_DRBG context initialization
 *                      Makes the context ready for mbedtls_hmac_drbg_seed(),
 *                      mbedtls_hmac_drbg_seed_buf() or
 *                      mbedtls_hmac_drbg_free().
 *
 * \param ctx           HMAC_DRBG context to be initialized
 */

Func mbedtls_hmac_drbg_seed

int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx,
                   const mbedtls_md_info_t * md_info,
                   int (*f_entropy)(void *, unsigned char *, size_t),
                   void *p_entropy,
                   const unsigned char *custom,
                   size_t len );
/**
 * \brief               HMAC_DRBG initial seeding
 *                      Seed and setup entropy source for future reseeds.
 *
 * \param ctx           HMAC_DRBG context to be seeded
 * \param md_info       MD algorithm to use for HMAC_DRBG
 * \param f_entropy     Entropy callback (p_entropy, buffer to fill, buffer
 *                      length)
 * \param p_entropy     Entropy context
 * \param custom        Personalization data (Device specific identifiers)
 *                      (Can be NULL)
 * \param len           Length of personalization data
 *
 * \note                The "security strength" as defined by NIST is set to:
 *                      128 bits if md_alg is SHA-1,
 *                      192 bits if md_alg is SHA-224,
 *                      256 bits if md_alg is SHA-256 or higher.
 *                      Note that SHA-256 is just as efficient as SHA-224.
 *
 * \return              0 if successful, or
 *                      MBEDTLS_ERR_MD_BAD_INPUT_DATA, or
 *                      MBEDTLS_ERR_MD_ALLOC_FAILED, or
 *                      MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED.
 */

Func mbedtls_hmac_drbg_seed_buf

int mbedtls_hmac_drbg_seed_buf( mbedtls_hmac_drbg_context *ctx,
                       const mbedtls_md_info_t * md_info,
                       const unsigned char *data, size_t data_len );
/**
 * \brief               Initilisation of simpified HMAC_DRBG (never reseeds).
 *                      (For use with deterministic ECDSA.)
 *
 * \param ctx           HMAC_DRBG context to be initialised
 * \param md_info       MD algorithm to use for HMAC_DRBG
 * \param data          Concatenation of entropy string and additional data
 * \param data_len      Length of data in bytes
 *
 * \return              0 if successful, or
 *                      MBEDTLS_ERR_MD_BAD_INPUT_DATA, or
 *                      MBEDTLS_ERR_MD_ALLOC_FAILED.
 */

Func mbedtls_hmac_drbg_set_prediction_resistance

void mbedtls_hmac_drbg_set_prediction_resistance( mbedtls_hmac_drbg_context *ctx,
                                         int resistance );
/**
 * \brief               Enable / disable prediction resistance (Default: Off)
 *
 * Note: If enabled, entropy is used for ctx->entropy_len before each call!
 *       Only use this if you have ample supply of good entropy!
 *
 * \param ctx           HMAC_DRBG context
 * \param resistance    MBEDTLS_HMAC_DRBG_PR_ON or MBEDTLS_HMAC_DRBG_PR_OFF
 */

Func mbedtls_hmac_drbg_set_entropy_len

void mbedtls_hmac_drbg_set_entropy_len( mbedtls_hmac_drbg_context *ctx,
                               size_t len );
/**
 * \brief               Set the amount of entropy grabbed on each reseed
 *                      (Default: given by the security strength, which
 *                      depends on the hash used, see \c mbedtls_hmac_drbg_init() )
 *
 * \param ctx           HMAC_DRBG context
 * \param len           Amount of entropy to grab, in bytes
 */

Func mbedtls_hmac_drbg_set_reseed_interval

void mbedtls_hmac_drbg_set_reseed_interval( mbedtls_hmac_drbg_context *ctx,
                                   int interval );
/**
 * \brief               Set the reseed interval
 *                      (Default: MBEDTLS_HMAC_DRBG_RESEED_INTERVAL)
 *
 * \param ctx           HMAC_DRBG context
 * \param interval      Reseed interval
 */

Func mbedtls_hmac_drbg_update_ret

int mbedtls_hmac_drbg_update_ret( mbedtls_hmac_drbg_context *ctx,
                      const unsigned char *additional, size_t add_len );
/**
 * \brief               HMAC_DRBG update state
 *
 * \param ctx           HMAC_DRBG context
 * \param additional    Additional data to update state with, or NULL
 * \param add_len       Length of additional data, or 0
 *
 * \return              \c 0 on success, or an error from the underlying
 *                      hash calculation.
 *
 * \note                Additional data is optional, pass NULL and 0 as second
 *                      third argument if no additional data is being used.
 */

Func mbedtls_hmac_drbg_reseed

int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx,
                     const unsigned char *additional, size_t len );
/**
 * \brief               HMAC_DRBG reseeding (extracts data from entropy source)
 *
 * \param ctx           HMAC_DRBG context
 * \param additional    Additional data to add to state (Can be NULL)
 * \param len           Length of additional data
 *
 * \return              0 if successful, or
 *                      MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED
 */

Func mbedtls_hmac_drbg_random_with_add

int mbedtls_hmac_drbg_random_with_add( void *p_rng,
                              unsigned char *output, size_t output_len,
                              const unsigned char *additional,
                              size_t add_len );
/**
 * \brief               HMAC_DRBG generate random with additional update input
 *
 * Note: Automatically reseeds if reseed_counter is reached or PR is enabled.
 *
 * \param p_rng         HMAC_DRBG context
 * \param output        Buffer to fill
 * \param output_len    Length of the buffer
 * \param additional    Additional data to update with (can be NULL)
 * \param add_len       Length of additional data (can be 0)
 *
 * \return              0 if successful, or
 *                      MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED, or
 *                      MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG, or
 *                      MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG.
 */

Func mbedtls_hmac_drbg_random

int mbedtls_hmac_drbg_random( void *p_rng, unsigned char *output, size_t out_len );
/**
 * \brief               HMAC_DRBG generate random
 *
 * Note: Automatically reseeds if reseed_counter is reached or PR is enabled.
 *
 * \param p_rng         HMAC_DRBG context
 * \param output        Buffer to fill
 * \param out_len       Length of the buffer
 *
 * \return              0 if successful, or
 *                      MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED, or
 *                      MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG
 */

Func mbedtls_hmac_drbg_free

void mbedtls_hmac_drbg_free( mbedtls_hmac_drbg_context *ctx );
/**
 * \brief               Free an HMAC_DRBG context
 *
 * \param ctx           HMAC_DRBG context to free.
 */

Func mbedtls_hmac_drbg_write_seed_file

int mbedtls_hmac_drbg_write_seed_file( mbedtls_hmac_drbg_context *ctx, const char *path );
/**
 * \brief               Write a seed file
 *
 * \param ctx           HMAC_DRBG context
 * \param path          Name of the file
 *
 * \return              0 if successful, 1 on file error, or
 *                      MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED
 */

Func mbedtls_hmac_drbg_update_seed_file

int mbedtls_hmac_drbg_update_seed_file( mbedtls_hmac_drbg_context *ctx, const char *path );
/**
 * \brief               Read and update a seed file. Seed is added to this
 *                      instance
 *
 * \param ctx           HMAC_DRBG context
 * \param path          Name of the file
 *
 * \return              0 if successful, 1 on file error,
 *                      MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED or
 *                      MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG
 */

Func mbedtls_hmac_drbg_self_test

int mbedtls_hmac_drbg_self_test( int verbose );
/**
 * \brief               Checkup routine
 *
 * \return              0 if successful, or 1 if the test failed
 */

Func mbedtls_md_init

void mbedtls_md_init( mbedtls_md_context_t *ctx );
/**
 * \brief           This function initializes a message-digest context without
 *                  binding it to a particular message-digest algorithm.
 *
 *                  This function should always be called first. It prepares the
 *                  context for mbedtls_md_setup() for binding it to a
 *                  message-digest algorithm.
 */

Func mbedtls_md_free

void mbedtls_md_free( mbedtls_md_context_t *ctx );
/**
 * \brief           This function clears the internal structure of \p ctx and
 *                  frees any embedded internal structure, but does not free
 *                  \p ctx itself.
 *
 *                  If you have called mbedtls_md_setup() on \p ctx, you must
 *                  call mbedtls_md_free() when you are no longer using the
 *                  context.
 *                  Calling this function if you have previously
 *                  called mbedtls_md_init() and nothing else is optional.
 *                  You must not call this function if you have not called
 *                  mbedtls_md_init().
 */

Func mbedtls_md_init_ctx

int mbedtls_md_init_ctx( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info ) MBEDTLS_DEPRECATED;
/**
 * \brief           This function selects the message digest algorithm to use,
 *                  and allocates internal structures.
 *
 *                  It should be called after mbedtls_md_init() or mbedtls_md_free().
 *                  Makes it necessary to call mbedtls_md_free() later.
 *
 * \deprecated      Superseded by mbedtls_md_setup() in 2.0.0
 *
 * \param ctx       The context to set up.
 * \param md_info   The information structure of the message-digest algorithm
 *                  to use.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 * \return          #MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure.
 */

Func mbedtls_md_setup

int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac );
/**
 * \brief           This function selects the message digest algorithm to use,
 *                  and allocates internal structures.
 *
 *                  It should be called after mbedtls_md_init() or
 *                  mbedtls_md_free(). Makes it necessary to call
 *                  mbedtls_md_free() later.
 *
 * \param ctx       The context to set up.
 * \param md_info   The information structure of the message-digest algorithm
 *                  to use.
 * \param hmac      Defines if HMAC is used. 0: HMAC is not used (saves some memory),
 *                  or non-zero: HMAC is used with this context.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 * \return          #MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure.
 */

Func mbedtls_md_clone

int mbedtls_md_clone( mbedtls_md_context_t *dst,
                     const mbedtls_md_context_t *src );
/**
 * \brief           This function clones the state of an message-digest
 *                  context.
 *
 * \note            You must call mbedtls_md_setup() on \c dst before calling
 *                  this function.
 *
 * \note            The two contexts must have the same type,
 *                  for example, both are SHA-256.
 *
 * \warning         This function clones the message-digest state, not the
 *                  HMAC state.
 *
 * \param dst       The destination context.
 * \param src       The context to be cloned.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure.
 */

Func mbedtls_md_starts

int mbedtls_md_starts( mbedtls_md_context_t *ctx );
/**
 * \brief           This function starts a message-digest computation.
 *
 *                  You must call this function after setting up the context
 *                  with mbedtls_md_setup(), and before passing data with
 *                  mbedtls_md_update().
 *
 * \param ctx       The generic message-digest context.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 */

Func mbedtls_md_update

int mbedtls_md_update( mbedtls_md_context_t *ctx, const unsigned char *input, size_t ilen );
/**
 * \brief           This function feeds an input buffer into an ongoing
 *                  message-digest computation.
 *
 *                  You must call mbedtls_md_starts() before calling this
 *                  function. You may call this function multiple times.
 *                  Afterwards, call mbedtls_md_finish().
 *
 * \param ctx       The generic message-digest context.
 * \param input     The buffer holding the input data.
 * \param ilen      The length of the input data.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 */

Func mbedtls_md_finish

int mbedtls_md_finish( mbedtls_md_context_t *ctx, unsigned char *output );
/**
 * \brief           This function finishes the digest operation,
 *                  and writes the result to the output buffer.
 *
 *                  Call this function after a call to mbedtls_md_starts(),
 *                  followed by any number of calls to mbedtls_md_update().
 *                  Afterwards, you may either clear the context with
 *                  mbedtls_md_free(), or call mbedtls_md_starts() to reuse
 *                  the context for another digest operation with the same
 *                  algorithm.
 *
 * \param ctx       The generic message-digest context.
 * \param output    The buffer for the generic message-digest checksum result.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 */

Func mbedtls_md

int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen,
       unsigned char *output );
/**
 * \brief          This function calculates the message-digest of a buffer,
 *                 with respect to a configurable message-digest algorithm
 *                 in a single call.
 *
 *                 The result is calculated as
 *                 Output = message_digest(input buffer).
 *
 * \param md_info  The information structure of the message-digest algorithm
 *                 to use.
 * \param input    The buffer holding the data.
 * \param ilen     The length of the input data.
 * \param output   The generic message-digest checksum result.
 *
 * \return         \c 0 on success.
 * \return         #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                 failure.
 */

Func mbedtls_md_file

int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path,
                    unsigned char *output );
/**
 * \brief          This function calculates the message-digest checksum
 *                 result of the contents of the provided file.
 *
 *                 The result is calculated as
 *                 Output = message_digest(file contents).
 *
 * \param md_info  The information structure of the message-digest algorithm
 *                 to use.
 * \param path     The input file name.
 * \param output   The generic message-digest checksum result.
 *
 * \return         \c 0 on success.
 * \return         #MBEDTLS_ERR_MD_FILE_IO_ERROR on an I/O error accessing
 *                 the file pointed by \p path.
 * \return         #MBEDTLS_ERR_MD_BAD_INPUT_DATA if \p md_info was NULL.
 */

Func mbedtls_md_hmac_starts

int mbedtls_md_hmac_starts( mbedtls_md_context_t *ctx, const unsigned char *key,
                   size_t keylen );
/**
 * \brief           This function sets the HMAC key and prepares to
 *                  authenticate a new message.
 *
 *                  Call this function after mbedtls_md_setup(), to use
 *                  the MD context for an HMAC calculation, then call
 *                  mbedtls_md_hmac_update() to provide the input data, and
 *                  mbedtls_md_hmac_finish() to get the HMAC value.
 *
 * \param ctx       The message digest context containing an embedded HMAC
 *                  context.
 * \param key       The HMAC secret key.
 * \param keylen    The length of the HMAC key in Bytes.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 */

Func mbedtls_md_hmac_update

int mbedtls_md_hmac_update( mbedtls_md_context_t *ctx, const unsigned char *input,
                   size_t ilen );
/**
 * \brief           This function feeds an input buffer into an ongoing HMAC
 *                  computation.
 *
 *                  Call mbedtls_md_hmac_starts() or mbedtls_md_hmac_reset()
 *                  before calling this function.
 *                  You may call this function multiple times to pass the
 *                  input piecewise.
 *                  Afterwards, call mbedtls_md_hmac_finish().
 *
 * \param ctx       The message digest context containing an embedded HMAC
 *                  context.
 * \param input     The buffer holding the input data.
 * \param ilen      The length of the input data.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 */

Func mbedtls_md_hmac_finish

int mbedtls_md_hmac_finish( mbedtls_md_context_t *ctx, unsigned char *output);
/**
 * \brief           This function finishes the HMAC operation, and writes
 *                  the result to the output buffer.
 *
 *                  Call this function after mbedtls_md_hmac_starts() and
 *                  mbedtls_md_hmac_update() to get the HMAC value. Afterwards
 *                  you may either call mbedtls_md_free() to clear the context,
 *                  or call mbedtls_md_hmac_reset() to reuse the context with
 *                  the same HMAC key.
 *
 * \param ctx       The message digest context containing an embedded HMAC
 *                  context.
 * \param output    The generic HMAC checksum result.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 */

Func mbedtls_md_hmac_reset

int mbedtls_md_hmac_reset( mbedtls_md_context_t *ctx );
/**
 * \brief           This function prepares to authenticate a new message with
 *                  the same key as the previous HMAC operation.
 *
 *                  You may call this function after mbedtls_md_hmac_finish().
 *                  Afterwards call mbedtls_md_hmac_update() to pass the new
 *                  input.
 *
 * \param ctx       The message digest context containing an embedded HMAC
 *                  context.
 *
 * \return          \c 0 on success.
 * \return          #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                  failure.
 */

Func mbedtls_md_hmac

int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen,
               const unsigned char *input, size_t ilen,
               unsigned char *output );
/**
 * \brief          This function calculates the full generic HMAC
 *                 on the input buffer with the provided key.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The HMAC result is calculated as
 *                 output = generic HMAC(hmac key, input buffer).
 *
 * \param md_info  The information structure of the message-digest algorithm
 *                 to use.
 * \param key      The HMAC secret key.
 * \param keylen   The length of the HMAC secret key in Bytes.
 * \param input    The buffer holding the input data.
 * \param ilen     The length of the input data.
 * \param output   The generic HMAC result.
 *
 * \return         \c 0 on success.
 * \return         #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification
 *                 failure.
 */

Func mbedtls_md_process

int mbedtls_md_process( mbedtls_md_context_t *ctx, const unsigned char *data );
/* Internal use */

Func mbedtls_md2_init

void mbedtls_md2_init( mbedtls_md2_context *ctx );
/**
 * \brief          Initialize MD2 context
 *
 * \param ctx      MD2 context to be initialized
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md2_free

void mbedtls_md2_free( mbedtls_md2_context *ctx );
/**
 * \brief          Clear MD2 context
 *
 * \param ctx      MD2 context to be cleared
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md2_clone

void mbedtls_md2_clone( mbedtls_md2_context *dst,
                       const mbedtls_md2_context *src );
/**
 * \brief          Clone (the state of) an MD2 context
 *
 * \param dst      The destination context
 * \param src      The context to be cloned
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md2_starts_ret

int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx );
/**
 * \brief          MD2 context setup
 *
 * \param ctx      context to be initialized
 *
 * \return         0 if successful
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md2_update_ret

int mbedtls_md2_update_ret( mbedtls_md2_context *ctx,
                           const unsigned char *input,
                           size_t ilen );
/**
 * \brief          MD2 process buffer
 *
 * \param ctx      MD2 context
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 *
 * \return         0 if successful
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md2_finish_ret

int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx,
                           unsigned char output[16] );
/**
 * \brief          MD2 final digest
 *
 * \param ctx      MD2 context
 * \param output   MD2 checksum result
 *
 * \return         0 if successful
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_internal_md2_process

int mbedtls_internal_md2_process( mbedtls_md2_context *ctx );
/**
 * \brief          MD2 process data block (internal use only)
 *
 * \param ctx      MD2 context
 *
 * \return         0 if successful
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md2_ret

int mbedtls_md2_ret( const unsigned char *input,
                    size_t ilen,
                    unsigned char output[16] );
/**
 * \brief          Output = MD2( input buffer )
 *
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 * \param output   MD2 checksum result
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md2_self_test

int mbedtls_md2_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md4_init

void mbedtls_md4_init( mbedtls_md4_context *ctx );
/**
 * \brief          Initialize MD4 context
 *
 * \param ctx      MD4 context to be initialized
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md4_free

void mbedtls_md4_free( mbedtls_md4_context *ctx );
/**
 * \brief          Clear MD4 context
 *
 * \param ctx      MD4 context to be cleared
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md4_clone

void mbedtls_md4_clone( mbedtls_md4_context *dst,
                       const mbedtls_md4_context *src );
/**
 * \brief          Clone (the state of) an MD4 context
 *
 * \param dst      The destination context
 * \param src      The context to be cloned
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md4_starts_ret

int mbedtls_md4_starts_ret( mbedtls_md4_context *ctx );
/**
 * \brief          MD4 context setup
 *
 * \param ctx      context to be initialized
 *
 * \return         0 if successful
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 */

Func mbedtls_md4_update_ret

int mbedtls_md4_update_ret( mbedtls_md4_context *ctx,
                           const unsigned char *input,
                           size_t ilen );
/**
 * \brief          MD4 process buffer
 *
 * \param ctx      MD4 context
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 *
 * \return         0 if successful
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md4_finish_ret

int mbedtls_md4_finish_ret( mbedtls_md4_context *ctx,
                           unsigned char output[16] );
/**
 * \brief          MD4 final digest
 *
 * \param ctx      MD4 context
 * \param output   MD4 checksum result
 *
 * \return         0 if successful
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_internal_md4_process

int mbedtls_internal_md4_process( mbedtls_md4_context *ctx,
                                 const unsigned char data[64] );
/**
 * \brief          MD4 process data block (internal use only)
 *
 * \param ctx      MD4 context
 * \param data     buffer holding one block of data
 *
 * \return         0 if successful
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md4_ret

int mbedtls_md4_ret( const unsigned char *input,
                    size_t ilen,
                    unsigned char output[16] );
/**
 * \brief          Output = MD4( input buffer )
 *
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 * \param output   MD4 checksum result
 *
 * \return         0 if successful
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md4_self_test

int mbedtls_md4_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md5_init

void mbedtls_md5_init( mbedtls_md5_context *ctx );
/**
 * \brief          Initialize MD5 context
 *
 * \param ctx      MD5 context to be initialized
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md5_free

void mbedtls_md5_free( mbedtls_md5_context *ctx );
/**
 * \brief          Clear MD5 context
 *
 * \param ctx      MD5 context to be cleared
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md5_clone

void mbedtls_md5_clone( mbedtls_md5_context *dst,
                       const mbedtls_md5_context *src );
/**
 * \brief          Clone (the state of) an MD5 context
 *
 * \param dst      The destination context
 * \param src      The context to be cloned
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md5_starts_ret

int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx );
/**
 * \brief          MD5 context setup
 *
 * \param ctx      context to be initialized
 *
 * \return         0 if successful
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md5_update_ret

int mbedtls_md5_update_ret( mbedtls_md5_context *ctx,
                           const unsigned char *input,
                           size_t ilen );
/**
 * \brief          MD5 process buffer
 *
 * \param ctx      MD5 context
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 *
 * \return         0 if successful
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md5_finish_ret

int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx,
                           unsigned char output[16] );
/**
 * \brief          MD5 final digest
 *
 * \param ctx      MD5 context
 * \param output   MD5 checksum result
 *
 * \return         0 if successful
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_internal_md5_process

int mbedtls_internal_md5_process( mbedtls_md5_context *ctx,
                                 const unsigned char data[64] );
/**
 * \brief          MD5 process data block (internal use only)
 *
 * \param ctx      MD5 context
 * \param data     buffer holding one block of data
 *
 * \return         0 if successful
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md5_ret

int mbedtls_md5_ret( const unsigned char *input,
                    size_t ilen,
                    unsigned char output[16] );
/**
 * \brief          Output = MD5( input buffer )
 *
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 * \param output   MD5 checksum result
 *
 * \return         0 if successful
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_md5_self_test

int mbedtls_md5_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Func mbedtls_memory_buffer_alloc_init

void mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len );
/**
 * \brief   Initialize use of stack-based memory allocator.
 *          The stack-based allocator does memory management inside the
 *          presented buffer and does not call calloc() and free().
 *          It sets the global mbedtls_calloc() and mbedtls_free() pointers
 *          to its own functions.
 *          (Provided mbedtls_calloc() and mbedtls_free() are thread-safe if
 *           MBEDTLS_THREADING_C is defined)
 *
 * \note    This code is not optimized and provides a straight-forward
 *          implementation of a stack-based memory allocator.
 *
 * \param buf   buffer to use as heap
 * \param len   size of the buffer
 */

Func mbedtls_memory_buffer_alloc_free

void mbedtls_memory_buffer_alloc_free( void );
/**
 * \brief   Free the mutex for thread-safety and clear remaining memory
 */

Func mbedtls_memory_buffer_set_verify

void mbedtls_memory_buffer_set_verify( int verify );
/**
 * \brief   Determine when the allocator should automatically verify the state
 *          of the entire chain of headers / meta-data.
 *          (Default: MBEDTLS_MEMORY_VERIFY_NONE)
 *
 * \param verify    One of MBEDTLS_MEMORY_VERIFY_NONE, MBEDTLS_MEMORY_VERIFY_ALLOC,
 *                  MBEDTLS_MEMORY_VERIFY_FREE or MBEDTLS_MEMORY_VERIFY_ALWAYS
 */

Func mbedtls_memory_buffer_alloc_status

void mbedtls_memory_buffer_alloc_status( void );
/**
 * \brief   Print out the status of the allocated memory (primarily for use
 *          after a program should have de-allocated all memory)
 *          Prints out a list of 'still allocated' blocks and their stack
 *          trace if MBEDTLS_MEMORY_BACKTRACE is defined.
 */

Func mbedtls_memory_buffer_alloc_max_get

void mbedtls_memory_buffer_alloc_max_get( size_t *max_used, size_t *max_blocks );
/**
 * \brief   Get the peak heap usage so far
 *
 * \param max_used      Peak number of bytes in use or committed. This
 *                      includes bytes in allocated blocks too small to split
 *                      into smaller blocks but larger than the requested size.
 * \param max_blocks    Peak number of blocks in use, including free and used
 */

Func mbedtls_memory_buffer_alloc_max_reset

void mbedtls_memory_buffer_alloc_max_reset( void );
/**
 * \brief   Reset peak statistics
 */

Func mbedtls_memory_buffer_alloc_cur_get

void mbedtls_memory_buffer_alloc_cur_get( size_t *cur_used, size_t *cur_blocks );
/**
 * \brief   Get the current heap usage
 *
 * \param cur_used      Current number of bytes in use or committed. This
 *                      includes bytes in allocated blocks too small to split
 *                      into smaller blocks but larger than the requested size.
 * \param cur_blocks    Current number of blocks in use, including free and used
 */

Func mbedtls_memory_buffer_alloc_verify

int mbedtls_memory_buffer_alloc_verify( void );
/**
 * \brief   Verifies that all headers in the memory buffer are correct
 *          and contain sane values. Helps debug buffer-overflow errors.
 *
 *          Prints out first failure if MBEDTLS_MEMORY_DEBUG is defined.
 *          Prints out full header information if MBEDTLS_MEMORY_DEBUG
 *          is defined. (Includes stack trace information for each block if
 *          MBEDTLS_MEMORY_BACKTRACE is defined as well).
 *
 * \return             0 if verified, 1 otherwise
 */

Func mbedtls_memory_buffer_alloc_self_test

int mbedtls_memory_buffer_alloc_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if a test failed
 */

Func mbedtls_net_init

void mbedtls_net_init( mbedtls_net_context *ctx );
/**
 * \brief          Initialize a context
 *                 Just makes the context ready to be used or freed safely.
 *
 * \param ctx      Context to initialize
 */

Func mbedtls_net_connect

int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, const char *port, int proto );
/**
 * \brief          Initiate a connection with host:port in the given protocol
 *
 * \param ctx      Socket to use
 * \param host     Host to connect to
 * \param port     Port to connect to
 * \param proto    Protocol: MBEDTLS_NET_PROTO_TCP or MBEDTLS_NET_PROTO_UDP
 *
 * \return         0 if successful, or one of:
 *                      MBEDTLS_ERR_NET_SOCKET_FAILED,
 *                      MBEDTLS_ERR_NET_UNKNOWN_HOST,
 *                      MBEDTLS_ERR_NET_CONNECT_FAILED
 *
 * \note           Sets the socket in connected mode even with UDP.
 */

Func mbedtls_net_bind

int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto );
/**
 * \brief          Create a receiving socket on bind_ip:port in the chosen
 *                 protocol. If bind_ip == NULL, all interfaces are bound.
 *
 * \param ctx      Socket to use
 * \param bind_ip  IP to bind to, can be NULL
 * \param port     Port number to use
 * \param proto    Protocol: MBEDTLS_NET_PROTO_TCP or MBEDTLS_NET_PROTO_UDP
 *
 * \return         0 if successful, or one of:
 *                      MBEDTLS_ERR_NET_SOCKET_FAILED,
 *                      MBEDTLS_ERR_NET_BIND_FAILED,
 *                      MBEDTLS_ERR_NET_LISTEN_FAILED
 *
 * \note           Regardless of the protocol, opens the sockets and binds it.
 *                 In addition, make the socket listening if protocol is TCP.
 */

Func mbedtls_net_accept

int mbedtls_net_accept( mbedtls_net_context *bind_ctx,
                       mbedtls_net_context *client_ctx,
                       void *client_ip, size_t buf_size, size_t *ip_len );
/**
 * \brief           Accept a connection from a remote client
 *
 * \param bind_ctx  Relevant socket
 * \param client_ctx Will contain the connected client socket
 * \param client_ip Will contain the client IP address, can be NULL
 * \param buf_size  Size of the client_ip buffer
 * \param ip_len    Will receive the size of the client IP written,
 *                  can be NULL if client_ip is null
 *
 * \return          0 if successful, or
 *                  MBEDTLS_ERR_NET_ACCEPT_FAILED, or
 *                  MBEDTLS_ERR_NET_BUFFER_TOO_SMALL if buf_size is too small,
 *                  MBEDTLS_ERR_SSL_WANT_READ if bind_fd was set to
 *                  non-blocking and accept() would block.
 */

Func mbedtls_net_poll

int mbedtls_net_poll( mbedtls_net_context *ctx, uint32_t rw, uint32_t timeout );
/**
 * \brief          Check and wait for the context to be ready for read/write
 *
 * \param ctx      Socket to check
 * \param rw       Bitflag composed of MBEDTLS_NET_POLL_READ and
 *                 MBEDTLS_NET_POLL_WRITE specifying the events
 *                 to wait for:
 *                 - If MBEDTLS_NET_POLL_READ is set, the function
 *                   will return as soon as the net context is available
 *                   for reading.
 *                 - If MBEDTLS_NET_POLL_WRITE is set, the function
 *                   will return as soon as the net context is available
 *                   for writing.
 * \param timeout  Maximal amount of time to wait before returning,
 *                 in milliseconds. If \c timeout is zero, the
 *                 function returns immediately. If \c timeout is
 *                 -1u, the function blocks potentially indefinitely.
 *
 * \return         Bitmask composed of MBEDTLS_NET_POLL_READ/WRITE
 *                 on success or timeout, or a negative return code otherwise.
 */

Func mbedtls_net_set_block

int mbedtls_net_set_block( mbedtls_net_context *ctx );
/**
 * \brief          Set the socket blocking
 *
 * \param ctx      Socket to set
 *
 * \return         0 if successful, or a non-zero error code
 */

Func mbedtls_net_set_nonblock

int mbedtls_net_set_nonblock( mbedtls_net_context *ctx );
/**
 * \brief          Set the socket non-blocking
 *
 * \param ctx      Socket to set
 *
 * \return         0 if successful, or a non-zero error code
 */

Func mbedtls_net_usleep

void mbedtls_net_usleep( unsigned long usec );
/**
 * \brief          Portable usleep helper
 *
 * \param usec     Amount of microseconds to sleep
 *
 * \note           Real amount of time slept will not be less than
 *                 select()'s timeout granularity (typically, 10ms).
 */

Func mbedtls_net_recv

int mbedtls_net_recv( void *ctx, unsigned char *buf, size_t len );
/**
 * \brief          Read at most 'len' characters. If no error occurs,
 *                 the actual amount read is returned.
 *
 * \param ctx      Socket
 * \param buf      The buffer to write to
 * \param len      Maximum length of the buffer
 *
 * \return         the number of bytes received,
 *                 or a non-zero error code; with a non-blocking socket,
 *                 MBEDTLS_ERR_SSL_WANT_READ indicates read() would block.
 */

Func mbedtls_net_send

int mbedtls_net_send( void *ctx, const unsigned char *buf, size_t len );
/**
 * \brief          Write at most 'len' characters. If no error occurs,
 *                 the actual amount read is returned.
 *
 * \param ctx      Socket
 * \param buf      The buffer to read from
 * \param len      The length of the buffer
 *
 * \return         the number of bytes sent,
 *                 or a non-zero error code; with a non-blocking socket,
 *                 MBEDTLS_ERR_SSL_WANT_WRITE indicates write() would block.
 */

Func mbedtls_net_recv_timeout

int mbedtls_net_recv_timeout( void *ctx, unsigned char *buf, size_t len,
                     uint32_t timeout );
/**
 * \brief          Read at most 'len' characters, blocking for at most
 *                 'timeout' seconds. If no error occurs, the actual amount
 *                 read is returned.
 *
 * \param ctx      Socket
 * \param buf      The buffer to write to
 * \param len      Maximum length of the buffer
 * \param timeout  Maximum number of milliseconds to wait for data
 *                 0 means no timeout (wait forever)
 *
 * \return         the number of bytes received,
 *                 or a non-zero error code:
 *                 MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out,
 *                 MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal.
 *
 * \note           This function will block (until data becomes available or
 *                 timeout is reached) even if the socket is set to
 *                 non-blocking. Handling timeouts with non-blocking reads
 *                 requires a different strategy.
 */

Func mbedtls_net_free

void mbedtls_net_free( mbedtls_net_context *ctx );
/**
 * \brief          Gracefully shutdown the connection and free associated data
 *
 * \param ctx      The context to free
 */

Func mbedtls_nist_kw_init

void mbedtls_nist_kw_init( mbedtls_nist_kw_context *ctx );
/**
 * \brief           This function initializes the specified key wrapping context
 *                  to make references valid and prepare the context
 *                  for mbedtls_nist_kw_setkey() or mbedtls_nist_kw_free().
 *
 * \param ctx       The key wrapping context to initialize.
 *
 */

Func mbedtls_nist_kw_setkey

int mbedtls_nist_kw_setkey( mbedtls_nist_kw_context *ctx,
                           mbedtls_cipher_id_t cipher,
                           const unsigned char *key,
                           unsigned int keybits,
                           const int is_wrap );
/**
 * \brief           This function initializes the key wrapping context set in the
 *                  \p ctx parameter and sets the encryption key.
 *
 * \param ctx       The key wrapping context.
 * \param cipher    The 128-bit block cipher to use. Only AES is supported.
 * \param key       The Key Encryption Key (KEK).
 * \param keybits   The KEK size in bits. This must be acceptable by the cipher.
 * \param is_wrap   Specify whether the operation within the context is wrapping or unwrapping
 *
 * \return          \c 0 on success.
 * \return          \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for any invalid input.
 * \return          \c MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE for 128-bit block ciphers
 *                  which are not supported.
 * \return          cipher-specific error code on failure of the underlying cipher.
 */

Func mbedtls_nist_kw_free

void mbedtls_nist_kw_free( mbedtls_nist_kw_context *ctx );
/**
 * \brief   This function releases and clears the specified key wrapping context
 *          and underlying cipher sub-context.
 *
 * \param ctx       The key wrapping context to clear.
 */

Func mbedtls_nist_kw_wrap

int mbedtls_nist_kw_wrap( mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode,
                         const unsigned char *input, size_t in_len,
                         unsigned char *output, size_t* out_len, size_t out_size );
/**
 * \brief           This function encrypts a buffer using key wrapping.
 *
 * \param ctx       The key wrapping context to use for encryption.
 * \param mode      The key wrapping mode to use (MBEDTLS_KW_MODE_KW or MBEDTLS_KW_MODE_KWP)
 * \param input     The buffer holding the input data.
 * \param in_len    The length of the input data in Bytes.
 *                  The input uses units of 8 Bytes called semiblocks.
 *                  
  • For KW mode: a multiple of 8 bytes between 16 and 2^57-8 inclusive.
  • *
  • For KWP mode: any length between 1 and 2^32-1 inclusive.
* \param[out] output The buffer holding the output data. *
  • For KW mode: Must be at least 8 bytes larger than \p in_len.
  • *
  • For KWP mode: Must be at least 8 bytes larger rounded up to a multiple of * 8 bytes for KWP (15 bytes at most).
* \param[out] out_len The number of bytes written to the output buffer. \c 0 on failure. * \param[in] out_size The capacity of the output buffer. * * \return \c 0 on success. * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for invalid input length. * \return cipher-specific error code on failure of the underlying cipher. */

Func mbedtls_nist_kw_unwrap

int mbedtls_nist_kw_unwrap( mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode,
                           const unsigned char *input, size_t in_len,
                           unsigned char *output, size_t* out_len, size_t out_size);
/**
 * \brief           This function decrypts a buffer using key wrapping.
 *
 * \param ctx       The key wrapping context to use for decryption.
 * \param mode      The key wrapping mode to use (MBEDTLS_KW_MODE_KW or MBEDTLS_KW_MODE_KWP)
 * \param input     The buffer holding the input data.
 * \param in_len    The length of the input data in Bytes.
 *                  The input uses units of 8 Bytes called semiblocks.
 *                  The input must be a multiple of semiblocks.
 *                  
  • For KW mode: a multiple of 8 bytes between 24 and 2^57 inclusive.
  • *
  • For KWP mode: a multiple of 8 bytes between 16 and 2^32 inclusive.
* \param[out] output The buffer holding the output data. * The output buffer's minimal length is 8 bytes shorter than \p in_len. * \param[out] out_len The number of bytes written to the output buffer. \c 0 on failure. * For KWP mode, the length could be up to 15 bytes shorter than \p in_len, * depending on how much padding was added to the data. * \param[in] out_size The capacity of the output buffer. * * \return \c 0 on success. * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for invalid input length. * \return \c MBEDTLS_ERR_CIPHER_AUTH_FAILED for verification failure of the ciphertext. * \return cipher-specific error code on failure of the underlying cipher. */

Func mbedtls_nist_kw_self_test

int mbedtls_nist_kw_self_test( int verbose );
/**
 * \brief          The key wrapping checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_oid_get_numeric_string

int mbedtls_oid_get_numeric_string( char *buf, size_t size, const mbedtls_asn1_buf *oid );
/**
 * \brief           Translate an ASN.1 OID into its numeric representation
 *                  (e.g. "\x2A\x86\x48\x86\xF7\x0D" into "1.2.840.113549")
 *
 * \param buf       buffer to put representation in
 * \param size      size of the buffer
 * \param oid       OID to translate
 *
 * \return          Length of the string written (excluding final NULL) or
 *                  MBEDTLS_ERR_OID_BUF_TOO_SMALL in case of error
 */

Func mbedtls_oid_get_x509_ext_type

int mbedtls_oid_get_x509_ext_type( const mbedtls_asn1_buf *oid, int *ext_type );
/**
 * \brief          Translate an X.509 extension OID into local values
 *
 * \param oid      OID to use
 * \param ext_type place to store the extension type
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_attr_short_name

int mbedtls_oid_get_attr_short_name( const mbedtls_asn1_buf *oid, const char **short_name );
/**
 * \brief          Translate an X.509 attribute type OID into the short name
 *                 (e.g. the OID for an X520 Common Name into "CN")
 *
 * \param oid      OID to use
 * \param short_name    place to store the string pointer
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_pk_alg

int mbedtls_oid_get_pk_alg( const mbedtls_asn1_buf *oid, mbedtls_pk_type_t *pk_alg );
/**
 * \brief          Translate PublicKeyAlgorithm OID into pk_type
 *
 * \param oid      OID to use
 * \param pk_alg   place to store public key algorithm
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_oid_by_pk_alg

int mbedtls_oid_get_oid_by_pk_alg( mbedtls_pk_type_t pk_alg,
                          const char **oid, size_t *olen );
/**
 * \brief          Translate pk_type into PublicKeyAlgorithm OID
 *
 * \param pk_alg   Public key type to look for
 * \param oid      place to store ASN.1 OID string pointer
 * \param olen     length of the OID
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_ec_grp

int mbedtls_oid_get_ec_grp( const mbedtls_asn1_buf *oid, mbedtls_ecp_group_id *grp_id );
/**
 * \brief          Translate NamedCurve OID into an EC group identifier
 *
 * \param oid      OID to use
 * \param grp_id   place to store group id
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_oid_by_ec_grp

int mbedtls_oid_get_oid_by_ec_grp( mbedtls_ecp_group_id grp_id,
                          const char **oid, size_t *olen );
/**
 * \brief          Translate EC group identifier into NamedCurve OID
 *
 * \param grp_id   EC group identifier
 * \param oid      place to store ASN.1 OID string pointer
 * \param olen     length of the OID
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_sig_alg

int mbedtls_oid_get_sig_alg( const mbedtls_asn1_buf *oid,
                    mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg );
/**
 * \brief          Translate SignatureAlgorithm OID into md_type and pk_type
 *
 * \param oid      OID to use
 * \param md_alg   place to store message digest algorithm
 * \param pk_alg   place to store public key algorithm
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_sig_alg_desc

int mbedtls_oid_get_sig_alg_desc( const mbedtls_asn1_buf *oid, const char **desc );
/**
 * \brief          Translate SignatureAlgorithm OID into description
 *
 * \param oid      OID to use
 * \param desc     place to store string pointer
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_oid_by_sig_alg

int mbedtls_oid_get_oid_by_sig_alg( mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg,
                           const char **oid, size_t *olen );
/**
 * \brief          Translate md_type and pk_type into SignatureAlgorithm OID
 *
 * \param md_alg   message digest algorithm
 * \param pk_alg   public key algorithm
 * \param oid      place to store ASN.1 OID string pointer
 * \param olen     length of the OID
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_md_alg

int mbedtls_oid_get_md_alg( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg );
/**
 * \brief          Translate hash algorithm OID into md_type
 *
 * \param oid      OID to use
 * \param md_alg   place to store message digest algorithm
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_md_hmac

int mbedtls_oid_get_md_hmac( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_hmac );
/**
 * \brief          Translate hmac algorithm OID into md_type
 *
 * \param oid      OID to use
 * \param md_hmac  place to store message hmac algorithm
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_extended_key_usage

int mbedtls_oid_get_extended_key_usage( const mbedtls_asn1_buf *oid, const char **desc );
/**
 * \brief          Translate Extended Key Usage OID into description
 *
 * \param oid      OID to use
 * \param desc     place to store string pointer
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_oid_by_md

int mbedtls_oid_get_oid_by_md( mbedtls_md_type_t md_alg, const char **oid, size_t *olen );
/**
 * \brief          Translate md_type into hash algorithm OID
 *
 * \param md_alg   message digest algorithm
 * \param oid      place to store ASN.1 OID string pointer
 * \param olen     length of the OID
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_cipher_alg

int mbedtls_oid_get_cipher_alg( const mbedtls_asn1_buf *oid, mbedtls_cipher_type_t *cipher_alg );
/**
 * \brief          Translate encryption algorithm OID into cipher_type
 *
 * \param oid           OID to use
 * \param cipher_alg    place to store cipher algorithm
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_oid_get_pkcs12_pbe_alg

int mbedtls_oid_get_pkcs12_pbe_alg( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg,
                           mbedtls_cipher_type_t *cipher_alg );
/**
 * \brief          Translate PKCS#12 PBE algorithm OID into md_type and
 *                 cipher_type
 *
 * \param oid           OID to use
 * \param md_alg        place to store message digest algorithm
 * \param cipher_alg    place to store cipher algorithm
 *
 * \return         0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND
 */

Func mbedtls_padlock_has_support

int mbedtls_padlock_has_support( int feature );
/**
 * \brief          Internal PadLock detection routine
 *
 * \note           This function is only for internal use by other library
 *                 functions; you must not call it directly.
 *
 * \param feature  The feature to detect
 *
 * \return         1 if CPU has support for the feature, 0 otherwise
 */

Func mbedtls_padlock_xcryptecb

int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx,
                              int mode,
                              const unsigned char input[16],
                              unsigned char output[16] );
/**
 * \brief          Internal PadLock AES-ECB block en(de)cryption
 *
 * \note           This function is only for internal use by other library
 *                 functions; you must not call it directly.
 *
 * \param ctx      AES context
 * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
 * \param input    16-byte input block
 * \param output   16-byte output block
 *
 * \return         0 if success, 1 if operation failed
 */

Func mbedtls_padlock_xcryptcbc

int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx,
                              int mode,
                              size_t length,
                              unsigned char iv[16],
                              const unsigned char *input,
                              unsigned char *output );
/**
 * \brief          Internal PadLock AES-CBC buffer en(de)cryption
 *
 * \note           This function is only for internal use by other library
 *                 functions; you must not call it directly.
 *
 * \param ctx      AES context
 * \param mode     MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT
 * \param length   length of the input data
 * \param iv       initialization vector (updated after use)
 * \param input    buffer holding the input data
 * \param output   buffer holding the output data
 *
 * \return         0 if success, 1 if operation failed
 */

Func mbedtls_pem_init

void mbedtls_pem_init( mbedtls_pem_context *ctx );
/**
 * \brief       PEM context setup
 *
 * \param ctx   context to be initialized
 */

Func mbedtls_pem_read_buffer

int mbedtls_pem_read_buffer( mbedtls_pem_context *ctx, const char *header, const char *footer,
                    const unsigned char *data,
                    const unsigned char *pwd,
                    size_t pwdlen, size_t *use_len );
/**
 * \brief       Read a buffer for PEM information and store the resulting
 *              data into the specified context buffers.
 *
 * \param ctx       context to use
 * \param header    header string to seek and expect
 * \param footer    footer string to seek and expect
 * \param data      source data to look in (must be nul-terminated)
 * \param pwd       password for decryption (can be NULL)
 * \param pwdlen    length of password
 * \param use_len   destination for total length used (set after header is
 *                  correctly read, so unless you get
 *                  MBEDTLS_ERR_PEM_BAD_INPUT_DATA or
 *                  MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT, use_len is
 *                  the length to skip)
 *
 * \note            Attempts to check password correctness by verifying if
 *                  the decrypted text starts with an ASN.1 sequence of
 *                  appropriate length
 *
 * \return          0 on success, or a specific PEM error code
 */

Func mbedtls_pem_free

void mbedtls_pem_free( mbedtls_pem_context *ctx );
/**
 * \brief       PEM context memory freeing
 *
 * \param ctx   context to be freed
 */

Func mbedtls_pem_write_buffer

int mbedtls_pem_write_buffer( const char *header, const char *footer,
                     const unsigned char *der_data, size_t der_len,
                     unsigned char *buf, size_t buf_len, size_t *olen );
/**
 * \brief           Write a buffer of PEM information from a DER encoded
 *                  buffer.
 *
 * \param header    header string to write
 * \param footer    footer string to write
 * \param der_data  DER data to write
 * \param der_len   length of the DER data
 * \param buf       buffer to write to
 * \param buf_len   length of output buffer
 * \param olen      total length written / required (if buf_len is not enough)
 *
 * \return          0 on success, or a specific PEM or BASE64 error code. On
 *                  MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL olen is the required
 *                  size.
 */

Func mbedtls_pk_init

void mbedtls_pk_init( mbedtls_pk_context *ctx );
/**
 * \brief           Initialize a #mbedtls_pk_context (as NONE).
 *
 * \param ctx       The context to initialize.
 *                  This must not be \c NULL.
 */

Func mbedtls_pk_free

void mbedtls_pk_free( mbedtls_pk_context *ctx );
/**
 * \brief           Free the components of a #mbedtls_pk_context.
 *
 * \param ctx       The context to clear. It must have been initialized.
 *                  If this is \c NULL, this function does nothing.
 */

Func mbedtls_pk_restart_init

void mbedtls_pk_restart_init( mbedtls_pk_restart_ctx *ctx );
/**
 * \brief           Initialize a restart context
 *
 * \param ctx       The context to initialize.
 *                  This must not be \c NULL.
 */

Func mbedtls_pk_restart_free

void mbedtls_pk_restart_free( mbedtls_pk_restart_ctx *ctx );
/**
 * \brief           Free the components of a restart context
 *
 * \param ctx       The context to clear. It must have been initialized.
 *                  If this is \c NULL, this function does nothing.
 */

Func mbedtls_pk_setup

int mbedtls_pk_setup( mbedtls_pk_context *ctx, const mbedtls_pk_info_t *info );
/**
 * \brief           Initialize a PK context with the information given
 *                  and allocates the type-specific PK subcontext.
 *
 * \param ctx       Context to initialize. It must not have been set
 *                  up yet (type #MBEDTLS_PK_NONE).
 * \param info      Information to use
 *
 * \return          0 on success,
 *                  MBEDTLS_ERR_PK_BAD_INPUT_DATA on invalid input,
 *                  MBEDTLS_ERR_PK_ALLOC_FAILED on allocation failure.
 *
 * \note            For contexts holding an RSA-alt key, use
 *                  \c mbedtls_pk_setup_rsa_alt() instead.
 */

Func mbedtls_pk_setup_rsa_alt

int mbedtls_pk_setup_rsa_alt( mbedtls_pk_context *ctx, void * key,
                        mbedtls_pk_rsa_alt_decrypt_func decrypt_func,
                        mbedtls_pk_rsa_alt_sign_func sign_func,
                        mbedtls_pk_rsa_alt_key_len_func key_len_func );
/**
 * \brief           Initialize an RSA-alt context
 *
 * \param ctx       Context to initialize. It must not have been set
 *                  up yet (type #MBEDTLS_PK_NONE).
 * \param key       RSA key pointer
 * \param decrypt_func  Decryption function
 * \param sign_func     Signing function
 * \param key_len_func  Function returning key length in bytes
 *
 * \return          0 on success, or MBEDTLS_ERR_PK_BAD_INPUT_DATA if the
 *                  context wasn't already initialized as RSA_ALT.
 *
 * \note            This function replaces \c mbedtls_pk_setup() for RSA-alt.
 */

Func mbedtls_pk_get_bitlen

size_t mbedtls_pk_get_bitlen( const mbedtls_pk_context *ctx );
/**
 * \brief           Get the size in bits of the underlying key
 *
 * \param ctx       The context to query. It must have been initialized.
 *
 * \return          Key size in bits, or 0 on error
 */

Func mbedtls_pk_can_do

int mbedtls_pk_can_do( const mbedtls_pk_context *ctx, mbedtls_pk_type_t type );
/**
 * \brief           Tell if a context can do the operation given by type
 *
 * \param ctx       The context to query. It must have been initialized.
 * \param type      The desired type.
 *
 * \return          1 if the context can do operations on the given type.
 * \return          0 if the context cannot do the operations on the given
 *                  type. This is always the case for a context that has
 *                  been initialized but not set up, or that has been
 *                  cleared with mbedtls_pk_free().
 */

Func mbedtls_pk_verify

int mbedtls_pk_verify( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
              const unsigned char *hash, size_t hash_len,
              const unsigned char *sig, size_t sig_len );
/**
 * \brief           Verify signature (including padding if relevant).
 *
 * \param ctx       The PK context to use. It must have been set up.
 * \param md_alg    Hash algorithm used (see notes)
 * \param hash      Hash of the message to sign
 * \param hash_len  Hash length or 0 (see notes)
 * \param sig       Signature to verify
 * \param sig_len   Signature length
 *
 * \return          0 on success (signature is valid),
 *                  #MBEDTLS_ERR_PK_SIG_LEN_MISMATCH if there is a valid
 *                  signature in sig but its length is less than \p siglen,
 *                  or a specific error code.
 *
 * \note            For RSA keys, the default padding type is PKCS#1 v1.5.
 *                  Use \c mbedtls_pk_verify_ext( MBEDTLS_PK_RSASSA_PSS, ... )
 *                  to verify RSASSA_PSS signatures.
 *
 * \note            If hash_len is 0, then the length associated with md_alg
 *                  is used instead, or an error returned if it is invalid.
 *
 * \note            md_alg may be MBEDTLS_MD_NONE, only if hash_len != 0
 */

Func mbedtls_pk_verify_restartable

int mbedtls_pk_verify_restartable( mbedtls_pk_context *ctx,
              mbedtls_md_type_t md_alg,
              const unsigned char *hash, size_t hash_len,
              const unsigned char *sig, size_t sig_len,
              mbedtls_pk_restart_ctx *rs_ctx );
/**
 * \brief           Restartable version of \c mbedtls_pk_verify()
 *
 * \note            Performs the same job as \c mbedtls_pk_verify(), but can
 *                  return early and restart according to the limit set with
 *                  \c mbedtls_ecp_set_max_ops() to reduce blocking for ECC
 *                  operations. For RSA, same as \c mbedtls_pk_verify().
 *
 * \param ctx       The PK context to use. It must have been set up.
 * \param md_alg    Hash algorithm used (see notes)
 * \param hash      Hash of the message to sign
 * \param hash_len  Hash length or 0 (see notes)
 * \param sig       Signature to verify
 * \param sig_len   Signature length
 * \param rs_ctx    Restart context (NULL to disable restart)
 *
 * \return          See \c mbedtls_pk_verify(), or
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 */

Func mbedtls_pk_verify_ext

int mbedtls_pk_verify_ext( mbedtls_pk_type_t type, const void *options,
                  mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
                  const unsigned char *hash, size_t hash_len,
                  const unsigned char *sig, size_t sig_len );
/**
 * \brief           Verify signature, with options.
 *                  (Includes verification of the padding depending on type.)
 *
 * \param type      Signature type (inc. possible padding type) to verify
 * \param options   Pointer to type-specific options, or NULL
 * \param ctx       The PK context to use. It must have been set up.
 * \param md_alg    Hash algorithm used (see notes)
 * \param hash      Hash of the message to sign
 * \param hash_len  Hash length or 0 (see notes)
 * \param sig       Signature to verify
 * \param sig_len   Signature length
 *
 * \return          0 on success (signature is valid),
 *                  #MBEDTLS_ERR_PK_TYPE_MISMATCH if the PK context can't be
 *                  used for this type of signatures,
 *                  #MBEDTLS_ERR_PK_SIG_LEN_MISMATCH if there is a valid
 *                  signature in sig but its length is less than \p siglen,
 *                  or a specific error code.
 *
 * \note            If hash_len is 0, then the length associated with md_alg
 *                  is used instead, or an error returned if it is invalid.
 *
 * \note            md_alg may be MBEDTLS_MD_NONE, only if hash_len != 0
 *
 * \note            If type is MBEDTLS_PK_RSASSA_PSS, then options must point
 *                  to a mbedtls_pk_rsassa_pss_options structure,
 *                  otherwise it must be NULL.
 */

Func mbedtls_pk_sign

int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
            const unsigned char *hash, size_t hash_len,
            unsigned char *sig, size_t *sig_len,
            int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
 * \brief           Make signature, including padding if relevant.
 *
 * \param ctx       The PK context to use. It must have been set up
 *                  with a private key.
 * \param md_alg    Hash algorithm used (see notes)
 * \param hash      Hash of the message to sign
 * \param hash_len  Hash length or 0 (see notes)
 * \param sig       Place to write the signature
 * \param sig_len   Number of bytes written
 * \param f_rng     RNG function
 * \param p_rng     RNG parameter
 *
 * \return          0 on success, or a specific error code.
 *
 * \note            For RSA keys, the default padding type is PKCS#1 v1.5.
 *                  There is no interface in the PK module to make RSASSA-PSS
 *                  signatures yet.
 *
 * \note            If hash_len is 0, then the length associated with md_alg
 *                  is used instead, or an error returned if it is invalid.
 *
 * \note            For RSA, md_alg may be MBEDTLS_MD_NONE if hash_len != 0.
 *                  For ECDSA, md_alg may never be MBEDTLS_MD_NONE.
 */

Func mbedtls_pk_sign_restartable

int mbedtls_pk_sign_restartable( mbedtls_pk_context *ctx,
            mbedtls_md_type_t md_alg,
            const unsigned char *hash, size_t hash_len,
            unsigned char *sig, size_t *sig_len,
            int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
            mbedtls_pk_restart_ctx *rs_ctx );
/**
 * \brief           Restartable version of \c mbedtls_pk_sign()
 *
 * \note            Performs the same job as \c mbedtls_pk_sign(), but can
 *                  return early and restart according to the limit set with
 *                  \c mbedtls_ecp_set_max_ops() to reduce blocking for ECC
 *                  operations. For RSA, same as \c mbedtls_pk_sign().
 *
 * \param ctx       The PK context to use. It must have been set up
 *                  with a private key.
 * \param md_alg    Hash algorithm used (see notes)
 * \param hash      Hash of the message to sign
 * \param hash_len  Hash length or 0 (see notes)
 * \param sig       Place to write the signature
 * \param sig_len   Number of bytes written
 * \param f_rng     RNG function
 * \param p_rng     RNG parameter
 * \param rs_ctx    Restart context (NULL to disable restart)
 *
 * \return          See \c mbedtls_pk_sign(), or
 * \return          #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                  operations was reached: see \c mbedtls_ecp_set_max_ops().
 */

Func mbedtls_pk_decrypt

int mbedtls_pk_decrypt( mbedtls_pk_context *ctx,
               const unsigned char *input, size_t ilen,
               unsigned char *output, size_t *olen, size_t osize,
               int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
 * \brief           Decrypt message (including padding if relevant).
 *
 * \param ctx       The PK context to use. It must have been set up
 *                  with a private key.
 * \param input     Input to decrypt
 * \param ilen      Input size
 * \param output    Decrypted output
 * \param olen      Decrypted message length
 * \param osize     Size of the output buffer
 * \param f_rng     RNG function
 * \param p_rng     RNG parameter
 *
 * \note            For RSA keys, the default padding type is PKCS#1 v1.5.
 *
 * \return          0 on success, or a specific error code.
 */

Func mbedtls_pk_encrypt

int mbedtls_pk_encrypt( mbedtls_pk_context *ctx,
               const unsigned char *input, size_t ilen,
               unsigned char *output, size_t *olen, size_t osize,
               int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
/**
 * \brief           Encrypt message (including padding if relevant).
 *
 * \param ctx       The PK context to use. It must have been set up.
 * \param input     Message to encrypt
 * \param ilen      Message size
 * \param output    Encrypted output
 * \param olen      Encrypted output length
 * \param osize     Size of the output buffer
 * \param f_rng     RNG function
 * \param p_rng     RNG parameter
 *
 * \note            For RSA keys, the default padding type is PKCS#1 v1.5.
 *
 * \return          0 on success, or a specific error code.
 */

Func mbedtls_pk_check_pair

int mbedtls_pk_check_pair( const mbedtls_pk_context *pub, const mbedtls_pk_context *prv );
/**
 * \brief           Check if a public-private pair of keys matches.
 *
 * \param pub       Context holding a public key.
 * \param prv       Context holding a private (and public) key.
 *
 * \return          0 on success or MBEDTLS_ERR_PK_BAD_INPUT_DATA
 */

Func mbedtls_pk_debug

int mbedtls_pk_debug( const mbedtls_pk_context *ctx, mbedtls_pk_debug_item *items );
/**
 * \brief           Export debug information
 *
 * \param ctx       The PK context to use. It must have been initialized.
 * \param items     Place to write debug items
 *
 * \return          0 on success or MBEDTLS_ERR_PK_BAD_INPUT_DATA
 */

Func mbedtls_pk_parse_key

int mbedtls_pk_parse_key( mbedtls_pk_context *ctx,
                 const unsigned char *key, size_t keylen,
                 const unsigned char *pwd, size_t pwdlen );
/**
 * \brief           Parse a private key in PEM or DER format
 *
 * \param ctx       The PK context to fill. It must have been initialized
 *                  but not set up.
 * \param key       Input buffer to parse.
 *                  The buffer must contain the input exactly, with no
 *                  extra trailing material. For PEM, the buffer must
 *                  contain a null-terminated string.
 * \param keylen    Size of \b key in bytes.
 *                  For PEM data, this includes the terminating null byte,
 *                  so \p keylen must be equal to `strlen(key) + 1`.
 * \param pwd       Optional password for decryption.
 *                  Pass \c NULL if expecting a non-encrypted key.
 *                  Pass a string of \p pwdlen bytes if expecting an encrypted
 *                  key; a non-encrypted key will also be accepted.
 *                  The empty password is not supported.
 * \param pwdlen    Size of the password in bytes.
 *                  Ignored if \p pwd is \c NULL.
 *
 * \note            On entry, ctx must be empty, either freshly initialised
 *                  with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a
 *                  specific key type, check the result with mbedtls_pk_can_do().
 *
 * \note            The key is also checked for correctness.
 *
 * \return          0 if successful, or a specific PK or PEM error code
 */

Func mbedtls_pk_parse_public_key

int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx,
                        const unsigned char *key, size_t keylen );
/**
 * \brief           Parse a public key in PEM or DER format
 *
 * \param ctx       The PK context to fill. It must have been initialized
 *                  but not set up.
 * \param key       Input buffer to parse.
 *                  The buffer must contain the input exactly, with no
 *                  extra trailing material. For PEM, the buffer must
 *                  contain a null-terminated string.
 * \param keylen    Size of \b key in bytes.
 *                  For PEM data, this includes the terminating null byte,
 *                  so \p keylen must be equal to `strlen(key) + 1`.
 *
 * \note            On entry, ctx must be empty, either freshly initialised
 *                  with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a
 *                  specific key type, check the result with mbedtls_pk_can_do().
 *
 * \note            The key is also checked for correctness.
 *
 * \return          0 if successful, or a specific PK or PEM error code
 */

Func mbedtls_pk_parse_keyfile

int mbedtls_pk_parse_keyfile( mbedtls_pk_context *ctx,
                     const char *path, const char *password );
/**
 * \brief           Load and parse a private key
 *
 * \param ctx       The PK context to fill. It must have been initialized
 *                  but not set up.
 * \param path      filename to read the private key from
 * \param password  Optional password to decrypt the file.
 *                  Pass \c NULL if expecting a non-encrypted key.
 *                  Pass a null-terminated string if expecting an encrypted
 *                  key; a non-encrypted key will also be accepted.
 *                  The empty password is not supported.
 *
 * \note            On entry, ctx must be empty, either freshly initialised
 *                  with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a
 *                  specific key type, check the result with mbedtls_pk_can_do().
 *
 * \note            The key is also checked for correctness.
 *
 * \return          0 if successful, or a specific PK or PEM error code
 */

Func mbedtls_pk_parse_public_keyfile

int mbedtls_pk_parse_public_keyfile( mbedtls_pk_context *ctx, const char *path );
/**
 * \brief           Load and parse a public key
 *
 * \param ctx       The PK context to fill. It must have been initialized
 *                  but not set up.
 * \param path      filename to read the public key from
 *
 * \note            On entry, ctx must be empty, either freshly initialised
 *                  with mbedtls_pk_init() or reset with mbedtls_pk_free(). If
 *                  you need a specific key type, check the result with
 *                  mbedtls_pk_can_do().
 *
 * \note            The key is also checked for correctness.
 *
 * \return          0 if successful, or a specific PK or PEM error code
 */

Func mbedtls_pk_write_key_der

int mbedtls_pk_write_key_der( mbedtls_pk_context *ctx, unsigned char *buf, size_t size );
/**
 * \brief           Write a private key to a PKCS#1 or SEC1 DER structure
 *                  Note: data is written at the end of the buffer! Use the
 *                        return value to determine where you should start
 *                        using the buffer
 *
 * \param ctx       PK context which must contain a valid private key.
 * \param buf       buffer to write to
 * \param size      size of the buffer
 *
 * \return          length of data written if successful, or a specific
 *                  error code
 */

Func mbedtls_pk_write_pubkey_der

int mbedtls_pk_write_pubkey_der( mbedtls_pk_context *ctx, unsigned char *buf, size_t size );
/**
 * \brief           Write a public key to a SubjectPublicKeyInfo DER structure
 *                  Note: data is written at the end of the buffer! Use the
 *                        return value to determine where you should start
 *                        using the buffer
 *
 * \param ctx       PK context which must contain a valid public or private key.
 * \param buf       buffer to write to
 * \param size      size of the buffer
 *
 * \return          length of data written if successful, or a specific
 *                  error code
 */

Func mbedtls_pk_write_pubkey_pem

int mbedtls_pk_write_pubkey_pem( mbedtls_pk_context *ctx, unsigned char *buf, size_t size );
/**
 * \brief           Write a public key to a PEM string
 *
 * \param ctx       PK context which must contain a valid public or private key.
 * \param buf       Buffer to write to. The output includes a
 *                  terminating null byte.
 * \param size      Size of the buffer in bytes.
 *
 * \return          0 if successful, or a specific error code
 */

Func mbedtls_pk_write_key_pem

int mbedtls_pk_write_key_pem( mbedtls_pk_context *ctx, unsigned char *buf, size_t size );
/**
 * \brief           Write a private key to a PKCS#1 or SEC1 PEM string
 *
 * \param ctx       PK context which must contain a valid private key.
 * \param buf       Buffer to write to. The output includes a
 *                  terminating null byte.
 * \param size      Size of the buffer in bytes.
 *
 * \return          0 if successful, or a specific error code
 */

Func mbedtls_pk_parse_subpubkey

int mbedtls_pk_parse_subpubkey( unsigned char **p, const unsigned char *end,
                       mbedtls_pk_context *pk );
/**
 * \brief           Parse a SubjectPublicKeyInfo DER structure
 *
 * \param p         the position in the ASN.1 data
 * \param end       end of the buffer
 * \param pk        The PK context to fill. It must have been initialized
 *                  but not set up.
 *
 * \return          0 if successful, or a specific PK error code
 */

Func mbedtls_pk_write_pubkey

int mbedtls_pk_write_pubkey( unsigned char **p, unsigned char *start,
                    const mbedtls_pk_context *key );
/**
 * \brief           Write a subjectPublicKey to ASN.1 data
 *                  Note: function works backwards in data buffer
 *
 * \param p         reference to current position pointer
 * \param start     start of the buffer (for bounds-checking)
 * \param key       PK context which must contain a valid public or private key.
 *
 * \return          the length written or a negative error code
 */

Func mbedtls_pk_load_file

int mbedtls_pk_load_file( const char *path, unsigned char **buf, size_t *n );


      

Func mbedtls_pkcs11_init

void mbedtls_pkcs11_init( mbedtls_pkcs11_context *ctx );
/**
 * Initialize a mbedtls_pkcs11_context.
 * (Just making memory references valid.)
 */

Func mbedtls_pkcs11_x509_cert_bind

int mbedtls_pkcs11_x509_cert_bind( mbedtls_x509_crt *cert, pkcs11h_certificate_t pkcs11h_cert );
/**
 * Fill in a mbed TLS certificate, based on the given PKCS11 helper certificate.
 *
 * \param cert          X.509 certificate to fill
 * \param pkcs11h_cert  PKCS #11 helper certificate
 *
 * \return              0 on success.
 */

Func mbedtls_pkcs11_priv_key_bind

int mbedtls_pkcs11_priv_key_bind( mbedtls_pkcs11_context *priv_key,
       pkcs11h_certificate_t pkcs11_cert );
/**
 * Set up a mbedtls_pkcs11_context storing the given certificate. Note that the
 * mbedtls_pkcs11_context will take over control of the certificate, freeing it when
 * done.
 *
 * \param priv_key      Private key structure to fill.
 * \param pkcs11_cert   PKCS #11 helper certificate
 *
 * \return              0 on success
 */

Func mbedtls_pkcs11_priv_key_free

void mbedtls_pkcs11_priv_key_free( mbedtls_pkcs11_context *priv_key );
/**
 * Free the contents of the given private key context. Note that the structure
 * itself is not freed.
 *
 * \param priv_key      Private key structure to cleanup
 */

Func mbedtls_pkcs11_decrypt

int mbedtls_pkcs11_decrypt( mbedtls_pkcs11_context *ctx,
                      int mode, size_t *olen,
                      const unsigned char *input,
                      unsigned char *output,
                      size_t output_max_len );
/**
 * \brief          Do an RSA private key decrypt, then remove the message
 *                 padding
 *
 * \param ctx      PKCS #11 context
 * \param mode     must be MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's signature
 * \param input    buffer holding the encrypted data
 * \param output   buffer that will hold the plaintext
 * \param olen     will contain the plaintext length
 * \param output_max_len    maximum length of the output buffer
 *
 * \return         0 if successful, or an MBEDTLS_ERR_RSA_XXX error code
 *
 * \note           The output buffer must be as large as the size
 *                 of ctx->N (eg. 128 bytes if RSA-1024 is used) otherwise
 *                 an error is thrown.
 */

Func mbedtls_pkcs11_sign

int mbedtls_pkcs11_sign( mbedtls_pkcs11_context *ctx,
                   int mode,
                   mbedtls_md_type_t md_alg,
                   unsigned int hashlen,
                   const unsigned char *hash,
                   unsigned char *sig );
/**
 * \brief          Do a private RSA to sign a message digest
 *
 * \param ctx      PKCS #11 context
 * \param mode     must be MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's signature
 * \param md_alg   a MBEDTLS_MD_XXX (use MBEDTLS_MD_NONE for signing raw data)
 * \param hashlen  message digest length (for MBEDTLS_MD_NONE only)
 * \param hash     buffer holding the message digest
 * \param sig      buffer that will hold the ciphertext
 *
 * \return         0 if the signing operation was successful,
 *                 or an MBEDTLS_ERR_RSA_XXX error code
 *
 * \note           The "sig" buffer must be as large as the size
 *                 of ctx->N (eg. 128 bytes if RSA-1024 is used).
 */

Func mbedtls_pkcs12_pbe_sha1_rc4_128

int mbedtls_pkcs12_pbe_sha1_rc4_128( mbedtls_asn1_buf *pbe_params, int mode,
                            const unsigned char *pwd, size_t pwdlen,
                            const unsigned char *input, size_t len,
                            unsigned char *output );
/**
 * \brief            PKCS12 Password Based function (encryption / decryption)
 *                   for pbeWithSHAAnd128BitRC4
 *
 * \param pbe_params an ASN1 buffer containing the pkcs-12PbeParams structure
 * \param mode       either MBEDTLS_PKCS12_PBE_ENCRYPT or MBEDTLS_PKCS12_PBE_DECRYPT
 * \param pwd        the password used (may be NULL if no password is used)
 * \param pwdlen     length of the password (may be 0)
 * \param input      the input data
 * \param len        data length
 * \param output     the output buffer
 *
 * \return           0 if successful, or a MBEDTLS_ERR_XXX code
 */

Func mbedtls_pkcs12_pbe

int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode,
               mbedtls_cipher_type_t cipher_type, mbedtls_md_type_t md_type,
               const unsigned char *pwd, size_t pwdlen,
               const unsigned char *input, size_t len,
               unsigned char *output );
/**
 * \brief            PKCS12 Password Based function (encryption / decryption)
 *                   for cipher-based and mbedtls_md-based PBE's
 *
 * \param pbe_params an ASN1 buffer containing the pkcs-12PbeParams structure
 * \param mode       either MBEDTLS_PKCS12_PBE_ENCRYPT or MBEDTLS_PKCS12_PBE_DECRYPT
 * \param cipher_type the cipher used
 * \param md_type     the mbedtls_md used
 * \param pwd        the password used (may be NULL if no password is used)
 * \param pwdlen     length of the password (may be 0)
 * \param input      the input data
 * \param len        data length
 * \param output     the output buffer
 *
 * \return           0 if successful, or a MBEDTLS_ERR_XXX code
 */

Func mbedtls_pkcs12_derivation

int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen,
                      const unsigned char *pwd, size_t pwdlen,
                      const unsigned char *salt, size_t saltlen,
                      mbedtls_md_type_t mbedtls_md, int id, int iterations );
/**
 * \brief            The PKCS#12 derivation function uses a password and a salt
 *                   to produce pseudo-random bits for a particular "purpose".
 *
 *                   Depending on the given id, this function can produce an
 *                   encryption/decryption key, an nitialization vector or an
 *                   integrity key.
 *
 * \param data       buffer to store the derived data in
 * \param datalen    length to fill
 * \param pwd        password to use (may be NULL if no password is used)
 * \param pwdlen     length of the password (may be 0)
 * \param salt       salt buffer to use
 * \param saltlen    length of the salt
 * \param mbedtls_md         mbedtls_md type to use during the derivation
 * \param id         id that describes the purpose (can be MBEDTLS_PKCS12_DERIVE_KEY,
 *                   MBEDTLS_PKCS12_DERIVE_IV or MBEDTLS_PKCS12_DERIVE_MAC_KEY)
 * \param iterations number of iterations
 *
 * \return          0 if successful, or a MD, BIGNUM type error.
 */

Func mbedtls_pkcs5_pbes2

int mbedtls_pkcs5_pbes2( const mbedtls_asn1_buf *pbe_params, int mode,
                const unsigned char *pwd, size_t pwdlen,
                const unsigned char *data, size_t datalen,
                unsigned char *output );
/**
 * \brief          PKCS#5 PBES2 function
 *
 * \param pbe_params the ASN.1 algorithm parameters
 * \param mode       either MBEDTLS_PKCS5_DECRYPT or MBEDTLS_PKCS5_ENCRYPT
 * \param pwd        password to use when generating key
 * \param pwdlen     length of password
 * \param data       data to process
 * \param datalen    length of data
 * \param output     output buffer
 *
 * \returns        0 on success, or a MBEDTLS_ERR_XXX code if verification fails.
 */

Func mbedtls_pkcs5_pbkdf2_hmac

int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *password,
                      size_t plen, const unsigned char *salt, size_t slen,
                      unsigned int iteration_count,
                      uint32_t key_length, unsigned char *output );
/**
 * \brief          PKCS#5 PBKDF2 using HMAC
 *
 * \param ctx      Generic HMAC context
 * \param password Password to use when generating key
 * \param plen     Length of password
 * \param salt     Salt to use when generating key
 * \param slen     Length of salt
 * \param iteration_count       Iteration count
 * \param key_length            Length of generated key in bytes
 * \param output   Generated key. Must be at least as big as key_length
 *
 * \returns        0 on success, or a MBEDTLS_ERR_XXX code if verification fails.
 */

Func mbedtls_pkcs5_self_test

int mbedtls_pkcs5_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Func mbedtls_platform_set_calloc_free

int mbedtls_platform_set_calloc_free( void * (*calloc_func)( size_t, size_t ),
                             void (*free_func)( void * ) );
/**
 * \brief               This function dynamically sets the memory-management
 *                      functions used by the library, during runtime.
 *
 * \param calloc_func   The \c calloc function implementation.
 * \param free_func     The \c free function implementation.
 *
 * \return              \c 0.
 */

Func mbedtls_platform_set_fprintf

int mbedtls_platform_set_fprintf( int (*fprintf_func)( FILE *stream, const char *,
                                              ... ) );
/**
 * \brief                This function dynamically configures the fprintf
 *                       function that is called when the
 *                       mbedtls_fprintf() function is invoked by the library.
 *
 * \param fprintf_func   The \c fprintf function implementation.
 *
 * \return               \c 0.
 */

Func mbedtls_platform_set_printf

int mbedtls_platform_set_printf( int (*printf_func)( const char *, ... ) );
/**
 * \brief               This function dynamically configures the snprintf
 *                      function that is called when the mbedtls_snprintf()
 *                      function is invoked by the library.
 *
 * \param printf_func   The \c printf function implementation.
 *
 * \return              \c 0 on success.
 */

Func mbedtls_platform_win32_snprintf

int mbedtls_platform_win32_snprintf( char *s, size_t n, const char *fmt, ... );
/* For Windows (inc. MSYS2), we provide our own fixed implementation */

Func mbedtls_platform_set_snprintf

int mbedtls_platform_set_snprintf( int (*snprintf_func)( char * s, size_t n,
                                                const char * format, ... ) );
/**
 * \brief                 This function allows configuring a custom
 *                        \c snprintf function pointer.
 *
 * \param snprintf_func   The \c snprintf function implementation.
 *
 * \return                \c 0 on success.
 */

Func mbedtls_platform_set_exit

int mbedtls_platform_set_exit( void (*exit_func)( int status ) );
/**
 * \brief             This function dynamically configures the exit
 *                    function that is called when the mbedtls_exit()
 *                    function is invoked by the library.
 *
 * \param exit_func   The \c exit function implementation.
 *
 * \return            \c 0 on success.
 */

Func mbedtls_platform_std_nv_seed_read

int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len );
/* Internal standard platform definitions */

Func mbedtls_platform_std_nv_seed_write

int mbedtls_platform_std_nv_seed_write( unsigned char *buf, size_t buf_len );


      

Func mbedtls_platform_set_nv_seed

int mbedtls_platform_set_nv_seed(
           int (*nv_seed_read_func)( unsigned char *buf, size_t buf_len ),
           int (*nv_seed_write_func)( unsigned char *buf, size_t buf_len )
           );
/**
 * \brief   This function allows configuring custom seed file writing and
 *          reading functions.
 *
 * \param   nv_seed_read_func   The seed reading function implementation.
 * \param   nv_seed_write_func  The seed writing function implementation.
 *
 * \return  \c 0 on success.
 */

Func mbedtls_platform_setup

int mbedtls_platform_setup( mbedtls_platform_context *ctx );
/**
 * \brief   This function performs any platform-specific initialization
 *          operations.
 *
 * \note    This function should be called before any other library functions.
 *
 *          Its implementation is platform-specific, and unless
 *          platform-specific code is provided, it does nothing.
 *
 * \note    The usage and necessity of this function is dependent on the platform.
 *
 * \param   ctx     The platform context.
 *
 * \return  \c 0 on success.
 */

Func mbedtls_platform_teardown

void mbedtls_platform_teardown( mbedtls_platform_context *ctx );
/**
 * \brief   This function performs any platform teardown operations.
 *
 * \note    This function should be called after every other Mbed TLS module
 *          has been correctly freed using the appropriate free function.
 *
 *          Its implementation is platform-specific, and unless
 *          platform-specific code is provided, it does nothing.
 *
 * \note    The usage and necessity of this function is dependent on the platform.
 *
 * \param   ctx     The platform context.
 *
 */

Func mbedtls_platform_set_time

int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) );
/**
 * \brief   Set your own time function pointer
 *
 * \param   time_func   the time function implementation
 *
 * \return              0
 */

Func mbedtls_param_failed

void mbedtls_param_failed( const char *failure_condition,
                          const char *file,
                          int line );
/**
 * \brief       User supplied callback function for parameter validation failure.
 *              See #MBEDTLS_CHECK_PARAMS for context.
 *
 *              This function will be called unless an alternative treatement
 *              is defined through the #MBEDTLS_PARAM_FAILED macro.
 *
 *              This function can return, and the operation will be aborted, or
 *              alternatively, through use of setjmp()/longjmp() can resume
 *              execution in the application code.
 *
 * \param failure_condition The assertion that didn't hold.
 * \param file  The file where the assertion failed.
 * \param line  The line in the file where the assertion failed.
 */

Func mbedtls_platform_zeroize

void mbedtls_platform_zeroize( void *buf, size_t len );
/**
 * \brief       Securely zeroize a buffer
 *
 *              The function is meant to wipe the data contained in a buffer so
 *              that it can no longer be recovered even if the program memory
 *              is later compromised. Call this function on sensitive data
 *              stored on the stack before returning from a function, and on
 *              sensitive data stored on the heap before freeing the heap
 *              object.
 *
 *              It is extremely difficult to guarantee that calls to
 *              mbedtls_platform_zeroize() are not removed by aggressive
 *              compiler optimizations in a portable way. For this reason, Mbed
 *              TLS provides the configuration option
 *              MBEDTLS_PLATFORM_ZEROIZE_ALT, which allows users to configure
 *              mbedtls_platform_zeroize() to use a suitable implementation for
 *              their platform and needs
 *
 * \param buf   Buffer to be zeroized
 * \param len   Length of the buffer in bytes
 *
 */

Func mbedtls_poly1305_init

void mbedtls_poly1305_init( mbedtls_poly1305_context *ctx );
/**
 * \brief           This function initializes the specified Poly1305 context.
 *
 *                  It must be the first API called before using
 *                  the context.
 *
 *                  It is usually followed by a call to
 *                  \c mbedtls_poly1305_starts(), then one or more calls to
 *                  \c mbedtls_poly1305_update(), then one call to
 *                  \c mbedtls_poly1305_finish(), then finally
 *                  \c mbedtls_poly1305_free().
 *
 * \param ctx       The Poly1305 context to initialize. This must
 *                  not be \c NULL.
 */

Func mbedtls_poly1305_free

void mbedtls_poly1305_free( mbedtls_poly1305_context *ctx );
/**
 * \brief           This function releases and clears the specified
 *                  Poly1305 context.
 *
 * \param ctx       The Poly1305 context to clear. This may be \c NULL, in which
 *                  case this function is a no-op. If it is not \c NULL, it must
 *                  point to an initialized Poly1305 context.
 */

Func mbedtls_poly1305_starts

int mbedtls_poly1305_starts( mbedtls_poly1305_context *ctx,
                            const unsigned char key[32] );
/**
 * \brief           This function sets the one-time authentication key.
 *
 * \warning         The key must be unique and unpredictable for each
 *                  invocation of Poly1305.
 *
 * \param ctx       The Poly1305 context to which the key should be bound.
 *                  This must be initialized.
 * \param key       The buffer containing the \c 32 Byte (\c 256 Bit) key.
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_poly1305_update

int mbedtls_poly1305_update( mbedtls_poly1305_context *ctx,
                            const unsigned char *input,
                            size_t ilen );
/**
 * \brief           This functions feeds an input buffer into an ongoing
 *                  Poly1305 computation.
 *
 *                  It is called between \c mbedtls_cipher_poly1305_starts() and
 *                  \c mbedtls_cipher_poly1305_finish().
 *                  It can be called repeatedly to process a stream of data.
 *
 * \param ctx       The Poly1305 context to use for the Poly1305 operation.
 *                  This must be initialized and bound to a key.
 * \param ilen      The length of the input data in Bytes.
 *                  Any value is accepted.
 * \param input     The buffer holding the input data.
 *                  This pointer can be \c NULL if `ilen == 0`.
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_poly1305_finish

int mbedtls_poly1305_finish( mbedtls_poly1305_context *ctx,
                            unsigned char mac[16] );
/**
 * \brief           This function generates the Poly1305 Message
 *                  Authentication Code (MAC).
 *
 * \param ctx       The Poly1305 context to use for the Poly1305 operation.
 *                  This must be initialized and bound to a key.
 * \param mac       The buffer to where the MAC is written. This must
 *                  be a writable buffer of length \c 16 Bytes.
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_poly1305_mac

int mbedtls_poly1305_mac( const unsigned char key[32],
                         const unsigned char *input,
                         size_t ilen,
                         unsigned char mac[16] );
/**
 * \brief           This function calculates the Poly1305 MAC of the input
 *                  buffer with the provided key.
 *
 * \warning         The key must be unique and unpredictable for each
 *                  invocation of Poly1305.
 *
 * \param key       The buffer containing the \c 32 Byte (\c 256 Bit) key.
 * \param ilen      The length of the input data in Bytes.
 *                  Any value is accepted.
 * \param input     The buffer holding the input data.
 *                  This pointer can be \c NULL if `ilen == 0`.
 * \param mac       The buffer to where the MAC is written. This must be
 *                  a writable buffer of length \c 16 Bytes.
 *
 * \return          \c 0 on success.
 * \return          A negative error code on failure.
 */

Func mbedtls_poly1305_self_test

int mbedtls_poly1305_self_test( int verbose );
/**
 * \brief           The Poly1305 checkup routine.
 *
 * \return          \c 0 on success.
 * \return          \c 1 on failure.
 */

Func mbedtls_ripemd160_init

void mbedtls_ripemd160_init( mbedtls_ripemd160_context *ctx );
/**
 * \brief          Initialize RIPEMD-160 context
 *
 * \param ctx      RIPEMD-160 context to be initialized
 */

Func mbedtls_ripemd160_free

void mbedtls_ripemd160_free( mbedtls_ripemd160_context *ctx );
/**
 * \brief          Clear RIPEMD-160 context
 *
 * \param ctx      RIPEMD-160 context to be cleared
 */

Func mbedtls_ripemd160_clone

void mbedtls_ripemd160_clone( mbedtls_ripemd160_context *dst,
                       const mbedtls_ripemd160_context *src );
/**
 * \brief          Clone (the state of) an RIPEMD-160 context
 *
 * \param dst      The destination context
 * \param src      The context to be cloned
 */

Func mbedtls_ripemd160_starts_ret

int mbedtls_ripemd160_starts_ret( mbedtls_ripemd160_context *ctx );
/**
 * \brief          RIPEMD-160 context setup
 *
 * \param ctx      context to be initialized
 *
 * \return         0 if successful
 */

Func mbedtls_ripemd160_update_ret

int mbedtls_ripemd160_update_ret( mbedtls_ripemd160_context *ctx,
                                 const unsigned char *input,
                                 size_t ilen );
/**
 * \brief          RIPEMD-160 process buffer
 *
 * \param ctx      RIPEMD-160 context
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 *
 * \return         0 if successful
 */

Func mbedtls_ripemd160_finish_ret

int mbedtls_ripemd160_finish_ret( mbedtls_ripemd160_context *ctx,
                                 unsigned char output[20] );
/**
 * \brief          RIPEMD-160 final digest
 *
 * \param ctx      RIPEMD-160 context
 * \param output   RIPEMD-160 checksum result
 *
 * \return         0 if successful
 */

Func mbedtls_internal_ripemd160_process

int mbedtls_internal_ripemd160_process( mbedtls_ripemd160_context *ctx,
                                       const unsigned char data[64] );
/**
 * \brief          RIPEMD-160 process data block (internal use only)
 *
 * \param ctx      RIPEMD-160 context
 * \param data     buffer holding one block of data
 *
 * \return         0 if successful
 */

Func mbedtls_ripemd160_ret

int mbedtls_ripemd160_ret( const unsigned char *input,
                          size_t ilen,
                          unsigned char output[20] );
/**
 * \brief          Output = RIPEMD-160( input buffer )
 *
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 * \param output   RIPEMD-160 checksum result
 *
 * \return         0 if successful
 */

Func mbedtls_ripemd160_self_test

int mbedtls_ripemd160_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Func mbedtls_rsa_init

void mbedtls_rsa_init( mbedtls_rsa_context *ctx,
                      int padding,
                      int hash_id );
/**
 * \brief          This function initializes an RSA context.
 *
 * \note           Set padding to #MBEDTLS_RSA_PKCS_V21 for the RSAES-OAEP
 *                 encryption scheme and the RSASSA-PSS signature scheme.
 *
 * \note           The \p hash_id parameter is ignored when using
 *                 #MBEDTLS_RSA_PKCS_V15 padding.
 *
 * \note           The choice of padding mode is strictly enforced for private key
 *                 operations, since there might be security concerns in
 *                 mixing padding modes. For public key operations it is
 *                 a default value, which can be overriden by calling specific
 *                 \c rsa_rsaes_xxx or \c rsa_rsassa_xxx functions.
 *
 * \note           The hash selected in \p hash_id is always used for OEAP
 *                 encryption. For PSS signatures, it is always used for
 *                 making signatures, but can be overriden for verifying them.
 *                 If set to #MBEDTLS_MD_NONE, it is always overriden.
 *
 * \param ctx      The RSA context to initialize. This must not be \c NULL.
 * \param padding  The padding mode to use. This must be either
 *                 #MBEDTLS_RSA_PKCS_V15 or #MBEDTLS_RSA_PKCS_V21.
 * \param hash_id  The hash identifier of ::mbedtls_md_type_t type, if
 *                 \p padding is #MBEDTLS_RSA_PKCS_V21. It is unused
 *                 otherwise.
 */

Func mbedtls_rsa_import

int mbedtls_rsa_import( mbedtls_rsa_context *ctx,
                       const mbedtls_mpi *N,
                       const mbedtls_mpi *P, const mbedtls_mpi *Q,
                       const mbedtls_mpi *D, const mbedtls_mpi *E );
/**
 * \brief          This function imports a set of core parameters into an
 *                 RSA context.
 *
 * \note           This function can be called multiple times for successive
 *                 imports, if the parameters are not simultaneously present.
 *
 *                 Any sequence of calls to this function should be followed
 *                 by a call to mbedtls_rsa_complete(), which checks and
 *                 completes the provided information to a ready-for-use
 *                 public or private RSA key.
 *
 * \note           See mbedtls_rsa_complete() for more information on which
 *                 parameters are necessary to set up a private or public
 *                 RSA key.
 *
 * \note           The imported parameters are copied and need not be preserved
 *                 for the lifetime of the RSA context being set up.
 *
 * \param ctx      The initialized RSA context to store the parameters in.
 * \param N        The RSA modulus. This may be \c NULL.
 * \param P        The first prime factor of \p N. This may be \c NULL.
 * \param Q        The second prime factor of \p N. This may be \c NULL.
 * \param D        The private exponent. This may be \c NULL.
 * \param E        The public exponent. This may be \c NULL.
 *
 * \return         \c 0 on success.
 * \return         A non-zero error code on failure.
 */

Func mbedtls_rsa_import_raw

int mbedtls_rsa_import_raw( mbedtls_rsa_context *ctx,
                           unsigned char const *N, size_t N_len,
                           unsigned char const *P, size_t P_len,
                           unsigned char const *Q, size_t Q_len,
                           unsigned char const *D, size_t D_len,
                           unsigned char const *E, size_t E_len );
/**
 * \brief          This function imports core RSA parameters, in raw big-endian
 *                 binary format, into an RSA context.
 *
 * \note           This function can be called multiple times for successive
 *                 imports, if the parameters are not simultaneously present.
 *
 *                 Any sequence of calls to this function should be followed
 *                 by a call to mbedtls_rsa_complete(), which checks and
 *                 completes the provided information to a ready-for-use
 *                 public or private RSA key.
 *
 * \note           See mbedtls_rsa_complete() for more information on which
 *                 parameters are necessary to set up a private or public
 *                 RSA key.
 *
 * \note           The imported parameters are copied and need not be preserved
 *                 for the lifetime of the RSA context being set up.
 *
 * \param ctx      The initialized RSA context to store the parameters in.
 * \param N        The RSA modulus. This may be \c NULL.
 * \param N_len    The Byte length of \p N; it is ignored if \p N == NULL.
 * \param P        The first prime factor of \p N. This may be \c NULL.
 * \param P_len    The Byte length of \p P; it ns ignored if \p P == NULL.
 * \param Q        The second prime factor of \p N. This may be \c NULL.
 * \param Q_len    The Byte length of \p Q; it is ignored if \p Q == NULL.
 * \param D        The private exponent. This may be \c NULL.
 * \param D_len    The Byte length of \p D; it is ignored if \p D == NULL.
 * \param E        The public exponent. This may be \c NULL.
 * \param E_len    The Byte length of \p E; it is ignored if \p E == NULL.
 *
 * \return         \c 0 on success.
 * \return         A non-zero error code on failure.
 */

Func mbedtls_rsa_complete

int mbedtls_rsa_complete( mbedtls_rsa_context *ctx );
/**
 * \brief          This function completes an RSA context from
 *                 a set of imported core parameters.
 *
 *                 To setup an RSA public key, precisely \p N and \p E
 *                 must have been imported.
 *
 *                 To setup an RSA private key, sufficient information must
 *                 be present for the other parameters to be derivable.
 *
 *                 The default implementation supports the following:
 *                 
  • Derive \p P, \p Q from \p N, \p D, \p E.
  • *
  • Derive \p N, \p D from \p P, \p Q, \p E.
* Alternative implementations need not support these. * * If this function runs successfully, it guarantees that * the RSA context can be used for RSA operations without * the risk of failure or crash. * * \warning This function need not perform consistency checks * for the imported parameters. In particular, parameters that * are not needed by the implementation might be silently * discarded and left unchecked. To check the consistency * of the key material, see mbedtls_rsa_check_privkey(). * * \param ctx The initialized RSA context holding imported parameters. * * \return \c 0 on success. * \return #MBEDTLS_ERR_RSA_BAD_INPUT_DATA if the attempted derivations * failed. * */

Func mbedtls_rsa_export

int mbedtls_rsa_export( const mbedtls_rsa_context *ctx,
                       mbedtls_mpi *N, mbedtls_mpi *P, mbedtls_mpi *Q,
                       mbedtls_mpi *D, mbedtls_mpi *E );
/**
 * \brief          This function exports the core parameters of an RSA key.
 *
 *                 If this function runs successfully, the non-NULL buffers
 *                 pointed to by \p N, \p P, \p Q, \p D, and \p E are fully
 *                 written, with additional unused space filled leading by
 *                 zero Bytes.
 *
 *                 Possible reasons for returning
 *                 #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED:
    *
  • An alternative RSA implementation is in use, which * stores the key externally, and either cannot or should * not export it into RAM.
  • *
  • A SW or HW implementation might not support a certain * deduction. For example, \p P, \p Q from \p N, \p D, * and \p E if the former are not part of the * implementation.
* * If the function fails due to an unsupported operation, * the RSA context stays intact and remains usable. * * \param ctx The initialized RSA context. * \param N The MPI to hold the RSA modulus. * This may be \c NULL if this field need not be exported. * \param P The MPI to hold the first prime factor of \p N. * This may be \c NULL if this field need not be exported. * \param Q The MPI to hold the second prime factor of \p N. * This may be \c NULL if this field need not be exported. * \param D The MPI to hold the private exponent. * This may be \c NULL if this field need not be exported. * \param E The MPI to hold the public exponent. * This may be \c NULL if this field need not be exported. * * \return \c 0 on success. * \return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED if exporting the * requested parameters cannot be done due to missing * functionality or because of security policies. * \return A non-zero return code on any other failure. * */

Func mbedtls_rsa_export_raw

int mbedtls_rsa_export_raw( const mbedtls_rsa_context *ctx,
                           unsigned char *N, size_t N_len,
                           unsigned char *P, size_t P_len,
                           unsigned char *Q, size_t Q_len,
                           unsigned char *D, size_t D_len,
                           unsigned char *E, size_t E_len );
/**
 * \brief          This function exports core parameters of an RSA key
 *                 in raw big-endian binary format.
 *
 *                 If this function runs successfully, the non-NULL buffers
 *                 pointed to by \p N, \p P, \p Q, \p D, and \p E are fully
 *                 written, with additional unused space filled leading by
 *                 zero Bytes.
 *
 *                 Possible reasons for returning
 *                 #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED:
    *
  • An alternative RSA implementation is in use, which * stores the key externally, and either cannot or should * not export it into RAM.
  • *
  • A SW or HW implementation might not support a certain * deduction. For example, \p P, \p Q from \p N, \p D, * and \p E if the former are not part of the * implementation.
* If the function fails due to an unsupported operation, * the RSA context stays intact and remains usable. * * \note The length parameters are ignored if the corresponding * buffer pointers are NULL. * * \param ctx The initialized RSA context. * \param N The Byte array to store the RSA modulus, * or \c NULL if this field need not be exported. * \param N_len The size of the buffer for the modulus. * \param P The Byte array to hold the first prime factor of \p N, * or \c NULL if this field need not be exported. * \param P_len The size of the buffer for the first prime factor. * \param Q The Byte array to hold the second prime factor of \p N, * or \c NULL if this field need not be exported. * \param Q_len The size of the buffer for the second prime factor. * \param D The Byte array to hold the private exponent, * or \c NULL if this field need not be exported. * \param D_len The size of the buffer for the private exponent. * \param E The Byte array to hold the public exponent, * or \c NULL if this field need not be exported. * \param E_len The size of the buffer for the public exponent. * * \return \c 0 on success. * \return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED if exporting the * requested parameters cannot be done due to missing * functionality or because of security policies. * \return A non-zero return code on any other failure. */

Func mbedtls_rsa_export_crt

int mbedtls_rsa_export_crt( const mbedtls_rsa_context *ctx,
                           mbedtls_mpi *DP, mbedtls_mpi *DQ, mbedtls_mpi *QP );
/**
 * \brief          This function exports CRT parameters of a private RSA key.
 *
 * \note           Alternative RSA implementations not using CRT-parameters
 *                 internally can implement this function based on
 *                 mbedtls_rsa_deduce_opt().
 *
 * \param ctx      The initialized RSA context.
 * \param DP       The MPI to hold \c D modulo `P-1`,
 *                 or \c NULL if it need not be exported.
 * \param DQ       The MPI to hold \c D modulo `Q-1`,
 *                 or \c NULL if it need not be exported.
 * \param QP       The MPI to hold modular inverse of \c Q modulo \c P,
 *                 or \c NULL if it need not be exported.
 *
 * \return         \c 0 on success.
 * \return         A non-zero error code on failure.
 *
 */

Func mbedtls_rsa_set_padding

void mbedtls_rsa_set_padding( mbedtls_rsa_context *ctx, int padding,
                             int hash_id );
/**
 * \brief          This function sets padding for an already initialized RSA
 *                 context. See mbedtls_rsa_init() for details.
 *
 * \param ctx      The initialized RSA context to be configured.
 * \param padding  The padding mode to use. This must be either
 *                 #MBEDTLS_RSA_PKCS_V15 or #MBEDTLS_RSA_PKCS_V21.
 * \param hash_id  The #MBEDTLS_RSA_PKCS_V21 hash identifier.
 */

Func mbedtls_rsa_get_len

size_t mbedtls_rsa_get_len( const mbedtls_rsa_context *ctx );
/**
 * \brief          This function retrieves the length of RSA modulus in Bytes.
 *
 * \param ctx      The initialized RSA context.
 *
 * \return         The length of the RSA modulus in Bytes.
 *
 */

Func mbedtls_rsa_gen_key

int mbedtls_rsa_gen_key( mbedtls_rsa_context *ctx,
                        int (*f_rng)(void *, unsigned char *, size_t),
                        void *p_rng,
                        unsigned int nbits, int exponent );
/**
 * \brief          This function generates an RSA keypair.
 *
 * \note           mbedtls_rsa_init() must be called before this function,
 *                 to set up the RSA context.
 *
 * \param ctx      The initialized RSA context used to hold the key.
 * \param f_rng    The RNG function to be used for key generation.
 *                 This must not be \c NULL.
 * \param p_rng    The RNG context to be passed to \p f_rng.
 *                 This may be \c NULL if \p f_rng doesn't need a context.
 * \param nbits    The size of the public key in bits.
 * \param exponent The public exponent to use. For example, \c 65537.
 *                 This must be odd and greater than \c 1.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_check_pubkey

int mbedtls_rsa_check_pubkey( const mbedtls_rsa_context *ctx );
/**
 * \brief          This function checks if a context contains at least an RSA
 *                 public key.
 *
 *                 If the function runs successfully, it is guaranteed that
 *                 enough information is present to perform an RSA public key
 *                 operation using mbedtls_rsa_public().
 *
 * \param ctx      The initialized RSA context to check.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 *
 */

Func mbedtls_rsa_check_privkey

int mbedtls_rsa_check_privkey( const mbedtls_rsa_context *ctx );
/**
 * \brief      This function checks if a context contains an RSA private key
 *             and perform basic consistency checks.
 *
 * \note       The consistency checks performed by this function not only
 *             ensure that mbedtls_rsa_private() can be called successfully
 *             on the given context, but that the various parameters are
 *             mutually consistent with high probability, in the sense that
 *             mbedtls_rsa_public() and mbedtls_rsa_private() are inverses.
 *
 * \warning    This function should catch accidental misconfigurations
 *             like swapping of parameters, but it cannot establish full
 *             trust in neither the quality nor the consistency of the key
 *             material that was used to setup the given RSA context:
 *             
  • Consistency: Imported parameters that are irrelevant * for the implementation might be silently dropped. If dropped, * the current function does not have access to them, * and therefore cannot check them. See mbedtls_rsa_complete(). * If you want to check the consistency of the entire * content of an PKCS1-encoded RSA private key, for example, you * should use mbedtls_rsa_validate_params() before setting * up the RSA context. * Additionally, if the implementation performs empirical checks, * these checks substantiate but do not guarantee consistency.
  • *
  • Quality: This function is not expected to perform * extended quality assessments like checking that the prime * factors are safe. Additionally, it is the responsibility of the * user to ensure the trustworthiness of the source of his RSA * parameters, which goes beyond what is effectively checkable * by the library.
* * \param ctx The initialized RSA context to check. * * \return \c 0 on success. * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. */

Func mbedtls_rsa_check_pub_priv

int mbedtls_rsa_check_pub_priv( const mbedtls_rsa_context *pub,
                               const mbedtls_rsa_context *prv );
/**
 * \brief          This function checks a public-private RSA key pair.
 *
 *                 It checks each of the contexts, and makes sure they match.
 *
 * \param pub      The initialized RSA context holding the public key.
 * \param prv      The initialized RSA context holding the private key.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_public

int mbedtls_rsa_public( mbedtls_rsa_context *ctx,
               const unsigned char *input,
               unsigned char *output );
/**
 * \brief          This function performs an RSA public key operation.
 *
 * \param ctx      The initialized RSA context to use.
 * \param input    The input buffer. This must be a readable buffer
 *                 of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 * \param output   The output buffer. This must be a writable buffer
 *                 of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \note           This function does not handle message padding.
 *
 * \note           Make sure to set \p input[0] = 0 or ensure that
 *                 input is smaller than \p N.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_private

int mbedtls_rsa_private( mbedtls_rsa_context *ctx,
                int (*f_rng)(void *, unsigned char *, size_t),
                void *p_rng,
                const unsigned char *input,
                unsigned char *output );
/**
 * \brief          This function performs an RSA private key operation.
 *
 * \note           Blinding is used if and only if a PRNG is provided.
 *
 * \note           If blinding is used, both the base of exponentation
 *                 and the exponent are blinded, providing protection
 *                 against some side-channel attacks.
 *
 * \warning        It is deprecated and a security risk to not provide
 *                 a PRNG here and thereby prevent the use of blinding.
 *                 Future versions of the library may enforce the presence
 *                 of a PRNG.
 *
 * \param ctx      The initialized RSA context to use.
 * \param f_rng    The RNG function, used for blinding. It is discouraged
 *                 and deprecated to pass \c NULL here, in which case
 *                 blinding will be omitted.
 * \param p_rng    The RNG context to pass to \p f_rng. This may be \c NULL
 *                 if \p f_rng is \c NULL or if \p f_rng doesn't need a context.
 * \param input    The input buffer. This must be a readable buffer
 *                 of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 * \param output   The output buffer. This must be a writable buffer
 *                 of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 *
 */

Func mbedtls_rsa_pkcs1_encrypt

int mbedtls_rsa_pkcs1_encrypt( mbedtls_rsa_context *ctx,
                      int (*f_rng)(void *, unsigned char *, size_t),
                      void *p_rng,
                      int mode, size_t ilen,
                      const unsigned char *input,
                      unsigned char *output );
/**
 * \brief          This function adds the message padding, then performs an RSA
 *                 operation.
 *
 *                 It is the generic wrapper for performing a PKCS#1 encryption
 *                 operation using the \p mode from the context.
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 implicitly set to #MBEDTLS_RSA_PUBLIC.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PRIVATE and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA context to use.
 * \param f_rng    The RNG to use. It is mandatory for PKCS#1 v2.1 padding
 *                 encoding, and for PKCS#1 v1.5 padding encoding when used
 *                 with \p mode set to #MBEDTLS_RSA_PUBLIC. For PKCS#1 v1.5
 *                 padding encoding and \p mode set to #MBEDTLS_RSA_PRIVATE,
 *                 it is used for blinding and should be provided in this
 *                 case; see mbedtls_rsa_private() for more.
 * \param p_rng    The RNG context to be passed to \p f_rng. May be
 *                 \c NULL if \p f_rng is \c NULL or if \p f_rng doesn't
 *                 need a context argument.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
 * \param ilen     The length of the plaintext in Bytes.
 * \param input    The input data to encrypt. This must be a readable
 *                 buffer of size \p ilen Bytes. This must not be \c NULL.
 * \param output   The output buffer. This must be a writable buffer
 *                 of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_rsaes_pkcs1_v15_encrypt

int mbedtls_rsa_rsaes_pkcs1_v15_encrypt( mbedtls_rsa_context *ctx,
                                int (*f_rng)(void *, unsigned char *, size_t),
                                void *p_rng,
                                int mode, size_t ilen,
                                const unsigned char *input,
                                unsigned char *output );
/**
 * \brief          This function performs a PKCS#1 v1.5 encryption operation
 *                 (RSAES-PKCS1-v1_5-ENCRYPT).
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 implicitly set to #MBEDTLS_RSA_PUBLIC.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PRIVATE and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA context to use.
 * \param f_rng    The RNG function to use. It is needed for padding generation
 *                 if \p mode is #MBEDTLS_RSA_PUBLIC. If \p mode is
 *                 #MBEDTLS_RSA_PRIVATE (discouraged), it is used for
 *                 blinding and should be provided; see mbedtls_rsa_private().
 * \param p_rng    The RNG context to be passed to \p f_rng. This may
 *                 be \c NULL if \p f_rng is \c NULL or if \p f_rng
 *                 doesn't need a context argument.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
 * \param ilen     The length of the plaintext in Bytes.
 * \param input    The input data to encrypt. This must be a readable
 *                 buffer of size \p ilen Bytes. This must not be \c NULL.
 * \param output   The output buffer. This must be a writable buffer
 *                 of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_rsaes_oaep_encrypt

int mbedtls_rsa_rsaes_oaep_encrypt( mbedtls_rsa_context *ctx,
                           int (*f_rng)(void *, unsigned char *, size_t),
                           void *p_rng,
                           int mode,
                           const unsigned char *label, size_t label_len,
                           size_t ilen,
                           const unsigned char *input,
                           unsigned char *output );
/**
 * \brief            This function performs a PKCS#1 v2.1 OAEP encryption
 *                   operation (RSAES-OAEP-ENCRYPT).
 *
 * \note             The output buffer must be as large as the size
 *                   of ctx->N. For example, 128 Bytes if RSA-1024 is used.
 *
 * \deprecated       It is deprecated and discouraged to call this function
 *                   in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library
 *                   are likely to remove the \p mode argument and have it
 *                   implicitly set to #MBEDTLS_RSA_PUBLIC.
 *
 * \note             Alternative implementations of RSA need not support
 *                   mode being set to #MBEDTLS_RSA_PRIVATE and might instead
 *                   return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx        The initnialized RSA context to use.
 * \param f_rng      The RNG function to use. This is needed for padding
 *                   generation and must be provided.
 * \param p_rng      The RNG context to be passed to \p f_rng. This may
 *                   be \c NULL if \p f_rng doesn't need a context argument.
 * \param mode       The mode of operation. This must be either
 *                   #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
 * \param label      The buffer holding the custom label to use.
 *                   This must be a readable buffer of length \p label_len
 *                   Bytes. It may be \c NULL if \p label_len is \c 0.
 * \param label_len  The length of the label in Bytes.
 * \param ilen       The length of the plaintext buffer \p input in Bytes.
 * \param input      The input data to encrypt. This must be a readable
 *                   buffer of size \p ilen Bytes. This must not be \c NULL.
 * \param output     The output buffer. This must be a writable buffer
 *                   of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                   for an 2048-bit RSA modulus.
 *
 * \return           \c 0 on success.
 * \return           An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_pkcs1_decrypt

int mbedtls_rsa_pkcs1_decrypt( mbedtls_rsa_context *ctx,
                      int (*f_rng)(void *, unsigned char *, size_t),
                      void *p_rng,
                      int mode, size_t *olen,
                      const unsigned char *input,
                      unsigned char *output,
                      size_t output_max_len );
/**
 * \brief          This function performs an RSA operation, then removes the
 *                 message padding.
 *
 *                 It is the generic wrapper for performing a PKCS#1 decryption
 *                 operation using the \p mode from the context.
 *
 * \note           The output buffer length \c output_max_len should be
 *                 as large as the size \p ctx->len of \p ctx->N (for example,
 *                 128 Bytes if RSA-1024 is used) to be able to hold an
 *                 arbitrary decrypted message. If it is not large enough to
 *                 hold the decryption of the particular ciphertext provided,
 *                 the function returns \c MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE.
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 implicitly set to #MBEDTLS_RSA_PRIVATE.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PUBLIC and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA context to use.
 * \param f_rng    The RNG function. If \p mode is #MBEDTLS_RSA_PRIVATE,
 *                 this is used for blinding and should be provided; see
 *                 mbedtls_rsa_private() for more. If \p mode is
 *                 #MBEDTLS_RSA_PUBLIC, it is ignored.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng is \c NULL or doesn't need a context.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated).
 * \param olen     The address at which to store the length of
 *                 the plaintext. This must not be \c NULL.
 * \param input    The ciphertext buffer. This must be a readable buffer
 *                 of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 * \param output   The buffer used to hold the plaintext. This must
 *                 be a writable buffer of length \p output_max_len Bytes.
 * \param output_max_len The length in Bytes of the output buffer \p output.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_rsaes_pkcs1_v15_decrypt

int mbedtls_rsa_rsaes_pkcs1_v15_decrypt( mbedtls_rsa_context *ctx,
                                int (*f_rng)(void *, unsigned char *, size_t),
                                void *p_rng,
                                int mode, size_t *olen,
                                const unsigned char *input,
                                unsigned char *output,
                                size_t output_max_len );
/**
 * \brief          This function performs a PKCS#1 v1.5 decryption
 *                 operation (RSAES-PKCS1-v1_5-DECRYPT).
 *
 * \note           The output buffer length \c output_max_len should be
 *                 as large as the size \p ctx->len of \p ctx->N, for example,
 *                 128 Bytes if RSA-1024 is used, to be able to hold an
 *                 arbitrary decrypted message. If it is not large enough to
 *                 hold the decryption of the particular ciphertext provided,
 *                 the function returns #MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE.
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 implicitly set to #MBEDTLS_RSA_PRIVATE.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PUBLIC and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA context to use.
 * \param f_rng    The RNG function. If \p mode is #MBEDTLS_RSA_PRIVATE,
 *                 this is used for blinding and should be provided; see
 *                 mbedtls_rsa_private() for more. If \p mode is
 *                 #MBEDTLS_RSA_PUBLIC, it is ignored.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng is \c NULL or doesn't need a context.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated).
 * \param olen     The address at which to store the length of
 *                 the plaintext. This must not be \c NULL.
 * \param input    The ciphertext buffer. This must be a readable buffer
 *                 of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 * \param output   The buffer used to hold the plaintext. This must
 *                 be a writable buffer of length \p output_max_len Bytes.
 * \param output_max_len The length in Bytes of the output buffer \p output.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 *
 */

Func mbedtls_rsa_rsaes_oaep_decrypt

int mbedtls_rsa_rsaes_oaep_decrypt( mbedtls_rsa_context *ctx,
                           int (*f_rng)(void *, unsigned char *, size_t),
                           void *p_rng,
                           int mode,
                           const unsigned char *label, size_t label_len,
                           size_t *olen,
                           const unsigned char *input,
                           unsigned char *output,
                           size_t output_max_len );
/**
 * \brief            This function performs a PKCS#1 v2.1 OAEP decryption
 *                   operation (RSAES-OAEP-DECRYPT).
 *
 * \note             The output buffer length \c output_max_len should be
 *                   as large as the size \p ctx->len of \p ctx->N, for
 *                   example, 128 Bytes if RSA-1024 is used, to be able to
 *                   hold an arbitrary decrypted message. If it is not
 *                   large enough to hold the decryption of the particular
 *                   ciphertext provided, the function returns
 *                   #MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE.
 *
 * \deprecated       It is deprecated and discouraged to call this function
 *                   in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library
 *                   are likely to remove the \p mode argument and have it
 *                   implicitly set to #MBEDTLS_RSA_PRIVATE.
 *
 * \note             Alternative implementations of RSA need not support
 *                   mode being set to #MBEDTLS_RSA_PUBLIC and might instead
 *                   return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx        The initialized RSA context to use.
 * \param f_rng      The RNG function. If \p mode is #MBEDTLS_RSA_PRIVATE,
 *                   this is used for blinding and should be provided; see
 *                   mbedtls_rsa_private() for more. If \p mode is
 *                   #MBEDTLS_RSA_PUBLIC, it is ignored.
 * \param p_rng      The RNG context to be passed to \p f_rng. This may be
 *                   \c NULL if \p f_rng is \c NULL or doesn't need a context.
 * \param mode       The mode of operation. This must be either
 *                   #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated).
 * \param label      The buffer holding the custom label to use.
 *                   This must be a readable buffer of length \p label_len
 *                   Bytes. It may be \c NULL if \p label_len is \c 0.
 * \param label_len  The length of the label in Bytes.
 * \param olen       The address at which to store the length of
 *                   the plaintext. This must not be \c NULL.
 * \param input      The ciphertext buffer. This must be a readable buffer
 *                   of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                   for an 2048-bit RSA modulus.
 * \param output     The buffer used to hold the plaintext. This must
 *                   be a writable buffer of length \p output_max_len Bytes.
 * \param output_max_len The length in Bytes of the output buffer \p output.
 *
 * \return         \c 0 on success.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_pkcs1_sign

int mbedtls_rsa_pkcs1_sign( mbedtls_rsa_context *ctx,
                   int (*f_rng)(void *, unsigned char *, size_t),
                   void *p_rng,
                   int mode,
                   mbedtls_md_type_t md_alg,
                   unsigned int hashlen,
                   const unsigned char *hash,
                   unsigned char *sig );
/**
 * \brief          This function performs a private RSA operation to sign
 *                 a message digest using PKCS#1.
 *
 *                 It is the generic wrapper for performing a PKCS#1
 *                 signature using the \p mode from the context.
 *
 * \note           The \p sig buffer must be as large as the size
 *                 of \p ctx->N. For example, 128 Bytes if RSA-1024 is used.
 *
 * \note           For PKCS#1 v2.1 encoding, see comments on
 *                 mbedtls_rsa_rsassa_pss_sign() for details on
 *                 \p md_alg and \p hash_id.
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 implicitly set to #MBEDTLS_RSA_PRIVATE.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PUBLIC and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA context to use.
 * \param f_rng    The RNG function to use. If the padding mode is PKCS#1 v2.1,
 *                 this must be provided. If the padding mode is PKCS#1 v1.5 and
 *                 \p mode is #MBEDTLS_RSA_PRIVATE, it is used for blinding
 *                 and should be provided; see mbedtls_rsa_private() for more
 *                 more. It is ignored otherwise.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be \c NULL
 *                 if \p f_rng is \c NULL or doesn't need a context argument.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated).
 * \param md_alg   The message-digest algorithm used to hash the original data.
 *                 Use #MBEDTLS_MD_NONE for signing raw data.
 * \param hashlen  The length of the message digest.
 *                 Ths is only used if \p md_alg is #MBEDTLS_MD_NONE.
 * \param hash     The buffer holding the message digest or raw data.
 *                 If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable
 *                 buffer of length \p hashlen Bytes. If \p md_alg is not
 *                 #MBEDTLS_MD_NONE, it must be a readable buffer of length
 *                 the size of the hash corresponding to \p md_alg.
 * \param sig      The buffer to hold the signature. This must be a writable
 *                 buffer of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 if the signing operation was successful.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_rsassa_pkcs1_v15_sign

int mbedtls_rsa_rsassa_pkcs1_v15_sign( mbedtls_rsa_context *ctx,
                              int (*f_rng)(void *, unsigned char *, size_t),
                              void *p_rng,
                              int mode,
                              mbedtls_md_type_t md_alg,
                              unsigned int hashlen,
                              const unsigned char *hash,
                              unsigned char *sig );
/**
 * \brief          This function performs a PKCS#1 v1.5 signature
 *                 operation (RSASSA-PKCS1-v1_5-SIGN).
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 implicitly set to #MBEDTLS_RSA_PRIVATE.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PUBLIC and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA context to use.
 * \param f_rng    The RNG function. If \p mode is #MBEDTLS_RSA_PRIVATE,
 *                 this is used for blinding and should be provided; see
 *                 mbedtls_rsa_private() for more. If \p mode is
 *                 #MBEDTLS_RSA_PUBLIC, it is ignored.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be \c NULL
 *                 if \p f_rng is \c NULL or doesn't need a context argument.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated).
 * \param md_alg   The message-digest algorithm used to hash the original data.
 *                 Use #MBEDTLS_MD_NONE for signing raw data.
 * \param hashlen  The length of the message digest.
 *                 Ths is only used if \p md_alg is #MBEDTLS_MD_NONE.
 * \param hash     The buffer holding the message digest or raw data.
 *                 If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable
 *                 buffer of length \p hashlen Bytes. If \p md_alg is not
 *                 #MBEDTLS_MD_NONE, it must be a readable buffer of length
 *                 the size of the hash corresponding to \p md_alg.
 * \param sig      The buffer to hold the signature. This must be a writable
 *                 buffer of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 if the signing operation was successful.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_rsassa_pss_sign

int mbedtls_rsa_rsassa_pss_sign( mbedtls_rsa_context *ctx,
                        int (*f_rng)(void *, unsigned char *, size_t),
                        void *p_rng,
                        int mode,
                        mbedtls_md_type_t md_alg,
                        unsigned int hashlen,
                        const unsigned char *hash,
                        unsigned char *sig );
/**
 * \brief          This function performs a PKCS#1 v2.1 PSS signature
 *                 operation (RSASSA-PSS-SIGN).
 *
 * \note           The \p hash_id in the RSA context is the one used for the
 *                 encoding. \p md_alg in the function call is the type of hash
 *                 that is encoded. According to RFC-3447: Public-Key
 *                 Cryptography Standards (PKCS) #1 v2.1: RSA Cryptography
 *                 Specifications it is advised to keep both hashes the
 *                 same.
 *
 * \note           This function always uses the maximum possible salt size,
 *                 up to the length of the payload hash. This choice of salt
 *                 size complies with FIPS 186-4 §5.5 (e) and RFC 8017 (PKCS#1
 *                 v2.2) §9.1.1 step 3. Furthermore this function enforces a
 *                 minimum salt size which is the hash size minus 2 bytes. If
 *                 this minimum size is too large given the key size (the salt
 *                 size, plus the hash size, plus 2 bytes must be no more than
 *                 the key size in bytes), this function returns
 *                 #MBEDTLS_ERR_RSA_BAD_INPUT_DATA.
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 implicitly set to #MBEDTLS_RSA_PRIVATE.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PUBLIC and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA context to use.
 * \param f_rng    The RNG function. It must not be \c NULL.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be \c NULL
 *                 if \p f_rng doesn't need a context argument.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated).
 * \param md_alg   The message-digest algorithm used to hash the original data.
 *                 Use #MBEDTLS_MD_NONE for signing raw data.
 * \param hashlen  The length of the message digest.
 *                 Ths is only used if \p md_alg is #MBEDTLS_MD_NONE.
 * \param hash     The buffer holding the message digest or raw data.
 *                 If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable
 *                 buffer of length \p hashlen Bytes. If \p md_alg is not
 *                 #MBEDTLS_MD_NONE, it must be a readable buffer of length
 *                 the size of the hash corresponding to \p md_alg.
 * \param sig      The buffer to hold the signature. This must be a writable
 *                 buffer of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 if the signing operation was successful.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_pkcs1_verify

int mbedtls_rsa_pkcs1_verify( mbedtls_rsa_context *ctx,
                     int (*f_rng)(void *, unsigned char *, size_t),
                     void *p_rng,
                     int mode,
                     mbedtls_md_type_t md_alg,
                     unsigned int hashlen,
                     const unsigned char *hash,
                     const unsigned char *sig );
/**
 * \brief          This function performs a public RSA operation and checks
 *                 the message digest.
 *
 *                 This is the generic wrapper for performing a PKCS#1
 *                 verification using the mode from the context.
 *
 * \note           For PKCS#1 v2.1 encoding, see comments on
 *                 mbedtls_rsa_rsassa_pss_verify() about \p md_alg and
 *                 \p hash_id.
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 set to #MBEDTLS_RSA_PUBLIC.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PRIVATE and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA public key context to use.
 * \param f_rng    The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
 *                 this is used for blinding and should be provided; see
 *                 mbedtls_rsa_private() for more. Otherwise, it is ignored.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng is \c NULL or doesn't need a context.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
 * \param md_alg   The message-digest algorithm used to hash the original data.
 *                 Use #MBEDTLS_MD_NONE for signing raw data.
 * \param hashlen  The length of the message digest.
 *                 This is only used if \p md_alg is #MBEDTLS_MD_NONE.
 * \param hash     The buffer holding the message digest or raw data.
 *                 If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable
 *                 buffer of length \p hashlen Bytes. If \p md_alg is not
 *                 #MBEDTLS_MD_NONE, it must be a readable buffer of length
 *                 the size of the hash corresponding to \p md_alg.
 * \param sig      The buffer holding the signature. This must be a readable
 *                 buffer of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 if the verify operation was successful.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_rsassa_pkcs1_v15_verify

int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx,
                                int (*f_rng)(void *, unsigned char *, size_t),
                                void *p_rng,
                                int mode,
                                mbedtls_md_type_t md_alg,
                                unsigned int hashlen,
                                const unsigned char *hash,
                                const unsigned char *sig );
/**
 * \brief          This function performs a PKCS#1 v1.5 verification
 *                 operation (RSASSA-PKCS1-v1_5-VERIFY).
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 set to #MBEDTLS_RSA_PUBLIC.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PRIVATE and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA public key context to use.
 * \param f_rng    The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
 *                 this is used for blinding and should be provided; see
 *                 mbedtls_rsa_private() for more. Otherwise, it is ignored.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng is \c NULL or doesn't need a context.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
 * \param md_alg   The message-digest algorithm used to hash the original data.
 *                 Use #MBEDTLS_MD_NONE for signing raw data.
 * \param hashlen  The length of the message digest.
 *                 This is only used if \p md_alg is #MBEDTLS_MD_NONE.
 * \param hash     The buffer holding the message digest or raw data.
 *                 If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable
 *                 buffer of length \p hashlen Bytes. If \p md_alg is not
 *                 #MBEDTLS_MD_NONE, it must be a readable buffer of length
 *                 the size of the hash corresponding to \p md_alg.
 * \param sig      The buffer holding the signature. This must be a readable
 *                 buffer of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 if the verify operation was successful.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_rsassa_pss_verify

int mbedtls_rsa_rsassa_pss_verify( mbedtls_rsa_context *ctx,
                          int (*f_rng)(void *, unsigned char *, size_t),
                          void *p_rng,
                          int mode,
                          mbedtls_md_type_t md_alg,
                          unsigned int hashlen,
                          const unsigned char *hash,
                          const unsigned char *sig );
/**
 * \brief          This function performs a PKCS#1 v2.1 PSS verification
 *                 operation (RSASSA-PSS-VERIFY).
 *
 *                 The hash function for the MGF mask generating function
 *                 is that specified in the RSA context.
 *
 * \note           The \p hash_id in the RSA context is the one used for the
 *                 verification. \p md_alg in the function call is the type of
 *                 hash that is verified. According to RFC-3447: Public-Key
 *                 Cryptography Standards (PKCS) #1 v2.1: RSA Cryptography
 *                 Specifications it is advised to keep both hashes the
 *                 same. If \p hash_id in the RSA context is unset,
 *                 the \p md_alg from the function call is used.
 *
 * \deprecated     It is deprecated and discouraged to call this function
 *                 in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library
 *                 are likely to remove the \p mode argument and have it
 *                 implicitly set to #MBEDTLS_RSA_PUBLIC.
 *
 * \note           Alternative implementations of RSA need not support
 *                 mode being set to #MBEDTLS_RSA_PRIVATE and might instead
 *                 return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
 *
 * \param ctx      The initialized RSA public key context to use.
 * \param f_rng    The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
 *                 this is used for blinding and should be provided; see
 *                 mbedtls_rsa_private() for more. Otherwise, it is ignored.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng is \c NULL or doesn't need a context.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
 * \param md_alg   The message-digest algorithm used to hash the original data.
 *                 Use #MBEDTLS_MD_NONE for signing raw data.
 * \param hashlen  The length of the message digest.
 *                 This is only used if \p md_alg is #MBEDTLS_MD_NONE.
 * \param hash     The buffer holding the message digest or raw data.
 *                 If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable
 *                 buffer of length \p hashlen Bytes. If \p md_alg is not
 *                 #MBEDTLS_MD_NONE, it must be a readable buffer of length
 *                 the size of the hash corresponding to \p md_alg.
 * \param sig      The buffer holding the signature. This must be a readable
 *                 buffer of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 if the verify operation was successful.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_rsassa_pss_verify_ext

int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx,
                              int (*f_rng)(void *, unsigned char *, size_t),
                              void *p_rng,
                              int mode,
                              mbedtls_md_type_t md_alg,
                              unsigned int hashlen,
                              const unsigned char *hash,
                              mbedtls_md_type_t mgf1_hash_id,
                              int expected_salt_len,
                              const unsigned char *sig );
/**
 * \brief          This function performs a PKCS#1 v2.1 PSS verification
 *                 operation (RSASSA-PSS-VERIFY).
 *
 *                 The hash function for the MGF mask generating function
 *                 is that specified in \p mgf1_hash_id.
 *
 * \note           The \p sig buffer must be as large as the size
 *                 of \p ctx->N. For example, 128 Bytes if RSA-1024 is used.
 *
 * \note           The \p hash_id in the RSA context is ignored.
 *
 * \param ctx      The initialized RSA public key context to use.
 * \param f_rng    The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
 *                 this is used for blinding and should be provided; see
 *                 mbedtls_rsa_private() for more. Otherwise, it is ignored.
 * \param p_rng    The RNG context to be passed to \p f_rng. This may be
 *                 \c NULL if \p f_rng is \c NULL or doesn't need a context.
 * \param mode     The mode of operation. This must be either
 *                 #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE.
 * \param md_alg   The message-digest algorithm used to hash the original data.
 *                 Use #MBEDTLS_MD_NONE for signing raw data.
 * \param hashlen  The length of the message digest.
 *                 This is only used if \p md_alg is #MBEDTLS_MD_NONE.
 * \param hash     The buffer holding the message digest or raw data.
 *                 If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable
 *                 buffer of length \p hashlen Bytes. If \p md_alg is not
 *                 #MBEDTLS_MD_NONE, it must be a readable buffer of length
 *                 the size of the hash corresponding to \p md_alg.
 * \param mgf1_hash_id      The message digest used for mask generation.
 * \param expected_salt_len The length of the salt used in padding. Use
 *                          #MBEDTLS_RSA_SALT_LEN_ANY to accept any salt length.
 * \param sig      The buffer holding the signature. This must be a readable
 *                 buffer of length \c ctx->len Bytes. For example, \c 256 Bytes
 *                 for an 2048-bit RSA modulus.
 *
 * \return         \c 0 if the verify operation was successful.
 * \return         An \c MBEDTLS_ERR_RSA_XXX error code on failure.
 */

Func mbedtls_rsa_copy

int mbedtls_rsa_copy( mbedtls_rsa_context *dst, const mbedtls_rsa_context *src );
/**
 * \brief          This function copies the components of an RSA context.
 *
 * \param dst      The destination context. This must be initialized.
 * \param src      The source context. This must be initialized.
 *
 * \return         \c 0 on success.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory allocation failure.
 */

Func mbedtls_rsa_free

void mbedtls_rsa_free( mbedtls_rsa_context *ctx );
/**
 * \brief          This function frees the components of an RSA key.
 *
 * \param ctx      The RSA context to free. May be \c NULL, in which case
 *                 this function is a no-op. If it is not \c NULL, it must
 *                 point to an initialized RSA context.
 */

Func mbedtls_rsa_self_test

int mbedtls_rsa_self_test( int verbose );
/**
 * \brief          The RSA checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_rsa_deduce_primes

int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *E,
                              mbedtls_mpi const *D,
                              mbedtls_mpi *P, mbedtls_mpi *Q );
/**
 * \brief          Compute RSA prime moduli P, Q from public modulus N=PQ
 *                 and a pair of private and public key.
 *
 * \note           This is a 'static' helper function not operating on
 *                 an RSA context. Alternative implementations need not
 *                 overwrite it.
 *
 * \param N        RSA modulus N = PQ, with P, Q to be found
 * \param E        RSA public exponent
 * \param D        RSA private exponent
 * \param P        Pointer to MPI holding first prime factor of N on success
 * \param Q        Pointer to MPI holding second prime factor of N on success
 *
 * \return
 *                 - 0 if successful. In this case, P and Q constitute a
 *                   factorization of N.
 *                 - A non-zero error code otherwise.
 *
 * \note           It is neither checked that P, Q are prime nor that
 *                 D, E are modular inverses wrt. P-1 and Q-1. For that,
 *                 use the helper function \c mbedtls_rsa_validate_params.
 *
 */

Func mbedtls_rsa_deduce_private_exponent

int mbedtls_rsa_deduce_private_exponent( mbedtls_mpi const *P,
                                        mbedtls_mpi const *Q,
                                        mbedtls_mpi const *E,
                                        mbedtls_mpi *D );
/**
 * \brief          Compute RSA private exponent from
 *                 prime moduli and public key.
 *
 * \note           This is a 'static' helper function not operating on
 *                 an RSA context. Alternative implementations need not
 *                 overwrite it.
 *
 * \param P        First prime factor of RSA modulus
 * \param Q        Second prime factor of RSA modulus
 * \param E        RSA public exponent
 * \param D        Pointer to MPI holding the private exponent on success.
 *
 * \return
 *                 - 0 if successful. In this case, D is set to a simultaneous
 *                   modular inverse of E modulo both P-1 and Q-1.
 *                 - A non-zero error code otherwise.
 *
 * \note           This function does not check whether P and Q are primes.
 *
 */

Func mbedtls_rsa_deduce_crt

int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
                           const mbedtls_mpi *D, mbedtls_mpi *DP,
                           mbedtls_mpi *DQ, mbedtls_mpi *QP );
/**
 * \brief          Generate RSA-CRT parameters
 *
 * \note           This is a 'static' helper function not operating on
 *                 an RSA context. Alternative implementations need not
 *                 overwrite it.
 *
 * \param P        First prime factor of N
 * \param Q        Second prime factor of N
 * \param D        RSA private exponent
 * \param DP       Output variable for D modulo P-1
 * \param DQ       Output variable for D modulo Q-1
 * \param QP       Output variable for the modular inverse of Q modulo P.
 *
 * \return         0 on success, non-zero error code otherwise.
 *
 * \note           This function does not check whether P, Q are
 *                 prime and whether D is a valid private exponent.
 *
 */

Func mbedtls_rsa_validate_params

int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P,
                                const mbedtls_mpi *Q, const mbedtls_mpi *D,
                                const mbedtls_mpi *E,
                                int (*f_rng)(void *, unsigned char *, size_t),
                                void *p_rng );
/**
 * \brief          Check validity of core RSA parameters
 *
 * \note           This is a 'static' helper function not operating on
 *                 an RSA context. Alternative implementations need not
 *                 overwrite it.
 *
 * \param N        RSA modulus N = PQ
 * \param P        First prime factor of N
 * \param Q        Second prime factor of N
 * \param D        RSA private exponent
 * \param E        RSA public exponent
 * \param f_rng    PRNG to be used for primality check, or NULL
 * \param p_rng    PRNG context for f_rng, or NULL
 *
 * \return
 *                 - 0 if the following conditions are satisfied
 *                   if all relevant parameters are provided:
 *                    - P prime if f_rng != NULL (%)
 *                    - Q prime if f_rng != NULL (%)
 *                    - 1 < N = P * Q
 *                    - 1 < D, E < N
 *                    - D and E are modular inverses modulo P-1 and Q-1
 *                   (%) This is only done if MBEDTLS_GENPRIME is defined.
 *                 - A non-zero error code otherwise.
 *
 * \note           The function can be used with a restricted set of arguments
 *                 to perform specific checks only. E.g., calling it with
 *                 (-,P,-,-,-) and a PRNG amounts to a primality check for P.
 */

Func mbedtls_rsa_validate_crt

int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q,
                             const mbedtls_mpi *D, const mbedtls_mpi *DP,
                             const mbedtls_mpi *DQ, const mbedtls_mpi *QP );
/**
 * \brief          Check validity of RSA CRT parameters
 *
 * \note           This is a 'static' helper function not operating on
 *                 an RSA context. Alternative implementations need not
 *                 overwrite it.
 *
 * \param P        First prime factor of RSA modulus
 * \param Q        Second prime factor of RSA modulus
 * \param D        RSA private exponent
 * \param DP       MPI to check for D modulo P-1
 * \param DQ       MPI to check for D modulo P-1
 * \param QP       MPI to check for the modular inverse of Q modulo P.
 *
 * \return
 *                 - 0 if the following conditions are satisfied:
 *                    - D = DP mod P-1 if P, D, DP != NULL
 *                    - Q = DQ mod P-1 if P, D, DQ != NULL
 *                    - QP = Q^-1 mod P if P, Q, QP != NULL
 *                 - \c MBEDTLS_ERR_RSA_KEY_CHECK_FAILED if check failed,
 *                   potentially including \c MBEDTLS_ERR_MPI_XXX if some
 *                   MPI calculations failed.
 *                 - \c MBEDTLS_ERR_RSA_BAD_INPUT_DATA if insufficient
 *                   data was provided to check DP, DQ or QP.
 *
 * \note           The function can be used with a restricted set of arguments
 *                 to perform specific checks only. E.g., calling it with the
 *                 parameters (P, -, D, DP, -, -) will check DP = D mod P-1.
 */

Func mbedtls_sha1_init

void mbedtls_sha1_init( mbedtls_sha1_context *ctx );
/**
 * \brief          This function initializes a SHA-1 context.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \param ctx      The SHA-1 context to initialize.
 *                 This must not be \c NULL.
 *
 */

Func mbedtls_sha1_free

void mbedtls_sha1_free( mbedtls_sha1_context *ctx );
/**
 * \brief          This function clears a SHA-1 context.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \param ctx      The SHA-1 context to clear. This may be \c NULL,
 *                 in which case this function does nothing. If it is
 *                 not \c NULL, it must point to an initialized
 *                 SHA-1 context.
 *
 */

Func mbedtls_sha1_clone

void mbedtls_sha1_clone( mbedtls_sha1_context *dst,
                        const mbedtls_sha1_context *src );
/**
 * \brief          This function clones the state of a SHA-1 context.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \param dst      The SHA-1 context to clone to. This must be initialized.
 * \param src      The SHA-1 context to clone from. This must be initialized.
 *
 */

Func mbedtls_sha1_starts_ret

int mbedtls_sha1_starts_ret( mbedtls_sha1_context *ctx );
/**
 * \brief          This function starts a SHA-1 checksum calculation.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \param ctx      The SHA-1 context to initialize. This must be initialized.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 *
 */

Func mbedtls_sha1_update_ret

int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx,
                            const unsigned char *input,
                            size_t ilen );
/**
 * \brief          This function feeds an input buffer into an ongoing SHA-1
 *                 checksum calculation.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \param ctx      The SHA-1 context. This must be initialized
 *                 and have a hash operation started.
 * \param input    The buffer holding the input data.
 *                 This must be a readable buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data \p input in Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_sha1_finish_ret

int mbedtls_sha1_finish_ret( mbedtls_sha1_context *ctx,
                            unsigned char output[20] );
/**
 * \brief          This function finishes the SHA-1 operation, and writes
 *                 the result to the output buffer.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \param ctx      The SHA-1 context to use. This must be initialized and
 *                 have a hash operation started.
 * \param output   The SHA-1 checksum result. This must be a writable
 *                 buffer of length \c 20 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_internal_sha1_process

int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx,
                                  const unsigned char data[64] );
/**
 * \brief          SHA-1 process data block (internal use only).
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \param ctx      The SHA-1 context to use. This must be initialized.
 * \param data     The data block being processed. This must be a
 *                 readable buffer of length \c 64 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 *
 */

Func mbedtls_sha1_ret

int mbedtls_sha1_ret( const unsigned char *input,
                     size_t ilen,
                     unsigned char output[20] );
/**
 * \brief          This function calculates the SHA-1 checksum of a buffer.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The SHA-1 result is calculated as
 *                 output = SHA-1(input buffer).
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \param input    The buffer holding the input data.
 *                 This must be a readable buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data \p input in Bytes.
 * \param output   The SHA-1 checksum result.
 *                 This must be a writable buffer of length \c 20 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 *
 */

Func mbedtls_sha1_self_test

int mbedtls_sha1_self_test( int verbose );
/**
 * \brief          The SHA-1 checkup routine.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 *
 */

Func mbedtls_sha256_init

void mbedtls_sha256_init( mbedtls_sha256_context *ctx );
/**
 * \brief          This function initializes a SHA-256 context.
 *
 * \param ctx      The SHA-256 context to initialize. This must not be \c NULL.
 */

Func mbedtls_sha256_free

void mbedtls_sha256_free( mbedtls_sha256_context *ctx );
/**
 * \brief          This function clears a SHA-256 context.
 *
 * \param ctx      The SHA-256 context to clear. This may be \c NULL, in which
 *                 case this function returns immediately. If it is not \c NULL,
 *                 it must point to an initialized SHA-256 context.
 */

Func mbedtls_sha256_clone

void mbedtls_sha256_clone( mbedtls_sha256_context *dst,
                          const mbedtls_sha256_context *src );
/**
 * \brief          This function clones the state of a SHA-256 context.
 *
 * \param dst      The destination context. This must be initialized.
 * \param src      The context to clone. This must be initialized.
 */

Func mbedtls_sha256_starts_ret

int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 );
/**
 * \brief          This function starts a SHA-224 or SHA-256 checksum
 *                 calculation.
 *
 * \param ctx      The context to use. This must be initialized.
 * \param is224    This determines which function to use. This must be
 *                 either \c 0 for SHA-256, or \c 1 for SHA-224.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_sha256_update_ret

int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx,
                              const unsigned char *input,
                              size_t ilen );
/**
 * \brief          This function feeds an input buffer into an ongoing
 *                 SHA-256 checksum calculation.
 *
 * \param ctx      The SHA-256 context. This must be initialized
 *                 and have a hash operation started.
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_sha256_finish_ret

int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx,
                              unsigned char output[32] );
/**
 * \brief          This function finishes the SHA-256 operation, and writes
 *                 the result to the output buffer.
 *
 * \param ctx      The SHA-256 context. This must be initialized
 *                 and have a hash operation started.
 * \param output   The SHA-224 or SHA-256 checksum result.
 *                 This must be a writable buffer of length \c 32 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_internal_sha256_process

int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx,
                                    const unsigned char data[64] );
/**
 * \brief          This function processes a single data block within
 *                 the ongoing SHA-256 computation. This function is for
 *                 internal use only.
 *
 * \param ctx      The SHA-256 context. This must be initialized.
 * \param data     The buffer holding one block of data. This must
 *                 be a readable buffer of length \c 64 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_sha256_ret

int mbedtls_sha256_ret( const unsigned char *input,
                       size_t ilen,
                       unsigned char output[32],
                       int is224 );
/**
 * \brief          This function calculates the SHA-224 or SHA-256
 *                 checksum of a buffer.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The SHA-256 result is calculated as
 *                 output = SHA-256(input buffer).
 *
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 * \param output   The SHA-224 or SHA-256 checksum result. This must
 *                 be a writable buffer of length \c 32 Bytes.
 * \param is224    Determines which function to use. This must be
 *                 either \c 0 for SHA-256, or \c 1 for SHA-224.
 */

Func mbedtls_sha256_self_test

int mbedtls_sha256_self_test( int verbose );
/**
 * \brief          The SHA-224 and SHA-256 checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_sha512_init

void mbedtls_sha512_init( mbedtls_sha512_context *ctx );
/**
 * \brief          This function initializes a SHA-512 context.
 *
 * \param ctx      The SHA-512 context to initialize. This must
 *                 not be \c NULL.
 */

Func mbedtls_sha512_free

void mbedtls_sha512_free( mbedtls_sha512_context *ctx );
/**
 * \brief          This function clears a SHA-512 context.
 *
 * \param ctx      The SHA-512 context to clear. This may be \c NULL,
 *                 in which case this function does nothing. If it
 *                 is not \c NULL, it must point to an initialized
 *                 SHA-512 context.
 */

Func mbedtls_sha512_clone

void mbedtls_sha512_clone( mbedtls_sha512_context *dst,
                          const mbedtls_sha512_context *src );
/**
 * \brief          This function clones the state of a SHA-512 context.
 *
 * \param dst      The destination context. This must be initialized.
 * \param src      The context to clone. This must be initialized.
 */

Func mbedtls_sha512_starts_ret

int mbedtls_sha512_starts_ret( mbedtls_sha512_context *ctx, int is384 );
/**
 * \brief          This function starts a SHA-384 or SHA-512 checksum
 *                 calculation.
 *
 * \param ctx      The SHA-512 context to use. This must be initialized.
 * \param is384    Determines which function to use. This must be
 *                 either \c for SHA-512, or \c 1 for SHA-384.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_sha512_update_ret

int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx,
                   const unsigned char *input,
                   size_t ilen );
/**
 * \brief          This function feeds an input buffer into an ongoing
 *                 SHA-512 checksum calculation.
 *
 * \param ctx      The SHA-512 context. This must be initialized
 *                 and have a hash operation started.
 * \param input    The buffer holding the input data. This must
 *                 be a readable buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_sha512_finish_ret

int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx,
                              unsigned char output[64] );
/**
 * \brief          This function finishes the SHA-512 operation, and writes
 *                 the result to the output buffer. This function is for
 *                 internal use only.
 *
 * \param ctx      The SHA-512 context. This must be initialized
 *                 and have a hash operation started.
 * \param output   The SHA-384 or SHA-512 checksum result.
 *                 This must be a writable buffer of length \c 64 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_internal_sha512_process

int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx,
                                    const unsigned char data[128] );
/**
 * \brief          This function processes a single data block within
 *                 the ongoing SHA-512 computation.
 *
 * \param ctx      The SHA-512 context. This must be initialized.
 * \param data     The buffer holding one block of data. This
 *                 must be a readable buffer of length \c 128 Bytes.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_sha512_ret

int mbedtls_sha512_ret( const unsigned char *input,
                       size_t ilen,
                       unsigned char output[64],
                       int is384 );
/**
 * \brief          This function calculates the SHA-512 or SHA-384
 *                 checksum of a buffer.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The SHA-512 result is calculated as
 *                 output = SHA-512(input buffer).
 *
 * \param input    The buffer holding the input data. This must be
 *                 a readable buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 * \param output   The SHA-384 or SHA-512 checksum result.
 *                 This must be a writable buffer of length \c 64 Bytes.
 * \param is384    Determines which function to use. This must be either
 *                 \c 0 for SHA-512, or \c 1 for SHA-384.
 *
 * \return         \c 0 on success.
 * \return         A negative error code on failure.
 */

Func mbedtls_sha512_self_test

int mbedtls_sha512_self_test( int verbose );
/**
 * \brief          The SHA-384 or SHA-512 checkup routine.
 *
 * \return         \c 0 on success.
 * \return         \c 1 on failure.
 */

Func mbedtls_ssl_get_ciphersuite_id

int mbedtls_ssl_get_ciphersuite_id( const char *ciphersuite_name );
/**
 * \brief               Return the ID of the ciphersuite associated with the
 *                      given name
 *
 * \param ciphersuite_name SSL ciphersuite name
 *
 * \return              the ID with the ciphersuite or 0 if not found
 */

Func mbedtls_ssl_init

void mbedtls_ssl_init( mbedtls_ssl_context *ssl );
/**
 * \brief          Initialize an SSL context
 *                 Just makes the context ready for mbedtls_ssl_setup() or
 *                 mbedtls_ssl_free()
 *
 * \param ssl      SSL context
 */

Func mbed_tls_reset_in_buf_len

void mbed_tls_reset_in_buf_len(mbedtls_ssl_context *ssl, unsigned int new_len);


      

Func mbed_tls_reset_out_buf_len

void mbed_tls_reset_out_buf_len(mbedtls_ssl_context *ssl, unsigned int new_len);


      

Func mbedtls_ssl_setup

int mbedtls_ssl_setup( mbedtls_ssl_context *ssl,
                      const mbedtls_ssl_config *conf );
/**
 * \brief          Set up an SSL context for use
 *
 * \note           No copy of the configuration context is made, it can be
 *                 shared by many mbedtls_ssl_context structures.
 *
 * \warning        The conf structure will be accessed during the session.
 *                 It must not be modified or freed as long as the session
 *                 is active.
 *
 * \warning        This function must be called exactly once per context.
 *                 Calling mbedtls_ssl_setup again is not supported, even
 *                 if no session is active.
 *
 * \param ssl      SSL context
 * \param conf     SSL configuration to use
 *
 * \return         0 if successful, or MBEDTLS_ERR_SSL_ALLOC_FAILED if
 *                 memory allocation failed
 */

Func mbedtls_ssl_session_reset

int mbedtls_ssl_session_reset( mbedtls_ssl_context *ssl );
/**
 * \brief          Reset an already initialized SSL context for re-use
 *                 while retaining application-set variables, function
 *                 pointers and data.
 *
 * \param ssl      SSL context
 * \return         0 if successful, or MBEDTLS_ERR_SSL_ALLOC_FAILED,
                   MBEDTLS_ERR_SSL_HW_ACCEL_FAILED or
 *                 MBEDTLS_ERR_SSL_COMPRESSION_FAILED
 */

Func mbedtls_ssl_conf_endpoint

void mbedtls_ssl_conf_endpoint( mbedtls_ssl_config *conf, int endpoint );
/**
 * \brief          Set the current endpoint type
 *
 * \param conf     SSL configuration
 * \param endpoint must be MBEDTLS_SSL_IS_CLIENT or MBEDTLS_SSL_IS_SERVER
 */

Func mbedtls_ssl_conf_transport

void mbedtls_ssl_conf_transport( mbedtls_ssl_config *conf, int transport );
/**
 * \brief           Set the transport type (TLS or DTLS).
 *                  Default: TLS
 *
 * \note            For DTLS, you must either provide a recv callback that
 *                  doesn't block, or one that handles timeouts, see
 *                  \c mbedtls_ssl_set_bio(). You also need to provide timer
 *                  callbacks with \c mbedtls_ssl_set_timer_cb().
 *
 * \param conf      SSL configuration
 * \param transport transport type:
 *                  MBEDTLS_SSL_TRANSPORT_STREAM for TLS,
 *                  MBEDTLS_SSL_TRANSPORT_DATAGRAM for DTLS.
 */

Func mbedtls_ssl_conf_authmode

void mbedtls_ssl_conf_authmode( mbedtls_ssl_config *conf, int authmode );
/**
 * \brief          Set the certificate verification mode
 *                 Default: NONE on server, REQUIRED on client
 *
 * \param conf     SSL configuration
 * \param authmode can be:
 *
 *  MBEDTLS_SSL_VERIFY_NONE:      peer certificate is not checked
 *                        (default on server)
 *                        (insecure on client)
 *
 *  MBEDTLS_SSL_VERIFY_OPTIONAL:  peer certificate is checked, however the
 *                        handshake continues even if verification failed;
 *                        mbedtls_ssl_get_verify_result() can be called after the
 *                        handshake is complete.
 *
 *  MBEDTLS_SSL_VERIFY_REQUIRED:  peer *must* present a valid certificate,
 *                        handshake is aborted if verification failed.
 *                        (default on client)
 *
 * \note On client, MBEDTLS_SSL_VERIFY_REQUIRED is the recommended mode.
 * With MBEDTLS_SSL_VERIFY_OPTIONAL, the user needs to call mbedtls_ssl_get_verify_result() at
 * the right time(s), which may not be obvious, while REQUIRED always perform
 * the verification as soon as possible. For example, REQUIRED was protecting
 * against the "triple handshake" attack even before it was found.
 */

Func mbedtls_ssl_conf_verify

void mbedtls_ssl_conf_verify( mbedtls_ssl_config *conf,
                    int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
                    void *p_vrfy );
/**
 * \brief          Set the verification callback (Optional).
 *
 *                 If set, the verify callback is called for each
 *                 certificate in the chain. For implementation
 *                 information, please see \c mbedtls_x509_crt_verify()
 *
 * \param conf     SSL configuration
 * \param f_vrfy   verification function
 * \param p_vrfy   verification parameter
 */

Func mbedtls_ssl_conf_rng

void mbedtls_ssl_conf_rng( mbedtls_ssl_config *conf,
                 int (*f_rng)(void *, unsigned char *, size_t),
                 void *p_rng );
/**
 * \brief          Set the random number generator callback
 *
 * \param conf     SSL configuration
 * \param f_rng    RNG function
 * \param p_rng    RNG parameter
 */

Func mbedtls_ssl_conf_dbg

void mbedtls_ssl_conf_dbg( mbedtls_ssl_config *conf,
                 void (*f_dbg)(void *, int, const char *, int, const char *),
                 void *p_dbg );
/**
 * \brief          Set the debug callback
 *
 *                 The callback has the following argument:
 *                 void *           opaque context for the callback
 *                 int              debug level
 *                 const char *     file name
 *                 int              line number
 *                 const char *     message
 *
 * \param conf     SSL configuration
 * \param f_dbg    debug function
 * \param p_dbg    debug parameter
 */

Func mbedtls_ssl_set_bio

void mbedtls_ssl_set_bio( mbedtls_ssl_context *ssl,
                         void *p_bio,
                         mbedtls_ssl_send_t *f_send,
                         mbedtls_ssl_recv_t *f_recv,
                         mbedtls_ssl_recv_timeout_t *f_recv_timeout );
/**
 * \brief          Set the underlying BIO callbacks for write, read and
 *                 read-with-timeout.
 *
 * \param ssl      SSL context
 * \param p_bio    parameter (context) shared by BIO callbacks
 * \param f_send   write callback
 * \param f_recv   read callback
 * \param f_recv_timeout blocking read callback with timeout.
 *
 * \note           One of f_recv or f_recv_timeout can be NULL, in which case
 *                 the other is used. If both are non-NULL, f_recv_timeout is
 *                 used and f_recv is ignored (as if it were NULL).
 *
 * \note           The two most common use cases are:
 *                 - non-blocking I/O, f_recv != NULL, f_recv_timeout == NULL
 *                 - blocking I/O, f_recv == NULL, f_recv_timout != NULL
 *
 * \note           For DTLS, you need to provide either a non-NULL
 *                 f_recv_timeout callback, or a f_recv that doesn't block.
 *
 * \note           See the documentations of \c mbedtls_ssl_sent_t,
 *                 \c mbedtls_ssl_recv_t and \c mbedtls_ssl_recv_timeout_t for
 *                 the conventions those callbacks must follow.
 *
 * \note           On some platforms, net_sockets.c provides
 *                 \c mbedtls_net_send(), \c mbedtls_net_recv() and
 *                 \c mbedtls_net_recv_timeout() that are suitable to be used
 *                 here.
 */

Func mbedtls_ssl_set_mtu

void mbedtls_ssl_set_mtu( mbedtls_ssl_context *ssl, uint16_t mtu );
/**
 * \brief          Set the Maximum Tranport Unit (MTU).
 *                 Special value: 0 means unset (no limit).
 *                 This represents the maximum size of a datagram payload
 *                 handled by the transport layer (usually UDP) as determined
 *                 by the network link and stack. In practice, this controls
 *                 the maximum size datagram the DTLS layer will pass to the
 *                 \c f_send() callback set using \c mbedtls_ssl_set_bio().
 *
 * \note           The limit on datagram size is converted to a limit on
 *                 record payload by subtracting the current overhead of
 *                 encapsulation and encryption/authentication if any.
 *
 * \note           This can be called at any point during the connection, for
 *                 example when a Path Maximum Transfer Unit (PMTU)
 *                 estimate becomes available from other sources,
 *                 such as lower (or higher) protocol layers.
 *
 * \note           This setting only controls the size of the packets we send,
 *                 and does not restrict the size of the datagrams we're
 *                 willing to receive. Client-side, you can request the
 *                 server to use smaller records with \c
 *                 mbedtls_ssl_conf_max_frag_len().
 *
 * \note           If both a MTU and a maximum fragment length have been
 *                 configured (or negotiated with the peer), the resulting
 *                 lower limit on record payload (see first note) is used.
 *
 * \note           This can only be used to decrease the maximum size
 *                 of datagrams (hence records, see first note) sent. It
 *                 cannot be used to increase the maximum size of records over
 *                 the limit set by #MBEDTLS_SSL_OUT_CONTENT_LEN.
 *
 * \note           Values lower than the current record layer expansion will
 *                 result in an error when trying to send data.
 *
 * \note           Using record compression together with a non-zero MTU value
 *                 will result in an error when trying to send data.
 *
 * \param ssl      SSL context
 * \param mtu      Value of the path MTU in bytes
 */

Func mbedtls_ssl_conf_read_timeout

void mbedtls_ssl_conf_read_timeout( mbedtls_ssl_config *conf, uint32_t timeout );
/**
 * \brief          Set the timeout period for mbedtls_ssl_read()
 *                 (Default: no timeout.)
 *
 * \param conf     SSL configuration context
 * \param timeout  Timeout value in milliseconds.
 *                 Use 0 for no timeout (default).
 *
 * \note           With blocking I/O, this will only work if a non-NULL
 *                 \c f_recv_timeout was set with \c mbedtls_ssl_set_bio().
 *                 With non-blocking I/O, this will only work if timer
 *                 callbacks were set with \c mbedtls_ssl_set_timer_cb().
 *
 * \note           With non-blocking I/O, you may also skip this function
 *                 altogether and handle timeouts at the application layer.
 */

Func mbedtls_ssl_set_timer_cb

void mbedtls_ssl_set_timer_cb( mbedtls_ssl_context *ssl,
                              void *p_timer,
                              mbedtls_ssl_set_timer_t *f_set_timer,
                              mbedtls_ssl_get_timer_t *f_get_timer );
/**
 * \brief          Set the timer callbacks (Mandatory for DTLS.)
 *
 * \param ssl      SSL context
 * \param p_timer  parameter (context) shared by timer callbacks
 * \param f_set_timer   set timer callback
 * \param f_get_timer   get timer callback. Must return:
 *
 * \note           See the documentation of \c mbedtls_ssl_set_timer_t and
 *                 \c mbedtls_ssl_get_timer_t for the conventions this pair of
 *                 callbacks must follow.
 *
 * \note           On some platforms, timing.c provides
 *                 \c mbedtls_timing_set_delay() and
 *                 \c mbedtls_timing_get_delay() that are suitable for using
 *                 here, except if using an event-driven style.
 *
 * \note           See also the "DTLS tutorial" article in our knowledge base.
 *                 https://tls.mbed.org/kb/how-to/dtls-tutorial
 */

Func mbedtls_ssl_conf_session_tickets_cb

void mbedtls_ssl_conf_session_tickets_cb( mbedtls_ssl_config *conf,
       mbedtls_ssl_ticket_write_t *f_ticket_write,
       mbedtls_ssl_ticket_parse_t *f_ticket_parse,
       void *p_ticket );
/**
 * \brief           Configure SSL session ticket callbacks (server only).
 *                  (Default: none.)
 *
 * \note            On server, session tickets are enabled by providing
 *                  non-NULL callbacks.
 *
 * \note            On client, use \c mbedtls_ssl_conf_session_tickets().
 *
 * \param conf      SSL configuration context
 * \param f_ticket_write    Callback for writing a ticket
 * \param f_ticket_parse    Callback for parsing a ticket
 * \param p_ticket          Context shared by the two callbacks
 */

Func mbedtls_ssl_conf_export_keys_cb

void mbedtls_ssl_conf_export_keys_cb( mbedtls_ssl_config *conf,
       mbedtls_ssl_export_keys_t *f_export_keys,
       void *p_export_keys );
/**
 * \brief           Configure key export callback.
 *                  (Default: none.)
 *
 * \note            See \c mbedtls_ssl_export_keys_t.
 *
 * \param conf      SSL configuration context
 * \param f_export_keys     Callback for exporting keys
 * \param p_export_keys     Context for the callback
 */

Func mbedtls_ssl_conf_async_private_cb

void mbedtls_ssl_conf_async_private_cb( mbedtls_ssl_config *conf,
                                       mbedtls_ssl_async_sign_t *f_async_sign,
                                       mbedtls_ssl_async_decrypt_t *f_async_decrypt,
                                       mbedtls_ssl_async_resume_t *f_async_resume,
                                       mbedtls_ssl_async_cancel_t *f_async_cancel,
                                       void *config_data );
/**
 * \brief           Configure asynchronous private key operation callbacks.
 *
 * \param conf              SSL configuration context
 * \param f_async_sign      Callback to start a signature operation. See
 *                          the description of ::mbedtls_ssl_async_sign_t
 *                          for more information. This may be \c NULL if the
 *                          external processor does not support any signature
 *                          operation; in this case the private key object
 *                          associated with the certificate will be used.
 * \param f_async_decrypt   Callback to start a decryption operation. See
 *                          the description of ::mbedtls_ssl_async_decrypt_t
 *                          for more information. This may be \c NULL if the
 *                          external processor does not support any decryption
 *                          operation; in this case the private key object
 *                          associated with the certificate will be used.
 * \param f_async_resume    Callback to resume an asynchronous operation. See
 *                          the description of ::mbedtls_ssl_async_resume_t
 *                          for more information. This may not be \c NULL unless
 *                          \p f_async_sign and \p f_async_decrypt are both
 *                          \c NULL.
 * \param f_async_cancel    Callback to cancel an asynchronous operation. See
 *                          the description of ::mbedtls_ssl_async_cancel_t
 *                          for more information. This may be \c NULL if
 *                          no cleanup is needed.
 * \param config_data       A pointer to configuration data which can be
 *                          retrieved with
 *                          mbedtls_ssl_conf_get_async_config_data(). The
 *                          library stores this value without dereferencing it.
 */

Func mbedtls_ssl_conf_get_async_config_data

void *mbedtls_ssl_conf_get_async_config_data( const mbedtls_ssl_config *conf );
/**
 * \brief           Retrieve the configuration data set by
 *                  mbedtls_ssl_conf_async_private_cb().
 *
 * \param conf      SSL configuration context
 * \return          The configuration data set by
 *                  mbedtls_ssl_conf_async_private_cb().
 */

Func mbedtls_ssl_get_async_operation_data

void *mbedtls_ssl_get_async_operation_data( const mbedtls_ssl_context *ssl );
/**
 * \brief           Retrieve the asynchronous operation user context.
 *
 * \note            This function may only be called while a handshake
 *                  is in progress.
 *
 * \param ssl       The SSL context to access.
 *
 * \return          The asynchronous operation user context that was last
 *                  set during the current handshake. If
 *                  mbedtls_ssl_set_async_operation_data() has not yet been
 *                  called during the current handshake, this function returns
 *                  \c NULL.
 */

Func mbedtls_ssl_set_async_operation_data

void mbedtls_ssl_set_async_operation_data( mbedtls_ssl_context *ssl,
                                void *ctx );
/**
 * \brief           Retrieve the asynchronous operation user context.
 *
 * \note            This function may only be called while a handshake
 *                  is in progress.
 *
 * \param ssl       The SSL context to access.
 * \param ctx       The new value of the asynchronous operation user context.
 *                  Call mbedtls_ssl_get_async_operation_data() later during the
 *                  same handshake to retrieve this value.
 */

Func mbedtls_ssl_conf_dtls_cookies

void mbedtls_ssl_conf_dtls_cookies( mbedtls_ssl_config *conf,
                          mbedtls_ssl_cookie_write_t *f_cookie_write,
                          mbedtls_ssl_cookie_check_t *f_cookie_check,
                          void *p_cookie );
/**
 * \brief           Register callbacks for DTLS cookies
 *                  (Server only. DTLS only.)
 *
 *                  Default: dummy callbacks that fail, in order to force you to
 *                  register working callbacks (and initialize their context).
 *
 *                  To disable HelloVerifyRequest, register NULL callbacks.
 *
 * \warning         Disabling hello verification allows your server to be used
 *                  for amplification in DoS attacks against other hosts.
 *                  Only disable if you known this can't happen in your
 *                  particular environment.
 *
 * \note            See comments on \c mbedtls_ssl_handshake() about handling
 *                  the MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED that is expected
 *                  on the first handshake attempt when this is enabled.
 *
 * \note            This is also necessary to handle client reconnection from
 *                  the same port as described in RFC 6347 section 4.2.8 (only
 *                  the variant with cookies is supported currently). See
 *                  comments on \c mbedtls_ssl_read() for details.
 *
 * \param conf              SSL configuration
 * \param f_cookie_write    Cookie write callback
 * \param f_cookie_check    Cookie check callback
 * \param p_cookie          Context for both callbacks
 */

Func mbedtls_ssl_set_client_transport_id

int mbedtls_ssl_set_client_transport_id( mbedtls_ssl_context *ssl,
                                const unsigned char *info,
                                size_t ilen );
/**
 * \brief          Set client's transport-level identification info.
 *                 (Server only. DTLS only.)
 *
 *                 This is usually the IP address (and port), but could be
 *                 anything identify the client depending on the underlying
 *                 network stack. Used for HelloVerifyRequest with DTLS.
 *                 This is *not* used to route the actual packets.
 *
 * \param ssl      SSL context
 * \param info     Transport-level info identifying the client (eg IP + port)
 * \param ilen     Length of info in bytes
 *
 * \note           An internal copy is made, so the info buffer can be reused.
 *
 * \return         0 on success,
 *                 MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used on client,
 *                 MBEDTLS_ERR_SSL_ALLOC_FAILED if out of memory.
 */

Func mbedtls_ssl_conf_dtls_anti_replay

void mbedtls_ssl_conf_dtls_anti_replay( mbedtls_ssl_config *conf, char mode );
/**
 * \brief          Enable or disable anti-replay protection for DTLS.
 *                 (DTLS only, no effect on TLS.)
 *                 Default: enabled.
 *
 * \param conf     SSL configuration
 * \param mode     MBEDTLS_SSL_ANTI_REPLAY_ENABLED or MBEDTLS_SSL_ANTI_REPLAY_DISABLED.
 *
 * \warning        Disabling this is a security risk unless the application
 *                 protocol handles duplicated packets in a safe way. You
 *                 should not disable this without careful consideration.
 *                 However, if your application already detects duplicated
 *                 packets and needs information about them to adjust its
 *                 transmission strategy, then you'll want to disable this.
 */

Func mbedtls_ssl_conf_dtls_badmac_limit

void mbedtls_ssl_conf_dtls_badmac_limit( mbedtls_ssl_config *conf, unsigned limit );
/**
 * \brief          Set a limit on the number of records with a bad MAC
 *                 before terminating the connection.
 *                 (DTLS only, no effect on TLS.)
 *                 Default: 0 (disabled).
 *
 * \param conf     SSL configuration
 * \param limit    Limit, or 0 to disable.
 *
 * \note           If the limit is N, then the connection is terminated when
 *                 the Nth non-authentic record is seen.
 *
 * \note           Records with an invalid header are not counted, only the
 *                 ones going through the authentication-decryption phase.
 *
 * \note           This is a security trade-off related to the fact that it's
 *                 often relatively easy for an active attacker ot inject UDP
 *                 datagrams. On one hand, setting a low limit here makes it
 *                 easier for such an attacker to forcibly terminated a
 *                 connection. On the other hand, a high limit or no limit
 *                 might make us waste resources checking authentication on
 *                 many bogus packets.
 */

Func mbedtls_ssl_set_datagram_packing

void mbedtls_ssl_set_datagram_packing( mbedtls_ssl_context *ssl,
                                      unsigned allow_packing );
/**
 * \brief          Allow or disallow packing of multiple handshake records
 *                 within a single datagram.
 *
 * \param ssl           The SSL context to configure.
 * \param allow_packing This determines whether datagram packing may
 *                      be used or not. A value of \c 0 means that every
 *                      record will be sent in a separate datagram; a
 *                      value of \c 1 means that, if space permits,
 *                      multiple handshake messages (including CCS) belonging to
 *                      a single flight may be packed within a single datagram.
 *
 * \note           This is enabled by default and should only be disabled
 *                 for test purposes, or if datagram packing causes
 *                 interoperability issues with peers that don't support it.
 *
 * \note           Allowing datagram packing reduces the network load since
 *                 there's less overhead if multiple messages share the same
 *                 datagram. Also, it increases the handshake efficiency
 *                 since messages belonging to a single datagram will not
 *                 be reordered in transit, and so future message buffering
 *                 or flight retransmission (if no buffering is used) as
 *                 means to deal with reordering are needed less frequently.
 *
 * \note           Application records are not affected by this option and
 *                 are currently always sent in separate datagrams.
 *
 */

Func mbedtls_ssl_conf_handshake_timeout

void mbedtls_ssl_conf_handshake_timeout( mbedtls_ssl_config *conf, uint32_t min, uint32_t max );
/**
 * \brief          Set retransmit timeout values for the DTLS handshake.
 *                 (DTLS only, no effect on TLS.)
 *
 * \param conf     SSL configuration
 * \param min      Initial timeout value in milliseconds.
 *                 Default: 1000 (1 second).
 * \param max      Maximum timeout value in milliseconds.
 *                 Default: 60000 (60 seconds).
 *
 * \note           Default values are from RFC 6347 section 4.2.4.1.
 *
 * \note           The 'min' value should typically be slightly above the
 *                 expected round-trip time to your peer, plus whatever time
 *                 it takes for the peer to process the message. For example,
 *                 if your RTT is about 600ms and you peer needs up to 1s to
 *                 do the cryptographic operations in the handshake, then you
 *                 should set 'min' slightly above 1600. Lower values of 'min'
 *                 might cause spurious resends which waste network resources,
 *                 while larger value of 'min' will increase overall latency
 *                 on unreliable network links.
 *
 * \note           The more unreliable your network connection is, the larger
 *                 your max / min ratio needs to be in order to achieve
 *                 reliable handshakes.
 *
 * \note           Messages are retransmitted up to log2(ceil(max/min)) times.
 *                 For example, if min = 1s and max = 5s, the retransmit plan
 *                 goes: send ... 1s -> resend ... 2s -> resend ... 4s ->
 *                 resend ... 5s -> give up and return a timeout error.
 */

Func mbedtls_ssl_conf_session_cache

void mbedtls_ssl_conf_session_cache( mbedtls_ssl_config *conf,
       void *p_cache,
       int (*f_get_cache)(void *, mbedtls_ssl_session *),
       int (*f_set_cache)(void *, const mbedtls_ssl_session *) );
/**
 * \brief          Set the session cache callbacks (server-side only)
 *                 If not set, no session resuming is done (except if session
 *                 tickets are enabled too).
 *
 *                 The session cache has the responsibility to check for stale
 *                 entries based on timeout. See RFC 5246 for recommendations.
 *
 *                 Warning: session.peer_cert is cleared by the SSL/TLS layer on
 *                 connection shutdown, so do not cache the pointer! Either set
 *                 it to NULL or make a full copy of the certificate.
 *
 *                 The get callback is called once during the initial handshake
 *                 to enable session resuming. The get function has the
 *                 following parameters: (void *parameter, mbedtls_ssl_session *session)
 *                 If a valid entry is found, it should fill the master of
 *                 the session object with the cached values and return 0,
 *                 return 1 otherwise. Optionally peer_cert can be set as well
 *                 if it is properly present in cache entry.
 *
 *                 The set callback is called once during the initial handshake
 *                 to enable session resuming after the entire handshake has
 *                 been finished. The set function has the following parameters:
 *                 (void *parameter, const mbedtls_ssl_session *session). The function
 *                 should create a cache entry for future retrieval based on
 *                 the data in the session structure and should keep in mind
 *                 that the mbedtls_ssl_session object presented (and all its referenced
 *                 data) is cleared by the SSL/TLS layer when the connection is
 *                 terminated. It is recommended to add metadata to determine if
 *                 an entry is still valid in the future. Return 0 if
 *                 successfully cached, return 1 otherwise.
 *
 * \param conf           SSL configuration
 * \param p_cache        parmater (context) for both callbacks
 * \param f_get_cache    session get callback
 * \param f_set_cache    session set callback
 */

Func mbedtls_ssl_set_session

int mbedtls_ssl_set_session( mbedtls_ssl_context *ssl, const mbedtls_ssl_session *session );
/**
 * \brief          Request resumption of session (client-side only)
 *                 Session data is copied from presented session structure.
 *
 * \param ssl      SSL context
 * \param session  session context
 *
 * \return         0 if successful,
 *                 MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed,
 *                 MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or
 *                 arguments are otherwise invalid
 *
 * \sa             mbedtls_ssl_get_session()
 */

Func mbedtls_ssl_conf_ciphersuites

void mbedtls_ssl_conf_ciphersuites( mbedtls_ssl_config *conf,
                                  const int *ciphersuites );
/**
 * \brief               Set the list of allowed ciphersuites and the preference
 *                      order. First in the list has the highest preference.
 *                      (Overrides all version-specific lists)
 *
 *                      The ciphersuites array is not copied, and must remain
 *                      valid for the lifetime of the ssl_config.
 *
 *                      Note: The server uses its own preferences
 *                      over the preference of the client unless
 *                      MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE is defined!
 *
 * \param conf          SSL configuration
 * \param ciphersuites  0-terminated list of allowed ciphersuites
 */

Func mbedtls_ssl_conf_ciphersuites_for_version

void mbedtls_ssl_conf_ciphersuites_for_version( mbedtls_ssl_config *conf,
                                      const int *ciphersuites,
                                      int major, int minor );
/**
 * \brief               Set the list of allowed ciphersuites and the
 *                      preference order for a specific version of the protocol.
 *                      (Only useful on the server side)
 *
 *                      The ciphersuites array is not copied, and must remain
 *                      valid for the lifetime of the ssl_config.
 *
 * \param conf          SSL configuration
 * \param ciphersuites  0-terminated list of allowed ciphersuites
 * \param major         Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3
 *                      supported)
 * \param minor         Minor version number (MBEDTLS_SSL_MINOR_VERSION_0,
 *                      MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2,
 *                      MBEDTLS_SSL_MINOR_VERSION_3 supported)
 *
 * \note                With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0
 *                      and MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2
 */

Func mbedtls_ssl_conf_cert_profile

void mbedtls_ssl_conf_cert_profile( mbedtls_ssl_config *conf,
                                   const mbedtls_x509_crt_profile *profile );
/**
 * \brief          Set the X.509 security profile used for verification
 *
 * \note           The restrictions are enforced for all certificates in the
 *                 chain. However, signatures in the handshake are not covered
 *                 by this setting but by \b mbedtls_ssl_conf_sig_hashes().
 *
 * \param conf     SSL configuration
 * \param profile  Profile to use
 */

Func mbedtls_ssl_conf_ca_chain

void mbedtls_ssl_conf_ca_chain( mbedtls_ssl_config *conf,
                              mbedtls_x509_crt *ca_chain,
                              mbedtls_x509_crl *ca_crl );
/**
 * \brief          Set the data required to verify peer certificate
 *
 * \note           See \c mbedtls_x509_crt_verify() for notes regarding the
 *                 parameters ca_chain (maps to trust_ca for that function)
 *                 and ca_crl.
 *
 * \param conf     SSL configuration
 * \param ca_chain trusted CA chain (meaning all fully trusted top-level CAs)
 * \param ca_crl   trusted CA CRLs
 */

Func mbedtls_ssl_conf_own_cert

int mbedtls_ssl_conf_own_cert( mbedtls_ssl_config *conf,
                             mbedtls_x509_crt *own_cert,
                             mbedtls_pk_context *pk_key );
/**
 * \brief          Set own certificate chain and private key
 *
 * \note           own_cert should contain in order from the bottom up your
 *                 certificate chain. The top certificate (self-signed)
 *                 can be omitted.
 *
 * \note           On server, this function can be called multiple times to
 *                 provision more than one cert/key pair (eg one ECDSA, one
 *                 RSA with SHA-256, one RSA with SHA-1). An adequate
 *                 certificate will be selected according to the client's
 *                 advertised capabilities. In case mutliple certificates are
 *                 adequate, preference is given to the one set by the first
 *                 call to this function, then second, etc.
 *
 * \note           On client, only the first call has any effect. That is,
 *                 only one client certificate can be provisioned. The
 *                 server's preferences in its CertficateRequest message will
 *                 be ignored and our only cert will be sent regardless of
 *                 whether it matches those preferences - the server can then
 *                 decide what it wants to do with it.
 *
 * \note           The provided \p pk_key needs to match the public key in the
 *                 first certificate in \p own_cert, or all handshakes using
 *                 that certificate will fail. It is your responsibility
 *                 to ensure that; this function will not perform any check.
 *                 You may use mbedtls_pk_check_pair() in order to perform
 *                 this check yourself, but be aware that this function can
 *                 be computationally expensive on some key types.
 *
 * \param conf     SSL configuration
 * \param own_cert own public certificate chain
 * \param pk_key   own private key
 *
 * \return         0 on success or MBEDTLS_ERR_SSL_ALLOC_FAILED
 */

Func mbedtls_ssl_conf_psk

int mbedtls_ssl_conf_psk( mbedtls_ssl_config *conf,
               const unsigned char *psk, size_t psk_len,
               const unsigned char *psk_identity, size_t psk_identity_len );
/**
 * \brief          Set the Pre Shared Key (PSK) and the expected identity name
 *
 * \note           This is mainly useful for clients. Servers will usually
 *                 want to use \c mbedtls_ssl_conf_psk_cb() instead.
 *
 * \note           Currently clients can only register one pre-shared key.
 *                 In other words, the servers' identity hint is ignored.
 *                 Support for setting multiple PSKs on clients and selecting
 *                 one based on the identity hint is not a planned feature but
 *                 feedback is welcomed.
 *
 * \param conf     SSL configuration
 * \param psk      pointer to the pre-shared key
 * \param psk_len  pre-shared key length
 * \param psk_identity      pointer to the pre-shared key identity
 * \param psk_identity_len  identity key length
 *
 * \return         0 if successful or MBEDTLS_ERR_SSL_ALLOC_FAILED
 */

Func mbedtls_ssl_set_hs_psk

int mbedtls_ssl_set_hs_psk( mbedtls_ssl_context *ssl,
                           const unsigned char *psk, size_t psk_len );
/**
 * \brief          Set the Pre Shared Key (PSK) for the current handshake
 *
 * \note           This should only be called inside the PSK callback,
 *                 ie the function passed to \c mbedtls_ssl_conf_psk_cb().
 *
 * \param ssl      SSL context
 * \param psk      pointer to the pre-shared key
 * \param psk_len  pre-shared key length
 *
 * \return         0 if successful or MBEDTLS_ERR_SSL_ALLOC_FAILED
 */

Func mbedtls_ssl_conf_psk_cb

void mbedtls_ssl_conf_psk_cb( mbedtls_ssl_config *conf,
                    int (*f_psk)(void *, mbedtls_ssl_context *, const unsigned char *,
                                 size_t),
                    void *p_psk );
/**
 * \brief          Set the PSK callback (server-side only).
 *
 *                 If set, the PSK callback is called for each
 *                 handshake where a PSK ciphersuite was negotiated.
 *                 The caller provides the identity received and wants to
 *                 receive the actual PSK data and length.
 *
 *                 The callback has the following parameters: (void *parameter,
 *                 mbedtls_ssl_context *ssl, const unsigned char *psk_identity,
 *                 size_t identity_len)
 *                 If a valid PSK identity is found, the callback should use
 *                 \c mbedtls_ssl_set_hs_psk() on the ssl context to set the
 *                 correct PSK and return 0.
 *                 Any other return value will result in a denied PSK identity.
 *
 * \note           If you set a PSK callback using this function, then you
 *                 don't need to set a PSK key and identity using
 *                 \c mbedtls_ssl_conf_psk().
 *
 * \param conf     SSL configuration
 * \param f_psk    PSK identity function
 * \param p_psk    PSK identity parameter
 */

Func mbedtls_ssl_conf_dh_param_bin

int mbedtls_ssl_conf_dh_param_bin( mbedtls_ssl_config *conf,
                                  const unsigned char *dhm_P, size_t P_len,
                                  const unsigned char *dhm_G, size_t G_len );
/**
 * \brief          Set the Diffie-Hellman public P and G values
 *                 from big-endian binary presentations.
 *                 (Default values: MBEDTLS_DHM_RFC3526_MODP_2048_[PG]_BIN)
 *
 * \param conf     SSL configuration
 * \param dhm_P    Diffie-Hellman-Merkle modulus in big-endian binary form
 * \param P_len    Length of DHM modulus
 * \param dhm_G    Diffie-Hellman-Merkle generator in big-endian binary form
 * \param G_len    Length of DHM generator
 *
 * \return         0 if successful
 */

Func mbedtls_ssl_conf_dh_param_ctx

int mbedtls_ssl_conf_dh_param_ctx( mbedtls_ssl_config *conf, mbedtls_dhm_context *dhm_ctx );
/**
 * \brief          Set the Diffie-Hellman public P and G values,
 *                 read from existing context (server-side only)
 *
 * \param conf     SSL configuration
 * \param dhm_ctx  Diffie-Hellman-Merkle context
 *
 * \return         0 if successful
 */

Func mbedtls_ssl_conf_dhm_min_bitlen

void mbedtls_ssl_conf_dhm_min_bitlen( mbedtls_ssl_config *conf,
                                     unsigned int bitlen );
/**
 * \brief          Set the minimum length for Diffie-Hellman parameters.
 *                 (Client-side only.)
 *                 (Default: 1024 bits.)
 *
 * \param conf     SSL configuration
 * \param bitlen   Minimum bit length of the DHM prime
 */

Func mbedtls_ssl_conf_curves

void mbedtls_ssl_conf_curves( mbedtls_ssl_config *conf,
                             const mbedtls_ecp_group_id *curves );
/**
 * \brief          Set the allowed curves in order of preference.
 *                 (Default: all defined curves.)
 *
 *                 On server: this only affects selection of the ECDHE curve;
 *                 the curves used for ECDH and ECDSA are determined by the
 *                 list of available certificates instead.
 *
 *                 On client: this affects the list of curves offered for any
 *                 use. The server can override our preference order.
 *
 *                 Both sides: limits the set of curves accepted for use in
 *                 ECDHE and in the peer's end-entity certificate.
 *
 * \note           This has no influence on which curves are allowed inside the
 *                 certificate chains, see \c mbedtls_ssl_conf_cert_profile()
 *                 for that. For the end-entity certificate however, the key
 *                 will be accepted only if it is allowed both by this list
 *                 and by the cert profile.
 *
 * \note           This list should be ordered by decreasing preference
 *                 (preferred curve first).
 *
 * \param conf     SSL configuration
 * \param curves   Ordered list of allowed curves,
 *                 terminated by MBEDTLS_ECP_DP_NONE.
 */

Func mbedtls_ssl_conf_sig_hashes

void mbedtls_ssl_conf_sig_hashes( mbedtls_ssl_config *conf,
                                 const int *hashes );
/**
 * \brief          Set the allowed hashes for signatures during the handshake.
 *                 (Default: all available hashes except MD5.)
 *
 * \note           This only affects which hashes are offered and can be used
 *                 for signatures during the handshake. Hashes for message
 *                 authentication and the TLS PRF are controlled by the
 *                 ciphersuite, see \c mbedtls_ssl_conf_ciphersuites(). Hashes
 *                 used for certificate signature are controlled by the
 *                 verification profile, see \c mbedtls_ssl_conf_cert_profile().
 *
 * \note           This list should be ordered by decreasing preference
 *                 (preferred hash first).
 *
 * \param conf     SSL configuration
 * \param hashes   Ordered list of allowed signature hashes,
 *                 terminated by \c MBEDTLS_MD_NONE.
 */

Func mbedtls_ssl_set_hostname

int mbedtls_ssl_set_hostname( mbedtls_ssl_context *ssl, const char *hostname );
/**
 * \brief          Set or reset the hostname to check against the received
 *                 server certificate. It sets the ServerName TLS extension,
 *                 too, if that extension is enabled. (client-side only)
 *
 * \param ssl      SSL context
 * \param hostname the server hostname, may be NULL to clear hostname

 * \note           Maximum hostname length MBEDTLS_SSL_MAX_HOST_NAME_LEN.
 *
 * \return         0 if successful, MBEDTLS_ERR_SSL_ALLOC_FAILED on
 *                 allocation failure, MBEDTLS_ERR_SSL_BAD_INPUT_DATA on
 *                 too long input hostname.
 *
 *                 Hostname set to the one provided on success (cleared
 *                 when NULL). On allocation failure hostname is cleared.
 *                 On too long input failure, old hostname is unchanged.
 */

Func mbedtls_ssl_set_hs_own_cert

int mbedtls_ssl_set_hs_own_cert( mbedtls_ssl_context *ssl,
                                mbedtls_x509_crt *own_cert,
                                mbedtls_pk_context *pk_key );
/**
 * \brief          Set own certificate and key for the current handshake
 *
 * \note           Same as \c mbedtls_ssl_conf_own_cert() but for use within
 *                 the SNI callback.
 *
 * \param ssl      SSL context
 * \param own_cert own public certificate chain
 * \param pk_key   own private key
 *
 * \return         0 on success or MBEDTLS_ERR_SSL_ALLOC_FAILED
 */

Func mbedtls_ssl_set_hs_ca_chain

void mbedtls_ssl_set_hs_ca_chain( mbedtls_ssl_context *ssl,
                                 mbedtls_x509_crt *ca_chain,
                                 mbedtls_x509_crl *ca_crl );
/**
 * \brief          Set the data required to verify peer certificate for the
 *                 current handshake
 *
 * \note           Same as \c mbedtls_ssl_conf_ca_chain() but for use within
 *                 the SNI callback.
 *
 * \param ssl      SSL context
 * \param ca_chain trusted CA chain (meaning all fully trusted top-level CAs)
 * \param ca_crl   trusted CA CRLs
 */

Func mbedtls_ssl_set_hs_authmode

void mbedtls_ssl_set_hs_authmode( mbedtls_ssl_context *ssl,
                                 int authmode );
/**
 * \brief          Set authmode for the current handshake.
 *
 * \note           Same as \c mbedtls_ssl_conf_authmode() but for use within
 *                 the SNI callback.
 *
 * \param ssl      SSL context
 * \param authmode MBEDTLS_SSL_VERIFY_NONE, MBEDTLS_SSL_VERIFY_OPTIONAL or
 *                 MBEDTLS_SSL_VERIFY_REQUIRED
 */

Func mbedtls_ssl_conf_sni

void mbedtls_ssl_conf_sni( mbedtls_ssl_config *conf,
                 int (*f_sni)(void *, mbedtls_ssl_context *, const unsigned char *,
                              size_t),
                 void *p_sni );
/**
 * \brief          Set server side ServerName TLS extension callback
 *                 (optional, server-side only).
 *
 *                 If set, the ServerName callback is called whenever the
 *                 server receives a ServerName TLS extension from the client
 *                 during a handshake. The ServerName callback has the
 *                 following parameters: (void *parameter, mbedtls_ssl_context *ssl,
 *                 const unsigned char *hostname, size_t len). If a suitable
 *                 certificate is found, the callback must set the
 *                 certificate(s) and key(s) to use with \c
 *                 mbedtls_ssl_set_hs_own_cert() (can be called repeatedly),
 *                 and may optionally adjust the CA and associated CRL with \c
 *                 mbedtls_ssl_set_hs_ca_chain() as well as the client
 *                 authentication mode with \c mbedtls_ssl_set_hs_authmode(),
 *                 then must return 0. If no matching name is found, the
 *                 callback must either set a default cert, or
 *                 return non-zero to abort the handshake at this point.
 *
 * \param conf     SSL configuration
 * \param f_sni    verification function
 * \param p_sni    verification parameter
 */

Func mbedtls_ssl_set_hs_ecjpake_password

int mbedtls_ssl_set_hs_ecjpake_password( mbedtls_ssl_context *ssl,
                                        const unsigned char *pw,
                                        size_t pw_len );
/**
 * \brief          Set the EC J-PAKE password for current handshake.
 *
 * \note           An internal copy is made, and destroyed as soon as the
 *                 handshake is completed, or when the SSL context is reset or
 *                 freed.
 *
 * \note           The SSL context needs to be already set up. The right place
 *                 to call this function is between \c mbedtls_ssl_setup() or
 *                 \c mbedtls_ssl_reset() and \c mbedtls_ssl_handshake().
 *
 * \param ssl      SSL context
 * \param pw       EC J-PAKE password (pre-shared secret)
 * \param pw_len   length of pw in bytes
 *
 * \return         0 on success, or a negative error code.
 */

Func mbedtls_ssl_conf_alpn_protocols

int mbedtls_ssl_conf_alpn_protocols( mbedtls_ssl_config *conf, const char **protos );
/**
 * \brief          Set the supported Application Layer Protocols.
 *
 * \param conf     SSL configuration
 * \param protos   Pointer to a NULL-terminated list of supported protocols,
 *                 in decreasing preference order. The pointer to the list is
 *                 recorded by the library for later reference as required, so
 *                 the lifetime of the table must be atleast as long as the
 *                 lifetime of the SSL configuration structure.
 *
 * \return         0 on success, or MBEDTLS_ERR_SSL_BAD_INPUT_DATA.
 */

Func mbedtls_ssl_conf_srtp_mki_value_supported

void mbedtls_ssl_conf_srtp_mki_value_supported( mbedtls_ssl_config *conf,
                                               int support_mki_value );
/**
 * \brief                   Add support for mki value in use_srtp extension
 *                          (Default: MBEDTLS_SSL_DTLS_SRTP_MKI_UNSUPPORTED)
 *
 * \param conf              SSL configuration
 * \param support_mki_value Enable or disable (MBEDTLS_SSL_DTLS_SRTP_MKI_UNSUPPORTED
 *                          or MBEDTLS_SSL_DTLS_SRTP_MKI_SUPPORTED)
 */

Func mbedtls_ssl_conf_dtls_srtp_protection_profiles

int mbedtls_ssl_conf_dtls_srtp_protection_profiles( mbedtls_ssl_config *conf,
                                                   const mbedtls_ssl_srtp_profile *profiles,
                                                   size_t profiles_number );
/**
 * \brief                   Set the supported DTLS-SRTP protection profiles.
 *
 * \param conf              SSL configuration
 * \param profiles          List of supported protection profiles,
 *                          in decreasing preference order.
 * \param profiles_number   Number of supported profiles.
 *
 * \return         0 on success, or MBEDTLS_ERR_SSL_BAD_INPUT_DATA.
 */

Func mbedtls_ssl_dtls_srtp_set_mki_value

int mbedtls_ssl_dtls_srtp_set_mki_value( mbedtls_ssl_context *ssl,
                                        unsigned char *mki_value,
                                        size_t mki_len );
/**
 * \brief                   Set the mki_value for the current dtls session.
 *
 * \param ssl              SSL context
 * \param mki_value        MKI value to set
 * \param mki_len          MKI length
 *
 * \return         0 on success, MBEDTLS_ERR_SSL_BAD_INPUT_DATA
 *                 or MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE on failure
 */

Func mbedtls_ssl_get_dtls_srtp_key_material

int mbedtls_ssl_get_dtls_srtp_key_material( const mbedtls_ssl_context *ssl,
                                           unsigned char *key,
                                           size_t *key_len );
/**
 * \brief                  Get the generated DTLS-SRTP key material.
 *                         This function should be called after the handshake is
 *                         completed. It shall returns 80 bytes of key material
 *                         generated according to RFC5764
 *
 * \param ssl              SSL context
 * \param key              Buffer to hold the generated key material
 * \param key_len          [in/out] key buffer size. outputs the actual number
 *                         of bytes written
 *
 * \return         0 on succes, MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL if the key buffer
 *                 is too small to hold the generated key
 */

Func mbedtls_ssl_conf_max_version

void mbedtls_ssl_conf_max_version( mbedtls_ssl_config *conf, int major, int minor );
/**
 * \brief          Set the maximum supported version sent from the client side
 *                 and/or accepted at the server side
 *                 (Default: MBEDTLS_SSL_MAX_MAJOR_VERSION, MBEDTLS_SSL_MAX_MINOR_VERSION)
 *
 * \note           This ignores ciphersuites from higher versions.
 *
 * \note           With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 and
 *                 MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2
 *
 * \param conf     SSL configuration
 * \param major    Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 supported)
 * \param minor    Minor version number (MBEDTLS_SSL_MINOR_VERSION_0,
 *                 MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2,
 *                 MBEDTLS_SSL_MINOR_VERSION_3 supported)
 */

Func mbedtls_ssl_conf_min_version

void mbedtls_ssl_conf_min_version( mbedtls_ssl_config *conf, int major, int minor );
/**
 * \brief          Set the minimum accepted SSL/TLS protocol version
 *                 (Default: TLS 1.0)
 *
 * \note           Input outside of the SSL_MAX_XXXXX_VERSION and
 *                 SSL_MIN_XXXXX_VERSION range is ignored.
 *
 * \note           MBEDTLS_SSL_MINOR_VERSION_0 (SSL v3) should be avoided.
 *
 * \note           With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 and
 *                 MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2
 *
 * \param conf     SSL configuration
 * \param major    Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 supported)
 * \param minor    Minor version number (MBEDTLS_SSL_MINOR_VERSION_0,
 *                 MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2,
 *                 MBEDTLS_SSL_MINOR_VERSION_3 supported)
 */

Func mbedtls_ssl_conf_fallback

void mbedtls_ssl_conf_fallback( mbedtls_ssl_config *conf, char fallback );
/**
 * \brief          Set the fallback flag (client-side only).
 *                 (Default: MBEDTLS_SSL_IS_NOT_FALLBACK).
 *
 * \note           Set to MBEDTLS_SSL_IS_FALLBACK when preparing a fallback
 *                 connection, that is a connection with max_version set to a
 *                 lower value than the value you're willing to use. Such
 *                 fallback connections are not recommended but are sometimes
 *                 necessary to interoperate with buggy (version-intolerant)
 *                 servers.
 *
 * \warning        You should NOT set this to MBEDTLS_SSL_IS_FALLBACK for
 *                 non-fallback connections! This would appear to work for a
 *                 while, then cause failures when the server is upgraded to
 *                 support a newer TLS version.
 *
 * \param conf     SSL configuration
 * \param fallback MBEDTLS_SSL_IS_NOT_FALLBACK or MBEDTLS_SSL_IS_FALLBACK
 */

Func mbedtls_ssl_conf_encrypt_then_mac

void mbedtls_ssl_conf_encrypt_then_mac( mbedtls_ssl_config *conf, char etm );
/**
 * \brief           Enable or disable Encrypt-then-MAC
 *                  (Default: MBEDTLS_SSL_ETM_ENABLED)
 *
 * \note            This should always be enabled, it is a security
 *                  improvement, and should not cause any interoperability
 *                  issue (used only if the peer supports it too).
 *
 * \param conf      SSL configuration
 * \param etm       MBEDTLS_SSL_ETM_ENABLED or MBEDTLS_SSL_ETM_DISABLED
 */

Func mbedtls_ssl_conf_extended_master_secret

void mbedtls_ssl_conf_extended_master_secret( mbedtls_ssl_config *conf, char ems );
/**
 * \brief           Enable or disable Extended Master Secret negotiation.
 *                  (Default: MBEDTLS_SSL_EXTENDED_MS_ENABLED)
 *
 * \note            This should always be enabled, it is a security fix to the
 *                  protocol, and should not cause any interoperability issue
 *                  (used only if the peer supports it too).
 *
 * \param conf      SSL configuration
 * \param ems       MBEDTLS_SSL_EXTENDED_MS_ENABLED or MBEDTLS_SSL_EXTENDED_MS_DISABLED
 */

Func mbedtls_ssl_conf_arc4_support

void mbedtls_ssl_conf_arc4_support( mbedtls_ssl_config *conf, char arc4 );
/**
 * \brief          Disable or enable support for RC4
 *                 (Default: MBEDTLS_SSL_ARC4_DISABLED)
 *
 * \warning        Use of RC4 in DTLS/TLS has been prohibited by RFC 7465
 *                 for security reasons. Use at your own risk.
 *
 * \note           This function is deprecated and will likely be removed in
 *                 a future version of the library.
 *                 RC4 is disabled by default at compile time and needs to be
 *                 actively enabled for use with legacy systems.
 *
 * \param conf     SSL configuration
 * \param arc4     MBEDTLS_SSL_ARC4_ENABLED or MBEDTLS_SSL_ARC4_DISABLED
 */

Func mbedtls_ssl_conf_cert_req_ca_list

void mbedtls_ssl_conf_cert_req_ca_list( mbedtls_ssl_config *conf,
                                         char cert_req_ca_list );
/**
 * \brief          Whether to send a list of acceptable CAs in
 *                 CertificateRequest messages.
 *                 (Default: do send)
 *
 * \param conf     SSL configuration
 * \param cert_req_ca_list   MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED or
 *                          MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED
 */

Func mbedtls_ssl_conf_max_frag_len

int mbedtls_ssl_conf_max_frag_len( mbedtls_ssl_config *conf, unsigned char mfl_code );
/**
 * \brief          Set the maximum fragment length to emit and/or negotiate.
 *                 (Typical: the smaller of #MBEDTLS_SSL_IN_CONTENT_LEN and
 *                 #MBEDTLS_SSL_OUT_CONTENT_LEN, usually `2^14` bytes)
 *                 (Server: set maximum fragment length to emit,
 *                 usually negotiated by the client during handshake)
 *                 (Client: set maximum fragment length to emit *and*
 *                 negotiate with the server during handshake)
 *                 (Default: #MBEDTLS_SSL_MAX_FRAG_LEN_NONE)
 *
 * \note           On the client side, the maximum fragment length extension
 *                 *will not* be used, unless the maximum fragment length has
 *                 been set via this function to a value different than
 *                 #MBEDTLS_SSL_MAX_FRAG_LEN_NONE.
 *
 * \note           This sets the maximum length for a record's payload,
 *                 excluding record overhead that will be added to it, see
 *                 \c mbedtls_ssl_get_record_expansion().
 *
 * \note           With TLS, this currently only affects ApplicationData (sent
 *                 with \c mbedtls_ssl_read()), not handshake messages.
 *                 With DTLS, this affects both ApplicationData and handshake.
 *
 * \note           For DTLS, it is also possible to set a limit for the total
 *                 size of daragrams passed to the transport layer, including
 *                 record overhead, see \c mbedtls_ssl_set_mtu().
 *
 * \param conf     SSL configuration
 * \param mfl_code Code for maximum fragment length (allowed values:
 *                 MBEDTLS_SSL_MAX_FRAG_LEN_512,  MBEDTLS_SSL_MAX_FRAG_LEN_1024,
 *                 MBEDTLS_SSL_MAX_FRAG_LEN_2048, MBEDTLS_SSL_MAX_FRAG_LEN_4096)
 *
 * \return         0 if successful or MBEDTLS_ERR_SSL_BAD_INPUT_DATA
 */

Func mbedtls_ssl_conf_truncated_hmac

void mbedtls_ssl_conf_truncated_hmac( mbedtls_ssl_config *conf, int truncate );
/**
 * \brief          Activate negotiation of truncated HMAC
 *                 (Default: MBEDTLS_SSL_TRUNC_HMAC_DISABLED)
 *
 * \param conf     SSL configuration
 * \param truncate Enable or disable (MBEDTLS_SSL_TRUNC_HMAC_ENABLED or
 *                                    MBEDTLS_SSL_TRUNC_HMAC_DISABLED)
 */

Func mbedtls_ssl_conf_cbc_record_splitting

void mbedtls_ssl_conf_cbc_record_splitting( mbedtls_ssl_config *conf, char split );
/**
 * \brief          Enable / Disable 1/n-1 record splitting
 *                 (Default: MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED)
 *
 * \note           Only affects SSLv3 and TLS 1.0, not higher versions.
 *                 Does not affect non-CBC ciphersuites in any version.
 *
 * \param conf     SSL configuration
 * \param split    MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED or
 *                 MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED
 */

Func mbedtls_ssl_conf_session_tickets

void mbedtls_ssl_conf_session_tickets( mbedtls_ssl_config *conf, int use_tickets );
/**
 * \brief          Enable / Disable session tickets (client only).
 *                 (Default: MBEDTLS_SSL_SESSION_TICKETS_ENABLED.)
 *
 * \note           On server, use \c mbedtls_ssl_conf_session_tickets_cb().
 *
 * \param conf     SSL configuration
 * \param use_tickets   Enable or disable (MBEDTLS_SSL_SESSION_TICKETS_ENABLED or
 *                                         MBEDTLS_SSL_SESSION_TICKETS_DISABLED)
 */

Func mbedtls_ssl_conf_renegotiation

void mbedtls_ssl_conf_renegotiation( mbedtls_ssl_config *conf, int renegotiation );
/**
 * \brief          Enable / Disable renegotiation support for connection when
 *                 initiated by peer
 *                 (Default: MBEDTLS_SSL_RENEGOTIATION_DISABLED)
 *
 * \warning        It is recommended to always disable renegotation unless you
 *                 know you need it and you know what you're doing. In the
 *                 past, there have been several issues associated with
 *                 renegotiation or a poor understanding of its properties.
 *
 * \note           Server-side, enabling renegotiation also makes the server
 *                 susceptible to a resource DoS by a malicious client.
 *
 * \param conf    SSL configuration
 * \param renegotiation     Enable or disable (MBEDTLS_SSL_RENEGOTIATION_ENABLED or
 *                                             MBEDTLS_SSL_RENEGOTIATION_DISABLED)
 */

Func mbedtls_ssl_conf_legacy_renegotiation

void mbedtls_ssl_conf_legacy_renegotiation( mbedtls_ssl_config *conf, int allow_legacy );
/**
 * \brief          Prevent or allow legacy renegotiation.
 *                 (Default: MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION)
 *
 *                 MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION allows connections to
 *                 be established even if the peer does not support
 *                 secure renegotiation, but does not allow renegotiation
 *                 to take place if not secure.
 *                 (Interoperable and secure option)
 *
 *                 MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION allows renegotiations
 *                 with non-upgraded peers. Allowing legacy renegotiation
 *                 makes the connection vulnerable to specific man in the
 *                 middle attacks. (See RFC 5746)
 *                 (Most interoperable and least secure option)
 *
 *                 MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE breaks off connections
 *                 if peer does not support secure renegotiation. Results
 *                 in interoperability issues with non-upgraded peers
 *                 that do not support renegotiation altogether.
 *                 (Most secure option, interoperability issues)
 *
 * \param conf     SSL configuration
 * \param allow_legacy  Prevent or allow (SSL_NO_LEGACY_RENEGOTIATION,
 *                                        SSL_ALLOW_LEGACY_RENEGOTIATION or
 *                                        MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE)
 */

Func mbedtls_ssl_conf_renegotiation_enforced

void mbedtls_ssl_conf_renegotiation_enforced( mbedtls_ssl_config *conf, int max_records );
/**
 * \brief          Enforce renegotiation requests.
 *                 (Default: enforced, max_records = 16)
 *
 *                 When we request a renegotiation, the peer can comply or
 *                 ignore the request. This function allows us to decide
 *                 whether to enforce our renegotiation requests by closing
 *                 the connection if the peer doesn't comply.
 *
 *                 However, records could already be in transit from the peer
 *                 when the request is emitted. In order to increase
 *                 reliability, we can accept a number of records before the
 *                 expected handshake records.
 *
 *                 The optimal value is highly dependent on the specific usage
 *                 scenario.
 *
 * \note           With DTLS and server-initiated renegotiation, the
 *                 HelloRequest is retransmited every time mbedtls_ssl_read() times
 *                 out or receives Application Data, until:
 *                 - max_records records have beens seen, if it is >= 0, or
 *                 - the number of retransmits that would happen during an
 *                 actual handshake has been reached.
 *                 Please remember the request might be lost a few times
 *                 if you consider setting max_records to a really low value.
 *
 * \warning        On client, the grace period can only happen during
 *                 mbedtls_ssl_read(), as opposed to mbedtls_ssl_write() and mbedtls_ssl_renegotiate()
 *                 which always behave as if max_record was 0. The reason is,
 *                 if we receive application data from the server, we need a
 *                 place to write it, which only happens during mbedtls_ssl_read().
 *
 * \param conf     SSL configuration
 * \param max_records Use MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED if you don't want to
 *                 enforce renegotiation, or a non-negative value to enforce
 *                 it but allow for a grace period of max_records records.
 */

Func mbedtls_ssl_conf_renegotiation_period

void mbedtls_ssl_conf_renegotiation_period( mbedtls_ssl_config *conf,
                                  const unsigned char period[8] );
/**
 * \brief          Set record counter threshold for periodic renegotiation.
 *                 (Default: 2^48 - 1)
 *
 *                 Renegotiation is automatically triggered when a record
 *                 counter (outgoing or ingoing) crosses the defined
 *                 threshold. The default value is meant to prevent the
 *                 connection from being closed when the counter is about to
 *                 reached its maximal value (it is not allowed to wrap).
 *
 *                 Lower values can be used to enforce policies such as "keys
 *                 must be refreshed every N packets with cipher X".
 *
 *                 The renegotiation period can be disabled by setting
 *                 conf->disable_renegotiation to
 *                 MBEDTLS_SSL_RENEGOTIATION_DISABLED.
 *
 * \note           When the configured transport is
 *                 MBEDTLS_SSL_TRANSPORT_DATAGRAM the maximum renegotiation
 *                 period is 2^48 - 1, and for MBEDTLS_SSL_TRANSPORT_STREAM,
 *                 the maximum renegotiation period is 2^64 - 1.
 *
 * \param conf     SSL configuration
 * \param period   The threshold value: a big-endian 64-bit number.
 */

Func mbedtls_ssl_check_pending

int mbedtls_ssl_check_pending( const mbedtls_ssl_context *ssl );
/**
 * \brief          Check if there is data already read from the
 *                 underlying transport but not yet processed.
 *
 * \param ssl      SSL context
 *
 * \return         0 if nothing's pending, 1 otherwise.
 *
 * \note           This is different in purpose and behaviour from
 *                 \c mbedtls_ssl_get_bytes_avail in that it considers
 *                 any kind of unprocessed data, not only unread
 *                 application data. If \c mbedtls_ssl_get_bytes
 *                 returns a non-zero value, this function will
 *                 also signal pending data, but the converse does
 *                 not hold. For example, in DTLS there might be
 *                 further records waiting to be processed from
 *                 the current underlying transport's datagram.
 *
 * \note           If this function returns 1 (data pending), this
 *                 does not imply that a subsequent call to
 *                 \c mbedtls_ssl_read will provide any data;
 *                 e.g., the unprocessed data might turn out
 *                 to be an alert or a handshake message.
 *
 * \note           This function is useful in the following situation:
 *                 If the SSL/TLS module successfully returns from an
 *                 operation - e.g. a handshake or an application record
 *                 read - and you're awaiting incoming data next, you
 *                 must not immediately idle on the underlying transport
 *                 to have data ready, but you need to check the value
 *                 of this function first. The reason is that the desired
 *                 data might already be read but not yet processed.
 *                 If, in contrast, a previous call to the SSL/TLS module
 *                 returned MBEDTLS_ERR_SSL_WANT_READ, it is not necessary
 *                 to call this function, as the latter error code entails
 *                 that all internal data has been processed.
 *
 */

Func mbedtls_ssl_get_bytes_avail

size_t mbedtls_ssl_get_bytes_avail( const mbedtls_ssl_context *ssl );
/**
 * \brief          Return the number of application data bytes
 *                 remaining to be read from the current record.
 *
 * \param ssl      SSL context
 *
 * \return         How many bytes are available in the application
 *                 data record read buffer.
 *
 * \note           When working over a datagram transport, this is
 *                 useful to detect the current datagram's boundary
 *                 in case \c mbedtls_ssl_read has written the maximal
 *                 amount of data fitting into the input buffer.
 *
 */

Func mbedtls_ssl_get_verify_result

uint32_t mbedtls_ssl_get_verify_result( const mbedtls_ssl_context *ssl );
/**
 * \brief          Return the result of the certificate verification
 *
 * \param ssl      The SSL context to use.
 *
 * \return         \c 0 if the certificate verification was successful.
 * \return         \c -1u if the result is not available. This may happen
 *                 e.g. if the handshake aborts early, or a verification
 *                 callback returned a fatal error.
 * \return         A bitwise combination of \c MBEDTLS_X509_BADCERT_XXX
 *                 and \c MBEDTLS_X509_BADCRL_XXX failure flags; see x509.h.
 */

Func mbedtls_ssl_get_record_expansion

int mbedtls_ssl_get_record_expansion( const mbedtls_ssl_context *ssl );
/**
 * \brief          Return the (maximum) number of bytes added by the record
 *                 layer: header + encryption/MAC overhead (inc. padding)
 *
 * \note           This function is not available (always returns an error)
 *                 when record compression is enabled.
 *
 * \param ssl      SSL context
 *
 * \return         Current maximum record expansion in bytes, or
 *                 MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE if compression is
 *                 enabled, which makes expansion much less predictable
 */

Func mbedtls_ssl_get_max_frag_len

size_t mbedtls_ssl_get_max_frag_len( const mbedtls_ssl_context *ssl );
/**
 * \brief          Return the maximum fragment length (payload, in bytes).
 *                 This is the value negotiated with peer if any,
 *                 or the locally configured value.
 *
 * \sa             mbedtls_ssl_conf_max_frag_len()
 * \sa             mbedtls_ssl_get_max_record_payload()
 *
 * \param ssl      SSL context
 *
 * \return         Current maximum fragment length.
 */

Func mbedtls_ssl_get_max_out_record_payload

int mbedtls_ssl_get_max_out_record_payload( const mbedtls_ssl_context *ssl );
/**
 * \brief          Return the current maximum outgoing record payload in bytes.
 *                 This takes into account the config.h setting \c
 *                 MBEDTLS_SSL_OUT_CONTENT_LEN, the configured and negotiated
 *                 max fragment length extension if used, and for DTLS the
 *                 path MTU as configured and current record expansion.
 *
 * \note           With DTLS, \c mbedtls_ssl_write() will return an error if
 *                 called with a larger length value.
 *                 With TLS, \c mbedtls_ssl_write() will fragment the input if
 *                 necessary and return the number of bytes written; it is up
 *                 to the caller to call \c mbedtls_ssl_write() again in
 *                 order to send the remaining bytes if any.
 *
 * \note           This function is not available (always returns an error)
 *                 when record compression is enabled.
 *
 * \sa             mbedtls_ssl_set_mtu()
 * \sa             mbedtls_ssl_get_max_frag_len()
 * \sa             mbedtls_ssl_get_record_expansion()
 *
 * \param ssl      SSL context
 *
 * \return         Current maximum payload for an outgoing record,
 *                 or a negative error code.
 */

Func mbedtls_ssl_get_session

int mbedtls_ssl_get_session( const mbedtls_ssl_context *ssl, mbedtls_ssl_session *session );
/**
 * \brief          Save session in order to resume it later (client-side only)
 *                 Session data is copied to presented session structure.
 *
 *
 * \param ssl      SSL context
 * \param session  session context
 *
 * \return         0 if successful,
 *                 MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed,
 *                 MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or
 *                 arguments are otherwise invalid.
 *
 * \note           Only the server certificate is copied, and not the full chain,
 *                 so you should not attempt to validate the certificate again
 *                 by calling \c mbedtls_x509_crt_verify() on it.
 *                 Instead, you should use the results from the verification
 *                 in the original handshake by calling \c mbedtls_ssl_get_verify_result()
 *                 after loading the session again into a new SSL context
 *                 using \c mbedtls_ssl_set_session().
 *
 * \note           Once the session object is not needed anymore, you should
 *                 free it by calling \c mbedtls_ssl_session_free().
 *
 * \sa             mbedtls_ssl_set_session()
 */

Func mbedtls_ssl_handshake

int mbedtls_ssl_handshake( mbedtls_ssl_context *ssl );
/**
 * \brief          Perform the SSL handshake
 *
 * \param ssl      SSL context
 *
 * \return         \c 0 if successful.
 * \return         #MBEDTLS_ERR_SSL_WANT_READ or #MBEDTLS_ERR_SSL_WANT_WRITE
 *                 if the handshake is incomplete and waiting for data to
 *                 be available for reading from or writing to the underlying
 *                 transport - in this case you must call this function again
 *                 when the underlying transport is ready for the operation.
 * \return         #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if an asynchronous
 *                 operation is in progress (see
 *                 mbedtls_ssl_conf_async_private_cb()) - in this case you
 *                 must call this function again when the operation is ready.
 * \return         #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS if a cryptographic
 *                 operation is in progress (see mbedtls_ecp_set_max_ops()) -
 *                 in this case you must call this function again to complete
 *                 the handshake when you're done attending other tasks.
 * \return         #MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED if DTLS is in use
 *                 and the client did not demonstrate reachability yet - in
 *                 this case you must stop using the context (see below).
 * \return         Another SSL error code - in this case you must stop using
 *                 the context (see below).
 *
 * \warning        If this function returns something other than
 *                 \c 0,
 *                 #MBEDTLS_ERR_SSL_WANT_READ,
 *                 #MBEDTLS_ERR_SSL_WANT_WRITE,
 *                 #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS or
 *                 #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS,
 *                 you must stop using the SSL context for reading or writing,
 *                 and either free it or call \c mbedtls_ssl_session_reset()
 *                 on it before re-using it for a new connection; the current
 *                 connection must be closed.
 *
 * \note           If DTLS is in use, then you may choose to handle
 *                 #MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED specially for logging
 *                 purposes, as it is an expected return value rather than an
 *                 actual error, but you still need to reset/free the context.
 *
 * \note           Remarks regarding event-driven DTLS:
 *                 If the function returns #MBEDTLS_ERR_SSL_WANT_READ, no datagram
 *                 from the underlying transport layer is currently being processed,
 *                 and it is safe to idle until the timer or the underlying transport
 *                 signal a new event. This is not true for a successful handshake,
 *                 in which case the datagram of the underlying transport that is
 *                 currently being processed might or might not contain further
 *                 DTLS records.
 */

Func mbedtls_ssl_handshake_step

int mbedtls_ssl_handshake_step( mbedtls_ssl_context *ssl );
/**
 * \brief          Perform a single step of the SSL handshake
 *
 * \note           The state of the context (ssl->state) will be at
 *                 the next state after this function returns \c 0. Do not
 *                 call this function if state is MBEDTLS_SSL_HANDSHAKE_OVER.
 *
 * \param ssl      SSL context
 *
 * \return         See mbedtls_ssl_handshake().
 *
 * \warning        If this function returns something other than \c 0,
 *                 #MBEDTLS_ERR_SSL_WANT_READ, #MBEDTLS_ERR_SSL_WANT_WRITE,
 *                 #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS or
 *                 #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS, you must stop using
 *                 the SSL context for reading or writing, and either free it
 *                 or call \c mbedtls_ssl_session_reset() on it before
 *                 re-using it for a new connection; the current connection
 *                 must be closed.
 */

Func mbedtls_ssl_renegotiate

int mbedtls_ssl_renegotiate( mbedtls_ssl_context *ssl );
/**
 * \brief          Initiate an SSL renegotiation on the running connection.
 *                 Client: perform the renegotiation right now.
 *                 Server: request renegotiation, which will be performed
 *                 during the next call to mbedtls_ssl_read() if honored by
 *                 client.
 *
 * \param ssl      SSL context
 *
 * \return         0 if successful, or any mbedtls_ssl_handshake() return
 *                 value except #MBEDTLS_ERR_SSL_CLIENT_RECONNECT that can't
 *                 happen during a renegotiation.
 *
 * \warning        If this function returns something other than \c 0,
 *                 #MBEDTLS_ERR_SSL_WANT_READ, #MBEDTLS_ERR_SSL_WANT_WRITE,
 *                 #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS or
 *                 #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS, you must stop using
 *                 the SSL context for reading or writing, and either free it
 *                 or call \c mbedtls_ssl_session_reset() on it before
 *                 re-using it for a new connection; the current connection
 *                 must be closed.
 *
 */

Func mbedtls_ssl_read

int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len );
/**
 * \brief          Read at most 'len' application data bytes
 *
 * \param ssl      SSL context
 * \param buf      buffer that will hold the data
 * \param len      maximum number of bytes to read
 *
 * \return         The (positive) number of bytes read if successful.
 * \return         \c 0 if the read end of the underlying transport was closed
 *                 - in this case you must stop using the context (see below).
 * \return         #MBEDTLS_ERR_SSL_WANT_READ or #MBEDTLS_ERR_SSL_WANT_WRITE
 *                 if the handshake is incomplete and waiting for data to
 *                 be available for reading from or writing to the underlying
 *                 transport - in this case you must call this function again
 *                 when the underlying transport is ready for the operation.
 * \return         #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if an asynchronous
 *                 operation is in progress (see
 *                 mbedtls_ssl_conf_async_private_cb()) - in this case you
 *                 must call this function again when the operation is ready.
 * \return         #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS if a cryptographic
 *                 operation is in progress (see mbedtls_ecp_set_max_ops()) -
 *                 in this case you must call this function again to complete
 *                 the handshake when you're done attending other tasks.
 * \return         #MBEDTLS_ERR_SSL_CLIENT_RECONNECT if we're at the server
 *                 side of a DTLS connection and the client is initiating a
 *                 new connection using the same source port. See below.
 * \return         Another SSL error code - in this case you must stop using
 *                 the context (see below).
 *
 * \warning        If this function returns something other than
 *                 a positive value,
 *                 #MBEDTLS_ERR_SSL_WANT_READ,
 *                 #MBEDTLS_ERR_SSL_WANT_WRITE,
 *                 #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS,
 *                 #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS or
 *                 #MBEDTLS_ERR_SSL_CLIENT_RECONNECT,
 *                 you must stop using the SSL context for reading or writing,
 *                 and either free it or call \c mbedtls_ssl_session_reset()
 *                 on it before re-using it for a new connection; the current
 *                 connection must be closed.
 *
 * \note           When this function returns #MBEDTLS_ERR_SSL_CLIENT_RECONNECT
 *                 (which can only happen server-side), it means that a client
 *                 is initiating a new connection using the same source port.
 *                 You can either treat that as a connection close and wait
 *                 for the client to resend a ClientHello, or directly
 *                 continue with \c mbedtls_ssl_handshake() with the same
 *                 context (as it has been reset internally). Either way, you
 *                 must make sure this is seen by the application as a new
 *                 connection: application state, if any, should be reset, and
 *                 most importantly the identity of the client must be checked
 *                 again. WARNING: not validating the identity of the client
 *                 again, or not transmitting the new identity to the
 *                 application layer, would allow authentication bypass!
 *
 * \note           Remarks regarding event-driven DTLS:
 *                 - If the function returns #MBEDTLS_ERR_SSL_WANT_READ, no datagram
 *                   from the underlying transport layer is currently being processed,
 *                   and it is safe to idle until the timer or the underlying transport
 *                   signal a new event.
 *                 - This function may return MBEDTLS_ERR_SSL_WANT_READ even if data was
 *                   initially available on the underlying transport, as this data may have
 *                   been only e.g. duplicated messages or a renegotiation request.
 *                   Therefore, you must be prepared to receive MBEDTLS_ERR_SSL_WANT_READ even
 *                   when reacting to an incoming-data event from the underlying transport.
 *                 - On success, the datagram of the underlying transport that is currently
 *                   being processed may contain further DTLS records. You should call
 *                   \c mbedtls_ssl_check_pending to check for remaining records.
 *
 */

Func mbedtls_ssl_write

int mbedtls_ssl_write( mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len );
/**
 * \brief          Try to write exactly 'len' application data bytes
 *
 * \warning        This function will do partial writes in some cases. If the
 *                 return value is non-negative but less than length, the
 *                 function must be called again with updated arguments:
 *                 buf + ret, len - ret (if ret is the return value) until
 *                 it returns a value equal to the last 'len' argument.
 *
 * \param ssl      SSL context
 * \param buf      buffer holding the data
 * \param len      how many bytes must be written
 *
 * \return         The (non-negative) number of bytes actually written if
 *                 successful (may be less than \p len).
 * \return         #MBEDTLS_ERR_SSL_WANT_READ or #MBEDTLS_ERR_SSL_WANT_WRITE
 *                 if the handshake is incomplete and waiting for data to
 *                 be available for reading from or writing to the underlying
 *                 transport - in this case you must call this function again
 *                 when the underlying transport is ready for the operation.
 * \return         #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if an asynchronous
 *                 operation is in progress (see
 *                 mbedtls_ssl_conf_async_private_cb()) - in this case you
 *                 must call this function again when the operation is ready.
 * \return         #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS if a cryptographic
 *                 operation is in progress (see mbedtls_ecp_set_max_ops()) -
 *                 in this case you must call this function again to complete
 *                 the handshake when you're done attending other tasks.
 * \return         Another SSL error code - in this case you must stop using
 *                 the context (see below).
 *
 * \warning        If this function returns something other than
 *                 a non-negative value,
 *                 #MBEDTLS_ERR_SSL_WANT_READ,
 *                 #MBEDTLS_ERR_SSL_WANT_WRITE,
 *                 #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS or
 *                 #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS,
 *                 you must stop using the SSL context for reading or writing,
 *                 and either free it or call \c mbedtls_ssl_session_reset()
 *                 on it before re-using it for a new connection; the current
 *                 connection must be closed.
 *
 * \note           When this function returns #MBEDTLS_ERR_SSL_WANT_WRITE/READ,
 *                 it must be called later with the *same* arguments,
 *                 until it returns a value greater that or equal to 0. When
 *                 the function returns #MBEDTLS_ERR_SSL_WANT_WRITE there may be
 *                 some partial data in the output buffer, however this is not
 *                 yet sent.
 *
 * \note           If the requested length is greater than the maximum
 *                 fragment length (either the built-in limit or the one set
 *                 or negotiated with the peer), then:
 *                 - with TLS, less bytes than requested are written.
 *                 - with DTLS, MBEDTLS_ERR_SSL_BAD_INPUT_DATA is returned.
 *                 \c mbedtls_ssl_get_max_frag_len() may be used to query the
 *                 active maximum fragment length.
 *
 * \note           Attempting to write 0 bytes will result in an empty TLS
 *                 application record being sent.
 */

Func mbedtls_ssl_send_alert_message

int mbedtls_ssl_send_alert_message( mbedtls_ssl_context *ssl,
                           unsigned char level,
                           unsigned char message );
/**
 * \brief           Send an alert message
 *
 * \param ssl       SSL context
 * \param level     The alert level of the message
 *                  (MBEDTLS_SSL_ALERT_LEVEL_WARNING or MBEDTLS_SSL_ALERT_LEVEL_FATAL)
 * \param message   The alert message (SSL_ALERT_MSG_*)
 *
 * \return          0 if successful, or a specific SSL error code.
 *
 * \note           If this function returns something other than 0 or
 *                 MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using
 *                 the SSL context for reading or writing, and either free it or
 *                 call \c mbedtls_ssl_session_reset() on it before re-using it
 *                 for a new connection; the current connection must be closed.
 */

Func mbedtls_ssl_close_notify

int mbedtls_ssl_close_notify( mbedtls_ssl_context *ssl );
/**
 * \brief          Notify the peer that the connection is being closed
 *
 * \param ssl      SSL context
 *
 * \return          0 if successful, or a specific SSL error code.
 *
 * \note           If this function returns something other than 0 or
 *                 MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using
 *                 the SSL context for reading or writing, and either free it or
 *                 call \c mbedtls_ssl_session_reset() on it before re-using it
 *                 for a new connection; the current connection must be closed.
 */

Func mbedtls_ssl_free

void mbedtls_ssl_free( mbedtls_ssl_context *ssl );
/**
 * \brief          Free referenced items in an SSL context and clear memory
 *
 * \param ssl      SSL context
 */

Func mbedtls_ssl_free_session_negotiate_peer_cert

void mbedtls_ssl_free_session_negotiate_peer_cert( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_config_init

void mbedtls_ssl_config_init( mbedtls_ssl_config *conf );
/**
 * \brief          Initialize an SSL configuration context
 *                 Just makes the context ready for
 *                 mbedtls_ssl_config_defaults() or mbedtls_ssl_config_free().
 *
 * \note           You need to call mbedtls_ssl_config_defaults() unless you
 *                 manually set all of the relevent fields yourself.
 *
 * \param conf     SSL configuration context
 */

Func mbedtls_ssl_config_defaults

int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf,
                                int endpoint, int transport, int preset );
/**
 * \brief          Load reasonnable default SSL configuration values.
 *                 (You need to call mbedtls_ssl_config_init() first.)
 *
 * \param conf     SSL configuration context
 * \param endpoint MBEDTLS_SSL_IS_CLIENT or MBEDTLS_SSL_IS_SERVER
 * \param transport MBEDTLS_SSL_TRANSPORT_STREAM for TLS, or
 *                  MBEDTLS_SSL_TRANSPORT_DATAGRAM for DTLS
 * \param preset   a MBEDTLS_SSL_PRESET_XXX value
 *
 * \note           See \c mbedtls_ssl_conf_transport() for notes on DTLS.
 *
 * \return         0 if successful, or
 *                 MBEDTLS_ERR_XXX_ALLOC_FAILED on memory allocation error.
 */

Func mbedtls_ssl_config_free

void mbedtls_ssl_config_free( mbedtls_ssl_config *conf );
/**
 * \brief          Free an SSL configuration context
 *
 * \param conf     SSL configuration context
 */

Func mbedtls_ssl_session_init

void mbedtls_ssl_session_init( mbedtls_ssl_session *session );
/**
 * \brief          Initialize SSL session structure
 *
 * \param session  SSL session
 */

Func mbedtls_ssl_session_free

void mbedtls_ssl_session_free( mbedtls_ssl_session *session );
/**
 * \brief          Free referenced items in an SSL session including the
 *                 peer certificate and clear memory
 *
 * \note           A session object can be freed even if the SSL context
 *                 that was used to retrieve the session is still in use.
 *
 * \param session  SSL session
 */

Func mbedtls_ssl_session_free_peer_cert

void mbedtls_ssl_session_free_peer_cert( mbedtls_ssl_session *session );


      

Func mbedtls_ssl_cache_init

void mbedtls_ssl_cache_init( mbedtls_ssl_cache_context *cache );
/**
 * \brief          Initialize an SSL cache context
 *
 * \param cache    SSL cache context
 */

Func mbedtls_ssl_cache_get

int mbedtls_ssl_cache_get( void *data, mbedtls_ssl_session *session );
/**
 * \brief          Cache get callback implementation
 *                 (Thread-safe if MBEDTLS_THREADING_C is enabled)
 *
 * \param data     SSL cache context
 * \param session  session to retrieve entry for
 */

Func mbedtls_ssl_cache_set

int mbedtls_ssl_cache_set( void *data, const mbedtls_ssl_session *session );
/**
 * \brief          Cache set callback implementation
 *                 (Thread-safe if MBEDTLS_THREADING_C is enabled)
 *
 * \param data     SSL cache context
 * \param session  session to store entry for
 */

Func mbedtls_ssl_cache_set_timeout

void mbedtls_ssl_cache_set_timeout( mbedtls_ssl_cache_context *cache, int timeout );
/**
 * \brief          Set the cache timeout
 *                 (Default: MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT (1 day))
 *
 *                 A timeout of 0 indicates no timeout.
 *
 * \param cache    SSL cache context
 * \param timeout  cache entry timeout in seconds
 */

Func mbedtls_ssl_cache_set_max_entries

void mbedtls_ssl_cache_set_max_entries( mbedtls_ssl_cache_context *cache, int max );
/**
 * \brief          Set the maximum number of cache entries
 *                 (Default: MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES (50))
 *
 * \param cache    SSL cache context
 * \param max      cache entry maximum
 */

Func mbedtls_ssl_cache_free

void mbedtls_ssl_cache_free( mbedtls_ssl_cache_context *cache );
/**
 * \brief          Free referenced items in a cache context and clear memory
 *
 * \param cache    SSL cache context
 */

Func mbedtls_ssl_ciphersuite_uses_ec

int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info );


      

Func mbedtls_ssl_ciphersuite_uses_psk

int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info );


      
      
void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx );
/**
 * \brief          Initialize cookie context
 */
int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx,
                     int (*f_rng)(void *, unsigned char *, size_t),
                     void *p_rng );
/**
 * \brief          Setup cookie context (generate keys)
 */
void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay );
/**
 * \brief          Set expiration delay for cookies
 *                 (Default MBEDTLS_SSL_COOKIE_TIMEOUT)
 *
 * \param ctx      Cookie contex
 * \param delay    Delay, in seconds if HAVE_TIME, or in number of cookies
 *                 issued in the meantime.
 *                 0 to disable expiration (NOT recommended)
 */
void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx );
/**
 * \brief          Free cookie context
 */

Func mbedtls_ssl_sig_hash_set_add

void mbedtls_ssl_sig_hash_set_add( mbedtls_ssl_sig_hash_set_t *set,
                                  mbedtls_pk_type_t sig_alg,
                                  mbedtls_md_type_t md_alg );
/* Add a signature-hash-pair to a signature-hash set */

Func mbedtls_ssl_sig_hash_set_const_hash

void mbedtls_ssl_sig_hash_set_const_hash( mbedtls_ssl_sig_hash_set_t *set,
                                         mbedtls_md_type_t md_alg );
/* Allow exactly one hash algorithm for each signature. */

Func mbedtls_ssl_transform_free

void mbedtls_ssl_transform_free( mbedtls_ssl_transform *transform );
/**
 * \brief           Free referenced items in an SSL transform context and clear
 *                  memory
 *
 * \param transform SSL transform context
 */

Func mbedtls_ssl_handshake_free

void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl );
/**
 * \brief           Free referenced items in an SSL handshake context and clear
 *                  memory
 *
 * \param ssl       SSL context
 */

Func mbedtls_ssl_handshake_client_step

int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_handshake_server_step

int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_handshake_wrapup

void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_send_fatal_handshake_failure

int mbedtls_ssl_send_fatal_handshake_failure( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_reset_checksum

void mbedtls_ssl_reset_checksum( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_derive_keys

int mbedtls_ssl_derive_keys( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_handle_message_type

int mbedtls_ssl_handle_message_type( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_prepare_handshake_record

int mbedtls_ssl_prepare_handshake_record( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_update_handshake_status

void mbedtls_ssl_update_handshake_status( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_read_record

int mbedtls_ssl_read_record( mbedtls_ssl_context *ssl,
                            unsigned update_hs_digest );
/**
 * \brief       Update record layer
 *
 *              This function roughly separates the implementation
 *              of the logic of (D)TLS from the implementation
 *              of the secure transport.
 *
 * \param  ssl              The SSL context to use.
 * \param  update_hs_digest This indicates if the handshake digest
 *                          should be automatically updated in case
 *                          a handshake message is found.
 *
 * \return      0 or non-zero error code.
 *
 * \note        A clarification on what is called 'record layer' here
 *              is in order, as many sensible definitions are possible:
 *
 *              The record layer takes as input an untrusted underlying
 *              transport (stream or datagram) and transforms it into
 *              a serially multiplexed, secure transport, which
 *              conceptually provides the following:
 *
 *              (1) Three datagram based, content-agnostic transports
 *                  for handshake, alert and CCS messages.
 *              (2) One stream- or datagram-based transport
 *                  for application data.
 *              (3) Functionality for changing the underlying transform
 *                  securing the contents.
 *
 *              The interface to this functionality is given as follows:
 *
 *              a Updating
 *                [Currently implemented by mbedtls_ssl_read_record]
 *
 *                Check if and on which of the four 'ports' data is pending:
 *                Nothing, a controlling datagram of type (1), or application
 *                data (2). In any case data is present, internal buffers
 *                provide access to the data for the user to process it.
 *                Consumption of type (1) datagrams is done automatically
 *                on the next update, invalidating that the internal buffers
 *                for previous datagrams, while consumption of application
 *                data (2) is user-controlled.
 *
 *              b Reading of application data
 *                [Currently manual adaption of ssl->in_offt pointer]
 *
 *                As mentioned in the last paragraph, consumption of data
 *                is different from the automatic consumption of control
 *                datagrams (1) because application data is treated as a stream.
 *
 *              c Tracking availability of application data
 *                [Currently manually through decreasing ssl->in_msglen]
 *
 *                For efficiency and to retain datagram semantics for
 *                application data in case of DTLS, the record layer
 *                provides functionality for checking how much application
 *                data is still available in the internal buffer.
 *
 *              d Changing the transformation securing the communication.
 *
 *              Given an opaque implementation of the record layer in the
 *              above sense, it should be possible to implement the logic
 *              of (D)TLS on top of it without the need to know anything
 *              about the record layer's internals. This is done e.g.
 *              in all the handshake handling functions, and in the
 *              application data reading function mbedtls_ssl_read.
 *
 * \note        The above tries to give a conceptual picture of the
 *              record layer, but the current implementation deviates
 *              from it in some places. For example, our implementation of
 *              the update functionality through mbedtls_ssl_read_record
 *              discards datagrams depending on the current state, which
 *              wouldn't fall under the record layer's responsibility
 *              following the above definition.
 *
 */

Func mbedtls_ssl_fetch_input

int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want );


      

Func mbedtls_ssl_write_handshake_msg

int mbedtls_ssl_write_handshake_msg( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_write_record

int mbedtls_ssl_write_record( mbedtls_ssl_context *ssl, uint8_t force_flush );


      

Func mbedtls_ssl_flush_output

int mbedtls_ssl_flush_output( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_parse_certificate

int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_write_certificate

int mbedtls_ssl_write_certificate( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_parse_change_cipher_spec

int mbedtls_ssl_parse_change_cipher_spec( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_write_change_cipher_spec

int mbedtls_ssl_write_change_cipher_spec( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_parse_finished

int mbedtls_ssl_parse_finished( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_write_finished

int mbedtls_ssl_write_finished( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_optimize_checksum

void mbedtls_ssl_optimize_checksum( mbedtls_ssl_context *ssl,
                           const mbedtls_ssl_ciphersuite_t *ciphersuite_info );


      

Func mbedtls_ssl_psk_derive_premaster

int mbedtls_ssl_psk_derive_premaster( mbedtls_ssl_context *ssl, mbedtls_key_exchange_type_t key_ex );


      

Func mbedtls_ssl_set_calc_verify_md

int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md );


      

Func mbedtls_ssl_check_curve

int mbedtls_ssl_check_curve( const mbedtls_ssl_context *ssl, mbedtls_ecp_group_id grp_id );


      

Func mbedtls_ssl_check_sig_hash

int mbedtls_ssl_check_sig_hash( const mbedtls_ssl_context *ssl,
                               mbedtls_md_type_t md );


      

Func mbedtls_ssl_check_cert_usage

int mbedtls_ssl_check_cert_usage( const mbedtls_x509_crt *cert,
                         const mbedtls_ssl_ciphersuite_t *ciphersuite,
                         int cert_endpoint,
                         uint32_t *flags );
/*
 * Check usage of a certificate wrt extensions:
 * keyUsage, extendedKeyUsage (later), and nSCertType (later).
 *
 * Warning: cert_endpoint is the endpoint of the cert (ie, of our peer when we
 * check a cert we received from them)!
 *
 * Return 0 if everything is OK, -1 if not.
 */

Func mbedtls_ssl_write_version

void mbedtls_ssl_write_version( int major, int minor, int transport,
                       unsigned char ver[2] );


      

Func mbedtls_ssl_read_version

void mbedtls_ssl_read_version( int *major, int *minor, int transport,
                      const unsigned char ver[2] );


      

Func mbedtls_ssl_send_flight_completed

void mbedtls_ssl_send_flight_completed( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_recv_flight_completed

void mbedtls_ssl_recv_flight_completed( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_resend

int mbedtls_ssl_resend( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_flight_transmit

int mbedtls_ssl_flight_transmit( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_dtls_replay_check

int mbedtls_ssl_dtls_replay_check( mbedtls_ssl_context *ssl );


      

Func mbedtls_ssl_dtls_replay_update

void mbedtls_ssl_dtls_replay_update( mbedtls_ssl_context *ssl );


      

Func return

return( diff );


      

Func mbedtls_ssl_get_key_exchange_md_ssl_tls

int mbedtls_ssl_get_key_exchange_md_ssl_tls( mbedtls_ssl_context *ssl,
                                       unsigned char *output,
                                       unsigned char *data, size_t data_len );


      

Func mbedtls_ssl_get_key_exchange_md_tls1_2

int mbedtls_ssl_get_key_exchange_md_tls1_2( mbedtls_ssl_context *ssl,
                                           unsigned char *hash, size_t *hashlen,
                                           unsigned char *data, size_t data_len,
                                           mbedtls_md_type_t md_alg );


      

Func mbedtls_ssl_ticket_init

void mbedtls_ssl_ticket_init( mbedtls_ssl_ticket_context *ctx );
/**
 * \brief           Initialize a ticket context.
 *                  (Just make it ready for mbedtls_ssl_ticket_setup()
 *                  or mbedtls_ssl_ticket_free().)
 *
 * \param ctx       Context to be initialized
 */

Func mbedtls_ssl_ticket_setup

int mbedtls_ssl_ticket_setup( mbedtls_ssl_ticket_context *ctx,
   int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
   mbedtls_cipher_type_t cipher,
   uint32_t lifetime );
/**
 * \brief           Prepare context to be actually used
 *
 * \param ctx       Context to be set up
 * \param f_rng     RNG callback function
 * \param p_rng     RNG callback context
 * \param cipher    AEAD cipher to use for ticket protection.
 *                  Recommended value: MBEDTLS_CIPHER_AES_256_GCM.
 * \param lifetime  Tickets lifetime in seconds
 *                  Recommended value: 86400 (one day).
 *
 * \note            It is highly recommended to select a cipher that is at
 *                  least as strong as the the strongest ciphersuite
 *                  supported. Usually that means a 256-bit key.
 *
 * \note            The lifetime of the keys is twice the lifetime of tickets.
 *                  It is recommended to pick a reasonnable lifetime so as not
 *                  to negate the benefits of forward secrecy.
 *
 * \return          0 if successful,
 *                  or a specific MBEDTLS_ERR_XXX error code
 */

Func mbedtls_ssl_ticket_free

void mbedtls_ssl_ticket_free( mbedtls_ssl_ticket_context *ctx );
/**
 * \brief           Free a context's content and zeroize it.
 *
 * \param ctx       Context to be cleaned up
 */

Func mbedtls_threading_set_alt

void mbedtls_threading_set_alt( void (*mutex_init)( mbedtls_threading_mutex_t * ),
                      void (*mutex_free)( mbedtls_threading_mutex_t * ),
                      int (*mutex_lock)( mbedtls_threading_mutex_t * ),
                      int (*mutex_unlock)( mbedtls_threading_mutex_t * ) );
/**
 * \brief           Set your alternate threading implementation function
 *                  pointers and initialize global mutexes. If used, this
 *                  function must be called once in the main thread before any
 *                  other mbed TLS function is called, and
 *                  mbedtls_threading_free_alt() must be called once in the main
 *                  thread after all other mbed TLS functions.
 *
 * \note            mutex_init() and mutex_free() don't return a status code.
 *                  If mutex_init() fails, it should leave its argument (the
 *                  mutex) in a state such that mutex_lock() will fail when
 *                  called with this argument.
 *
 * \param mutex_init    the init function implementation
 * \param mutex_free    the free function implementation
 * \param mutex_lock    the lock function implementation
 * \param mutex_unlock  the unlock function implementation
 */

Func mbedtls_threading_free_alt

void mbedtls_threading_free_alt( void );
/**
 * \brief               Free global mutexes.
 */

Func mbedtls_timing_hardclock

unsigned long mbedtls_timing_hardclock( void );
/**
 * \brief          Return the CPU cycle counter value
 *
 * \warning        This is only a best effort! Do not rely on this!
 *                 In particular, it is known to be unreliable on virtual
 *                 machines.
 *
 * \note           This value starts at an unspecified origin and
 *                 may wrap around.
 */

Func mbedtls_timing_get_timer

unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset );
/**
 * \brief          Return the elapsed time in milliseconds
 *
 * \param val      points to a timer structure
 * \param reset    If 0, query the elapsed time. Otherwise (re)start the timer.
 *
 * \return         Elapsed time since the previous reset in ms. When
 *                 restarting, this is always 0.
 *
 * \note           To initialize a timer, call this function with reset=1.
 *
 *                 Determining the elapsed time and resetting the timer is not
 *                 atomic on all platforms, so after the sequence
 *                 `{ get_timer(1); ...; time1 = get_timer(1); ...; time2 =
 *                 get_timer(0) }` the value time1+time2 is only approximately
 *                 the delay since the first reset.
 */

Func mbedtls_set_alarm

void mbedtls_set_alarm( int seconds );
/**
 * \brief          Setup an alarm clock
 *
 * \param seconds  delay before the "mbedtls_timing_alarmed" flag is set
 *                 (must be >=0)
 *
 * \warning        Only one alarm at a time  is supported. In a threaded
 *                 context, this means one for the whole process, not one per
 *                 thread.
 */

Func mbedtls_timing_set_delay

void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms );
/**
 * \brief          Set a pair of delays to watch
 *                 (See \c mbedtls_timing_get_delay().)
 *
 * \param data     Pointer to timing data.
 *                 Must point to a valid \c mbedtls_timing_delay_context struct.
 * \param int_ms   First (intermediate) delay in milliseconds.
 *                 The effect if int_ms > fin_ms is unspecified.
 * \param fin_ms   Second (final) delay in milliseconds.
 *                 Pass 0 to cancel the current delay.
 *
 * \note           To set a single delay, either use \c mbedtls_timing_set_timer
 *                 directly or use this function with int_ms == fin_ms.
 */

Func mbedtls_timing_get_delay

int mbedtls_timing_get_delay( void *data );
/**
 * \brief          Get the status of delays
 *                 (Memory helper: number of delays passed.)
 *
 * \param data     Pointer to timing data
 *                 Must point to a valid \c mbedtls_timing_delay_context struct.
 *
 * \return         -1 if cancelled (fin_ms = 0),
 *                  0 if none of the delays are passed,
 *                  1 if only the intermediate delay is passed,
 *                  2 if the final delay is passed.
 */

Func mbedtls_timing_self_test

int mbedtls_timing_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if a test failed
 */

Func mbedtls_version_get_number

unsigned int mbedtls_version_get_number( void );
/**
 * Get the version number.
 *
 * \return          The constructed version number in the format
 *                  MMNNPP00 (Major, Minor, Patch).
 */

Func mbedtls_version_get_string

void mbedtls_version_get_string( char *string );
/**
 * Get the version string ("x.y.z").
 *
 * \param string    The string that will receive the value.
 *                  (Should be at least 9 bytes in size)
 */

Func mbedtls_version_get_string_full

void mbedtls_version_get_string_full( char *string );
/**
 * Get the full version string ("mbed TLS x.y.z").
 *
 * \param string    The string that will receive the value. The mbed TLS version
 *                  string will use 18 bytes AT MOST including a terminating
 *                  null byte.
 *                  (So the buffer should be at least 18 bytes to receive this
 *                  version string).
 */

Func mbedtls_version_check_feature

int mbedtls_version_check_feature( const char *feature );
/**
 * \brief           Check if support for a feature was compiled into this
 *                  mbed TLS binary. This allows you to see at runtime if the
 *                  library was for instance compiled with or without
 *                  Multi-threading support.
 *
 * \note            only checks against defines in the sections "System
 *                  support", "mbed TLS modules" and "mbed TLS feature
 *                  support" in config.h
 *
 * \param feature   The string for the define to check (e.g. "MBEDTLS_AES_C")
 *
 * \return          0 if the feature is present,
 *                  -1 if the feature is not present and
 *                  -2 if support for feature checking as a whole was not
 *                  compiled in.
 */

Func mbedtls_x509_dn_gets

int mbedtls_x509_dn_gets( char *buf, size_t size, const mbedtls_x509_name *dn );
/**
 * \brief          Store the certificate DN in printable form into buf;
 *                 no more than size characters will be written.
 *
 * \param buf      Buffer to write to
 * \param size     Maximum size of buffer
 * \param dn       The X509 name to represent
 *
 * \return         The length of the string written (not including the
 *                 terminated nul byte), or a negative error code.
 */

Func mbedtls_x509_serial_gets

int mbedtls_x509_serial_gets( char *buf, size_t size, const mbedtls_x509_buf *serial );
/**
 * \brief          Store the certificate serial in printable form into buf;
 *                 no more than size characters will be written.
 *
 * \param buf      Buffer to write to
 * \param size     Maximum size of buffer
 * \param serial   The X509 serial to represent
 *
 * \return         The length of the string written (not including the
 *                 terminated nul byte), or a negative error code.
 */

Func mbedtls_x509_time_is_past

int mbedtls_x509_time_is_past( const mbedtls_x509_time *to );
/**
 * \brief          Check a given mbedtls_x509_time against the system time
 *                 and tell if it's in the past.
 *
 * \note           Intended usage is "if( is_past( valid_to ) ) ERROR".
 *                 Hence the return value of 1 if on internal errors.
 *
 * \param to       mbedtls_x509_time to check
 *
 * \return         1 if the given time is in the past or an error occured,
 *                 0 otherwise.
 */

Func mbedtls_x509_time_is_future

int mbedtls_x509_time_is_future( const mbedtls_x509_time *from );
/**
 * \brief          Check a given mbedtls_x509_time against the system time
 *                 and tell if it's in the future.
 *
 * \note           Intended usage is "if( is_future( valid_from ) ) ERROR".
 *                 Hence the return value of 1 if on internal errors.
 *
 * \param from     mbedtls_x509_time to check
 *
 * \return         1 if the given time is in the future or an error occured,
 *                 0 otherwise.
 */

Func mbedtls_x509_self_test

int mbedtls_x509_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Func mbedtls_x509_get_name

int mbedtls_x509_get_name( unsigned char **p, const unsigned char *end,
                  mbedtls_x509_name *cur );
/*
 * Internal module functions. You probably do not want to use these unless you
 * know you do.
 */

Func mbedtls_x509_get_alg_null

int mbedtls_x509_get_alg_null( unsigned char **p, const unsigned char *end,
                      mbedtls_x509_buf *alg );


      

Func mbedtls_x509_get_alg

int mbedtls_x509_get_alg( unsigned char **p, const unsigned char *end,
                 mbedtls_x509_buf *alg, mbedtls_x509_buf *params );


      

Func mbedtls_x509_get_rsassa_pss_params

int mbedtls_x509_get_rsassa_pss_params( const mbedtls_x509_buf *params,
                               mbedtls_md_type_t *md_alg, mbedtls_md_type_t *mgf_md,
                               int *salt_len );


      

Func mbedtls_x509_get_sig

int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig );


      

Func mbedtls_x509_get_sig_alg

int mbedtls_x509_get_sig_alg( const mbedtls_x509_buf *sig_oid, const mbedtls_x509_buf *sig_params,
                     mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg,
                     void **sig_opts );


      

Func mbedtls_x509_get_time

int mbedtls_x509_get_time( unsigned char **p, const unsigned char *end,
                  mbedtls_x509_time *t );


      

Func mbedtls_x509_get_serial

int mbedtls_x509_get_serial( unsigned char **p, const unsigned char *end,
                    mbedtls_x509_buf *serial );


      

Func mbedtls_x509_get_ext

int mbedtls_x509_get_ext( unsigned char **p, const unsigned char *end,
                 mbedtls_x509_buf *ext, int tag );


      

Func mbedtls_x509_sig_alg_gets

int mbedtls_x509_sig_alg_gets( char *buf, size_t size, const mbedtls_x509_buf *sig_oid,
                      mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg,
                      const void *sig_opts );


      

Func mbedtls_x509_key_size_helper

int mbedtls_x509_key_size_helper( char *buf, size_t buf_size, const char *name );


      

Func mbedtls_x509_string_to_names

int mbedtls_x509_string_to_names( mbedtls_asn1_named_data **head, const char *name );


      

Func mbedtls_x509_set_extension

int mbedtls_x509_set_extension( mbedtls_asn1_named_data **head, const char *oid, size_t oid_len,
                       int critical, const unsigned char *val,
                       size_t val_len );


      

Func mbedtls_x509_write_extensions

int mbedtls_x509_write_extensions( unsigned char **p, unsigned char *start,
                          mbedtls_asn1_named_data *first );


      

Func mbedtls_x509_write_names

int mbedtls_x509_write_names( unsigned char **p, unsigned char *start,
                     mbedtls_asn1_named_data *first );


      

Func mbedtls_x509_write_sig

int mbedtls_x509_write_sig( unsigned char **p, unsigned char *start,
                   const char *oid, size_t oid_len,
                   unsigned char *sig, size_t size );


      

Func mbedtls_x509_crl_parse_der

int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain,
                       const unsigned char *buf, size_t buflen );
/**
 * \brief          Parse a DER-encoded CRL and append it to the chained list
 *
 * \param chain    points to the start of the chain
 * \param buf      buffer holding the CRL data in DER format
 * \param buflen   size of the buffer
 *                 (including the terminating null byte for PEM data)
 *
 * \return         0 if successful, or a specific X509 or PEM error code
 */

Func mbedtls_x509_crl_parse

int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen );
/**
 * \brief          Parse one or more CRLs and append them to the chained list
 *
 * \note           Mutliple CRLs are accepted only if using PEM format
 *
 * \param chain    points to the start of the chain
 * \param buf      buffer holding the CRL data in PEM or DER format
 * \param buflen   size of the buffer
 *                 (including the terminating null byte for PEM data)
 *
 * \return         0 if successful, or a specific X509 or PEM error code
 */

Func mbedtls_x509_crl_parse_file

int mbedtls_x509_crl_parse_file( mbedtls_x509_crl *chain, const char *path );
/**
 * \brief          Load one or more CRLs and append them to the chained list
 *
 * \note           Mutliple CRLs are accepted only if using PEM format
 *
 * \param chain    points to the start of the chain
 * \param path     filename to read the CRLs from (in PEM or DER encoding)
 *
 * \return         0 if successful, or a specific X509 or PEM error code
 */

Func mbedtls_x509_crl_info

int mbedtls_x509_crl_info( char *buf, size_t size, const char *prefix,
                  const mbedtls_x509_crl *crl );
/**
 * \brief          Returns an informational string about the CRL.
 *
 * \param buf      Buffer to write to
 * \param size     Maximum size of buffer
 * \param prefix   A line prefix
 * \param crl      The X509 CRL to represent
 *
 * \return         The length of the string written (not including the
 *                 terminated nul byte), or a negative error code.
 */

Func mbedtls_x509_crl_init

void mbedtls_x509_crl_init( mbedtls_x509_crl *crl );
/**
 * \brief          Initialize a CRL (chain)
 *
 * \param crl      CRL chain to initialize
 */

Func mbedtls_x509_crl_free

void mbedtls_x509_crl_free( mbedtls_x509_crl *crl );
/**
 * \brief          Unallocate all CRL data
 *
 * \param crl      CRL chain to free
 */

Func mbedtls_x509_crt_parse_der

int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, const unsigned char *buf,
                       size_t buflen );
/**
 * \brief          Parse a single DER formatted certificate and add it
 *                 to the chained list.
 *
 * \param chain    points to the start of the chain
 * \param buf      buffer holding the certificate DER data
 * \param buflen   size of the buffer
 *
 * \return         0 if successful, or a specific X509 or PEM error code
 */

Func mbedtls_x509_crt_parse

int mbedtls_x509_crt_parse( mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen );
/**
 * \brief          Parse one DER-encoded or one or more concatenated PEM-encoded
 *                 certificates and add them to the chained list.
 *
 *                 For CRTs in PEM encoding, the function parses permissively:
 *                 if at least one certificate can be parsed, the function
 *                 returns the number of certificates for which parsing failed
 *                 (hence \c 0 if all certificates were parsed successfully).
 *                 If no certificate could be parsed, the function returns
 *                 the first (negative) error encountered during parsing.
 *
 *                 PEM encoded certificates may be interleaved by other data
 *                 such as human readable descriptions of their content, as
 *                 long as the certificates are enclosed in the PEM specific
 *                 '-----{BEGIN/END} CERTIFICATE-----' delimiters.
 *
 * \param chain    The chain to which to add the parsed certificates.
 * \param buf      The buffer holding the certificate data in PEM or DER format.
 *                 For certificates in PEM encoding, this may be a concatenation
 *                 of multiple certificates; for DER encoding, the buffer must
 *                 comprise exactly one certificate.
 * \param buflen   The size of \p buf, including the terminating \c NULL byte
 *                 in case of PEM encoded data.
 *
 * \return         \c 0 if all certificates were parsed successfully.
 * \return         The (positive) number of certificates that couldn't
 *                 be parsed if parsing was partly successful (see above).
 * \return         A negative X509 or PEM error code otherwise.
 *
 */

Func mbedtls_x509_crt_parse_file

int mbedtls_x509_crt_parse_file( mbedtls_x509_crt *chain, const char *path );
/**
 * \brief          Load one or more certificates and add them
 *                 to the chained list. Parses permissively. If some
 *                 certificates can be parsed, the result is the number
 *                 of failed certificates it encountered. If none complete
 *                 correctly, the first error is returned.
 *
 * \param chain    points to the start of the chain
 * \param path     filename to read the certificates from
 *
 * \return         0 if all certificates parsed successfully, a positive number
 *                 if partly successful or a specific X509 or PEM error code
 */

Func mbedtls_x509_crt_parse_path

int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path );
/**
 * \brief          Load one or more certificate files from a path and add them
 *                 to the chained list. Parses permissively. If some
 *                 certificates can be parsed, the result is the number
 *                 of failed certificates it encountered. If none complete
 *                 correctly, the first error is returned.
 *
 * \param chain    points to the start of the chain
 * \param path     directory / folder to read the certificate files from
 *
 * \return         0 if all certificates parsed successfully, a positive number
 *                 if partly successful or a specific X509 or PEM error code
 */

Func mbedtls_x509_crt_info

int mbedtls_x509_crt_info( char *buf, size_t size, const char *prefix,
                  const mbedtls_x509_crt *crt );
/**
 * \brief          Returns an informational string about the
 *                 certificate.
 *
 * \param buf      Buffer to write to
 * \param size     Maximum size of buffer
 * \param prefix   A line prefix
 * \param crt      The X509 certificate to represent
 *
 * \return         The length of the string written (not including the
 *                 terminated nul byte), or a negative error code.
 */

Func mbedtls_x509_crt_verify_info

int mbedtls_x509_crt_verify_info( char *buf, size_t size, const char *prefix,
                         uint32_t flags );
/**
 * \brief          Returns an informational string about the
 *                 verification status of a certificate.
 *
 * \param buf      Buffer to write to
 * \param size     Maximum size of buffer
 * \param prefix   A line prefix
 * \param flags    Verification flags created by mbedtls_x509_crt_verify()
 *
 * \return         The length of the string written (not including the
 *                 terminated nul byte), or a negative error code.
 */

Func mbedtls_x509_crt_verify

int mbedtls_x509_crt_verify( mbedtls_x509_crt *crt,
                    mbedtls_x509_crt *trust_ca,
                    mbedtls_x509_crl *ca_crl,
                    const char *cn, uint32_t *flags,
                    int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
                    void *p_vrfy );
/**
 * \brief          Verify the certificate signature
 *
 *                 The verify callback is a user-supplied callback that
 *                 can clear / modify / add flags for a certificate. If set,
 *                 the verification callback is called for each
 *                 certificate in the chain (from the trust-ca down to the
 *                 presented crt). The parameters for the callback are:
 *                 (void *parameter, mbedtls_x509_crt *crt, int certificate_depth,
 *                 int *flags). With the flags representing current flags for
 *                 that specific certificate and the certificate depth from
 *                 the bottom (Peer cert depth = 0).
 *
 *                 All flags left after returning from the callback
 *                 are also returned to the application. The function should
 *                 return 0 for anything (including invalid certificates)
 *                 other than fatal error, as a non-zero return code
 *                 immediately aborts the verification process. For fatal
 *                 errors, a specific error code should be used (different
 *                 from MBEDTLS_ERR_X509_CERT_VERIFY_FAILED which should not
 *                 be returned at this point), or MBEDTLS_ERR_X509_FATAL_ERROR
 *                 can be used if no better code is available.
 *
 * \note           In case verification failed, the results can be displayed
 *                 using \c mbedtls_x509_crt_verify_info()
 *
 * \note           Same as \c mbedtls_x509_crt_verify_with_profile() with the
 *                 default security profile.
 *
 * \note           It is your responsibility to provide up-to-date CRLs for
 *                 all trusted CAs. If no CRL is provided for the CA that was
 *                 used to sign the certificate, CRL verification is skipped
 *                 silently, that is *without* setting any flag.
 *
 * \note           The \c trust_ca list can contain two types of certificates:
 *                 (1) those of trusted root CAs, so that certificates
 *                 chaining up to those CAs will be trusted, and (2)
 *                 self-signed end-entity certificates to be trusted (for
 *                 specific peers you know) - in that case, the self-signed
 *                 certificate doesn't need to have the CA bit set.
 *
 * \param crt      a certificate (chain) to be verified
 * \param trust_ca the list of trusted CAs (see note above)
 * \param ca_crl   the list of CRLs for trusted CAs (see note above)
 * \param cn       expected Common Name (can be set to
 *                 NULL if the CN must not be verified)
 * \param flags    result of the verification
 * \param f_vrfy   verification function
 * \param p_vrfy   verification parameter
 *
 * \return         0 (and flags set to 0) if the chain was verified and valid,
 *                 MBEDTLS_ERR_X509_CERT_VERIFY_FAILED if the chain was verified
 *                 but found to be invalid, in which case *flags will have one
 *                 or more MBEDTLS_X509_BADCERT_XXX or MBEDTLS_X509_BADCRL_XXX
 *                 flags set, or another error (and flags set to 0xffffffff)
 *                 in case of a fatal error encountered during the
 *                 verification process.
 */

Func mbedtls_x509_crt_verify_with_profile

int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt,
                    mbedtls_x509_crt *trust_ca,
                    mbedtls_x509_crl *ca_crl,
                    const mbedtls_x509_crt_profile *profile,
                    const char *cn, uint32_t *flags,
                    int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
                    void *p_vrfy );
/**
 * \brief          Verify the certificate signature according to profile
 *
 * \note           Same as \c mbedtls_x509_crt_verify(), but with explicit
 *                 security profile.
 *
 * \note           The restrictions on keys (RSA minimum size, allowed curves
 *                 for ECDSA) apply to all certificates: trusted root,
 *                 intermediate CAs if any, and end entity certificate.
 *
 * \param crt      a certificate (chain) to be verified
 * \param trust_ca the list of trusted CAs
 * \param ca_crl   the list of CRLs for trusted CAs
 * \param profile  security profile for verification
 * \param cn       expected Common Name (can be set to
 *                 NULL if the CN must not be verified)
 * \param flags    result of the verification
 * \param f_vrfy   verification function
 * \param p_vrfy   verification parameter
 *
 * \return         0 if successful or MBEDTLS_ERR_X509_CERT_VERIFY_FAILED
 *                 in which case *flags will have one or more
 *                 MBEDTLS_X509_BADCERT_XXX or MBEDTLS_X509_BADCRL_XXX flags
 *                 set,
 *                 or another error in case of a fatal error encountered
 *                 during the verification process.
 */

Func mbedtls_x509_crt_verify_restartable

int mbedtls_x509_crt_verify_restartable( mbedtls_x509_crt *crt,
                    mbedtls_x509_crt *trust_ca,
                    mbedtls_x509_crl *ca_crl,
                    const mbedtls_x509_crt_profile *profile,
                    const char *cn, uint32_t *flags,
                    int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *),
                    void *p_vrfy,
                    mbedtls_x509_crt_restart_ctx *rs_ctx );
/**
 * \brief          Restartable version of \c mbedtls_crt_verify_with_profile()
 *
 * \note           Performs the same job as \c mbedtls_crt_verify_with_profile()
 *                 but can return early and restart according to the limit
 *                 set with \c mbedtls_ecp_set_max_ops() to reduce blocking.
 *
 * \param crt      a certificate (chain) to be verified
 * \param trust_ca the list of trusted CAs
 * \param ca_crl   the list of CRLs for trusted CAs
 * \param profile  security profile for verification
 * \param cn       expected Common Name (can be set to
 *                 NULL if the CN must not be verified)
 * \param flags    result of the verification
 * \param f_vrfy   verification function
 * \param p_vrfy   verification parameter
 * \param rs_ctx   restart context (NULL to disable restart)
 *
 * \return         See \c mbedtls_crt_verify_with_profile(), or
 * \return         #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of
 *                 operations was reached: see \c mbedtls_ecp_set_max_ops().
 */

Func mbedtls_x509_crt_check_key_usage

int mbedtls_x509_crt_check_key_usage( const mbedtls_x509_crt *crt,
                                     unsigned int usage );
/**
 * \brief          Check usage of certificate against keyUsage extension.
 *
 * \param crt      Leaf certificate used.
 * \param usage    Intended usage(s) (eg MBEDTLS_X509_KU_KEY_ENCIPHERMENT
 *                 before using the certificate to perform an RSA key
 *                 exchange).
 *
 * \note           Except for decipherOnly and encipherOnly, a bit set in the
 *                 usage argument means this bit MUST be set in the
 *                 certificate. For decipherOnly and encipherOnly, it means
 *                 that bit MAY be set.
 *
 * \return         0 is these uses of the certificate are allowed,
 *                 MBEDTLS_ERR_X509_BAD_INPUT_DATA if the keyUsage extension
 *                 is present but does not match the usage argument.
 *
 * \note           You should only call this function on leaf certificates, on
 *                 (intermediate) CAs the keyUsage extension is automatically
 *                 checked by \c mbedtls_x509_crt_verify().
 */

Func mbedtls_x509_crt_check_extended_key_usage

int mbedtls_x509_crt_check_extended_key_usage( const mbedtls_x509_crt *crt,
                                              const char *usage_oid,
                                              size_t usage_len );
/**
 * \brief           Check usage of certificate against extendedKeyUsage.
 *
 * \param crt       Leaf certificate used.
 * \param usage_oid Intended usage (eg MBEDTLS_OID_SERVER_AUTH or
 *                  MBEDTLS_OID_CLIENT_AUTH).
 * \param usage_len Length of usage_oid (eg given by MBEDTLS_OID_SIZE()).
 *
 * \return          0 if this use of the certificate is allowed,
 *                  MBEDTLS_ERR_X509_BAD_INPUT_DATA if not.
 *
 * \note            Usually only makes sense on leaf certificates.
 */

Func mbedtls_x509_crt_is_revoked

int mbedtls_x509_crt_is_revoked( const mbedtls_x509_crt *crt, const mbedtls_x509_crl *crl );
/**
 * \brief          Verify the certificate revocation status
 *
 * \param crt      a certificate to be verified
 * \param crl      the CRL to verify against
 *
 * \return         1 if the certificate is revoked, 0 otherwise
 *
 */

Func mbedtls_x509_crt_init

void mbedtls_x509_crt_init( mbedtls_x509_crt *crt );
/**
 * \brief          Initialize a certificate (chain)
 *
 * \param crt      Certificate chain to initialize
 */

Func mbedtls_x509_crt_free

void mbedtls_x509_crt_free( mbedtls_x509_crt *crt );
/**
 * \brief          Unallocate all certificate data
 *
 * \param crt      Certificate chain to free
 */

Func mbedtls_x509_crt_restart_init

void mbedtls_x509_crt_restart_init( mbedtls_x509_crt_restart_ctx *ctx );
/**
 * \brief           Initialize a restart context
 */

Func mbedtls_x509_crt_restart_free

void mbedtls_x509_crt_restart_free( mbedtls_x509_crt_restart_ctx *ctx );
/**
 * \brief           Free the components of a restart context
 */

Func mbedtls_x509write_crt_init

void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx );
/**
 * \brief           Initialize a CRT writing context
 *
 * \param ctx       CRT context to initialize
 */

Func mbedtls_x509write_crt_set_version

void mbedtls_x509write_crt_set_version( mbedtls_x509write_cert *ctx, int version );
/**
 * \brief           Set the verion for a Certificate
 *                  Default: MBEDTLS_X509_CRT_VERSION_3
 *
 * \param ctx       CRT context to use
 * \param version   version to set (MBEDTLS_X509_CRT_VERSION_1, MBEDTLS_X509_CRT_VERSION_2 or
 *                                  MBEDTLS_X509_CRT_VERSION_3)
 */

Func mbedtls_x509write_crt_set_serial

int mbedtls_x509write_crt_set_serial( mbedtls_x509write_cert *ctx, const mbedtls_mpi *serial );
/**
 * \brief           Set the serial number for a Certificate.
 *
 * \param ctx       CRT context to use
 * \param serial    serial number to set
 *
 * \return          0 if successful
 */

Func mbedtls_x509write_crt_set_validity

int mbedtls_x509write_crt_set_validity( mbedtls_x509write_cert *ctx, const char *not_before,
                               const char *not_after );
/**
 * \brief           Set the validity period for a Certificate
 *                  Timestamps should be in string format for UTC timezone
 *                  i.e. "YYYYMMDDhhmmss"
 *                  e.g. "20131231235959" for December 31st 2013
 *                       at 23:59:59
 *
 * \param ctx       CRT context to use
 * \param not_before    not_before timestamp
 * \param not_after     not_after timestamp
 *
 * \return          0 if timestamp was parsed successfully, or
 *                  a specific error code
 */

Func mbedtls_x509write_crt_set_issuer_name

int mbedtls_x509write_crt_set_issuer_name( mbedtls_x509write_cert *ctx,
                                  const char *issuer_name );
/**
 * \brief           Set the issuer name for a Certificate
 *                  Issuer names should contain a comma-separated list
 *                  of OID types and values:
 *                  e.g. "C=UK,O=ARM,CN=mbed TLS CA"
 *
 * \param ctx           CRT context to use
 * \param issuer_name   issuer name to set
 *
 * \return          0 if issuer name was parsed successfully, or
 *                  a specific error code
 */

Func mbedtls_x509write_crt_set_subject_name

int mbedtls_x509write_crt_set_subject_name( mbedtls_x509write_cert *ctx,
                                   const char *subject_name );
/**
 * \brief           Set the subject name for a Certificate
 *                  Subject names should contain a comma-separated list
 *                  of OID types and values:
 *                  e.g. "C=UK,O=ARM,CN=mbed TLS Server 1"
 *
 * \param ctx           CRT context to use
 * \param subject_name  subject name to set
 *
 * \return          0 if subject name was parsed successfully, or
 *                  a specific error code
 */

Func mbedtls_x509write_crt_set_subject_key

void mbedtls_x509write_crt_set_subject_key( mbedtls_x509write_cert *ctx, mbedtls_pk_context *key );
/**
 * \brief           Set the subject public key for the certificate
 *
 * \param ctx       CRT context to use
 * \param key       public key to include
 */

Func mbedtls_x509write_crt_set_issuer_key

void mbedtls_x509write_crt_set_issuer_key( mbedtls_x509write_cert *ctx, mbedtls_pk_context *key );
/**
 * \brief           Set the issuer key used for signing the certificate
 *
 * \param ctx       CRT context to use
 * \param key       private key to sign with
 */

Func mbedtls_x509write_crt_set_md_alg

void mbedtls_x509write_crt_set_md_alg( mbedtls_x509write_cert *ctx, mbedtls_md_type_t md_alg );
/**
 * \brief           Set the MD algorithm to use for the signature
 *                  (e.g. MBEDTLS_MD_SHA1)
 *
 * \param ctx       CRT context to use
 * \param md_alg    MD algorithm to use
 */

Func mbedtls_x509write_crt_set_extension

int mbedtls_x509write_crt_set_extension( mbedtls_x509write_cert *ctx,
                                const char *oid, size_t oid_len,
                                int critical,
                                const unsigned char *val, size_t val_len );
/**
 * \brief           Generic function to add to or replace an extension in the
 *                  CRT
 *
 * \param ctx       CRT context to use
 * \param oid       OID of the extension
 * \param oid_len   length of the OID
 * \param critical  if the extension is critical (per the RFC's definition)
 * \param val       value of the extension OCTET STRING
 * \param val_len   length of the value data
 *
 * \return          0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
 */

Func mbedtls_x509write_crt_set_basic_constraints

int mbedtls_x509write_crt_set_basic_constraints( mbedtls_x509write_cert *ctx,
                                        int is_ca, int max_pathlen );
/**
 * \brief           Set the basicConstraints extension for a CRT
 *
 * \param ctx       CRT context to use
 * \param is_ca     is this a CA certificate
 * \param max_pathlen   maximum length of certificate chains below this
 *                      certificate (only for CA certificates, -1 is
 *                      inlimited)
 *
 * \return          0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
 */

Func mbedtls_x509write_crt_set_subject_key_identifier

int mbedtls_x509write_crt_set_subject_key_identifier( mbedtls_x509write_cert *ctx );
/**
 * \brief           Set the subjectKeyIdentifier extension for a CRT
 *                  Requires that mbedtls_x509write_crt_set_subject_key() has been
 *                  called before
 *
 * \param ctx       CRT context to use
 *
 * \return          0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
 */

Func mbedtls_x509write_crt_set_authority_key_identifier

int mbedtls_x509write_crt_set_authority_key_identifier( mbedtls_x509write_cert *ctx );
/**
 * \brief           Set the authorityKeyIdentifier extension for a CRT
 *                  Requires that mbedtls_x509write_crt_set_issuer_key() has been
 *                  called before
 *
 * \param ctx       CRT context to use
 *
 * \return          0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
 */

Func mbedtls_x509write_crt_set_key_usage

int mbedtls_x509write_crt_set_key_usage( mbedtls_x509write_cert *ctx,
                                        unsigned int key_usage );
/**
 * \brief           Set the Key Usage Extension flags
 *                  (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN)
 *
 * \param ctx       CRT context to use
 * \param key_usage key usage flags to set
 *
 * \return          0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
 */

Func mbedtls_x509write_crt_set_ns_cert_type

int mbedtls_x509write_crt_set_ns_cert_type( mbedtls_x509write_cert *ctx,
                                   unsigned char ns_cert_type );
/**
 * \brief           Set the Netscape Cert Type flags
 *                  (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TYPE_EMAIL)
 *
 * \param ctx           CRT context to use
 * \param ns_cert_type  Netscape Cert Type flags to set
 *
 * \return          0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
 */

Func mbedtls_x509write_crt_free

void mbedtls_x509write_crt_free( mbedtls_x509write_cert *ctx );
/**
 * \brief           Free the contents of a CRT write context
 *
 * \param ctx       CRT context to free
 */

Func mbedtls_x509write_crt_der

int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size,
                      int (*f_rng)(void *, unsigned char *, size_t),
                      void *p_rng );
/**
 * \brief           Write a built up certificate to a X509 DER structure
 *                  Note: data is written at the end of the buffer! Use the
 *                        return value to determine where you should start
 *                        using the buffer
 *
 * \param ctx       certificate to write away
 * \param buf       buffer to write to
 * \param size      size of the buffer
 * \param f_rng     RNG function (for signature, see note)
 * \param p_rng     RNG parameter
 *
 * \return          length of data written if successful, or a specific
 *                  error code
 *
 * \note            f_rng may be NULL if RSA is used for signature and the
 *                  signature is made offline (otherwise f_rng is desirable
 *                  for countermeasures against timing attacks).
 *                  ECDSA signatures always require a non-NULL f_rng.
 */

Func mbedtls_x509write_crt_pem

int mbedtls_x509write_crt_pem( mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size,
                      int (*f_rng)(void *, unsigned char *, size_t),
                      void *p_rng );
/**
 * \brief           Write a built up certificate to a X509 PEM string
 *
 * \param ctx       certificate to write away
 * \param buf       buffer to write to
 * \param size      size of the buffer
 * \param f_rng     RNG function (for signature, see note)
 * \param p_rng     RNG parameter
 *
 * \return          0 if successful, or a specific error code
 *
 * \note            f_rng may be NULL if RSA is used for signature and the
 *                  signature is made offline (otherwise f_rng is desirable
 *                  for countermeasures against timing attacks).
 *                  ECDSA signatures always require a non-NULL f_rng.
 */

Func mbedtls_x509_csr_parse_der

int mbedtls_x509_csr_parse_der( mbedtls_x509_csr *csr,
                       const unsigned char *buf, size_t buflen );
/**
 * \brief          Load a Certificate Signing Request (CSR) in DER format
 *
 * \note           CSR attributes (if any) are currently silently ignored.
 *
 * \param csr      CSR context to fill
 * \param buf      buffer holding the CRL data
 * \param buflen   size of the buffer
 *
 * \return         0 if successful, or a specific X509 error code
 */

Func mbedtls_x509_csr_parse

int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen );
/**
 * \brief          Load a Certificate Signing Request (CSR), DER or PEM format
 *
 * \note           See notes for \c mbedtls_x509_csr_parse_der()
 *
 * \param csr      CSR context to fill
 * \param buf      buffer holding the CRL data
 * \param buflen   size of the buffer
 *                 (including the terminating null byte for PEM data)
 *
 * \return         0 if successful, or a specific X509 or PEM error code
 */

Func mbedtls_x509_csr_parse_file

int mbedtls_x509_csr_parse_file( mbedtls_x509_csr *csr, const char *path );
/**
 * \brief          Load a Certificate Signing Request (CSR)
 *
 * \note           See notes for \c mbedtls_x509_csr_parse()
 *
 * \param csr      CSR context to fill
 * \param path     filename to read the CSR from
 *
 * \return         0 if successful, or a specific X509 or PEM error code
 */

Func mbedtls_x509_csr_info

int mbedtls_x509_csr_info( char *buf, size_t size, const char *prefix,
                  const mbedtls_x509_csr *csr );
/**
 * \brief          Returns an informational string about the
 *                 CSR.
 *
 * \param buf      Buffer to write to
 * \param size     Maximum size of buffer
 * \param prefix   A line prefix
 * \param csr      The X509 CSR to represent
 *
 * \return         The length of the string written (not including the
 *                 terminated nul byte), or a negative error code.
 */

Func mbedtls_x509_csr_init

void mbedtls_x509_csr_init( mbedtls_x509_csr *csr );
/**
 * \brief          Initialize a CSR
 *
 * \param csr      CSR to initialize
 */

Func mbedtls_x509_csr_free

void mbedtls_x509_csr_free( mbedtls_x509_csr *csr );
/**
 * \brief          Unallocate all CSR data
 *
 * \param csr      CSR to free
 */

Func mbedtls_x509write_csr_init

void mbedtls_x509write_csr_init( mbedtls_x509write_csr *ctx );
/**
 * \brief           Initialize a CSR context
 *
 * \param ctx       CSR context to initialize
 */

Func mbedtls_x509write_csr_set_subject_name

int mbedtls_x509write_csr_set_subject_name( mbedtls_x509write_csr *ctx,
                                   const char *subject_name );
/**
 * \brief           Set the subject name for a CSR
 *                  Subject names should contain a comma-separated list
 *                  of OID types and values:
 *                  e.g. "C=UK,O=ARM,CN=mbed TLS Server 1"
 *
 * \param ctx           CSR context to use
 * \param subject_name  subject name to set
 *
 * \return          0 if subject name was parsed successfully, or
 *                  a specific error code
 */

Func mbedtls_x509write_csr_set_key

void mbedtls_x509write_csr_set_key( mbedtls_x509write_csr *ctx, mbedtls_pk_context *key );
/**
 * \brief           Set the key for a CSR (public key will be included,
 *                  private key used to sign the CSR when writing it)
 *
 * \param ctx       CSR context to use
 * \param key       Asymetric key to include
 */

Func mbedtls_x509write_csr_set_md_alg

void mbedtls_x509write_csr_set_md_alg( mbedtls_x509write_csr *ctx, mbedtls_md_type_t md_alg );
/**
 * \brief           Set the MD algorithm to use for the signature
 *                  (e.g. MBEDTLS_MD_SHA1)
 *
 * \param ctx       CSR context to use
 * \param md_alg    MD algorithm to use
 */

Func mbedtls_x509write_csr_set_key_usage

int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned char key_usage );
/**
 * \brief           Set the Key Usage Extension flags
 *                  (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN)
 *
 * \param ctx       CSR context to use
 * \param key_usage key usage flags to set
 *
 * \return          0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
 *
 * \note            The decipherOnly flag from the Key Usage
 *                  extension is represented by bit 8 (i.e.
 *                  0x8000), which cannot typically be represented
 *                  in an unsigned char. Therefore, the flag
 *                  decipherOnly (i.e.
 *                  #MBEDTLS_X509_KU_DECIPHER_ONLY) cannot be set using this
 *                  function.
 */

Func mbedtls_x509write_csr_set_ns_cert_type

int mbedtls_x509write_csr_set_ns_cert_type( mbedtls_x509write_csr *ctx,
                                   unsigned char ns_cert_type );
/**
 * \brief           Set the Netscape Cert Type flags
 *                  (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TYPE_EMAIL)
 *
 * \param ctx           CSR context to use
 * \param ns_cert_type  Netscape Cert Type flags to set
 *
 * \return          0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
 */

Func mbedtls_x509write_csr_set_extension

int mbedtls_x509write_csr_set_extension( mbedtls_x509write_csr *ctx,
                                const char *oid, size_t oid_len,
                                const unsigned char *val, size_t val_len );
/**
 * \brief           Generic function to add to or replace an extension in the
 *                  CSR
 *
 * \param ctx       CSR context to use
 * \param oid       OID of the extension
 * \param oid_len   length of the OID
 * \param val       value of the extension OCTET STRING
 * \param val_len   length of the value data
 *
 * \return          0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED
 */

Func mbedtls_x509write_csr_free

void mbedtls_x509write_csr_free( mbedtls_x509write_csr *ctx );
/**
 * \brief           Free the contents of a CSR context
 *
 * \param ctx       CSR context to free
 */

Func mbedtls_x509write_csr_der

int mbedtls_x509write_csr_der( mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size,
                      int (*f_rng)(void *, unsigned char *, size_t),
                      void *p_rng );
/**
 * \brief           Write a CSR (Certificate Signing Request) to a
 *                  DER structure
 *                  Note: data is written at the end of the buffer! Use the
 *                        return value to determine where you should start
 *                        using the buffer
 *
 * \param ctx       CSR to write away
 * \param buf       buffer to write to
 * \param size      size of the buffer
 * \param f_rng     RNG function (for signature, see note)
 * \param p_rng     RNG parameter
 *
 * \return          length of data written if successful, or a specific
 *                  error code
 *
 * \note            f_rng may be NULL if RSA is used for signature and the
 *                  signature is made offline (otherwise f_rng is desirable
 *                  for countermeasures against timing attacks).
 *                  ECDSA signatures always require a non-NULL f_rng.
 */

Func mbedtls_x509write_csr_pem

int mbedtls_x509write_csr_pem( mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size,
                      int (*f_rng)(void *, unsigned char *, size_t),
                      void *p_rng );
/**
 * \brief           Write a CSR (Certificate Signing Request) to a
 *                  PEM string
 *
 * \param ctx       CSR to write away
 * \param buf       buffer to write to
 * \param size      size of the buffer
 * \param f_rng     RNG function (for signature, see note)
 * \param p_rng     RNG parameter
 *
 * \return          0 if successful, or a specific error code
 *
 * \note            f_rng may be NULL if RSA is used for signature and the
 *                  signature is made offline (otherwise f_rng is desirable
 *                  for countermeasures against timing attacks).
 *                  ECDSA signatures always require a non-NULL f_rng.
 */

Func mbedtls_xtea_init

void mbedtls_xtea_init( mbedtls_xtea_context *ctx );
/**
 * \brief          Initialize XTEA context
 *
 * \param ctx      XTEA context to be initialized
 */

Func mbedtls_xtea_free

void mbedtls_xtea_free( mbedtls_xtea_context *ctx );
/**
 * \brief          Clear XTEA context
 *
 * \param ctx      XTEA context to be cleared
 */

Func mbedtls_xtea_setup

void mbedtls_xtea_setup( mbedtls_xtea_context *ctx, const unsigned char key[16] );
/**
 * \brief          XTEA key schedule
 *
 * \param ctx      XTEA context to be initialized
 * \param key      the secret key
 */

Func mbedtls_xtea_crypt_ecb

int mbedtls_xtea_crypt_ecb( mbedtls_xtea_context *ctx,
                   int mode,
                   const unsigned char input[8],
                   unsigned char output[8] );
/**
 * \brief          XTEA cipher function
 *
 * \param ctx      XTEA context
 * \param mode     MBEDTLS_XTEA_ENCRYPT or MBEDTLS_XTEA_DECRYPT
 * \param input    8-byte input block
 * \param output   8-byte output block
 *
 * \return         0 if successful
 */

Func mbedtls_xtea_crypt_cbc

int mbedtls_xtea_crypt_cbc( mbedtls_xtea_context *ctx,
                   int mode,
                   size_t length,
                   unsigned char iv[8],
                   const unsigned char *input,
                   unsigned char *output);
/**
 * \brief          XTEA CBC cipher function
 *
 * \param ctx      XTEA context
 * \param mode     MBEDTLS_XTEA_ENCRYPT or MBEDTLS_XTEA_DECRYPT
 * \param length   the length of input, multiple of 8
 * \param iv       initialization vector for CBC mode
 * \param input    input block
 * \param output   output block
 *
 * \return         0 if successful,
 *                 MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH if the length % 8 != 0
 */

Func mbedtls_xtea_self_test

int mbedtls_xtea_self_test( int verbose );
/**
 * \brief          Checkup routine
 *
 * \return         0 if successful, or 1 if the test failed
 */

Func tuya_tls_load_der_info

VOID tuya_tls_load_der_info(VOID);


      

Func tuya_tls_register_constant

VOID tuya_tls_register_constant(IN CHAR_T *p_uuid, IN CHAR_T *p_authkey, IN CHAR_T *p_psk_key);
/**
 * @brief tls register
 * 
 * @param[in] p_uuid uudi
 * @param[in] p_authkey auth key
 * @param[in] p_psk_key psk key
 *
 */

Func tuya_tls_set_ssl_verify

VOID tuya_tls_set_ssl_verify(IN CONST INT_T verify_mode);
/**
 * @brief set tls verity
 * 
 * @param[in] verify_mode VERIFY_NONE:0,VERIFY_OPTIONAL:1,VERIFY_REQUIRED:2
 */

Func tuya_tls_register_x509_crt_der

INT_T tuya_tls_register_x509_crt_der(VOID *p_ctx, UCHAR_T *p_der, UINT_T der_len);
/**
 * @brief tls register x509 ca
 * 
 * @param[in] p_ctx ca content
 * @param[in] p_der ca
 * @param[in] der_len ca len
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_tls_set_load_cert

VOID tuya_tls_set_load_cert(BOOL_T load);
/**
 * @brief load ca flag
 * 
 * @param[in] load flag
 *
 */

Func tuya_tls_set_coustom_cert

void tuya_tls_set_coustom_cert(CHAR_T *cert, INT_T len);
/**
 * @brief set ca
 * 
 * @param[in] cert ca
 * @param[in] len ca length
 *
 */

Func tuya_tls_set_client_cert_pkey

void tuya_tls_set_client_cert_pkey(CHAR_T *cert, INT_T len, CHAR_T *client_pkey, INT_T pkey_len);
/**
 * @brief set pkey
 * 
 * @param[in] cert ca
 * @param[in] len ca length
 * @param[in] client_pkey key
 * @param[in] pkey_len key length
 *
 */

Func tuya_tls_init

OPERATE_RET tuya_tls_init(IN tuya_tls_event_cb event_cb);
/**
 * @brief tls init
 * 
 * @param[in] event_cb refer to tuya_tls_event_cb
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_tls_connect

OPERATE_RET tuya_tls_connect(OUT tuya_tls_hander *p_tls_handler, IN CHAR_T *hostname,IN INT_T port_num, IN INT_T sethostname,
                            IN VOID *p_custom_net_ctx, IN tuya_tls_send_cb send_cb, IN tuya_tls_recv_cb recv_cb,
                            IN INT_T socket_fd, IN INT_T overtime_s);
/**
 * @brief tls connect
 * 
 * @param[in] p_tls_handler refer to tuya_tls_hander
 * @param[in] hostname url
 * @param[in] port_num port
 * @param[in] sethostname need set hostname or not
 * @param[in] p_custom_net_ctx net content 
 * @param[in] send_cb callback of send
 * @param[in] recv_cb callback of received
 * @param[in] socket_fd fd
 * @param[in] overtime_s connect timeout
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_tls_write

INT_T tuya_tls_write(IN tuya_tls_hander tls_handler, BYTE_T *buf, UINT_T len);
/**
 * @brief tls write
 * 
 * @param[in] tls_handler refer to tuya_tls_hander
 * @param[in] buf write data
 * @param[in] len write length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_tls_read

INT_T tuya_tls_read(IN tuya_tls_hander tls_handler, BYTE_T *buf, UINT_T len);
/**
 * @brief tls read
 * 
 * @param[in] tls_handler refer to tuya_tls_hander
 * @param[out] buf read data
 * @param[in] len read length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_tls_disconnect

OPERATE_RET tuya_tls_disconnect(IN tuya_tls_hander tls_handler);
/**
 * @brief generated random
 * 
 * @param[in] tls_handler refer to tuya_tls_hander
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func __tuya_tls_random

int __tuya_tls_random(void *p_rng, unsigned char *output, size_t output_len);
/**
 * @brief generated random
 * 
 * @param[in] p_rng no use
 * @param[out] output random data
 * @param[in] output_len length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_tls_set_calloc_and_free

void tuya_tls_set_calloc_and_free(void);
/**
 * @brief set tls calloc and free function
 * 
 */

Func tuya_cli_init

int tuya_cli_init(void);
/**
 * @brief cli init function,default uart0
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * 
 */

Func tuya_cli_cmd_register

int tuya_cli_cmd_register(const cli_cmd_t *cmd, uint8_t num);
/**
 * @brief cli command register
 *
 * @param[in] cmd Info of one command
 * @param[in] num Number
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * 
 */

Func tuya_cli_init_with_uart

int tuya_cli_init_with_uart(uint8_t uart_num);
/**
 * @brief uart cli init
 *
 * @param[in] uart_num The number of UART
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * 
 */

Func ws_db_init

OPERATE_RET ws_db_init(IN CONST CHAR_T *fs_storge_path, IN CONST BYTE_T *p_key);
/**
 * @brief tuya key-value database initialization
 * 
 * @param[in] fs_storge_path the storage path of the key-value database, only used in linux system
 * @param[in] p_key the encypto key of the key-value database, if p_key==NULL, will generate a random one
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * 
 * @note user don't need to care about this function, it will be called when tuya IoTOS initialization.
 * 
 */

Func ws_db_init_mf

OPERATE_RET ws_db_init_mf(VOID);
/**
 * @brief tuya key-value database initialization in mf
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * 
 * @note user don't need to care about this function, it will be called when tuya IoTOS initialization.
 * 
 */

Func ws_db_uninit

VOID ws_db_uninit(VOID) ;
/**
 * @brief tuya key-value database de-initialization
 * 
 * @return VOID 
 */

Func ws_db_format

OPERATE_RET ws_db_format(VOID);
/**
 * @brief tuya key-value database format
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h 
 */

Func ws_db_rebuild

OPERATE_RET ws_db_rebuild(VOID);
/**
 * @brief tuya key-value database rebuild to recycle
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h 
 */

Func ws_db_get_storage_path

CHAR_T* ws_db_get_storage_path(VOID);
/**
 * @brief tuya key-value database get storage path
 *
 * @note Caller shall free the buffer returned
 *
 * @return Buffer for storage path, NULL on error
 */

Func wd_common_write

OPERATE_RET wd_common_write(IN CONST CHAR_T *key, IN CONST BYTE_T *value, IN CONST UINT_T len);
/**
 * @brief tuya key-value database write entry
 * 
 * @param[in] key key of the entry you want to write
 * @param[in] value value buffer you want to write 
 * @param[in] len the numbers of byte you want to write
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h 
 */

Func wd_common_read

OPERATE_RET wd_common_read(IN CONST CHAR_T *key, OUT BYTE_T **value, OUT UINT_T *p_len);
/**
 * @brief tuya key-value database read entry
 * 
 * @param[in] key  key of the entry you want to read
 * @param[out] value buffer of the value
 * @param[out] p_len length of the buffer
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h  
 * 
 * @note must free the value buffer with wd_common_free_data when you nolonger need the buffer
 */

Func wd_common_fuzzy_read

OPERATE_RET wd_common_fuzzy_read(IN CONST CHAR_T *fuzzy_name, INOUT UINT_T *index, OUT BYTE_T **data, OUT UINT_T *len);
/**
 * @brief tuya key-value database fuzzy read entry
 * 
 * @param[in] fuzzy_name  key of the entry you want to read
 * @param[in] index index of the value sequnence
 * @param[out] data buffer of the value
 * @param[out] p_len length of the buffer
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h  
 * 
 * @note if we have three entry "x1","x2","x3" in database, and read use "x" as the key will got all these 3 entrys
 * and will chose the return entry by index
 * 
 * @note must free the value buffer with wd_common_free_data when you nolonger need the buffer
 */

Func wd_common_free_data

OPERATE_RET wd_common_free_data(IN BYTE_T *data);
/**
 * @brief free the buffer which allocated by wd_common_read or wd_common_fuzzy_read 
 * 
 * @param[in] data the buffer got from wd_common_read or wd_common_fuzzy_read
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h   
 */

Func wd_common_delete

OPERATE_RET wd_common_delete(IN CONST CHAR_T *key);
/**
 * @brief delete the entry from key-value database
 * 
 * @param[in] key key of the entry you want to delete
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func wd_common_fuzzy_delete

OPERATE_RET wd_common_fuzzy_delete(IN CONST CHAR_T *key);
/**
 * @brief fuzzy delete the entry from key-value database
 * 
 * @param[in] key key of the entry you want to delete
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h  
 * 
 * @note delete all entries if the key match the prefix of entry key
 */

Func wd_common_exist

OPERATE_RET wd_common_exist(IN CONST CHAR_T *key, OUT BOOL_T *exist);
/**
 * @brief check the entry from key-value database
 * 
 * @param[in] key key of the entry you want to check
 * @param[OUT] exist TRUE on exist
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func wd_protected_write

OPERATE_RET wd_protected_write(IN CONST CHAR_T *key, IN CONST BYTE_T *value, IN CONST UINT_T len);
/**
 * @brief tuya protected storage write entry
 * 
 * @param[in] key key of the entry you want to write
 * @param[in] value value buffer you want to write 
 * @param[in] len the numbers of byte you want to write
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h 
 */

Func wd_protected_read

OPERATE_RET wd_protected_read(IN CONST CHAR_T *key, OUT BYTE_T **value, OUT UINT_T *p_len);
/**
 * @brief tuya protected storage read entry
 * 
 * @param[in] key  key of the entry you want to read
 * @param[out] value buffer of the value
 * @param[out] p_len length of the buffer
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h  
 * 
 * @note must free the value buffer with wd_common_free_data when you nolonger need the buffer
 */

Func wd_protected_delete

OPERATE_RET wd_protected_delete(IN CONST CHAR_T *key);
/**
 * @brief delete the entry from protected storage
 * 
 * @param[in] key key of the entry you want to delete
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func wd_user_param_write

OPERATE_RET wd_user_param_write(IN CONST BYTE_T *data, IN CONST UINT_T len);
/**
 * @brief write the user parameter to tuya key-value database
 * 
 * @param[in] data buffer of the data
 * @param[in] len length of the data
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h   
 * 
 * @note the key of user parameter entry is "user_param_key"
 */

Func wd_user_param_read

OPERATE_RET wd_user_param_read(OUT BYTE_T **buf, OUT UINT_T *len);
/**
 * @brief read the user parameter from tuya key-value database
 * 
 * @param[out] buf buffer of the data
 * @param[out] len length of the data
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 * 
 * @note the key of user parameter entry is "user_param_key",must free the value buffer with 
 * wd_common_free_data when you nolonger need the buffer
 */

Func wd_utils_serialize

OPERATE_RET wd_utils_serialize(IN CONST TY_DB_RW_S *rw, IN CONST UINT_T rw_cnt, OUT CHAR_T **out, OUT UINT_T *out_len);
/**
 * @brief tuya key-value serialize, transfer the data from TY_DB_RW_S array to json format
 * 
 * @param[in] rw the database entry which contains a property array
 * @param[in] rw_cnt the database entry property array count
 * @param[out] out the serialized json format buffer
 * @param[out] out_len the serialized json format length
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func wd_utils_serialize_save

OPERATE_RET wd_utils_serialize_save(IN CONST CHAR_T *key, IN CONST TY_DB_RW_S *rw, IN CONST UINT_T rw_cnt);
/**
 * @brief tuya key-value serialize and save in tuya key-value database
 * 
 * @param[in] key key of the database entry
 * @param[in] rw the database entry which contains a property array
 * @param[in] rw_cnt the database entry property array count
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func wd_utils_serialize_restore

OPERATE_RET wd_utils_serialize_restore(IN CONST CHAR_T *key, INOUT TY_DB_RW_S *rw, IN CONST UINT_T rw_cnt);
/**
 * @brief tuya key-value serialize restore, will read the data from tuya key-value database and restore to database property entry
 * 
 * @param[in] key key of the database entry
 * @param[inout] rw the database entry which contains a property array
 * @param[inout] rw_cnt the database entry property array count
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 * 
 * @note tuya key-value database saved the json format data and this api will read and deserialize it to property entry according 
 * the rw and rw_cnt, so must fill the rw and rw_cnt in right format.
 */

Func wd_utils_deserialize

OPERATE_RET wd_utils_deserialize(IN CONST CHAR_T *in, INOUT TY_DB_RW_S *rw,IN CONST UINT_T rw_cnt);
/**
 * @brief tuya key-value deserialize, transfer the data from json format to property array 
 * 
 * @param[in] in the json format data
 * @param[inout] rw the database entry which contains a property array
 * @param[inout] rw_cnt the database entry property array count
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h   
 * 
 * @note deserialize the json format data to database property entry according the rw and rw_cnt, so must fill the rw and rw_cnt in right format.  
 */

Func wd_utils_free_outbuf

OPERATE_RET wd_utils_free_outbuf(IN CHAR_T *out_buf);
/**
 * @brief free the buffer which allocated by wd_utils_serialize_restore
 * 
 * @param out_buf the buffer got from wd_utils_serialize_restore
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func ty_event_init

int ty_event_init(void);
/** 
 * @brief event initialization
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_publish_event

int ty_publish_event(const char* name, void *data);
/** 
 * @brief: publish event
 *
 * @param[in] name: event name
 * @param[in] data: event data
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h   
 */

Func ty_subscribe_event

int ty_subscribe_event(const char *name, const char *desc, const event_subscribe_cb cb, SUBSCRIBE_TYPE_E type);
/** 
 * @brief: subscribe event
 *
 * @param[in] name: event name
 * @param[in] desc: subscribe description
 * @param[in] cb: subscribe callback function
 * @param[in] type: subscribe type
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h  
 */

Func ty_unsubscribe_event

int ty_unsubscribe_event(const char *name, const char *desc, event_subscribe_cb cb);
/** 
 * @brief: unsubscribe event
 *
 * @param[in] name: event name
 * @param[in] desc: subscribe description
 * @param[in] cb: subscribe callback function
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h 
 */

Func log_seq_insert_log

int log_seq_insert_log(const char *ls_name, BYTE_T id, LS_DATA_TP_T type, VOID_T* data);


      

Func log_seq_insert_error_log

int log_seq_insert_error_log(const char *ls_name, BYTE_T id, LS_DATA_TP_T type, VOID_T* data);


      

Func log_seq_insert_report_log

int log_seq_insert_report_log(const char *ls_name, BYTE_T id, LS_DATA_TP_T type, VOID_T* data);


      

Func log_seq_init

int log_seq_init(const char *log_seq_path);
/**
 * @brief initialize of log sequence.
 *
 * @param[in] log_seq_path log sequence path
 *
 * @note This API is used for initialize log sequence.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func log_seq_set_enable

int log_seq_set_enable(bool_t enable);
/**
 * @brief enable or disable log sequence.
 *
 * @param[in] enable if value is true, enable log sequence, otherwise disable log sequence
 *
 * @note This API is used for enalbe or disable log sequence.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func log_seq_set_depth

int log_seq_set_depth(const        unsigned int depth);
/**
 * @brief set log sequence depth.
 *
 * @param[in] depth log sequence depth
 *
 * @note This API is used for set depth of log sequence.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func log_seq_clean

int log_seq_clean(int is_force_clean_all);
/**
 * @brief reset log sequence, clean all log sequence, this is used when device reset.
 *
 * @param[in] is_force_clean_all, force clean all log sequence object
 *
 * @note This API is used for clean all log sequence object.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func log_seq_force_sync

int log_seq_force_sync(void);
/**
* @brief force synchronization of log sequence .
*
* @param[in] NONE
*
* @note This API is used for synchronization of log sequence.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func log_seq_upload_custom_log

int log_seq_upload_custom_log(const char *p_log);
/**
 * @brief upload customer log sequence .
 *
 * @param[in] p_log user log
 *
 * @note This API is used for upload customer log sequence.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func log_seq_get_netcfg_log

int log_seq_get_netcfg_log(char **log_buff, int *log_len);
/**
 * @brief get network configure log sequence.
 *
 * @param[in] log_buff, log buffer
 * @param[in] log_len, log size
 *
 * @note This API is used for get network configure log sequence.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func PrintLog

int PrintLog(const char* pModuleName,
                const LOG_LEVEL logLevel,
                const char* pFile, const int line,
                const char* pFmt,...);
/**
 * @brief output log
 *
 * @param[in] pModuleName, module name
 * @param[in] logLevel, this log level
 * @param[in] pFile, file name of this log
 * @param[in] line, line number in the file of this log
 * @param[in] pFmt, format string
 * @param[in] ..., parameters
 *
 * @note This API is used for output log.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func PrintErrLog

int PrintErrLog(const char* pFmt,...);


      

Func PrintWarnLog

int PrintWarnLog(const char* pFmt,...);


      

Func PrintInfoLog

int PrintInfoLog(const char* pFmt,...);


      

Func PrintNoticeLog

int PrintNoticeLog(const char* pFmt,...);


      

Func PrintDebugLog

int PrintDebugLog(const char* pFmt,...);


      

Func PrintTraceLog

int PrintTraceLog(const char* pFmt,...);


      

Func PrintErrLog

int PrintErrLog(const char* pFile, const char* pFmt,...);


      

Func PrintWarnLog

int PrintWarnLog(const char* pFile, const char* pFmt,...);


      

Func PrintInfoLog

int PrintInfoLog(const char* pFile, const char* pFmt,...);


      

Func PrintNoticeLog

int PrintNoticeLog(const char* pFile, const char* pFmt,...);


      

Func PrintDebugLog

int PrintDebugLog(const char* pFile, const char* pFmt,...);


      

Func PrintTraceLog

int PrintTraceLog(const char* pFile, const char* pFmt,...);


      

Func PrintErrLog

int PrintErrLog(const char* pFile, const int line, const char* pFmt,...);


      

Func PrintWarnLog

int PrintWarnLog(const char* pFile, const int line, const char* pFmt,...);


      

Func PrintInfoLog

int PrintInfoLog(const char* pFile, const int line, const char* pFmt,...);


      

Func PrintNoticeLog

int PrintNoticeLog(const char* pFile, const int line, const char* pFmt,...);


      

Func PrintDebugLog

int PrintDebugLog(const char* pFile, const int line, const char* pFmt,...);


      

Func PrintTraceLog

int PrintTraceLog(const char* pFile, const int line, const char* pFmt,...);


      

Func CreateLogManageAndInit

OPERATE_RET CreateLogManageAndInit(IN CONST LOG_LEVEL curLogLevel,IN CONST INT_T buf_len,\
                                             IN CONST LOG_OUTPUT output);
/**
 * @brief initialize log management.
 *
 * @param[in] curLogLevel , set log level
 * @param[in] buf_len , set log buffer size
 * @param[in] output , log print function pointer
 *
 * @note This API is used for initializing log management.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func AddOutputTerm

OPERATE_RET AddOutputTerm(IN CONST CHAR_T *name,IN CONST LOG_OUTPUT term);
/**
 * @brief add one output terminal.
 *
 * @param[in] name , terminal name
 * @param[in] term , output function pointer
 *
 * @note This API is used for adding one output terminal.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func DelOutputTerm

VOID DelOutputTerm(IN CONST CHAR_T *name);
/**
 * @brief delete one output terminal.
 *
 * @param[in] name , terminal name
 *
 * @note This API is used for delete one output terminal.
 *
 * @return NONE
 */

Func SetLogManageAttr

OPERATE_RET SetLogManageAttr(IN CONST LOG_LEVEL curLogLevel);
/**
 * @brief set global log level.
 *
 * @param[in] curLogLevel , log level
 *
 * @note This API is used for setting global log level.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func SetLogManagemtime

OPERATE_RET SetLogManagemtime(BOOL_T if_ms_level);
/**
 * @brief set log time whether show in millisecond.
 *
 * @param[in] if_ms_level, whether log time include millisecond
 *
 * @note This API is used for setting log time whether include milisecond.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func GetLogManageAttr

OPERATE_RET GetLogManageAttr(OUT LOG_LEVEL *pCurLogLevel);
/**
 * @brief get global log level.
 *
 * @param[in] pCurLogLevel, global log level
 *
 * @note This API is used for getting global log level.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func AddModuleLevel

OPERATE_RET AddModuleLevel(IN CONST PCHAR_T pModuleName,\
                                 IN CONST LOG_LEVEL logLevel);
/**
 * @brief add one module's log level
 *
 * @param[in] pModuleName, module name
 * @param[in] logLevel, this module's log level
 *
 * @note This API is used for adding one module's log level.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func SetModuleLevel

OPERATE_RET SetModuleLevel(IN CONST PCHAR_T pModuleName,\
                                 LOG_LEVEL log_level);
/**
 * @brief add one module's log level
 *
 * @param[in] pModuleName, module name
 * @param[in] logLevel, this module's log level
 *
 * @note This API is used for adding one module's log level.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func GetModuleLevel

OPERATE_RET GetModuleLevel(IN CONST PCHAR_T pModuleName,\
                                 OUT LOG_LEVEL *pLogLevel);
/**
 * @brief get one module's log level
 *
 * @param[in] pModuleName, module name
 * @param[in] logLevel, this module's log level
 *
 * @note This API is used for getting one module's log level.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func DeleteModuleLevel

OPERATE_RET DeleteModuleLevel(IN CONST PCHAR_T pModuleName);
/**
 * @brief delete one module's log level
 *
 * @param[in] pModuleName, module name
 *
 * @note This API is used for deleting one module's log level.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func PrintLogRaw

OPERATE_RET PrintLogRaw(IN CONST PCHAR_T pFmt,...);
/**
 * @brief only print user log information
 *
 * @param[in] pFmt, format string
 * @param[in] ..., parameter
 *
 * @note This API is used for print only user log info.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ReleaseLogManage

VOID ReleaseLogManage(VOID);
/**
 * @brief destroy log management
 *
 * @param[in] pFmt, format string
 * @param[in] ..., parameter
 *
 * @note This API is used for destroy log management.
 *
 * @return NONE
 */

Func tuya_debug_hex_dump

VOID tuya_debug_hex_dump(CHAR_T *title, UINT8_T width, UINT8_T *buf, UINT16_T size);
/**
 * @brief print a buffer in hex format
 *
 * @param[in] title, buffer title for print
 * @param[in] width, one line width
 * @param[in] buf, buffer address
 * @param[in] size, buffer size
 *
 * @note This API is used for print one buffer.
 *
 * @return NONE
 */

Func cmmod_release

OPERATE_RET cmmod_release(VOID);
/**
 * @brief Release module handle.
 *
 * @param VOID
 *
 * @note This API is used for releasing module handle.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_init

OPERATE_RET cmmod_init(VOID);
/**
 * @brief Init module handle.
 *
 * @param VOID
 *
 * @note This API is used for initializing module handle.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_reg_msgcb

OPERATE_RET cmmod_reg_msgcb(IN CONST MSG_CALLBACK msg_cb, OUT MSG_ID *msg_id);
/**
 * @brief Regist callback function for message.
 *
 * @param[in] msg_cb: message callback function
 * @param[out] msg_id: message id
 *
 * @note This API is used for registing message's callback function.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_unreg_msgcb

OPERATE_RET cmmod_unreg_msgcb(IN CONST MSG_ID msgID);
/**
 * @brief Unregist callback function for message.
 *
 * @param[in] msgID: message id
 *
 * @note This API is used for unRegisting message's callback function.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_post_msg

OPERATE_RET cmmod_post_msg(IN CONST MSG_ID msgID,IN CONST P_MSG_DATA pMsgData, IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a message.
 *
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_post_msg_malloc

OPERATE_RET cmmod_post_msg_malloc(IN CONST MSG_ID msgID,IN CONST P_MSG_DATA pMsgData, IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a message with memory alloc
 *
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a message with memory alloc, the param of message data can be local variable
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_post_instancy_msg

OPERATE_RET cmmod_post_instancy_msg(IN CONST MSG_ID msgID,IN CONST P_MSG_DATA pMsgData, IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a message instantly
 *
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a message instantly
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_post_instancy_msg_malloc

OPERATE_RET cmmod_post_instancy_msg_malloc(IN CONST MSG_ID msgID,IN CONST P_MSG_DATA pMsgData, IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a instant message with memory alloc
 *
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a instant message with memory alloc, the param of message data can be local variable
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_cr_tm_msg_hand

OPERATE_RET cmmod_cr_tm_msg_hand(IN CONST TM_MSG_CB cb,IN CONST VOID *data,OUT TM_MSG_S **tm_msg);
/**
 * @brief Create timer message handle.
 *
 * @param[in] cb: callback function
 * @param[in] data: message data
 * @param[out] tm_msg: timer message info
 *
 * @note This API is used for creating a timer message handle
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_start_tm_msg

OPERATE_RET cmmod_start_tm_msg(IN CONST TM_MSG_S *tm_msg,IN CONST TIME_MS timeCycle, IN CONST TIMER_TYPE timer_type);
/**
 * @brief Start the timer message.
 *
 * @param[in] tm_msg: timer message info
 * @param[in] timeCycle: cycle time of the timer
 * @param[in] timer_type: timer type, cycle or once
 *
 * @note This API is used for starting the timer message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_stop_tm_msg

OPERATE_RET cmmod_stop_tm_msg(IN CONST TM_MSG_S *tm_msg);
/**
 * @brief Stop the timer message.
 *
 * @param[in] tm_msg: timer message info
 *
 * @note This API is used for stopping the timer message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_release_tm_msg

OPERATE_RET cmmod_release_tm_msg(IN CONST TM_MSG_S *tm_msg);
/**
 * @brief Release the timer message.
 *
 * @param[in] tm_msg: timer message info
 *
 * @note This API is used for releasing the timer message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func cmmod_get_msg_node_num

INT_T cmmod_get_msg_node_num(VOID);
/**
 * @brief Get message node count.
 *
 * @param VOID
 *
 * @note This API is used for getting the count of message node.
 *
 * @return the count of message node.
 */

Func ReleaseModule

OPERATE_RET ReleaseModule(IN CONST MODULE_HANDLE moduleHandle);
/**
 * @brief Release module handle.
 *
 * @param[in] moduleHandle: the handle of the module
 *
 * @note This API is used for releasing module handle.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func CreateModuleAndStart

OPERATE_RET CreateModuleAndStart(OUT MODULE_HANDLE *pModuleHandle,\
                                        IN CONST P_CONSTRUCT_FUNC enter,\
                                        IN CONST P_EXTRACT_FUNC exit,\
                                        IN CONST THRD_PARAM_S *thrd_param);
/**
 * @brief Create and start the module
 *
 * @param[out] pModuleHandle: the handle of the module
 * @param[in] enter: the construct function of the module
 * @param[in] exit: the deconstructor function of the module
 * @param[in] thrd_param: the parameaters of the thread
 *
 * @note This API is used for creating and starting the module
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ModulePostMessage

OPERATE_RET ModulePostMessage(IN CONST MODULE_HANDLE moduleHandle,\
                                    IN CONST MSG_ID msgID,\
                                    IN CONST P_MSG_DATA pMsgData,\
                                    IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a message.
 *
 * @param[in] moduleHandle: the handle of the module
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ModPostMsgMalloc

OPERATE_RET ModPostMsgMalloc(IN CONST MODULE_HANDLE moduleHandle,\
                                   IN CONST MSG_ID msgID,\
                                   IN CONST P_MSG_DATA pMsgData,\
                                   IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a message with memory alloc
 *
 * @param[in] moduleHandle: the handle of the module
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a message with memory alloc, the param of message data can be local variable
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ModulePostInstancyMsg

OPERATE_RET ModulePostInstancyMsg(IN CONST MODULE_HANDLE moduleHandle,\
                                         IN CONST MSG_ID msgID,\
                                         IN CONST P_MSG_DATA pMsgData,\
                                         IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a message instantly
 *
 * @param[in] moduleHandle: the handle of the module
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a message instantly
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ModPostInstancyMsgMalloc

OPERATE_RET ModPostInstancyMsgMalloc(IN CONST MODULE_HANDLE moduleHandle,\
                                              IN CONST MSG_ID msgID,\
                                              IN CONST P_MSG_DATA pMsgData,\
                                              IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a instant message with memory alloc
 *
 * @param[in] moduleHandle: the handle of the module
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a instant message with memory alloc, the param of message data can be local variable
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ModuleRegisterMsgCb

OPERATE_RET ModuleRegisterMsgCb(IN CONST MODULE_HANDLE moduleHandle,\
                                       IN CONST MSG_CALLBACK msg_cb,\
                                       OUT MSG_ID *msg_id);
/**
 * @brief Regist callback function for message.
 *
 * @param[in] moduleHandle: the handle of the module
 * @param[in] msg_cb: message callback function
 * @param[out] msg_id: message id
 *
 * @note This API is used for registing message's callback function.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ModuleUnregisterMsgCb

OPERATE_RET ModuleUnregisterMsgCb(IN CONST MODULE_HANDLE moduleHandle,IN CONST MSG_ID msgID);
/**
 * @brief Unregist callback function for message.
 *
 * @param[in] moduleHandle: the handle of the module
 * @param[in] msgID: message id
 *
 * @note This API is used for unRegisting message's callback function.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func module_cr_tm_msg_hand

OPERATE_RET module_cr_tm_msg_hand(IN CONST MODULE_HANDLE moduleHandle,IN CONST VOID *data,\
                                          IN CONST TM_MSG_CB cb,OUT TM_MSG_S **tm_msg);
/**
 * @brief Create timer message handle.
 *
 * @param[in] moduleHandle: the handle of the module
 * @param[in] data: message data
 * @param[in] cb: callback function
 * @param[out] tm_msg: timer message info
 *
 * @note This API is used for creating a timer message handle
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func module_start_tm_msg

OPERATE_RET module_start_tm_msg(IN CONST TM_MSG_S *tm_msg,IN CONST TIME_MS timeCycle,\
                                       IN CONST TIMER_TYPE timer_type);
/**
 * @brief Start the timer message.
 *
 * @param[in] tm_msg: timer message info
 * @param[in] timeCycle: cycle time of the timer
 * @param[in] timer_type: timer type, cycle or once
 *
 * @note This API is used for starting the timer message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func module_stop_tm_msg

OPERATE_RET module_stop_tm_msg(IN CONST TM_MSG_S *tm_msg);
/**
 * @brief Stop the timer message.
 *
 * @param[in] tm_msg: timer message info
 *
 * @note This API is used for stopping the timer message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func module_release_tm_msg

OPERATE_RET module_release_tm_msg(IN CONST TM_MSG_S *tm_msg);
/**
 * @brief Release the timer message.
 *
 * @param[in] tm_msg: timer message info
 *
 * @note This API is used for releasing the timer message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ModuleGetMsgNodeNum

OPERATE_RET ModuleGetMsgNodeNum(IN CONST MODULE_HANDLE moduleHandle,OUT PINT_T pMsgNodeNum);
/**
 * @brief Get message node count.
 *
 * @param[in] moduleHandle: the handle of the module
 * @param[out] pMsgNodeNum: the message node count in the module
 *
 * @note This API is used for getting the count of message node.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func CreateMsgQueAndInit

OPERATE_RET CreateMsgQueAndInit(OUT MSG_QUE_HANDLE *pMsgQueHandle);
/**
 * @brief Create and init the message queue
 *
 * @param[in] pMsgQueHandle: the handle of message queue
 *
 * @note This API is used for initializing the message queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func AddMsgNodeToQueue

OPERATE_RET AddMsgNodeToQueue(IN CONST MSG_QUE_HANDLE msgQueHandle,\
                                    IN CONST MSG_ID msgID, IN CONST P_MSG_DATA pMsgData,\
                                    IN CONST MSG_DATA_LEN msgDataLen,\
                                    IN CONST MSG_TYPE msgType);
/**
 * @brief Add message to queue
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] pMsgData: message data lenth
 * @param[in] msgType: message type
 *
 * @note This API is used for adding a timer to the queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func GetMsgNodeFromQueue

OPERATE_RET GetMsgNodeFromQueue(IN CONST MSG_QUE_HANDLE msgQueHandle,\
                                       IN CONST MSG_ID msgID, OUT P_MSG_LIST *ppMsgListNode);
/**
 * @brief Get message node from queue
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[in] msgID: message id
 * @param[out] ppMsgListNode: message node
 *
 * @note This API is used for getting message node from the queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func GetFirstMsgFromQueue

OPERATE_RET GetFirstMsgFromQueue(IN CONST MSG_QUE_HANDLE msgQueHandle,\
                                        OUT P_MSG_LIST *ppMsgListNode);
/**
 * @brief Get the first message node from queue
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[out] ppMsgListNode: message node
 *
 * @note This API is used for getting the first message node from queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func GetMsgNodeNum

OPERATE_RET GetMsgNodeNum(IN CONST MSG_QUE_HANDLE msgQueHandle, OUT PINT_T pMsgNodeNum);
/**
 * @brief Get the count of message node from queue
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[out] pMsgNodeNum: the count of message node
 *
 * @note This API is used for getting the first message node from queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func DelAndFreeMsgNodeFromQueue

OPERATE_RET DelAndFreeMsgNodeFromQueue(IN CONST MSG_QUE_HANDLE msgQueHandle, IN CONST P_MSG_LIST pMsgListNode);
/**
 * @brief Delete and free the message node from queue
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[in] pMsgListNode: the message node
 *
 * @note This API is used to delete and free the message node from queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ReleaseMsgQue

OPERATE_RET ReleaseMsgQue(IN CONST MSG_QUE_HANDLE msgQueHandle);
/**
 * @brief Release the message queue
 *
 * @param[in] msgQueHandle: the handle of the message queue
 *
 * @note This API is used releasing the message queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func PostMessage

OPERATE_RET PostMessage(IN CONST MSG_QUE_HANDLE msgQueHandle,\
                           IN CONST MSG_ID msgID,\
                           IN CONST P_MSG_DATA pMsgData,\
                           IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a message.
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func PostInstancyMsg

OPERATE_RET PostInstancyMsg(IN CONST MSG_QUE_HANDLE msgQueHandle,\
                                 IN CONST MSG_ID msgID,\
                                 IN CONST P_MSG_DATA pMsgData,\
                                 IN CONST MSG_DATA_LEN msgDataLen);
/**
 * @brief Post a message instantly
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[in] msgID: message id
 * @param[in] pMsgData: message data
 * @param[in] msgDataLen: message data len
 *
 * @note This API is used for posting a message instantly
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func WaitMessage

OPERATE_RET WaitMessage(IN CONST MSG_QUE_HANDLE msgQueHandle, OUT P_MSG_LIST *ppMsgListNode);
/**
 * @brief Wait a message.
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[out] ppMsgListNode: message node
 *
 * @note This API is used for waiting a message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func RegisterMsgCb

OPERATE_RET RegisterMsgCb(IN CONST MSG_QUE_HANDLE msgQueHandle,\
                              IN CONST MSG_CALLBACK msg_cb, OUT MSG_ID *msg_id);
/**
 * @brief Regist callback function for message.
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[in] msg_cb: message callback function
 * @param[out] msg_id: message id
 *
 * @note This API is used for registing message's callback function.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func UnregisterMsgCb

OPERATE_RET UnregisterMsgCb(IN CONST MSG_QUE_HANDLE msgQueHandle,IN CONST MSG_ID msgID);
/**
 * @brief Unregist callback function for message.
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[in] msgID: message id
 *
 * @note This API is used for unRegisting message's callback function.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func MessageLoop

VOID MessageLoop(IN CONST MSG_QUE_HANDLE msgQueHandle);
/**
 * @brief Message loop processing.
 *
 * @param[in] msgQueHandle: the handle of the message queue
 *
 * @note This API is used for Message loop processing.
 *
 * @return VOID
 */

Func create_tm_msg_hand

OPERATE_RET create_tm_msg_hand(IN CONST MSG_QUE_HANDLE msgQueHandle,IN CONST VOID *data,\
                                     IN CONST TM_MSG_CB cb,OUT TM_MSG_S **tm_msg);
/**
 * @brief Create timer message handle.
 *
 * @param[in] msgQueHandle: the handle of the message queue
 * @param[in] data: message data
 * @param[in] cb: callback function
 * @param[out] tm_msg: timer message info
 *
 * @note This API is used for creating a timer message handle
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func start_tm_msg

OPERATE_RET start_tm_msg(IN CONST TM_MSG_S *tm_msg,IN CONST TIME_MS timeCycle,\
                             IN CONST TIMER_TYPE timer_type);
/**
 * @brief Start the timer message.
 *
 * @param[in] tm_msg: timer message info
 * @param[in] timeCycle: cycle time of the timer
 * @param[in] timer_type: timer type, cycle or once
 *
 * @note This API is used for starting the timer message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func stop_tm_msg

OPERATE_RET stop_tm_msg(IN CONST TM_MSG_S *tm_msg);
/**
 * @brief Stop the timer message.
 *
 * @param[in] tm_msg: timer message info
 *
 * @note This API is used for stopping the timer message
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func release_tm_msg_hand

VOID release_tm_msg_hand(IN CONST TM_MSG_S *tm_msg);
/**
 * @brief Release the timer message.
 *
 * @param[in] tm_msg: timer message info
 *
 * @note This API is used for releasing the timer message
 *
 * @return VOID
 */

Func tuya_os_intf_init

int tuya_os_intf_init(void);
/**
 * @brief Initialization for system interface adaption.
 *
 * @param void
 *
 * @note This API is used for Initialization for system interface adaption.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_mesh_prov_init

OPERATE_RET tuya_hal_bt_mesh_prov_init(ty_ble_mesh_prov_param_t *p);


      

Func tuya_hal_bt_mesh_prov_deinit

OPERATE_RET tuya_hal_bt_mesh_prov_deinit(VOID_T);


      

Func tuya_hal_bt_mesh_prov_set_info

OPERATE_RET tuya_hal_bt_mesh_prov_set_info(ty_ble_mesh_info_t *info);


      

Func tuya_hal_bt_mesh_prov_set_addr

OPERATE_RET tuya_hal_bt_mesh_prov_set_addr(UINT16_T mesh_addr);


      

Func tuya_hal_bt_mesh_prov_scan

OPERATE_RET tuya_hal_bt_mesh_prov_scan(BOOL_T enable);


      

Func tuya_hal_bt_mesh_prov_del_dev_with_addr

OPERATE_RET tuya_hal_bt_mesh_prov_del_dev_with_addr(UINT16_T mesh_addr, UINT8_T dev_key[16]);


      

Func tuya_hal_bt_mesh_prov_send_data

OPERATE_RET tuya_hal_bt_mesh_prov_send_data(UINT_T opcode, UINT16_T mesh_addr, UINT8_T *data, UINT_T length, UINT8_T dev_key[16]);


      

Func tuya_hal_bt_mesh_prov_node_reset

OPERATE_RET tuya_hal_bt_mesh_prov_node_reset(VOID_T);


      

Func tuya_os_ble_mesh_prov_intf_init

VOID_T tuya_os_ble_mesh_prov_intf_init(VOID_T);


      

Func tuya_hal_bt_port_init

OPERATE_RET tuya_hal_bt_port_init(ty_bt_param_t *p);
/**
 * @brief Init bluetooth.
 *
 * @param[in] p: parameters of bluetooth
 *
 * @note This API is used for initialization of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_port_deinit

OPERATE_RET tuya_hal_bt_port_deinit(void);
/**
 * @brief De-init bluetooth.
 *
 * @param void
 *
 * @note This API is used for de-initialization of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_gap_disconnect

OPERATE_RET tuya_hal_bt_gap_disconnect(void);
/**
 * @brief Disconnect bluetooth.
 *
 * @param void
 *
 * @note This API is used for disconnecting bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_send

OPERATE_RET tuya_hal_bt_send(BYTE_T *data, UINT8_T len);
/**
 * @brief Send data by bluetooth.
 *
 * @param[in] data: send data
 * @param[in] len: data lenth
 *
 * @note This API is used for sending data by bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_reset_adv

OPERATE_RET tuya_hal_bt_reset_adv(tuya_ble_data_buf_t *adv, tuya_ble_data_buf_t *scan_resp);
/**
 * @brief Reset advertisement data of bluetooth.
 *
 * @param[in] adv: advertisement data
 * @param[in] scan_resp: advertisement scan data
 *
 * @note This API is used for reseting advertisement data of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_get_rssi

OPERATE_RET tuya_hal_bt_get_rssi(SCHAR_T *rssi);
/**
 * @brief Get rssi info.
 *
 * @param[out] rssi: rssi info
 * 
 * @note This API is used for getting rssi info.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_start_adv

OPERATE_RET tuya_hal_bt_start_adv(void);
/**
 * @brief Start advertising of bluetooth.
 *
 * @param void
 *
 * @note This API is used to start advertising of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_stop_adv

OPERATE_RET tuya_hal_bt_stop_adv(void);
/**
 * @brief Stop advertising of bluetooth.
 *
 * @param void
 *
 * @note This API is used to stopping advertising of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_assign_scan

OPERATE_RET tuya_hal_bt_assign_scan(INOUT ty_bt_scan_info_t *info);
/**
 * @brief Get scan info of bluetooth.
 *
 * @param[out] info: scan info of bluetooth.
 * 
 * @note This API is used for getting scan info of bluetooth for mf test
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_get_ability

OPERATE_RET tuya_hal_bt_get_ability(VOID_T);
/**
 * @brief Get ability of bluetooth.
 *
 * @param VOID
 *
 * @note This API is used to getting ability of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_scan_init

OPERATE_RET tuya_hal_bt_scan_init(IN TY_BT_SCAN_ADV_CB scan_adv_cb);
/**
 * @brief Init advertisement scanning of bluetooth.
 *
 * @param[in] scan_adv_cb: callback function of advertisement scanning
 * @param[in] scan_resp: advertisement scan data
 *
 * @note This API is used for Initializion for advertisement scanning of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_start_scan

OPERATE_RET tuya_hal_bt_start_scan(VOID_T);
/**
 * @brief Start advertising scanning of bluetooth.
 *
 * @param VOID
 *
 * @note This API is used to start advertising scanning of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_stop_scan

OPERATE_RET tuya_hal_bt_stop_scan(VOID_T);
/**
 * @brief Stop advertising scanning of bluetooth.
 *
 * @param VOID
 *
 * @note This API is used to stop advertising scanning of bluetooth.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_central_init

OPERATE_RET tuya_hal_bt_central_init(ty_ble_central_param_t *p);


      

Func tuya_hal_bt_central_deinit

OPERATE_RET tuya_hal_bt_central_deinit(VOID_T);


      

Func tuya_hal_bt_master_connect

OPERATE_RET tuya_hal_bt_master_connect(UINT8_T mac[6], ty_ble_addr_type_t type, UINT_T timeout_ms, ty_ble_gap_conn_params_t *params);


      

Func tuya_hal_bt_master_disconnect

OPERATE_RET tuya_hal_bt_master_disconnect(UINT8_T mac[6], ty_ble_addr_type_t type);


      

Func tuya_hal_bt_master_scan

OPERATE_RET tuya_hal_bt_master_scan(BOOL_T enable);


      

Func tuya_hal_bt_master_get_max_slave_num

OPERATE_RET tuya_hal_bt_master_get_max_slave_num(UINT16_T *num);


      

Func tuya_hal_bt_gattc_send_data

OPERATE_RET tuya_hal_bt_gattc_send_data(UINT8_T mac[6], UINT8_T *data, UINT_T length);


      

Func tuya_hal_bt_gattc_start_discovery

OPERATE_RET tuya_hal_bt_gattc_start_discovery(UINT8_T mac[6], ty_bt_uuid_t *uuid);


      

Func tuya_hal_bt_send_beacon

OPERATE_RET tuya_hal_bt_send_beacon(tuya_ble_data_buf_t *adv, tuya_ble_data_buf_t *scan_resp, UINT16_T interval, UINT16_T timeout);


      

Func tuya_os_bt_intf_init

VOID_T tuya_os_bt_intf_init(VOID_T);
/**
 * @brief Bluetooth interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of bluetooth interface.
 *
 * @return VOID
 */

Func tuya_hal_bt_get_mac

OPERATE_RET tuya_hal_bt_get_mac(NW_MAC_S *mac);
/**
 * @brief Get mac
 *
 * @param[out] mac: refer NW_MAC_S struct
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_bt_set_mac

OPERATE_RET tuya_hal_bt_set_mac(CONST NW_MAC_S *mac);
/**
 * @brief Set mac
 *
 * @param[in] mac: refer NW_MAC_S struct
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_os_cellular_intf_init

VOID_T tuya_os_cellular_intf_init(VOID_T);


      

Func tuya_hal_cellular_set_imei

OPERATE_RET tuya_hal_cellular_set_imei(CONST CHAR_T imei[15 + 1]);


      

Func tuya_hal_cellular_get_imei

OPERATE_RET tuya_hal_cellular_get_imei(CHAR_T imei[15 + 1]);


      

Func tuya_hal_cellular_get_network_state

OPERATE_RET tuya_hal_cellular_get_network_state(BOOL_T *state);


      

Func tuya_hal_cellular_control

OPERATE_RET tuya_hal_cellular_control(uint8_t cmd, void *arg);


      

Func tuya_hal_cellular_get_iccid

OPERATE_RET tuya_hal_cellular_get_iccid(CHAR_T iccid[20 + 1]);


      

Func tuya_hal_cellular_get_ip

OPERATE_RET tuya_hal_cellular_get_ip(NW_IP_S *ip);


      

Func tuya_hal_cellular_get_simcard_state

OPERATE_RET tuya_hal_cellular_get_simcard_state(uint8_t *state);


      

Func tuya_hal_cellular_get_rssi

OPERATE_RET tuya_hal_cellular_get_rssi(SCHAR_T *rssi);


      

Func tuya_hal_cellular_get_test_intf

OPERATE_RET tuya_hal_cellular_get_test_intf(CELLULAR_TEST_INTF **intf);


      

Func tuya_hal_cellular_calibrated

BOOL_T tuya_hal_cellular_calibrated(VOID_T);


      

Func tuya_hal_fs_mkdir

INT_T tuya_hal_fs_mkdir(CONST CHAR_T* path);
/**
 * @brief Make directory
 *
 * @param[in] path: path of directory
 *
 * @note This API is used for making a directory
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_hal_fs_remove

INT_T tuya_hal_fs_remove(CONST CHAR_T* path);
/**
* @brief Remove directory
*
* @param[in] path: path of directory
*
* @note This API is used for removing a directory
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fs_mode

INT_T tuya_hal_fs_mode(CONST CHAR_T* path, UINT_T* mode);
/**
* @brief Get file mode
*
* @param[in] path: path of directory
* @param[out] mode: bit attibute of directory
*
* @note This API is used for getting file mode.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fs_is_exist

INT_T tuya_hal_fs_is_exist(CONST CHAR_T* path, BOOL_T* is_exist);
/**
* @brief Check whether the file or directory exists
*
* @param[in] path: path of directory
* @param[out] is_exist: the file or directory exists or not
*
* @note This API is used to check whether the file or directory exists.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fs_rename

INT_T tuya_hal_fs_rename(CONST CHAR_T* path_old, CONST CHAR_T* path_new);
/**
* @brief File rename
*
* @param[in] path_old: old path of directory
* @param[in] path_new: new path of directory
*
* @note This API is used to rename the file.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_dir_open

INT_T tuya_hal_dir_open(CONST CHAR_T* path, TUYA_DIR* dir);
/**
* @brief Open directory
*
* @param[in] path: path of directory
* @param[out] dir: handle of directory
*
* @note This API is used to open a directory
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_dir_close

INT_T tuya_hal_dir_close(TUYA_DIR dir);
/**
* @brief Close directory
*
* @param[in] dir: handle of directory
*
* @note This API is used to close a directory
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_dir_read

INT_T tuya_hal_dir_read(TUYA_DIR dir, TUYA_FILEINFO* info);
/**
* @brief Read directory
*
* @param[in] dir: handle of directory
* @param[out] info: file information
*
* @note This API is used to read a directory.
* Read the file information of the current node, and the internal pointer points to the next node.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_dir_name

INT_T tuya_hal_dir_name(TUYA_FILEINFO info, CONST CHAR_T** name);
/**
* @brief Get the name of the file node
*
* @param[in] info: file information
* @param[out] name: file name
*
* @note This API is used to get the name of the file node.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_dir_is_directory

INT_T tuya_hal_dir_is_directory(TUYA_FILEINFO info, BOOL_T* is_dir);
/**
* @brief Check whether the node is a directory
*
* @param[in] info: file information
* @param[out] is_dir: is directory or not
*
* @note This API is used to check whether the node is a directory.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_dir_is_regular

INT_T tuya_hal_dir_is_regular(TUYA_FILEINFO info, BOOL_T* is_regular);


      

Func tuya_hal_fopen

TUYA_FILE tuya_hal_fopen(CONST CHAR_T* path, CONST CHAR_T* mode);
/**
* @brief Open file
*
* @param[in] path: path of file
* @param[in] mode: file open mode: "r","w"...
*
* @note This API is used to open a file
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fclose

INT_T tuya_hal_fclose(TUYA_FILE file);
/**
* @brief Close file
*
* @param[in] file: file handle
*
* @note This API is used to close a file
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fread

INT_T tuya_hal_fread(VOID_T* buf, INT_T bytes, TUYA_FILE file);
/**
* @brief Read file
*
* @param[in] buf: buffer for reading file
* @param[in] bytes: buffer size
* @param[in] file: file handle
*
* @note This API is used to read a file
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fwrite

INT_T tuya_hal_fwrite(VOID_T* buf, INT_T bytes, TUYA_FILE file);
/**
* @brief write file
*
* @param[in] buf: buffer for writing file
* @param[in] bytes: buffer size
* @param[in] file: file handle
*
* @note This API is used to write a file
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fsync

INT_T tuya_hal_fsync(TUYA_FILE file);
/**
* @brief write buffer to flash
*
* @param[in] file: file handle
*
* @note This API is used to write buffer to flash
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fgets

CHAR_T* tuya_hal_fgets(CHAR_T* buf, INT_T len, TUYA_FILE file);
/**
* @brief Read string from file
*
* @param[in] buf: buffer for reading file
* @param[in] len: buffer size
* @param[in] file: file handle
*
* @note This API is used to read string from file
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_feof

INT_T tuya_hal_feof(TUYA_FILE file);
/**
* @brief Check wheather to reach the end fo the file
*
* @param[in] file: file handle
*
* @note This API is used to check wheather to reach the end fo the file
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_fseek

INT_T tuya_hal_fseek(TUYA_FILE file, INT64_T offs, INT_T whence);
/**
* @brief Seek to the offset position of the file
*
* @param[in] file: file handle
* @param[in] offs: offset
* @param[in] whence: seek start point mode
*
* @note This API is used to seek to the offset position of the file.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_ftell

INT64_T tuya_hal_ftell(TUYA_FILE file);
/**
* @brief Get current position of file
*
* @param[in] file: file handle
*
* @note This API is used to get current position of file.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_fs_intf_init

VOID_T tuya_os_fs_intf_init(VOID_T);
/**
 * @brief File system interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of file system interface.
 *
 * @return VOID
 */

Func tuya_hal_system_malloc

VOID_T *tuya_hal_system_malloc(CONST SIZE_T size);
/**
* @brief Alloc memory of system
*
* @param[in] size: memory size
*
* @note This API is used to alloc memory of system.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_system_free

VOID_T tuya_hal_system_free(VOID_T* ptr);
/**
* @brief Free memory of system
*
* @param[in] ptr: memory point
*
* @note This API is used to free memory of system.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_system_calloc

VOID_T *tuya_hal_system_calloc(size_t nitems, size_t size);
/**
 * @brief tuya_hal_system_calloc 用于分配并清除干净内存
 * 
 * @param[in]       nitems      需要分配内存块的数量
 * @param[in]       size        需要分配块的内存大小
 */

Func tuya_hal_system_realloc

VOID_T *tuya_hal_system_realloc(VOID_T* ptr, size_t size);
/**
 * @brief tuya_hal_system_realloc 重新调整内存大小
 * 
 * @param[in]       nitems      源内存指针
 * @param[in]       size        调整后的大小
 */

Func tuya_os_memory_intf_init

VOID_T tuya_os_memory_intf_init(VOID_T);
/* add begin: by sunkz, interface regist */

Func tuya_hal_mutex_create_init

OPERATE_RET tuya_hal_mutex_create_init(MUTEX_HANDLE *pMutexHandle);
/**
* @brief Create mutex
*
* @param[out] pMutexHandle: mutex handle
*
* @note This API is used to create mutex.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_mutex_lock

OPERATE_RET tuya_hal_mutex_lock(const MUTEX_HANDLE mutexHandle);
/**
* @brief Lock mutex
*
* @param[in] mutexHandle: mutex handle
*
* @note This API is used to lock mutex.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_mutex_unlock

OPERATE_RET tuya_hal_mutex_unlock(const MUTEX_HANDLE mutexHandle);
/**
* @brief Unlock mutex
*
* @param[in] mutexHandle: mutex handle
*
* @note This API is used to unlock mutex.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_mutex_release

OPERATE_RET tuya_hal_mutex_release(const MUTEX_HANDLE mutexHandle);
/**
* @brief Release mutex
*
* @param[in] mutexHandle: mutex handle
*
* @note This API is used to release mutex.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_mutex_intf_init

VOID_T tuya_os_mutex_intf_init(VOID_T);
/**
 * @brief Mutex interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of mutex interface.
 *
 * @return VOID
 */

Func tuya_hal_net_get_errno

UNW_ERRNO_T tuya_hal_net_get_errno(void);
/**
* @brief Get error code of network
*
* @param void
*
* @note This API is used for getting error code of network.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_fd_set

int tuya_hal_net_fd_set(int fd, UNW_FD_SET_T* fds);
/**
* @brief Add file descriptor to set
*
* @param[in] fd: file descriptor
* @param[in] fds: set of file descriptor
*
* @note This API is used to add file descriptor to set.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_net_fd_clear

int tuya_hal_net_fd_clear(int fd, UNW_FD_SET_T* fds);
/**
* @brief Clear file descriptor from set
*
* @param[in] fd: file descriptor
* @param[in] fds: set of file descriptor
*
* @note This API is used to clear file descriptor from set.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_net_fd_isset

int tuya_hal_net_fd_isset(int fd, UNW_FD_SET_T* fds);
/**
* @brief Check file descriptor is in set
*
* @param[in] fd: file descriptor
* @param[in] fds: set of file descriptor
*
* @note This API is used to check the file descriptor is in set.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_net_fd_zero

int tuya_hal_net_fd_zero(UNW_FD_SET_T* fds);
/**
* @brief Clear all file descriptor in set
*
* @param[in] fds: set of file descriptor
*
* @note This API is used to clear all file descriptor in set.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_net_select

int tuya_hal_net_select(const int maxfd, UNW_FD_SET_T *readfds, UNW_FD_SET_T *writefds,
                               UNW_FD_SET_T *errorfds, const UINT_T ms_timeout);
/**
* @brief Get available file descriptors
*
* @param[in] maxfd: max count of file descriptor
* @param[out] readfds: a set of readalbe file descriptor
* @param[out] writefds: a set of writable file descriptor
* @param[out] errorfds: a set of except file descriptor
* @param[in] ms_timeout: time out
*
* @note This API is used to get available file descriptors.
*
* @return the count of available file descriptors.
*/

Func tuya_hal_net_get_nonblock

int tuya_hal_net_get_nonblock(const int fd);
/**
* @brief Get no block file descriptors
*
* @param[in] fd: file descriptor
*
* @note This API is used to get no block file descriptors.
*
* @return the count of no block file descriptors.
*/

Func tuya_hal_net_set_block

int tuya_hal_net_set_block(const int fd, const bool block);
/**
* @brief Set block flag for file descriptors
*
* @param[in] fd: file descriptor
* @param[in] block: block flag
*
* @note This API is used to set block flag for file descriptors.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_close

int tuya_hal_net_close(const int fd);
/**
* @brief Close file descriptors
*
* @param[in] fd: file descriptor
*
* @note This API is used to close file descriptors.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_shutdown

int tuya_hal_net_shutdown(const int fd, const int how);
/**
* @brief Shutdown file descriptors
*
* @param[in] fd: file descriptor
* @param[in] how: shutdown type
*
* @note This API is used to shutdown file descriptors.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_socket_create

int tuya_hal_net_socket_create(const UNW_PROTOCOL_TYPE type);
/**
* @brief Create a tcp/udp socket
*
* @param[in] type: protocol type, tcp or udp
*
* @note This API is used for creating a tcp/udp socket.
*
* @return file descriptor
*/

Func tuya_hal_net_connect

int tuya_hal_net_connect(const int fd, const UNW_IP_ADDR_T addr, const UINT16_T port);
/**
* @brief Connect to network
*
* @param[in] fd: file descriptor
* @param[in] addr: address information of server
* @param[in] port: port information of server
*
* @note This API is used for connecting to network.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_connect_raw

int tuya_hal_net_connect_raw(const int fd, void *p_socket, const int len);
/**
* @brief Connect to network with raw data
*
* @param[in] fd: file descriptor
* @param[in] p_socket: raw socket data
* @param[in] len: data lenth
*
* @note This API is used for connecting to network with raw data.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_bind

int tuya_hal_net_bind(const int fd, const UNW_IP_ADDR_T addr, const UINT16_T port);
/**
* @brief Bind to network
*
* @param[in] fd: file descriptor
* @param[in] addr: address information of server
* @param[in] port: port information of server
*
* @note This API is used for binding to network.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_listen

int tuya_hal_net_listen(const int fd, const int backlog);
/**
* @brief Listen to network
*
* @param[in] fd: file descriptor
* @param[in] backlog: max count of backlog connection
*
* @note This API is used for listening to network.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_send

int tuya_hal_net_send(const int fd, const void *buf, const UINT_T nbytes);
/**
* @brief Send data to network
*
* @param[in] fd: file descriptor
* @param[in] buf: send data buffer
* @param[in] nbytes: buffer lenth
*
* @note This API is used for sending data to network
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_send_to

int tuya_hal_net_send_to(const int fd, const void *buf, const UINT_T nbytes,
                                const UNW_IP_ADDR_T addr, const UINT16_T port);
/**
* @brief Send data to specified server
*
* @param[in] fd: file descriptor
* @param[in] buf: send data buffer
* @param[in] nbytes: buffer lenth
* @param[in] addr: address information of server
* @param[in] port: port information of server
*
* @note This API is used for sending data to network
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_recv

int tuya_hal_net_recv(const int fd, void *buf, const UINT_T nbytes);
/**
* @brief Receive data from network
*
* @param[in] fd: file descriptor
* @param[in] buf: receive data buffer
* @param[in] nbytes: buffer lenth
*
* @note This API is used for receiving data from network
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_recvfrom

int tuya_hal_net_recvfrom(const int fd, void *buf, const UINT_T nbytes,
                                  UNW_IP_ADDR_T *addr, UINT16_T *port);
/**
* @brief Receive data from specified server
*
* @param[in] fd: file descriptor
* @param[in] buf: receive data buffer
* @param[in] nbytes: buffer lenth
* @param[in] addr: address information of server
* @param[in] port: port information of server
*
* @note This API is used for receiving data from specified server
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_set_timeout

int tuya_hal_net_set_timeout(const int fd, const int ms_timeout, const UNW_TRANS_TYPE_E type);
/**
* @brief Set timeout option of socket fd
*
* @param[in] fd: file descriptor
* @param[in] ms_timeout: timeout in ms
* @param[in] type: transfer type, receive or send
*
* @note This API is used for setting timeout option of socket fd.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_set_bufsize

int tuya_hal_net_set_bufsize(const int fd, const int buf_size, const UNW_TRANS_TYPE_E type);
/**
* @brief Set buffer_size option of socket fd
*
* @param[in] fd: file descriptor
* @param[in] buf_size: buffer size in byte
* @param[in] type: transfer type, receive or send
*
* @note This API is used for setting buffer_size option of socket fd.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_set_reuse

int tuya_hal_net_set_reuse(const int fd);
/**
* @brief Enable reuse option of socket fd
*
* @param[in] fd: file descriptor
*
* @note This API is used to enable reuse option of socket fd.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_disable_nagle

int tuya_hal_net_disable_nagle(const int fd);
/**
* @brief Disable nagle option of socket fd
*
* @param[in] fd: file descriptor
*
* @note This API is used to disable nagle option of socket fd.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_set_boardcast

int tuya_hal_net_set_boardcast(const int fd);
/**
* @brief Enable broadcast option of socket fd
*
* @param[in] fd: file descriptor
*
* @note This API is used to enable broadcast option of socket fd.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_set_keepalive

int tuya_hal_net_set_keepalive(int fd, const bool alive, const UINT_T idle, const UINT_T intr, const UINT_T cnt);
/**
* @brief Set keepalive option of socket fd to monitor the connection
*
* @param[in] fd: file descriptor
* @param[in] alive: keepalive option, enable or disable option
* @param[in] idle: keep idle option, if the connection has no data exchange with the idle time(in seconds), start probe.
* @param[in] intr: keep interval option, the probe time interval.
* @param[in] cnt: keep count option, probe count.
*
* @note This API is used to set keepalive option of socket fd to monitor the connection.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_gethostbyname

int tuya_hal_net_gethostbyname(const char *domain, UNW_IP_ADDR_T *addr);
/**
* @brief Get address information by domain
*
* @param[in] domain: domain information
* @param[in] addr: address information
*
* @note This API is used for getting address information by domain.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_accept

int tuya_hal_net_accept(const int fd, UNW_IP_ADDR_T *addr, UINT16_T *port);
/**
* @brief Accept the coming socket connection of the server fd
*
* @param[in] fd: file descriptor
* @param[in] addr: address information of server
* @param[in] port: port information of server
*
* @note This API is used for accepting the coming socket connection of the server fd.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_recv_nd_size

int tuya_hal_net_recv_nd_size(const int fd, void *buf, const UINT_T buf_size, const UINT_T nd_size);
/**
* @brief Receive data from network with need size
*
* @param[in] fd: file descriptor
* @param[in] buf: receive data buffer
* @param[in] nbytes: buffer lenth
* @param[in] nd_size: the need size
*
* @note This API is used for receiving data from network with need size
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_str2addr

UNW_IP_ADDR_T tuya_hal_net_str2addr(const char *ip_str);
/**
* @brief Change ip string to address
*
* @param[in] ip_str: ip string
*
* @note This API is used to change ip string to address.
*
* @return ip address
*/

Func tuya_hal_net_socket_bind

int tuya_hal_net_socket_bind(int fd, const char *ip);
/**
* @brief Bind to network with specified ip
*
* @param[in] fd: file descriptor
* @param[in] ip: ip address
*
* @note This API is used for binding to network with specified ip.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_set_cloexec

int tuya_hal_net_set_cloexec(const int fd);
/**
* @brief Set socket fd close mode
*
* @param[in] fd: file descriptor
*
* @note This API is used for setting socket fd close mode, the socket fd will not be closed in child processes generated by fork calls.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_get_socket_ip

int tuya_hal_net_get_socket_ip(int fd, UNW_IP_ADDR_T *addr);
/**
* @brief Get ip address by socket fd
*
* @param[in] fd: file descriptor
* @param[out] addr: ip address
*
* @note This API is used for getting ip address by socket fd.
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_hal_net_addr

UNW_IP_ADDR_T tuya_hal_net_addr(const char *ip);
/**
* @brief Get ip address by ip string
*
* @param[in] ip: ip string
*
* @note This API is used for getting ip address by ip string
*
* @return ip address
*/

Func tuya_hal_net_setsockopt

int tuya_hal_net_setsockopt(int fd, int level, int optname, void *optval, int optlen);
/**
* @brief set sock option
*
* @param[in] fd: socket id
* @param[in] level: level
* @param[in] optname: optname
* @param[in] optval: optval
* @param[in] optlen: optlen
*
* @note This API is used for set sock option
*
* @return UNW_SUCCESS on success. Others on error, please refer to tuya_os_adapter_error_code.h
*/

Func tuya_os_network_intf_init

VOID_T tuya_os_network_intf_init(VOID_T);
/**
 * @brief Network interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of network interface.
 *
 * @return VOID
 */

Func tuya_hal_ota_start_inform

int tuya_hal_ota_start_inform(unsigned int file_size, OTA_TYPE type);
/**
* @brief Start upgrade notification
*
* @param[in] file_size: file size
* @param[in] type: ota type
*
* @note This API is used for starting upgrade notification
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_ota_data_process

int tuya_hal_ota_data_process(const unsigned int total_len, const unsigned int offset,
                             const unsigned char* data, const unsigned int len, unsigned int* remain_len, void* pri_data);
/**
* @brief Ota data packet processing
*
* @param[in] total_len: total lenth of upgrade package
* @param[in] offset: offset of current data in upgrade package
* @param[in] data: ota data
* @param[in] len: ota data length
* @param[out] remain_len: the length of data that has been distributed internally but not yet processed
* @param[in] pri_data: reserved data
*
* @note This API is used for ota data packet processing
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_ota_end_inform

int tuya_hal_ota_end_inform(bool reset);
/**
* @brief Ota data transfer completion notification
*
* @param[in] reset: if need reset or not
*
* @note This API is used for ota data transfer completion notification
* users can do firmware verification and device restart
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_ota_intf_init

VOID_T tuya_os_ota_intf_init(VOID_T);
/**
 * @brief Ota interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of ota interface.
 *
 * @return VOID
 */

Func tuya_hal_output_log

VOID_T tuya_hal_output_log(CONST CHAR_T *str);
/**
* @brief Output log information
*
* @param[in] str: log information
*
* @note This API is used for outputing log information
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_log_close

OPERATE_RET tuya_hal_log_close(VOID_T);
/**
* @brief Close log port
*
* @param VOID
*
* @note This API is used for closing log port.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_log_open

OPERATE_RET tuya_hal_log_open(VOID_T);
/**
* @brief Open log port
*
* @param VOID
*
* @note This API is used for openning log port.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_output_intf_init

VOID_T tuya_os_output_intf_init(VOID_T);
/**
 * @brief Output interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of output interface.
 *
 * @return VOID
 */

Func tuya_hal_queue_create_init

OPERATE_RET tuya_hal_queue_create_init(QUEUE_HANDLE *queue, int msgsize,int msgcount);
/**
 * @brief tuya_hal_queue_create_init用于创建并初始化tuya 消息队列
 *
 * @param[in] msgsize 消息体的大小,msgcount 消息体的个数
 * @param[out] pQueue_hanle 返回queue句柄
 * @return int 0=成功,非0=失败
 */

Func tuya_hal_queue_post

OPERATE_RET tuya_hal_queue_post(CONST QUEUE_HANDLE pQueue_hanle,void *data, unsigned int timeout);
/**
 * @brief tuya_hal_queue_post用于发送一个消息到指定的队列中
 *
 * @param[in] pQueue_hanle tuya queue句柄,data消息体指针,timeout 超时时间
 * @return int 0=成功,非0=失败
 */

Func tuya_hal_queue_fetch

OPERATE_RET tuya_hal_queue_fetch(QUEUE_HANDLE pQueue_hanle, void *msg, unsigned int timeout);
/**
 * @brief tuya_hal_queue_fetch用于等待一个消息队列
 *
 * @param[in] pQueue_hanle  tuya queue句柄,data消息体指针,timeout 超时时间
 * @return int 0=成功,非0=失败
 */

Func tuya_hal_queue_free

OPERATE_RET tuya_hal_queue_free(CONST QUEUE_HANDLE pQueue_hanle);
/**
 * @brief tuya_hal_queue_free 释放消息队列
 *
 * @param[in] mutexHandle QUEUE_HANDLE tuya queue句柄
 * @return int 0=成功,非0=失败
 */

Func tuya_os_queue_intf_init

VOID_T tuya_os_queue_intf_init(VOID_T);
/* add begin: by sunkz, interface regist */

Func tuya_hal_semaphore_create_init

INT_T tuya_hal_semaphore_create_init(SEM_HANDLE *pHandle, CONST UINT_T semCnt, CONST UINT_T sem_max);
/**
* @brief Create semaphore
*
* @param[out] pHandle: semaphore handle
* @param[in] semCnt: semaphore init count
* @param[in] sem_max: semaphore max count
*
* @note This API is used for creating semaphore.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_semaphore_wait

INT_T tuya_hal_semaphore_wait(CONST SEM_HANDLE semHandle);
/**
* @brief Wait semaphore
*
* @param[in] semHandle: semaphore handle
*
* @note This API is used for waiting semaphore.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_semaphore_waittimeout

INT_T tuya_hal_semaphore_waittimeout(CONST SEM_HANDLE semHandle, unsigned int timeout);
/**
* @brief Wait semaphore with timeout
*
* @param[in] semHandle: semaphore handle
* @param[in] timeout: timeout(TUYA_OS_ADAPT_SEM_FOREVER: block forever)
*
* @note This API is used for waiting semaphore.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_semaphore_post

INT_T tuya_hal_semaphore_post(CONST SEM_HANDLE semHandle);
/**
* @brief Post semaphore
*
* @param[in] semHandle: semaphore handle
*
* @note This API is used for posting semaphore.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_semaphore_release

INT_T tuya_hal_semaphore_release(CONST SEM_HANDLE semHandle);
/**
* @brief Release semaphore
*
* @param[in] semHandle: semaphore handle
*
* @note This API is used for releasing semaphore.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_semaphore_intf_init

VOID_T tuya_os_semaphore_intf_init(VOID_T);
/**
 * @brief Semaphore interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of semaphore interface.
 *
 * @return VOID
 */

Func tuya_hal_flash_read

int tuya_hal_flash_read(const unsigned int addr, unsigned char *dst, const unsigned int size);
/**
* @brief Read flash
*
* @param[in] addr: flash address
* @param[out] dst: pointer of buffer
* @param[in] size: size of buffer
*
* @note This API is used for reading flash.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_flash_write

int tuya_hal_flash_write(const unsigned int addr, const unsigned char *src, const unsigned int size);
/**
* @brief Write flash
*
* @param[in] addr: flash address
* @param[in] src: pointer of buffer
* @param[in] size: size of buffer
*
* @note This API is used for reading flash.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_flash_erase

int tuya_hal_flash_erase(const unsigned int addr, const unsigned int size);
/**
* @brief Erase flash
*
* @param[in] addr: flash address
* @param[in] size: size of flash block
*
* @note This API is used for erasing flash.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_legacy_swap_get_desc

int tuya_hal_legacy_swap_get_desc(unsigned int *addr, unsigned int *size);
/**
* @brief Get legacy swap description
*
* @param[out] addr: legacy swap address
* @param[out] size: size of legacy swap
*
* @note This API is used to get legacy swap description.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_get_rcd_flash_desc

PARTITION_TABLE_S *tuya_hal_get_rcd_flash_desc(void);
/**
 * @brief get rcd flash description
 * 
 * @return  pointer to descrtion of rcd flash
 */

Func tuya_os_storage_intf_init

void tuya_os_storage_intf_init(void);
/**

 * @brief tuya_os_storage_intf_init用于初始化tuya storage组件接口
 * 
 * @return int 0=成功,非0=失败
 * @brief Storage interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of storage interface.
 *
 * @return VOID
 */

Func tuya_hal_get_systemtickcount

SYS_TICK_T tuya_hal_get_systemtickcount(VOID_T);
/**
* @brief Get system ticket count
*
* @param VOID
*
* @note This API is used to get system ticket count.
*
* @return system ticket count
*/

Func tuya_hal_get_tickratems

UINT_T tuya_hal_get_tickratems(VOID_T);
/**
* @brief Get time in MS per system ticket
*
* @param VOID
*
* @note This API is used to get time in MS per system ticket.
*
* @return time in MS
*/

Func tuya_hal_system_sleep

VOID_T tuya_hal_system_sleep(const unsigned long msTime);
/**
* @brief System sleep
*
* @param[in] msTime: time in MS
*
* @note This API is used for system sleep.
*
* @return VOID
*/

Func tuya_hal_system_reset

VOID_T tuya_hal_system_reset(VOID_T);
/**
* @brief System reset
*
* @param VOID
*
* @note This API is used for system reset.
*
* @return VOID
*/

Func tuya_hal_watchdog_init_start

unsigned int tuya_hal_watchdog_init_start(const unsigned int timeval);
/**
* @brief Watch dog init and start
*
* @param[in] timeval: interval time for watch dog detection
*
* @note This API is used to init and start watch dog.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_watchdog_refresh

VOID_T tuya_hal_watchdog_refresh(VOID_T);
/**
* @brief Watch dog refresh
*
* @param VOID
*
* @note This API is used to refresh watch dog.
*
* @return VOID
*/

Func tuya_hal_watchdog_stop

VOID_T tuya_hal_watchdog_stop(VOID_T);
/**
* @brief Watch dog stop
*
* @param VOID
*
* @note This API is used to stop watch dog.
*
* @return VOID
*/

Func tuya_hal_system_getheapsize

INT_T tuya_hal_system_getheapsize(VOID_T);
/**
* @brief Get free heap size
*
* @param VOID
*
* @note This API is used for getting free heap size.
*
* @return size of free heap
*/

Func tuya_hal_system_get_rst_ext_info

OPERATE_RET tuya_hal_system_get_rst_ext_info(CHAR_T** ext_info);
/**
* @brief Get system extend reset reason
*
* @param[out] ext_info: extend reset reason information
*
* @note This API is used for getting system extend reset reason.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_get_random_data

int tuya_hal_get_random_data(const unsigned int range);
/**
* @brief Get a random number in the specified range
*
* @param[in] range: range
*
* @note This API is used for getting a random number in the specified range
*
* @return a random number in the specified range
*/

Func tuya_hal_set_cpu_lp_mode

int tuya_hal_set_cpu_lp_mode(const BOOL_T en, const TY_CPU_SLEEP_MODE_E mode);
/**
* @brief Set the low power mode of CPU
*
* @param[in] en: enable switch
* @param[in] en: cpu sleep mode
*
* @note This API is used for setting the low power mode of CPU.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_system_intf_init

VOID_T tuya_os_system_intf_init(VOID_T);
/**
 * @brief System interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of system interface.
 *
 * @return VOID
 */

Func tuya_hal_thread_create

int tuya_hal_thread_create(THREAD_HANDLE* thread,
                                   const char* name,
                                   uint32_t stack_size,
                                   uint32_t priority,
                                   THREAD_FUNC_T func,
                                   void* const arg);
/**
* @brief Create thread
*
* @param[out] thread: thread handle
* @param[in] name: thread name
* @param[in] stack_size: stack size of thread
* @param[in] priority: priority of thread
* @param[in] func: the main thread process function
* @param[in] arg: the args of the func, can be null
*
* @note This API is used for creating thread.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_thread_release

int tuya_hal_thread_release(THREAD_HANDLE thread);
/**
* @brief Terminal thread and release thread resources
*
* @param[in] thread: thread handle
*
* @note This API is used to terminal thread and release thread resources.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_thread_is_self

int tuya_hal_thread_is_self(THREAD_HANDLE thread, BOOL_T* is_self);
/**
* @brief Check thread is self thread
*
* @param[in] thread: thread handle
* @param[out] is_self: is self thread or not
*
* @note This API is used to check thread is self thread.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_thread_get_watermark

int tuya_hal_thread_get_watermark(THREAD_HANDLE thread, UINT_T* watermark);
/**
* @brief Get the thread stack's watermark
*
* @param[in] thread: thread handle
* @param[out] watermark: watermark in Bytes
*
* @note This API is used to get the thread stack's watermark.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_thread_set_self_name

int tuya_hal_thread_set_self_name(const char* name);
/**
* @brief Set name of self thread
*
* @param[in] name: thread name
*
* @note This API is used to set name of self thread.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_thread_intf_init

VOID_T tuya_os_thread_intf_init(VOID_T);
/**
 * @brief thread interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of thread interface.
 *
 * @return VOID
 */

Func tuya_hal_wifi_all_ap_scan

OPERATE_RET tuya_hal_wifi_all_ap_scan(AP_IF_S **ap_ary, UINT_T *num);
/**
 * @brief scan current environment and obtain all the ap
 *        infos in current environment
 * 
 * @param[out]      ap_ary      current ap info array
 * @param[out]      num         the num of ar_ary
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_assign_ap_scan

OPERATE_RET tuya_hal_wifi_assign_ap_scan(CONST SCHAR_T *ssid, AP_IF_S **ap);
/**
 * @brief scan current environment and obtain the specific
 *        ap info.
 * 
 * @param[in]       ssid        the specific ssid
 * @param[out]      ap          the ap info
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_release_ap

OPERATE_RET tuya_hal_wifi_release_ap(AP_IF_S *ap);
/**
 * @brief release the memory malloced in 
 *        and  if needed. tuya-sdk
 *        will call this function when the ap info is no use.
 * 
 * @param[in]       ap          the ap info
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_set_cur_channel

OPERATE_RET tuya_hal_wifi_set_cur_channel(CONST UCHAR_T chan);
/**
 * @brief set wifi interface work channel
 * 
 * @param[in]       chan        the channel to set
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_get_cur_channel

OPERATE_RET tuya_hal_wifi_get_cur_channel(UCHAR_T *chan);
/**
 * @brief get wifi interface work channel
 * 
 * @param[out]      chan        the channel wifi works
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_sniffer_set

OPERATE_RET tuya_hal_wifi_sniffer_set(CONST BOOL_T en, CONST SNIFFER_CALLBACK cb);
/**
 * @brief enable / disable wifi sniffer mode.
 *        if wifi sniffer mode is enabled, wifi recv from
 *        packages from the air, and user shoud send these
 *        packages to tuya-sdk with callback .
 * 
 * @param[in]       en          enable or disable
 * @param[in]       cb          notify callback
 * @return  OPRT_OK: success  Other: fail
 */

Func tuya_hal_wifi_get_ip

OPERATE_RET tuya_hal_wifi_get_ip(CONST WF_IF_E wf, NW_IP_S *ip);
/**
 * @brief get wifi ip info.when wifi works in
 *        ap+station mode, wifi has two ips.
 * 
 * @param[in]       wf          wifi function type
 * @param[out]      ip          the ip addr info
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_set_mac

OPERATE_RET tuya_hal_wifi_set_mac(CONST WF_IF_E wf, CONST NW_MAC_S *mac);
/**
 * @brief set wifi mac info.when wifi works in
 *        ap+station mode, wifi has two macs.
 * 
 * @param[in]       wf          wifi function type
 * @param[in]       mac         the mac info
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_get_mac

OPERATE_RET tuya_hal_wifi_get_mac(CONST WF_IF_E wf, NW_MAC_S *mac);
/**
 * @brief get wifi mac info.when wifi works in
 *        ap+station mode, wifi has two macs.
 * 
 * @param[in]       wf          wifi function type
 * @param[out]      mac         the mac info
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_set_work_mode

OPERATE_RET tuya_hal_wifi_set_work_mode(CONST WF_WK_MD_E mode);
/**
 * @brief set wifi work mode
 * 
 * @param[in]       mode        wifi work mode
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_get_work_mode

OPERATE_RET tuya_hal_wifi_get_work_mode(WF_WK_MD_E *mode);
/**
 * @brief get wifi work mode
 * 
 * @param[out]      mode        wifi work mode
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_ap_start

OPERATE_RET tuya_hal_wifi_ap_start(CONST WF_AP_CFG_IF_S *cfg);
/**
 * @brief start a soft ap
 * 
 * @param[in]       cfg         the soft ap config
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_ap_stop

OPERATE_RET tuya_hal_wifi_ap_stop(VOID_T);
/**
 * @brief stop a soft ap
 * 
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_get_connected_ap_info_v2

OPERATE_RET tuya_hal_wifi_get_connected_ap_info_v2(FAST_WF_CONNECTED_AP_INFO_V2_S **fast_ap_info);
/**
 * @brief : get ap info for fast connect
 * @param[out]      fast_ap_info
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_fast_station_connect_v2

OPERATE_RET tuya_hal_fast_station_connect_v2(CONST FAST_WF_CONNECTED_AP_INFO_V2_S *fast_ap_info);
/**
 * @brief : fast connect
 * @param[in]      fast_ap_info
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_station_connect

OPERATE_RET tuya_hal_wifi_station_connect(CONST SCHAR_T *ssid, CONST SCHAR_T *passwd);
/**
 * @brief connect wifi with ssid and passwd
 * 
 * @param[in]       ssid
 * @param[in]       passwd
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_station_disconnect

OPERATE_RET tuya_hal_wifi_station_disconnect(VOID_T);
/**
 * @brief disconnect wifi from connect ap
 * 
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_station_get_conn_ap_rssi

OPERATE_RET tuya_hal_wifi_station_get_conn_ap_rssi(SCHAR_T *rssi);
/**
 * @brief get wifi connect rssi
 * 
 * @param[out]      rssi        the return rssi
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_get_bssid

OPERATE_RET tuya_hal_wifi_get_bssid(UCHAR_T *mac);
/**
 * @brief get wifi bssid
 * 
 * @param[out]      mac         uplink mac
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_station_get_status

OPERATE_RET tuya_hal_wifi_station_get_status(WF_STATION_STAT_E *stat);
/**
 * @brief get wifi station work status
 * 
 * @param[out]      stat        the wifi station work status
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_set_country_code

OPERATE_RET tuya_hal_wifi_set_country_code(CONST COUNTRY_CODE_E ccode);
/**
 * @brief set wifi country code
 * 
 * @param[in]       ccode  country code
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_send_mgnt

OPERATE_RET tuya_hal_wifi_send_mgnt(CONST UCHAR_T *buf, CONST UINT_T len);
/**
 * @brief send wifi management
 * 
 * @param[in]       buf         pointer to buffer
 * @param[in]       len         length of buffer
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_wifi_register_recv_mgnt_callback

OPERATE_RET tuya_hal_wifi_register_recv_mgnt_callback(CONST bool enable, CONST WIFI_REV_MGNT_CB recv_cb);
/**
 * @brief register receive wifi management callback
 * 
 * @param[in]       enable
 * @param[in]       recv_cb     receive callback
 * @return  OPRT_OS_ADAPTER_OK: success  Other: fail
 */

Func tuya_hal_set_wifi_lp_mode

OPERATE_RET tuya_hal_set_wifi_lp_mode(CONST BOOL_T en, CONST UINT_T dtim);
/***********************************************************
*  Function: tuya_hal_set_wifi_lp_mode
*  Input: en dtim
*  Output: none
*  Return: 0-succ,other-fail
***********************************************************/

Func tuya_hal_wifi_rf_calibrated

BOOL_T tuya_hal_wifi_rf_calibrated(VOID_T);
/***********************************************************
*  Function: tuya_hal_wifi_rf_calibrated
*  Input: none
*  Output: none
*  Return:BOOL
***********************************************************/

Func tuya_hal_wifi_send_beacon

OPERATE_RET tuya_hal_wifi_send_beacon(uint8_t channel, uint8_t *ssid, uint8_t ssid_len);


      

Func tuya_os_wifi_intf_init

VOID_T tuya_os_wifi_intf_init(VOID_T);
/**
 * @brief Wifi interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of wifi interface.
 *
 * @return VOID
 */

Func tuya_hal_wired_get_ip

OPERATE_RET tuya_hal_wired_get_ip(NW_IP_S *ip);
/**
* @brief Get wired ethernet ip info
*
* @param[in] ip: the ip addr info
*
* @note This API is used for getting wired ethernet ip info.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_wired_station_conn

BOOL_T tuya_hal_wired_station_conn(VOID);
/**
* @brief Check whether the hardware is connected to internet
*
* @param VOID
*
* @note This API is used to check whether the hardware is connected to internet.
*
* @return true on connected, false on disconnected.
*/

Func tuya_hal_wired_get_mac

OPERATE_RET tuya_hal_wired_get_mac(NW_MAC_S *mac);
/**
* @brief Get wired ethernet mac information
*
* @param[out] mac: the mac information
*
* @note This API is used for getting wired ethernet mac information
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_wired_set_mac

OPERATE_RET tuya_hal_wired_set_mac(const NW_MAC_S *mac);
/**
* @brief Set wired ethernet mac information
*
* @param[in] mac: the mac information
*
* @note This API is used for setting wired ethernet mac information
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_wired_wifi_set_station_connect

OPERATE_RET tuya_hal_wired_wifi_set_station_connect(const char *ssid, const char *passwd);
/**
* @brief If the hardware has a wifi interface, and user want to connect wifi, tuya-app will notify current wifi ssid and passwd,
* and tuya-sdk will nofity user with this function. user should implement wifi connect process in this function.
*
* @param[in] ssid: ssid of router
* @param[in] passwd: password of router
*
* @note This API is used for setting ssid and password of the router.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_wired_wifi_need_cfg

BOOL_T tuya_hal_wired_wifi_need_cfg(VOID);
/**
* @brief Check whether the hardware need to config
*
* @param VOID
*
* @note This API is used for checking whether the hardware need to config.
* if the hardware has a wifi interface, and user want to connect wifi, then return true.
* if the hardware does not have a wifi interface, or user do not want to connect wifi, return false.
*
* @return TRUE or FALSE
*/

Func tuya_hal_wired_wifi_station_get_conn_ap_rssi

OPERATE_RET tuya_hal_wired_wifi_station_get_conn_ap_rssi(int8_t *rssi);
/**
* @brief Get wifi rssi
*
* @param[out] rssi: wifi rssi
*
* @note This API is used for getting wifi rssi.
* if the hardware has a wifi interface and wifi is connected, return wifi rssi, or return null.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_wired_get_nw_stat

OPERATE_RET tuya_hal_wired_get_nw_stat(GW_BASE_NW_STAT_T *stat);
/**
* @brief Get network status
*
* @param[out] stat: the status of network
*
* @note This API is used for getting network status.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_hal_wired_if_connect_internet

OPERATE_RET tuya_hal_wired_if_connect_internet(BOOL_T *stat);
/**
* @brief Get wired connect status
*
* @param[out] stat: the status of network
*
* @note This API is used for getting wired connect status.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_wired_intf_init

VOID_T tuya_os_wired_intf_init(VOID_T);
/**
 * @brief Wired interface initialization
 *
 * @param VOID
 *
 * @note This API is used for initialization of wired interface.
 *
 * @return VOID
 */

Func tuya_os_adapt_reg_intf

OPERATE_RET tuya_os_adapt_reg_intf(INTF_TYPE_ENUM type, void* intf_ptr);
/**
* @brief register system interfaces in various types of platform
*
* @param[in] type: interface type
* @param[in] intf_ptr: interface pointer
*
* @note This API is used to register system interfaces in various types of platform.
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/

Func tuya_os_adapter_intf_impl_init

VOID_T tuya_os_adapter_intf_impl_init(VOID_T);
/**
* @brief Initialize system interface
*
* @param VOID
*
* @note This API is used to initialize system interface.
*
* @return VOID
*/

Func tuya_os_adapter_get_intf

VOID_T* tuya_os_adapter_get_intf(INTF_TYPE_ENUM type);
/**
* @brief Get the pointer of various types of system interfaces
*
* @param VOID
*
* @note This API is used to get the pointer of various types of system interfaces.
*
* @return the pointer of system interface
*/

Func tuya_os_adapter_get_platform_ver

CHAR_T* tuya_os_adapter_get_platform_ver(VOID_T);
/**
* @brief Get version of platform
*
* @param VOID
*
* @note This API is used to get the version of platform.
*
* @return the version of platform
*/

Func aes_pkcs7padding_buffer

UINT_T aes_pkcs7padding_buffer(BYTE_T *p_buffer, UINT_T length);
/**
 * @brief aes_pkcs7padding_buffer 
 *
 * @param[in] p_buffer
 * @param[in] length
 *
 * @return 
 */

Func aes_method_register

OPERATE_RET aes_method_register(IN CONST AES_METHOD_REG_S *aes, IN CONST TUYA_HW_AES_S* pafunc);
/**
 * @brief aes_method_register 
 *
 * @param[in] aes
 * @param[in] pafunc
 *
 * @return OPERATE_RET
 */

Func aes_method_unregister

VOID aes_method_unregister(VOID);
/**
 * @brief aes_method_unregister 
 *
 * @param VOID
 *
 * @return 
 */

Func aes192_cbc_encode

OPERATE_RET aes192_cbc_encode(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                           IN CONST BYTE_T *key,IN BYTE_T *iv,\
                           OUT BYTE_T **ec_data,OUT UINT_T *ec_len);
/**
 * @brief aes192_cbc_encode 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] ec_data
 * @param[out] ec_len
 *
 * @return OPERATE_RET
 */

Func aes192_cbc_decode

OPERATE_RET aes192_cbc_decode(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                           IN CONST BYTE_T *key,IN BYTE_T *iv,\
                           OUT BYTE_T **dec_data,OUT UINT_T *dec_len);
/**
 * @brief aes192_cbc_decode 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] dec_data
 * @param[out] dec_len
 *
 * @return OPERATE_RET
 */

Func aes128_ecb_encode

OPERATE_RET aes128_ecb_encode(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                             OUT BYTE_T **ec_data,OUT UINT_T *ec_len,\
                             IN CONST BYTE_T *key);
/**
 * @brief aes128_ecb_encode 
 *
 * @param[in] data
 * @param[in] len
 * @param[out] ec_data
 * @param[out] ec_len
 * @param[in] key
 *
 * @return OPERATE_RET
 */

Func aes128_ecb_decode

OPERATE_RET aes128_ecb_decode(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                             OUT BYTE_T **dec_data,OUT UINT_T *dec_len,\
                             IN CONST BYTE_T *key);
/**
 * @brief aes128_ecb_decode 
 *
 * @param[in] data
 * @param[in] len
 * @param[out] dec_data
 * @param[out] dec_len
 * @param[in] key
 *
 * @return OPERATE_RET
 */

Func aes128_cbc_encode

OPERATE_RET aes128_cbc_encode(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                             IN CONST BYTE_T *key,IN BYTE_T *iv,\
                             OUT BYTE_T **ec_data,OUT UINT_T *ec_len);
/**
 * @brief aes128_cbc_encode 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] ec_data
 * @param[out] ec_len
 *
 * @return OPERATE_RET
 */

Func aes128_cbc_decode

OPERATE_RET aes128_cbc_decode(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                             IN CONST BYTE_T *key,IN BYTE_T *iv,\
                             OUT BYTE_T **dec_data,OUT UINT_T *dec_len);
/**
 * @brief aes128_cbc_decode 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] dec_data
 * @param[out] dec_len
 *
 * @return OPERATE_RET
 */

Func aes_free_data

OPERATE_RET aes_free_data(IN BYTE_T *data);
/**
 * @brief aes_free_data 
 *
 * @param[in] data
 *
 * @return OPERATE_RET
 */

Func aes_get_actual_length

INT_T aes_get_actual_length(IN CONST BYTE_T *dec_data,IN CONST UINT_T dec_data_len);
/**
 * @brief aes_get_actual_length 
 *
 * @param[in] dec_data
 * @param[in] dec_data_len
 *
 * @return actural length of dec_data, negative on error
 */

Func aes192_cbc_encode_raw

OPERATE_RET aes192_cbc_encode_raw(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                                 IN CONST BYTE_T *key,IN BYTE_T *iv,\
                                 OUT BYTE_T *ec_data);
/**
 * @brief aes192_cbc_encode_raw 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] ec_data
 *
 * @return OPERATE_RET
 */

Func aes192_cbc_decode_raw

OPERATE_RET aes192_cbc_decode_raw(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                                 IN CONST BYTE_T *key,IN BYTE_T *iv,\
                                 OUT BYTE_T *dec_data);
/**
 * @brief aes192_cbc_decode_raw 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] dec_data
 *
 * @return OPERATE_RET
 */

Func aes256_cbc_encode_raw

OPERATE_RET aes256_cbc_encode_raw(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                                 IN CONST BYTE_T *key,IN BYTE_T *iv,\
                                 OUT BYTE_T *ec_data);
/**
 * @brief aes256_cbc_encode_raw 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] ec_data
 *
 * @return OPERATE_RET
 */

Func aes128_ecb_encode_raw

OPERATE_RET aes128_ecb_encode_raw(IN CONST BYTE_T *data, IN CONST UINT_T len,\
                                 OUT BYTE_T *ec_data,IN CONST BYTE_T *key);
/**
 * @brief aes128_ecb_encode_raw 
 *
 * @param[in] data
 * @param[in] len
 * @param[out] ec_data
 * @param[in] key
 *
 * @return OPERATE_RET
 */

Func aes128_ecb_decode_raw

OPERATE_RET aes128_ecb_decode_raw(IN CONST BYTE_T *data, IN CONST UINT_T len,\
                                 OUT BYTE_T *dec_data,IN CONST BYTE_T *key);
/**
 * @brief aes128_ecb_decode_raw 
 *
 * @param[in] data
 * @param[in] len
 * @param[out] dec_data
 * @param[in] key
 *
 * @return OPERATE_RET
 */

Func aes128_cbc_encode_raw

OPERATE_RET aes128_cbc_encode_raw(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                                 IN CONST BYTE_T *key,IN BYTE_T *iv,\
                                 OUT BYTE_T *ec_data);
/**
 * @brief aes128_cbc_encode_raw 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] ec_data
 *
 * @return OPERATE_RET
 */

Func aes128_cbc_decode_raw

OPERATE_RET aes128_cbc_decode_raw(IN CONST BYTE_T *data,IN CONST UINT_T len,\
                                 IN CONST BYTE_T *key,IN BYTE_T *iv,\
                                 OUT BYTE_T *dec_data);
/**
 * @brief aes128_cbc_decode_raw 
 *
 * @param[in] data
 * @param[in] len
 * @param[in] key
 * @param[in] iv
 * @param[out] dec_data
 *
 * @return OPERATE_RET
 */

Func aes_method_get_callback_func

void aes_method_get_callback_func(TUYA_HW_AES_S* paes);
/**
 * @brief aes_method_get_callback_func 
 *
 * @param paes
 */

Func tuya_hw_aes_crypt_init

int tuya_hw_aes_crypt_init(TUYA_HW_AES_HANDLE_S* paesHdl, char* pkey);
/**
 * @brief tuya_hw_aes_crypt_init 
 *
 * @param paesHdl
 * @param pkey
 *
 * @return int
 */

Func tuya_hw_aes_crypt_uninit

int tuya_hw_aes_crypt_uninit(TUYA_HW_AES_HANDLE_S* paesHdl);
/**
 * @brief tuya_hw_aes_crypt_uninit 
 *
 * @param paesHdl
 *
 * @return int
 */

Func tuya_hw_aes_update_key

int tuya_hw_aes_update_key(TUYA_HW_AES_HANDLE_S* paesHdl, char* pkey);
/**
 * @brief tuya_hw_aes_update_key 
 *
 * @param paesHdl
 * @param pkey
 *
 * @return int
 */

Func tuya_hw_aes_encrypt_cbc

int tuya_hw_aes_encrypt_cbc(TUYA_HW_AES_HANDLE_S* paesHdl, const unsigned char* iv, unsigned int ivbits,
                           const unsigned char *input, size_t length, unsigned char *output, size_t* poutlen);
/**
 * @brief tuya_hw_aes_encrypt_cbc 
 *
 * @param[in] paesHdl
 * @param[in] iv
 * @param[in] ivbits
 * @param[in] input
 * @param[in] length
 * @param[out] output
 * @param[out] poutlen
 *
 * @return int
 */

Func apr_sha1_init

void apr_sha1_init(apr_sha1_ctx_t *context);
/**
 * Initialize the SHA digest
 * @param context The SHA context to initialize
 */

Func apr_sha1_update

void apr_sha1_update(apr_sha1_ctx_t *context, const char *input,
                               unsigned int inputLen);
/**
 * Update the SHA digest
 * @param context The SHA1 context to update
 * @param input The buffer to add to the SHA digest
 * @param inputLen The length of the input buffer
 */

Func apr_sha1_update_binary

void apr_sha1_update_binary(apr_sha1_ctx_t *context,
                                      const unsigned char *input,
                                      unsigned int inputLen);
/**
 * Update the SHA digest with binary data
 * @param context The SHA1 context to update
 * @param input The buffer to add to the SHA digest
 * @param inputLen The length of the input buffer
 */

Func apr_sha1_final

void apr_sha1_final(unsigned char digest[APR_SHA1_DIGESTSIZE],
                              apr_sha1_ctx_t *context);
/**
 * Finish computing the SHA digest
 * @param digest the output buffer in which to store the digest
 * @param context The context to finalize
 */

Func HMAC_SHA1

void HMAC_SHA1(unsigned char hmac[20], const unsigned char *key, int key_len,
              const unsigned char *message, int message_len);
//calculate HMAC_SHA1

Func hash_crc32i_init

unsigned int hash_crc32i_init (void);


      

Func hash_crc32i_update

unsigned int hash_crc32i_update (unsigned int hash,const void *data,unsigned int size);


      

Func hash_crc32i_finish

unsigned int hash_crc32i_finish (unsigned int hash);


      

Func hash_crc32i_total

unsigned int hash_crc32i_total (const void* data,unsigned int size);
/*
=======================================
    CRC-32/IEEE 一次性完成
=======================================
*/

Func sha2_starts

void sha2_starts( sha2_context *ctx, int is224 );
/**
* @brief SHA-256 context setup
*
* @param ctx context to be initialized
* @param is224 0 = use SHA256, 1 = use SHA224
*/

Func sha2_update

void sha2_update( sha2_context *ctx, const unsigned char *input, size_t ilen );
/**
* @brief SHA-256 process buffer
*
* @param ctx SHA-256 context
* @param input buffer holding the data
* @param ilen length of the input data
*/

Func sha2_finish

void sha2_finish( sha2_context *ctx, unsigned char output[32] );
/**
* @brief SHA-256 final digest
*
* @param ctx SHA-256 context
* @param output SHA-224/256 checksum result
*/

Func sha2

void sha2( const unsigned char *input, size_t ilen,
          unsigned char output[32], int is224 );
/**
* @brief Output = SHA-256( input buffer )
*
* @param input buffer holding the data
* @param ilen length of the input data
* @param output SHA-224/256 checksum result
* @param is224 0 = use SHA256, 1 = use SHA224
*/

Func sha2_file

int sha2_file( const char *path, unsigned char output[32], int is224 );
/**
* @brief Output = SHA-256( file contents )
*
* @param path input file name
* @param output SHA-224/256 checksum result
* @param is224 0 = use SHA256, 1 = use SHA224
*
* @return 0 if successful, or POLARSSL_ERR_SHA2_FILE_IO_ERROR
*/

Func sha2_hmac_starts

void sha2_hmac_starts( sha2_context *ctx, const unsigned char *key, size_t keylen,
                      int is224 );
/**
* @brief SHA-256 HMAC context setup
*
* @param ctx HMAC context to be initialized
* @param key HMAC secret key
* @param keylen length of the HMAC key
* @param is224 0 = use SHA256, 1 = use SHA224
*/

Func sha2_hmac_update

void sha2_hmac_update( sha2_context *ctx, const unsigned char *input, size_t ilen );
/**
* @brief SHA-256 HMAC process buffer
*
* @param ctx HMAC context
* @param input buffer holding the data
* @param ilen length of the input data
*/

Func sha2_hmac_finish

void sha2_hmac_finish( sha2_context *ctx, unsigned char output[32] );
/**
* @brief SHA-256 HMAC final digest
*
* @param ctx HMAC context
* @param output SHA-224/256 HMAC checksum result
*/

Func sha2_hmac_reset

void sha2_hmac_reset( sha2_context *ctx );
/**
* @brief SHA-256 HMAC context reset
*
* @param ctx HMAC context to be reset
*/

Func sha2_hmac

void sha2_hmac( const unsigned char *key, size_t keylen,
               const unsigned char *input, size_t ilen,
               unsigned char output[32], int is224 );
/**
* @brief Output = HMAC-SHA-256( hmac key, input buffer )
*
* @param key HMAC secret key
* @param keylen length of the HMAC key
* @param input buffer holding the data
* @param ilen length of the input data
* @param output HMAC-SHA-224/256 result
* @param is224 0 = use SHA256, 1 = use SHA224
*/

Func sha2_self_test

int sha2_self_test( int verbose );
/**
* @brief Checkup routine
*
* @return 0 if successful, or 1 if the test failed
*/

Func tuya_base64_decode

int tuya_base64_decode( const char * base64, unsigned char * bindata );
/**
 * @brief tuya_base64_decode 
 *
 * @param[out] base64
 * @param[in] bindata
 *
 * @return 
 */

Func uni_md5_init

void uni_md5_init(UNI_MD5_CTX_S *context);
/**
 * @brief uni_md5_init 
 *
 * @param context
 */

Func uni_md5_update

void uni_md5_update(UNI_MD5_CTX_S *context,const unsigned char *input,const unsigned int inputlen);
/**
 * @brief uni_md5_update 
 *
 * @param context
 * @param[in] input
 * @param[in] inputlen
 */

Func uni_md5_final

void uni_md5_final(UNI_MD5_CTX_S *context,unsigned char digest[16]);
/**
 * @brief uni_md5_final 
 *
 * @param context
 * @param digest[16]
 */

Func create_notify_handle

OPERATE_RET create_notify_handle(OUT NOTIFY_HANDLE *p_handle);
/**
 * @brief Create notify handle.
 *
 * @param[out] p_handle: the notify handle
 *
 * @note This API is used for creating the notify handle
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func delete_notify_handle

OPERATE_RET delete_notify_handle(IN NOTIFY_HANDLE *p_handle);
/**
 * @brief Delete notify handle.
 *
 * @param[in] p_handle: the notify handle
 *
 * @note This API is used for deleting the notify handle
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func register_notify_handle

OPERATE_RET register_notify_handle(IN NOTIFY_HANDLE handle, \
                                           IN CONST P_NOTIFY_FUNC func, \
                                           IN CONST NOTIFY_PARAM param, \
                                           IN CONST NOTIFY_TIME_MS time_ms);
/**
 * @brief Register notify handle information.
 *
 * @param[in] handle: the notify handle
 * @param[in] func: the notify callback function
 * @param[in] param: the notify call back param
 * @param[in] time_ms: after time in MS, the notification will be trigged 
 *
 * @note This API is used for creating the notify handle
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func notify_handle_finish

OPERATE_RET notify_handle_finish(IN NOTIFY_HANDLE handle);
/**
 * @brief Finish notify handle.
 *
 * @param[in] handle: the notify handle
 *
 * @note This API is used for telling the caller the notification is finished.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func notify_handle_error

OPERATE_RET notify_handle_error(IN NOTIFY_HANDLE handle);
/**
 * @brief Finish notify handle.
 *
 * @param[in] handle: the notify handle
 *
 * @note This API is used for telling the caller the notification is error.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func system_timer_init

OPERATE_RET system_timer_init(void);
/**
 * @brief Initializing the system timer
 *
 * @param VOID
 *
 * @note This API is used for initializing the system timer
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sys_add_timer

OPERATE_RET sys_add_timer(IN CONST P_TIMER_FUNC pTimerFunc,\
                              IN CONST PVOID_T pTimerArg,\
                              OUT TIMER_ID *p_timerID);
/**
 * @brief Add a system timer
 *
 * @param[in] pTimerFunc: the processing function of the timer
 * @param[in] pTimerArg: the parameater of the timer function
 * @param[out] p_timerID: timer id
 *
 * @note This API is used for adding a system timer
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sys_delete_timer

OPERATE_RET sys_delete_timer(IN CONST TIMER_ID timerID);
/**
 * @brief Delete the system timer
 *
 * @param[in] timerID: timer id
 *
 * @note This API is used for deleting the system timer
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sys_stop_timer

OPERATE_RET sys_stop_timer(IN CONST TIMER_ID timerID);
/**
 * @brief Stop the system timer
 *
 * @param[in] timerID: timer id
 *
 * @note This API is used for stopping the system timer
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func IsThisSysTimerRun

BOOL_T IsThisSysTimerRun(IN CONST TIMER_ID timer_id);
/**
 * @brief Identify the system timer is running
 *
 * @param[in] timerID: timer id
 *
 * @note This API is used to identify wheather the system timer is running
 *
 * @return TRUE or FALSE
 */

Func sys_start_timer

OPERATE_RET sys_start_timer(IN CONST TIMER_ID timerID,\
                                 IN CONST TIME_MS timeCycle,\
                                 IN CONST TIMER_TYPE timer_type);
/**
 * @brief Start the system timer
 *
 * @param[in] timerID: timer id
 * @param[in] timeCycle: timer running cycle
 * @param[in] timer_type: timer type
 *
 * @note This API is used for starting the system timer
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func sys_trigger_timer

OPERATE_RET sys_trigger_timer(IN CONST TIMER_ID timerID);
/**
 * @brief Trigger the system timer
 *
 * @param[in] timerID: timer id
 *
 * @note This API is used for triggering the system timer instantly.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func system_timer_release

OPERATE_RET system_timer_release(void);
/**
 * @brief Release all resource of the system timer
 *
 * @param VOID
 *
 * @note This API is used for releasing all resource of the system timer
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func system_timer_set_sleep_interval

VOID system_timer_set_sleep_interval(ULONG_T interval);
/**
 * @brief Set sleep interval of the system timer
 *
 * @param[in] interval: sleep interval(MS) of the system timer
 *
 * @note This API is used for setting the sleep interval(MS) of the system timer
 *
 * @return VOID
 */

Func system_timer_get_sleep_interval

ULONG_T system_timer_get_sleep_interval(VOID);
/**
 * @brief Get sleep interval of the system timer
 *
 * @param VOID
 *
 * @note This API is used for getting the sleep interval(MS) of the system timer
 *
 * @return the sleep interval of the system timer
 */

Func sys_get_timer_num

INT_T sys_get_timer_num(VOID);
/**
 * @brief Get timer node currently
 *
 * @param VOID
 *
 * @note This API is used for getting the timer node currently.
 *
 * @return the timer node count.
 */

Func CreateTimerQueAndInit

OPERATE_RET CreateTimerQueAndInit(OUT TIMER_QUE_HANDLE *pTimerQueHandle);
/**
 * @brief Create and init the system timer queue
 *
 * @param[in] pTimerQueHandle: the handle of the timer queue
 *
 * @note This API is used for initializing the system timer
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func AddTimerToQueue

OPERATE_RET AddTimerToQueue(IN CONST TIMER_QUE_HANDLE timerQueHandle,\
                                 IN CONST TIME_MS timeCycle,\
                                 IN CONST P_TIMER_FUNC pTimerFunc,\
                                 OUT TIMER_ID *timerID,\
                                 IN CONST PVOID_T pTimerArg);
/**
 * @brief Add timer to queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 * @param[in] timeCycle: cycle of the timer
 * @param[in] pTimerFunc: processing function of the timer
 * @param[out] timerID: timer id
 * @param[in] pTimerArg: the parameter of the timer's processing function
 *
 * @note This API is used for adding a timer to the queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func DeleteTimerFromQueue

OPERATE_RET DeleteTimerFromQueue(IN CONST TIMER_QUE_HANDLE timerQueHandle, IN CONST TIMER_ID timerID);
/**
 * @brief Delete timer from queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 * @param[in] timerID: timer id
 *
 * @note This API is used for deleting a timer from the queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func StartTimerFromQueue

OPERATE_RET StartTimerFromQueue(IN CONST TIMER_QUE_HANDLE timerQueHandle,\
                                       IN CONST TIMER_ID timerID,\
                                       IN CONST TIME_MS timeCycle,\
                                       IN CONST TIMER_TYPE timer_type);
/**
 * @brief Start the timer in the queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 * @param[in] timerID: timer id
 * @param[in] timeCycle: cycle of the timer
 * @param[in] timer_type: type of the timer
 *
 * @note This API is used for starting the timer in the queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func TriggerTimerFromQueue

OPERATE_RET TriggerTimerFromQueue(IN CONST TIMER_QUE_HANDLE timerQueHandle, IN CONST TIMER_ID timerID);
/**
 * @brief Trigger the timer in the queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 * @param[in] timerID: timer id
 *
 * @note This API is used for triggering the timer in the queue instantly.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func StopTimerFromQueue

OPERATE_RET StopTimerFromQueue(IN CONST TIMER_QUE_HANDLE timerQueHandle, IN CONST TIMER_ID timerID);
/**
 * @brief Stop the timer in the queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 * @param[in] timerID: timer id
 *
 * @note This API is used for stopping the timer in the queue.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func DispatchTimerFromQuene

OPERATE_RET DispatchTimerFromQuene(IN CONST TIMER_QUE_HANDLE timerQueHandle);
/**
 * @brief Dispatch all timers in the queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 *
 * @note This API is used for dispatching all timers in the queue.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func GetTimerNodeNum

OPERATE_RET GetTimerNodeNum(IN CONST TIMER_QUE_HANDLE timerQueHandle, OUT PINT_T pTimerNodeNum);
/**
 * @brief Get the timer node count of the queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 * @param[out] pTimerNodeNum: the timer node count of the queue
 *
 * @note This API is used for getting the timer node count of the queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ReleaseTimerQue

OPERATE_RET ReleaseTimerQue(IN CONST TIMER_QUE_HANDLE timerQueHandle);
/**
 * @brief Release the timer queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 *
 * @note This API is used for releasing all resouce of the timer queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func GetIdleTimerIdRapid

TIMER_ID GetIdleTimerIdRapid(IN CONST TIMER_QUE_HANDLE timerQueHandle);
/**
 * @brief Get an idle timer of the queue
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 *
 * @note This API is used for getting an idle timer of the queue
 *
 * @return the timer id
 */

Func IsThisTimerRun

BOOL_T IsThisTimerRun(IN CONST TIMER_QUE_HANDLE timerQueHandle, IN CONST TIMER_ID timer_id);
/**
 * @brief Identify the timer is running
 *
 * @param[in] timerQueHandle: the handle of the timer queue
 * @param[in] timerID: timer id
 *
 * @note This API is used to identify wheather the timer is running
 *
 * @return TRUE or FALSE
 */

Func uf_db_init

OPERATE_RET uf_db_init(VOID);
/**
 * @brief tuya unique file database system initialization
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h 
 */

Func uf_db_user_param_write

OPERATE_RET uf_db_user_param_write(IN CONST BYTE_T *data, IN CONST UINT_T len);
/**
 * @brief write user parameter to unique file database
 * 
 * @param[in] data data write to user parameter database
 * @param[in] len data length write to user parameter database
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h  
 * 
 * @note the user parameter database is a file named "user_param_key", and max size is 4096 byte
 */

Func uf_db_user_param_read

OPERATE_RET uf_db_user_param_read(OUT BYTE_T **buf, OUT UINT_T *len);
/**
 * @brief read user parameter from unique file database
 * 
 * @param[out] buf buffer of the data read from user parameter file database
 * @param[out] len length of the data read from user parameter file database
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h  
 * 
 * @note the user parameter database is a file named "user_param_key", and max size is 4096 byte  
 */

Func ufinit

OPERATE_RET ufinit(VOID);
/**
 * @brief unique file system initialization
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h   
 * 
 * @note it will call by uf_db_init
 */

Func ufopen

uFILE* ufopen(IN CONST CHAR_T *filepath, IN CONST CHAR_T *mode);
/**
 * @brief open a unique file
 * 
 * @param[in] filepath the full file path
 * @param[in] mode the open mode
 * @return the handle of the file
 * 
 * @note the mode is same as file system open mode, contains "r","r+","a","a+","w","w+", 
 * and also support binary mode.
 */

Func ufclose

OPERATE_RET ufclose(IN uFILE *fd);
/**
 * @brief close a unique file
 * 
 * @param fd the file handle
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func ufdelete

OPERATE_RET ufdelete(IN CONST CHAR_T *filepath);
/**
 * @brief delete the unique file
 * 
 * @param[in] filepath the full file path
 * @return  OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func ufwrite

UINT_T ufwrite(IN uFILE *fd, IN CONST UCHAR_T *buf, IN CONST UINT_T len);
/**
 * @brief write to unique file
 * 
 * @param[in] fd the file handle
 * @param[in] buf the buffer write to the unique file
 * @param[in] len the length write to the unique file, in byte
 * @return characters written to the unique file
 */

Func ufread

UINT_T ufread(IN uFILE *fd, IN UCHAR_T *buf, IN CONST UINT_T len);
/**
 * @brief read from unique file
 * 
 * @param[in] fd the file handle
 * @param[in] buf the buffer used to save the data read from the unique file
 * @param[in] len the length want to read
 * @return the number of byte actually read from the unique file
 * 
 */

Func ufseek

INT_T ufseek(IN uFILE *fd, IN UINT_T offset, IN CONST ufmode_t uf_mode);
/**
 * @brief seek to the offset of the unique file
 * 
 * @param[in] fd the file handle
 * @param[in] offset the offset want to seek
 * @param[in] uf_mode the seek mode
 * @return the current offset after seek 
 */

Func uftell

INT_T uftell(IN uFILE *fd);
/**
 * @brief get current offset of the unique file
 * 
 * @param fd the file handle 
 * @return the current offset of the file
 */

Func ufeof

BOOL_T ufeof(IN uFILE *fd);
/**
 * @brief check if the current offset reach the end of the file
 * 
 * @param[in] fd the file handle
 * @return TRUE on reach the EOF, FLASE on not reach the EOF.
 */

Func ufgetsize

INT_T ufgetsize(IN CONST CHAR_T *filepath);
/**
 * @brief get the size of the unique file
 * 
 * @param[in] filepath the full file path
 * @return the size of the file 
 */

Func ufprintf

INT_T ufprintf(IN uFILE * stream, IN const char* pFmt, ...);
/**
 * @brief write a specail format to unique file
 * 
 * @param[in] stream the file handle
 * @param[in] pFmt the variable parameters format
 * @param ... 
 * @return the counts of written characters
 */

Func ufscanf

INT_T ufscanf(IN uFILE * stream, IN INT_T count, IN PCHAR_T pFmt,...);
/**
 * @brief read a special format from unique file
 * 
 * @param[in] stream the file handle
 * @param[in] count the counts read from file
 * @param[in] pFmt the variable parameters format
 * @param ... 
 * @return the items in the paramter list 
 */

Func ufexist

BOOL_T ufexist(IN CONST CHAR_T *filepath);
/**
 * @brief check if unique file is exist
 * 
 * @param[in] filepath the full file path
 * @return TRUE on existed, FLASE on not existed.
 */

Func ufaccess

INT_T ufaccess(IN CONST CHAR_T *filepath, IN INT_T mode);
/**
 * @brief test the permission of the unique file
 * 
 * @param[in] filepath the full file path
 * @param[in] mode check the access mode
 * @return INT_T 
 * 
 * @note the access mode contains "R_OK": read permission,"W_OK": write permission,"X_OK":excute permission,"F_OK": existed,
 * in flash unique file system, only support "F_OK" mode. 
 */

Func ufflush

INT_T ufflush(IN uFILE * stream);
/**
 * @brief flush the unique file, write the cache to physical disk
 * 
 * @param[in] stream the file handle
 * @return 0 on success, others on failed
 * 
 * @note in flash unique file system, always return success because the data was write to flash directly. 
 */

Func ufsync

INT_T ufsync(IN INT_T fd);
/**
 * @brief sync the unique file, write the file info to pysical disk
 * 
 * @param[in] fd the file handle
 * @return 0 on success, others on failed 
 * 
 * @note in flash unique file system, always return success because the data was write to flash directly. 
 */

Func ufileno

INT_T ufileno(IN uFILE * stream);
/**
 * @brief get the file description
 * 
 * @param[in] stream the file handle
 * @return the file description 
 * 
 * @note in flash unique file system, always return 0, it not support file description
 */

Func ufgetc

INT_T ufgetc(IN uFILE *stream);
/**
 * @brief read a character from unique file
 * 
 * @param[in] stream the file handle
 * @return -1 on failed, others means success 
 */

Func ufgets

CHAR_T *ufgets(IN CHAR_T *s,IN INT_T n, IN uFILE *stream);
/**
 * @brief read a line from unique file
 * 
 * @param[in] s the buffer used to save the string
 * @param[in] n the numbers want to get from the file
 * @param[in] stream the file handle
 * @return NULL on failed, others on success 
 * 
 * @note stop and return if reach the n or find "\n" character
 */

Func ufformat

OPERATE_RET ufformat(VOID);
/**
 * @brief format uf flash
 *
 * @return  OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func hashmap_new

map_t hashmap_new(unsigned int table_size);
/**
 * @brief create a new empty hashmap
 * 
 * @param[in] table_size the hash table size
 * @return a new empty hashmap 
 */

Func hashmap_put

int hashmap_put(map_t in, const char* key ,const any_t data);
/**
 * @brief Add an element to the hashmap
 * 
 * @param[in] in the hashmap
 * @param[in] key the key of hash element
 * @param[in] data the data of hash element
 * @return MAP_OK on success, others on failed, please refer to the define of hashmap error code 
 * 
 * @note For same key, it does not replace it. it is inserted in the head of the list
 */

Func hashmap_get

int hashmap_get(map_t in, const char* key, any_t *arg);
/**
 * @brief get an element from the hashmap
 * 
 * @param[in] in the hashmap
 * @param[in] key the key of the element
 * @param[out] arg the first value that the key matches
 * @return MAP_OK on success, others on failed, please refer to the define of hashmap error code  
 */

Func hashmap_data_traversal

int hashmap_data_traversal(map_t in, const char* key, any_t_iter *arg_iterator);
/**
 * @brief traverse all data with same key
 * 
 * @param[in] in the hashmap
 * @param[in] key the key of element
 * @param[inout] arg_iterator the traverse iterator
 * @return MAP_OK on success, others on failed, please refer to the define of hashmap error code  
 * 
 * @note if arg_iterator is NULL, fetch the first element, otherwise, fetch the next element
 */

Func hashmap_remove

int hashmap_remove(map_t in, char* key, any_t data);
/**
 * @brief remove an element from the hashmap
 * 
 * @param[in] in the hashmap
 * @param[in] key the key of element
 * @param[in] data the data of the element
 * @return MAP_OK on success, others on failed, please refer to the define of hashmap error code  
 * 
 * @note if data is NULL,then delete the first note match key.if data is not null, then delete the node match key and data.
 */

Func hashmap_free

void hashmap_free(map_t in);
/**
 * @brief free the hashmap
 * 
 * @param[in] in the hashmap need to free
 * 
 * @warning must remove all element first, otherwise, it will cause element leak
 */

Func hashmap_length

int hashmap_length(map_t in);
/**
 * @brief get current size of the hashmap
 * 
 * @param[in] in the hashmap
 * @return the current size
 */

Func SysMemoryPoolSetup

OPERATE_RET SysMemoryPoolSetup(VOID);
/**
 * @brief setup the memory pool use default memory pool table and partition number
 * 
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h    
 */

Func SysMemPoolSetupUserDef

OPERATE_RET SysMemPoolSetupUserDef(IN CONST MEM_POOL_SETUP_TBL *tbl, IN CONST INT_T cnt);
/**
 * @brief setup the memory pool use user defined memory pool table and partition number
 * 
 * @param[in] tbl the memory pool table
 * @param[in] cnt the partition number
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h     
 */

Func SysMemoryPoolDelete

VOID SysMemoryPoolDelete(VOID);
/**
 * @brief delete memory pool
 * 
 * @return VOID 
 */

Func MemPartitionCreate

OPERATE_RET MemPartitionCreate(IN CONST DWORD_T nblks, IN CONST DWORD_T blksize, OUT MEM_PARTITION **ppMemPartition);
/**
 * @brief create memory partotion
 * 
 * @param[in] nblks the number of memory block in partition
 * @param[in] blksize the size of memory block in partition
 * @param[out] ppMemPartition the memory partition
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h     
 */

Func MemPartitionDelete

OPERATE_RET MemPartitionDelete(IN MEM_PARTITION *pMemPart);
/**
 * @brief delete memory partition
 * 
 * @param[in] pMemPart the memory partition need to delete
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h  
 */

Func MemBlockGet

VOID *MemBlockGet(INOUT MEM_PARTITION *pMemPart, OUT OPERATE_RET *pOprtRet);
/**
 * @brief get a memory block from a partition
 * 
 * @param[in] pMemPart the input memory partition
 * @param[out] pOprtRet the operation return value, OPRT_OK on success, others on failed, please refer to tuya_error_code.h
 * @return the memory block address 
 */

Func MemBlockPut

OPERATE_RET MemBlockPut(INOUT MEM_PARTITION *pMemPart, IN CONST VOID *pblk);
/**
 * @brief release memory block to partition
 * 
 * @param[in] pMemPart the memory partition
 * @param[in] pblk the memory block address need to release
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h 
 */

Func MallocFromSysMemPool

VOID *MallocFromSysMemPool(IN CONST DWORD_T reqSize,OPERATE_RET *pRet);
/**
 * @brief malloc memory from memory pool
 * 
 * @param[in] reqSize the size of memory required
 * @param[in] pRet the operation return value, OPRT_OK on success, others on failed, please refer to tuya_error_code.h
 * @return the address of the memory
 */

Func FreeFromSysMemPool

OPERATE_RET FreeFromSysMemPool(IN PVOID_T pReqMem);
/**
 * @brief free the memory to memory pool
 * 
 * @param[in] pReqMem the memory which got from MallocFromSysMemPool function
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h 
 */

Func ShowSysMemPoolInfo

VOID ShowSysMemPoolInfo(VOID);
/**
 * @brief display the memory pool detail info, only valid when SHOW_MEM_POOL_DEBUG=1
 * 
 * @return VOID 
 */

Func __Malloc

VOID *__Malloc(IN CONST DWORD_T reqSize,IN CONST CHAR_T *file,IN CONST INT_T line);
/**
 * @brief a debug function which can record the file and line infomation when call Malloc
 * 
 * @param[in] reqSize the required memory size
 * @param[in] file the file name where Malloc called
 * @param[in] line the line where Malloc called
 * @return the memory address got from system memory pool
 */

Func __Free

VOID __Free(IN PVOID_T pReqMem,IN CONST CHAR_T *file,IN CONST INT_T line);
/**
 * @brief a debug function which can record the file and line infomation when call Free
 * 
 * @param[in] pReqMem the memory address which need to free
 * @param[in] file the file name where Free called
 * @param[in] line the line where Free called
 * @return VOID 
 */

Func Malloc

VOID *Malloc(IN SIZE_T reqSize);
/**
 * @brief malloc memory
 * 
 * @param[in] reqSize the required memory size 
 * @return  NULL on failed, others on the address of the memory
 */

Func Calloc

VOID *Calloc(IN CONST DWORD_T reqCount, IN SIZE_T reqSize);
/**
 * @brief malloc consecutive memory, the size is reqCount*reqSize
 * 
 * @param[in] reqCount the required memory count
 * @param[in] reqSize the required memory szie
 * @return NULL on failed, others on the address of the memory
 */

Func Free

VOID Free(IN PVOID_T pReqMem);
/**
 * @brief free memory
 * 
 * @param[in] pReqMem the memory address which got from Malloc or Calloc function
 * @return VOID 
 */

Func tuya_strncasecmp

int tuya_strncasecmp(const char *s1, const char *s2, size_t n);
/**
 * @brief compare the first n characters of two string
 * 
 * @param[in] s1 the string 1
 * @param[in] s2 the string 2
 * @param[in] n the first n characters
 * 
 * @return 0 one equal, 1 on s1 longer than s2, -1 on s2 longer than s1
 */

Func ascs2hex

void ascs2hex(unsigned char *hex,unsigned char *ascs,int srclen);
/**
 * @brief convert the character array to hex array
 * 
 * @param[out] hex the out hex array
 * @param[in] ascs the input character array
 * @param[in] srclen the length of input character array
 */

Func hex2str

void hex2str(unsigned char *pbDest, unsigned char *pbSrc, int nLen);
/**
 * @brief convert the input hex array to string array
 * 
 * @param[out] pbDest the out string array
 * @param[in] pbSrc the input hex array
 * @param[in] nLen the length of input hex array
 * 
 * @note the size of  must >= nLen * 2, convert example 00-ff -> "00"-"FF"
 */

Func byte2str

void byte2str(unsigned char *pbDest, unsigned char *pbSrc, int nLen, bool_t upper);


      

Func str_revr_find_ch

int str_revr_find_ch(const char *str,const int revr_index,const char ch);
/**
 * @brief find  in , start find in index , find in reverse order.
 * 
 * @param[in] str the string for find
 * @param[in] revr_index the start index to find
 * @param[in] ch the character to find
 * @return -2 on not found, -1 on invalid parameter, >=0 on the position of the character to find 
 */

Func byte_sort

void byte_sort(unsigned char is_ascend, unsigned char *buf, int buf_cnt);
/**
 * @brief sort the char in the buf according ascii value
 * 
 * @param[in] is_ascend sort in sacend order
 * @param[in] buf the buffer need to sort
 * @param[in] buf_cnt the character counts in buffer
 */

Func is_valid_version

int is_valid_version(char *ver);
/**
 * @brief check the version input is valid
 * 
 * @param[in] ver the version string
 * @return 1 on valid, 0 on invalid 
 */

Func string2mac

int string2mac(const char *str, char mac[6]);
/**
 * @brief convert mac address string to mac address array
 * 
 * @param[in] str the input mac address string
 * @param[out] mac the mac address array
 * @return 0 on success, others on failed.
 * 
 * @warning now only support valid mac address string: xxxxxxxxxxxx / xx-xx-xx-xx-xx-xx
 */

Func versionString2int

int versionString2int(const char* versionString);
/**
 * @brief convert version string to integer
 * 
 * @param[in] versionString the input version string
 * @return a integer version
 * 
 * @note  can support version string format x.y.z or x.y, for example: "1.0.1" to 0x010001 and "40.00" t0 0x2800

 */

Func tuya_isalpha

int tuya_isalpha(int c);


      

Func tuya_tolower

int tuya_tolower(int c);


      

Func tuya_toupper

int tuya_toupper(int c);


      

Func tuya_base_utilities_init

OPERATE_RET tuya_base_utilities_init(VOID);
/**
 * @brief utilites initialization
 * 
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h  
 */

Func uni_mkdir

OPERATE_RET uni_mkdir(const char* path);
/**
 * @brief create directory, ignore if existed
 * 
 * @param[in]       path        path of the directory 
 * @return  OPRT_OK on success, others on failed, please refer to tuya_error_code.h  
 */

Func uni_mkdir_all

OPERATE_RET uni_mkdir_all(const char* path);
/**
 * @brief create multi-level directory
 * 
 * @param[in]       path        path of the directory 
 * @return  OPRT_OK on success, others on failed, please refer to tuya_error_code.h  
 */

Func uni_remove

OPERATE_RET uni_remove(const char* path);
/**
 * @brief remove file or directory, ignore if not existed
 * 
 * @param[in]       path        the path of the file or directory
 * @return  OPRT_OK on success, others on failed, please refer to tuya_error_code.h  
 */

Func uni_is_exist

BOOL_T uni_is_exist(const char* path);
/**
 * @brief check if the file or directory existed
 * 
 * @param[in]       path        the path of the file or directory
 * @return  TRUE on existed, others on not existed
 */

Func uni_is_readable

BOOL_T uni_is_readable(const char* path);
/**
 * @brief check if the file readable
 * 
 * @param[in]       path        the path of the file
 * @return  TRUE on readable, others on un-readable
 */

Func uni_is_writable

BOOL_T uni_is_writable(const char* path);
/**
 * @brief check if the file writeable
 * 
 * @param[in]       path        the path of the file
 * @return  TRUE on writable, others on un-writable
 */

Func uni_is_executable

BOOL_T uni_is_executable(const char* path);
/**
 * @brief check if the file excuteable
 * 
 * @param[in]       path        the path of the file
 * @return  TRUE on excutable, others on un-excutable
 */

Func unw_gethostbyname

OPERATE_RET unw_gethostbyname(CONST CHAR_T *domain, UNW_IP_ADDR_T *addr);
/**
 * @brief get the domain ip address info by the domain name
 * 
 * @param[in] domain the domain name 
 * @param[out] addr the ip address of the domain
 * @return OPRT_OK: success, others: fail, please refer to tuya_error_code.h  
 */

Func unw_connect_to_domain

OPERATE_RET unw_connect_to_domain(INT_T *sockfd, CHAR_T *hostname, UINT16_T port, UINT_T retry_cnt, UINT_T timeout);
/**
 * @brief connect to a domain with specific tcp port
 * 
 * @param[out] sockfd the socket fd
 * @param[in] hostname the domian name
 * @param[in] port the tcp port
 * @param[in] retry_cnt retry count if tcp connect failed
 * @param[in] timeout timeout in ms
 * @return OPRT_OK: success, others: fail, please refer to tuya_error_code.h  
 */

Func unw_init_dns_cache

OPERATE_RET unw_init_dns_cache(VOID);
/**
 * @brief init the dns module
 * 
 * @return OPRT_OK: success, others: fail, please refer to tuya_error_code.h  
 */

Func unw_clear_all_dns_cache

OPERATE_RET unw_clear_all_dns_cache(VOID);
/**
 * @brief clean all dynamic dns cache
 * 
 * @return OPRT_OK: success, others: fail, please refer to tuya_error_code.h  
 */

Func unw_clear_dns_cache

OPERATE_RET unw_clear_dns_cache(CONST CHAR_T *domain);
/**
 * @brief clear the specific domain dns cache
 * 
 * @param[in] domain the domian which need to clear
 * @return OPRT_OK: success, others: fail, please refer to tuya_error_code.h  
 */

Func unw_add_dns_cache

OPERATE_RET unw_add_dns_cache(CONST CHAR_T *domain, CONST UNW_IP_ADDR_T ip);
/**
 * @brief add dns information to dynamic dns cache
 * 
 * @param[in] domain the domian name
 * @param[in] ip the ip address of the domain name
 * @return OPRT_OK: success, others: fail, please refer to tuya_error_code.h  
 */

Func unm_set_dns_region

OPERATE_RET unm_set_dns_region(REGION_E region);
/**
 * @brief set the dns current region
 * 
 * @param[in] region the new current region
 * @return OPRT_OK: success, others: fail, please refer to tuya_error_code.h  
 */

Func unm_set_dns_cache_priority

OPERATE_RET unm_set_dns_cache_priority(TY_DNS_PRIO_T dns_prio);
/**
 * @brief set the dns priority
 * 
 * @param[in] dns_prio the new dns priority
 * @return OPRT_OK: success, others: fail, please refer to tuya_error_code.h  
 */

Func unm_get_dns_cache_priority

TY_DNS_PRIO_T unm_get_dns_cache_priority(VOID);
/**
 * @brief get the dns current priority
 * 
 * @return REGION_E the current priority
 */

Func unm_lower_dns_cache_priority

VOID unm_lower_dns_cache_priority(VOID);
/**
 * @brief decrease the dns current priority
 * 
 * @note if the priority is DNS_PRIO_SYSTEM, lower dns priority will return to DNS_PRIO_REGION
 */

Func tuya_list_empty

INT_T tuya_list_empty(IN CONST P_LIST_HEAD pHead);
/**
 * @brief check if the bidirection list is empty
 * 
 * @param[in] pHead the bidirection list
 * @return 0 means empty, others means empty
 */

Func tuya_list_add

VOID tuya_list_add(IN CONST P_LIST_HEAD pNew, IN CONST P_LIST_HEAD pHead);
/**
 * @brief add new list node into bidirection list
 * 
 * @param[in] pNew the new list node
 * @param[in] pHead the bidirection list
 * @return VOID 
 */

Func tuya_list_add_tail

VOID tuya_list_add_tail(IN CONST P_LIST_HEAD pNew, IN CONST P_LIST_HEAD pHead);
/**
 * @brief add new list node to the tail of the bidirection list
 * 
 * @param[in] pNew the new list node
 * @param[in] pHead the bidirection list
 * @return VOID 
 */

Func tuya_list_splice

VOID tuya_list_splice(IN CONST P_LIST_HEAD pList, IN CONST P_LIST_HEAD pHead);
/**
 * @brief splice two dibrection list
 * 
 * @param[in] pList the bidirection list need to splice
 * @param[in] pHead the bidirection list
 * @return VOID 
 */

Func tuya_list_del

VOID tuya_list_del(IN CONST P_LIST_HEAD pEntry);
/**
 * @brief remove a list node from bidirection list
 * 
 * @param[in] pEntry the list node need to remove
 * @return VOID 
 */

Func tuya_list_del_init

VOID tuya_list_del_init(IN CONST P_LIST_HEAD pEntry);
/**
 * @brief remove a list node from bidirection list and initialize it
 * 
 * @param[in] pEntry the list node need to remove and initialize
 * @return VOID 
 */

Func GetCurFreeQueNum

unsigned int GetCurFreeQueNum(P_QUEUE_CLASS pQueObj);
/**
 * @brief get the free queue unit number
 * 
 * @param[in] pQueObj the queue handle
 * @return the current free unit counts
 */

Func GetCurQueNum

unsigned int GetCurQueNum(P_QUEUE_CLASS pQueObj);
/**
 * @brief get the queue unit number 
 * 
 * @param[in] pQueObj the queue handle
 * @return the current unit counts 
 */

Func ReleaseQueueObj

void ReleaseQueueObj(P_QUEUE_CLASS pQueObj);
/**
 * @brief release the queue
 * 
 * @param[in] pQueObj the queue handle
 */

Func uni_random

uint32_t uni_random(void);
/**
 * @brief generate a random 32bit unsigned integer
 * 
 * @return the random 32bit unsigned integer
 */

Func uni_random_string

int uni_random_string(char* dst, int size);
/**
 * @brief generate a random string
 * 
 * @param[out] dst the output random string
 * @param[in] size the length of the random string
 * @return 0 on success, others on failed. 
 */

Func get_rfc_data

VOID get_rfc_data(INOUT RFC_DATA_S *rfc_data);
/**
 * @brief get the reference data, increase the reference
 * 
 * @param[inout] rfc_data the reference data
 * @return VOID 
 */

Func put_rfc_data

VOID put_rfc_data(INOUT RFC_DATA_S *rfc_data);
/**
 * @brief put the reference data, decrease the reference
 * 
 * @param[inout] rfc_data the reference data 
 * @return VOID 
 * 
 * @note the reference data will be released when reference is 0
 */

Func del_rfc_data

VOID del_rfc_data(INOUT RFC_DATA_S *rfc_data);
/**
 * @brief delete the reference data, ignore the reference
 * 
 * @param[inout] rfc_data the reference data 
 * @return VOID 
 */

Func CreateAndStart

OPERATE_RET CreateAndStart(OUT THRD_HANDLE *pThrdHandle,\
                          IN CONST P_CONSTRUCT_FUNC enter,\
                          IN CONST P_EXTRACT_FUNC exit,\
                          IN CONST P_THRD_FUNC pThrdFunc,\
                          IN CONST PVOID_T pThrdFuncArg,\
                          IN CONST THRD_PARAM_S *thrd_param);
/**
 * @brief create and start a tuya sdk thread
 * 
 * @param[in] enter: the function called before the thread process called.can be null
 * @param[in] exit: the function called after the thread process called.can be null
 * @param[in] pThrdFunc: the main thread process function
 * @param[in] pThrdFuncArg: the args of the pThrdFunc.can be null
 * @param[in] thrd_param: the param of creating a thread
 * @param[out] pThrdHandle: the tuya sdk thread context
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func DeleteThrdHandle

OPERATE_RET DeleteThrdHandle(IN CONST THRD_HANDLE thrdHandle);
/**
 * @brief stop and free a tuya sdk thread
 * 
 * @param[in] thrdHandle: the input thread context
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func ThreadRunSelfSpace

OPERATE_RET ThreadRunSelfSpace(IN CONST THRD_HANDLE thrdHandle,OUT BOOL_T *bl);
/**
 * @brief check the function caller is in the input thread context
 * 
 * @param[in] thrdHandle: the input thread context
 * @param[in] bl: run in self space
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func GetThrdSta

THRD_STA GetThrdSta(IN CONST THRD_HANDLE thrdHandle);
/**
 * @brief get the thread context running status
 * 
 * @param[in] thrdHandle: the input thread context
 * @return the thread status
 */

Func uni_time_init

OPERATE_RET uni_time_init(VOID);
/**
 * @brief time-management module initialization
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func uni_mktime

TIME_T uni_mktime(IN CONST POSIX_TM_S *tm);
/**
 * @brief change posix time to TIME_T, redefine the std C func mktime
 * 
 * @param[in] tm the time in posix time format
 * @return the time in TIME_T format 
 */

Func uni_http_date_to_time

TIME_T uni_http_date_to_time(IN CONST CHAR_T *date);
/**
 * @brief change http-GMT format time to TIME_T
 * 
 * @param[in] date http-GMT format time
 * @return the time in TIME_T format
 */

Func uni_time_check_time_sync

OPERATE_RET uni_time_check_time_sync(VOID);
/**
 * @brief check IoTOS time synchronize status
 * 
 * @return OPRT_OK on synchronized. Others on not
 */

Func uni_time_check_time_zone_sync

OPERATE_RET uni_time_check_time_zone_sync(VOID);
/**
 * @brief check IoTOS time zone synchronized status
 * 
 * @return OPRT_OK on synchronized. Others on not 
 */

Func uni_time_set

OPERATE_RET uni_time_set(IN CONST POSIX_TM_S *tm);
/**
 * @brief set IoTOS UTC time
 * 
 * @param[in] tm the new time in posix time format
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h   
 */

Func uni_time_set_posix

OPERATE_RET uni_time_set_posix(IN CONST TIME_T time, IN CONST INT_T update_source);
/**
 * @brief set IoTOS UTC time in time_t format
 * 
 * @param[in] time the new time in time_t format
 * @param[in] update_source the source of time (0:rtc 1:cloud 2:other)
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h    
 */

Func uni_time_get

OPERATE_RET uni_time_get(OUT POSIX_TM_S *tm);
/**
 * @brief get IoTOS UTC time in posix time format
 * 
 * @param[out] tm the IoTOS UTC time in posix time format
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h   
 */

Func uni_time_get_posix

TIME_T uni_time_get_posix(VOID);
/**
 * @brief get IoTOS UTC time in TIME_T format
 * 
 * @return the current second time in TIME_T format 
 */

Func uni_time_get_posix_ms

SYS_TICK_T uni_time_get_posix_ms(VOID);
/**
 * @brief get IoTOS UTC time in SYS_TICK_T format
 * 
 * @return the current micro-second time in SYS_TICK_T format 
 */

Func uni_time_get_posix_ms_ext

OPERATE_RET uni_time_get_posix_ms_ext(uint32_t *time_s, uint32_t *remain_time_ms);
/**
 * @brief get IoTOS UTC time second/remain micro-second time
 *
 * @return the remain micro-second time in second/remain micro-second format
 *
 * @note in 32bit process, cannot return 8byte, because the high 4byte will be cut by cpu, we should use:
 * "uint32_t time_s,remain_time_ms; uni_time_get_posix_ms_ext(&time_s, &remain_time_ms);
 *  uint64_t time_ms = time_s*1000ULL + remain_time_ms" to get the micro-seconds
 */

Func uni_time_get_cur_posix

TIME_T uni_time_get_cur_posix(VOID);
/**
 * @brief get IoTOS last synchronized UTC time in TIME_T format
 * 
 * @return the time in TIME_T format 
 */

Func uni_time_get_posix_ms_remain_tick

uint32_t uni_time_get_posix_ms_remain_tick(VOID);
/**
 * @brief get IoTOS UTC time remain micro-second time
 * 
 * @return the remain micro-second time
 * 
 * @note in 32bit process, cannot return 8byte, because the high 4byte will be cut by cpu, we should use:
 * "uint64_t ms = uni_time_get_posix()*1000ULL + uni_time_get_posix_ms_remain_tick()" to get the micro-seconds
 */

Func uni_get_system_time

VOID uni_get_system_time(OUT TIME_S *pSecTime,OUT TIME_MS *pMsTime);
/**
 * @brief get IoTOS UTC time, both second and micro-second
 * 
 * @param[out] pSecTime the current time in second
 * @param[out] pMsTime the current time in micro-second
 * @return VOID 
 */

Func uni_set_time_zone

OPERATE_RET uni_set_time_zone(IN CONST CHAR_T *time_zone);
/**
 * @brief set IoTOS time zone in "+/-hh:mm" format
 * 
 * @param[in] time_zone the new time zone in "+/-hh:mm" format
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func uni_set_time_zone_seconds

OPERATE_RET uni_set_time_zone_seconds(IN INT_T time_zone_sec);
/**
 * @brief set IoTOS time zone in second format
 * 
 * @param[in] time_zone the new time zone in second format
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func uni_get_time_zone_seconds

OPERATE_RET uni_get_time_zone_seconds(OUT INT_T *time_zone);
/**
 * @brief get IoTOS time zone in second format
 * 
 * @param[out] time_zone the current time zone in second format
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func uni_set_sum_zone_tbl

VOID uni_set_sum_zone_tbl(IN CONST SUM_ZONE_S *zone,IN CONST UINT_T cnt);
/**
 * @brief set IoTOS summer time zone
 * 
 * @param[in] zone the summer time zone table
 * @param[in] cnt the summer time counts
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func uni_sum_time_get

OPERATE_RET uni_sum_time_get(OUT POSIX_TM_S *tm);
/**
 * @brief get IoTOS UTC summer time in posix time format
 * 
 * @param[out] tm the summer time in posix format
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func uni_sum_time_get_posix

TIME_T uni_sum_time_get_posix(VOID);
/**
 * @brief get IoTOS UTC summer time int TIME_T format 
 * 
 * @return the summer time in TIME_T format
 */

Func uni_is_in_sum_zone

BOOL_T uni_is_in_sum_zone(TIME_T time);
/**
 * @brief get IoTOS UTC summer time int TIME_T format 
 * 
 * @return the summer time in TIME_T format
 */

Func uni_local_time_get

OPERATE_RET uni_local_time_get(OUT POSIX_TM_S *tm);
/**
 * @brief get IoTOS local time (local, contains the time zone and summer time zone)
 * 
 * @param[out] tm the current local time in posix format
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func uni_local_time_get_custom

OPERATE_RET uni_local_time_get_custom(IN TIME_T in_time, OUT POSIX_TM_S *tm);
/**
 * @brief get IoTOS local time (local, contains the time zone and summer time zone)
 * 
 * @param[in] in_time the time need translate
 * @param[out] tm the local time in posix format
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 *
 * @note if in_time is 0, return the IoTOS local time, otherwise, translate the in_time to
 * local time
 */

Func tuya_uni_get_sum_zone

OPERATE_RET tuya_uni_get_sum_zone(OUT SUM_ZONE_TBL_S *sum_zone);
/**
 * @brief get sum zone info
 * 
 * @param[out] sum zone info
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h     
 */

Func tuya_wf_recv_mng_frame_reg

OPERATE_RET tuya_wf_recv_mng_frame_reg(WIFI_REV_MGNT_FILTER filter_cb,WIFI_REV_MGNT_CB cb);
/**
 * @brief register wifi recv mng frame cb
 *
 * @param[in] mng_tp mng type
 * @param[in] cb callback
 *
 * @note called to register mng recv.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func tuya_wf_recv_mng_frame_unreg

OPERATE_RET tuya_wf_recv_mng_frame_unreg(WIFI_REV_MGNT_CB cb);
/**
 * @brief unregister wifi recv mng frame cb
 *
 * @param[in] cb callback
 *
 * @note called to unregister mng recv.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func bnw_get_ip

OPERATE_RET bnw_get_ip(OUT NW_IP_S *ip);
/**
 * @brief bnw_get_ip 
 * @desc get the ip address of the wired network interface
 *
 * @param[out] ip: the ip address
 *
 * @return OPRT_OK: success  Other: fail
 *
 * @note this api can used when in wired or wired&wifi mode
 */

Func bnw_set_station_connect

OPERATE_RET bnw_set_station_connect(IN const char *ssid,IN const char *passwd);
/**
 * @brief bnw_set_station_connect 
 * @desc connect to a special ap
 *
 * @param[in] ssid: the ap ssid
 * @param[in] passwd: the ap password
 *
 * @return OPRT_OK: success  Other: fail
 *
 * @note this api only can used when in wired&wifi mode
 */

Func bnw_station_get_conn_ap_rssi

OPERATE_RET bnw_station_get_conn_ap_rssi(OUT int8_t *rssi);
/**
 * @brief bnw_station_get_conn_ap_rssi 
 * @desc get the connected ap rssi infomation
 *
 * @param[OUT] rssi: the ap rssi, rssi=99 if in wired mode, rssi=actually rssi if in wired&wifi mode
 *
 * @return OPRT_OK: success  Other: fail
 *
 * @note this api can used when in wired or wired&wifi mode
 */

Func bnw_get_mac

OPERATE_RET bnw_get_mac(OUT NW_MAC_S *mac);
/**
 * @brief bnw_get_mac 
 * @desc get the mac address of the wired network interface
 *
 * @param[OUT] mac: the mac address
 *
 * @return OPRT_OK: success  Other: fail
 *
 * @note this api can used when in wired or wired&wifi mode
 */

Func bnw_set_mac

OPERATE_RET bnw_set_mac(IN const NW_MAC_S *mac);
/**
 * @brief bnw_set_mac 
 * @desc set the mac address of the wired network interface
 *
 * @param[in] mac: the mac address
 *
 * @return OPRT_OK: success  Other: fail
 *
 * @note this api can used when in wired or wired&wifi mode
 */

Func bnw_if_wired_connect_net

OPERATE_RET bnw_if_wired_connect_net(BOOL_T *status);
/**
 * @brief bnw_if_wired_connect_net 
 * @desc get the status of the wired network interface
 *
 * @param[out] status: the connection status, TRUE means connected, FALSE means not connected
 *
 * @return OPRT_OK: success  Other: fail
 *
 * @note this api can used when in wired or wired&wifi mode
 */

Func bnw_station_conn

BOOL_T bnw_station_conn(void);
/**
 * @brief bnw_station_conn 
 * @desc get the status of the wifi network interface
 *
 * @return TRUE: connected, FALSE: not connected
 *
 * @note this api can used when in wired or wired&wifi mode
 */

Func bnw_need_wifi_cfg

BOOL_T bnw_need_wifi_cfg(void);
/**
 * @brief bnw_need_wifi_cfg 
 * @desc check if need config wifi
 *
 * @return TRUE: connected, FALSE: not connected
 *
 * @note this api can used when in wired or wired&wifi mode, 
 * it will used to add a wf_cfg infomation in lan discocery packet, 
 * and support set wifi ssid and passwd from lan.
 */

Func ty_work_queue_init

OPERATE_RET ty_work_queue_init(VOID);
/**
 * @brief init ty work queue
 *
 * @param[in] NONE
 *
 * @note This API is used for init work queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_work_queue_add

OPERATE_RET ty_work_queue_add(IN CONST TY_WK_CB cb, IN CONST VOID *data);
/**
 * @brief add work to work queue
 *
 * @param[in] cb, call back of work
 * @param[in] data, parameter of call back
 *
 * @note This API is used for add work to work queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func ty_work_queue_depth

UINT_T ty_work_queue_depth(VOID);
/**
 * @brief get current work number in work queue.
 *
 * @param[in] NONE
 *
 * @note This API is used for get the current work number in work queue.
 *
 * @return current work number in the work queue
 */

Func work_queue_create

OPERATE_RET work_queue_create(OUT WORK_QUEUE_HANDLE *phand,\
                                    IN CONST STACK_SIZE stack_size,\
                                    IN CONST TRD_PRI pri,\
                                    IN CONST UINT_T work_num);
/**
 * @brief Create work queue
 *
 * @param[out] phand: pointer of the work queue handle
 * @param[in] stack_size: stack depth of work queue's thread
 * @param[in] pri: thread priority of work queue
 * @param[in] work_num, thread num of work queue
 *
 * @note This API is used for creating work queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func work_queue_add

OPERATE_RET work_queue_add(IN CONST WORK_QUEUE_HANDLE hand,IN CONST WK_CALLBACK cb,\
                                IN CONST VOID *data);
/**
 * @brief Add a task to work queue
 *
 * @param[in] hand: handle of the work queue
 * @param[in] cb: callback function of task
 * @param[in] data: data for callback function
 *
 * @note This API is used for creating work queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func work_queue_check_and_del

OPERATE_RET work_queue_check_and_del(IN CONST WORK_QUEUE_HANDLE hand, IN CONST VOID *data);
/**
 * @brief Check and delete a task from work queue
 *
 * @param[in] hand: handle of the work queue
 * @param[in] cb: callback function of task
 * @param[in] data: data for callback function
 *
 * @note This API is used to check and delete a task from work queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func work_queue_release

OPERATE_RET work_queue_release(IN CONST WORK_QUEUE_HANDLE hand);
/**
 * @brief Release a work queue
 *
 * @param[in] hand: handle of the work queue
 *
 * @note This API is used for releasing a work queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func work_queue_get_depth

UINT_T work_queue_get_depth(IN CONST WORK_QUEUE_HANDLE hand);
/**
 * @brief Get stack depth of the work queue
 *
 * @param[in] hand: handle of the work queue
 *
 * @note This API is used for getting stack depth of the work queue
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Func wifi_netcfg_start_ap_mode

int wifi_netcfg_start_ap_mode();
/*启动配网时,切换到ap模式,并开启热点*/

Func wifi_ap_netcfg_start

int wifi_ap_netcfg_start(FN_NETCFG_CB cb, void * args, int type);
/*
	func desc:开始ap配网
	parameter:
		input:
		out:
	return:
		
*/

Func wifi_ap_netcfg_stop

int wifi_ap_netcfg_stop(int type);
/*
	func desc:停止配网,释放资源
	parameters:
		input:
	return:

*/

Func lan_ap_nw_cfg_error_report

void lan_ap_nw_cfg_error_report(IN CONST char *p_desc,IN CONST AP_CFG_ERR_CODE error_code);
/*
	func desc: 上报配网错误日志到app
*/

Func ap_netcfg_init

int ap_netcfg_init(int netcfg_policy, ApSsidPasswd_t ApInfo);
/*
	ap netcfg init :注册netcfg 到 netcfg module
*/

Func ffs_netcfg_init

int ffs_netcfg_init();


      

Func tuya_ffs_init

OPERATE_RET tuya_ffs_init(tuya_ffs_config_t *config);


      

Func tuya_ffs_start

OPERATE_RET tuya_ffs_start(FN_NETCFG_CB cb);


      

Func tuya_ffs_stop

OPERATE_RET tuya_ffs_stop();


      

Func tuya_ffs_destory

OPERATE_RET tuya_ffs_destory();


      

Func tuya_ffs_adapter_random_bytes

OPERATE_RET tuya_ffs_adapter_random_bytes(CHAR_T *random, INT_T len);


      

Func tuya_ffs_adapter_sha256

OPERATE_RET tuya_ffs_adapter_sha256(const tuya_ffs_stream_t *data_stream, tuya_ffs_stream_t *sha256_stream);


      

Func tuya_ffs_adapter_hmac_sha256

OPERATE_RET tuya_ffs_adapter_hmac_sha256(const tuya_ffs_stream_t *secret_key_stream, const tuya_ffs_stream_t *data_stream,
   tuya_ffs_stream_t *hmac_stream);


      

Func tuya_ffs_adapter_compute_ecdh_key

OPERATE_RET tuya_ffs_adapter_compute_ecdh_key(mbedtls_pk_context *private_key_stream,
   mbedtls_pk_context *public_key_stream, UINT8_T *secret_key_stream);


      

Func tuya_ffs_adapter_get_perm2der

OPERATE_RET tuya_ffs_adapter_get_perm2der(const tuya_ffs_stream_t *perm, tuya_ffs_stream_t *der);


      

Func tuya_ffs_adapter_encode_base64

OPERATE_RET tuya_ffs_adapter_encode_base64(const tuya_ffs_stream_t *data_stream, tuya_ffs_stream_t *base64_stream);


      

Func tuya_ffs_adapter_encode_base85

OPERATE_RET tuya_ffs_adapter_encode_base85(const tuya_ffs_stream_t *data_stream, tuya_ffs_stream_t *base85_stream);


      

Func tuya_ffs_adapter_connect_ap

OPERATE_RET tuya_ffs_adapter_connect_ap(tuya_ffs_info_t *ffs_info,const CHAR_T *ssid, const CHAR_T *passwd, UINT_T timeout_sec);


      

Func tuya_ffs_adapter_scan_ssid

OPERATE_RET tuya_ffs_adapter_scan_ssid(const CHAR_T *ssid);


      

Func tuya_ffs_dss_init

OPERATE_RET tuya_ffs_dss_init(tuya_ffs_config_t* config, uint32_t port);


      

Func tuya_ffs_dss_run

OPERATE_RET tuya_ffs_dss_run(tuya_ffs_info_t *ffs_info);


      

Func tuya_ffs_dss_destory

OPERATE_RET tuya_ffs_dss_destory();


      

Func tuya_ffs_stream_free

OPERATE_RET tuya_ffs_stream_free(tuya_ffs_stream_t *stream);


      

Func tuya_ffs_stream_write

OPERATE_RET tuya_ffs_stream_write(tuya_ffs_stream_t *stream, UINT8_T *data, UINT_T len);


      

Func tuya_ffs_stream_bind_data

OPERATE_RET tuya_ffs_stream_bind_data(tuya_ffs_stream_t *stream, UINT8_T *data, UINT_T len);


      

Func tuya_ffs_stream_flush

OPERATE_RET tuya_ffs_stream_flush(tuya_ffs_stream_t *stream);


      

Func tuya_ffs_stream_get_space_size

INT_T tuya_ffs_stream_get_space_size(const tuya_ffs_stream_t *stream);


      

Func tuya_ffs_stream_get_write_pointer

CHAR_T *tuya_ffs_stream_get_write_pointer(tuya_ffs_stream_t *stream);


      

Func user_netcfg_cfg

int user_netcfg_cfg(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd,IN CONST CHAR_T *token);


      

Func user_netcfg_init

int user_netcfg_init();


      

Func mimo_ak_bc_parse

OPERATE_RET mimo_ak_bc_parse(IN CONST SCHAR_T rssi,IN CONST MIMO_TYPE_E type,
                                     IN CONST BYTE_T mcs,IN CONST USHORT_T len,IN CONST BYTE_T chan);
/***********************************************************
*  Function: mimo_ak_bc_parse
*  Input: rssi type mcs len chan(1-14)
*  Output:
*  Return: none
***********************************************************/

Func thing_config_init

OPERATE_RET thing_config_init(IN THING_CONFIG_SOCKET_CB socket_cb);


      

Func thing_config_start

OPERATE_RET thing_config_start(IN CONST CHAR_T *ssid, IN CONST CHAR_T *passwd, IN CONST CHAR_T *token, IN CONST UINT_T timeout);


      

Func thing_config_stop

VOID thing_config_stop(VOID);


      

Func thing_config_mqc_handle

OPERATE_RET thing_config_mqc_handle(IN ty_cJSON *root_json);


      

Func smart_netcfg_init

int smart_netcfg_init(int netcfg_policy);
/*
	smart cfg配网初始化接口
*/

Vars

Variable

struct altcp_pcb;


      

Variable altcp_functions

struct altcp_functions;


      

Variable tcp_pcb

struct tcp_pcb;


      

Variable altcp_tls_config

struct altcp_tls_config;
/** @ingroup altcp_tls
 * ALTCP_TLS configuration handle, content depends on port (e.g. mbedtls)
 */

Variable altcp_tls_config

struct altcp_tls_config *altcp_tls_create_config_server_privkey_cert(const u8_t *privkey, size_t privkey_len,
                           const u8_t *privkey_pass, size_t privkey_pass_len,
                           const u8_t *cert, size_t cert_len);
/** @ingroup altcp_tls
 * Create an ALTCP_TLS server configuration handle
 */

Variable altcp_tls_config

struct altcp_tls_config *altcp_tls_create_config_client(const u8_t *cert, size_t cert_len);
/** @ingroup altcp_tls
 * Create an ALTCP_TLS client configuration handle
 */

Variable altcp_tls_config

struct altcp_tls_config *altcp_tls_create_config_client_2wayauth(const u8_t *ca, size_t ca_len, const u8_t *privkey, size_t privkey_len,
                           const u8_t *privkey_pass, size_t privkey_pass_len,
                           const u8_t *cert, size_t cert_len);
/** @ingroup altcp_tls
 * Create an ALTCP_TLS client configuration handle with two-way server/client authentication
 */

Variable ip_pcb

struct ip_pcb;
/* forward-declare some structs to avoid to include their headers */

Variable tcp_pcb

struct tcp_pcb;


      

Variable udp_pcb

struct udp_pcb;


      

Variable raw_pcb

struct raw_pcb;


      

Variable netconn

struct netconn;


      

Variable api_msg

struct api_msg;


      

Variable pending_err

err_t pending_err;
/** the last asynchronous unreported error this netconn had */

Variable op_completed

sys_sem_t op_completed;
/** sem that is used to synchronously execute functions in the core context */

Variable recvmbox

sys_mbox_t recvmbox;
/** mbox where received packets are stored until they are fetched
      by the netconn application thread (can grow quite big) */

Variable acceptmbox

sys_mbox_t acceptmbox;
/** mbox where new connections are stored until processed
      by the application thread */

Variable mbox_threads_waiting

int mbox_threads_waiting;
/** number of threads waiting on an mbox. This is required to unblock
      all threads when closing while threads are waiting. */

Variable socket

int socket;


      

Variable s32_t

s32_t send_timeout;
/** timeout to wait for sending data (which means enqueueing data for sending
      in internal buffers) in milliseconds */

Variable recv_timeout

u32_t recv_timeout;
/** timeout in milliseconds to wait for new data to be received
      (or connections to arrive for listening netconns) */

Variable recv_bufsize

int recv_bufsize;
/** maximum amount of bytes queued in recvmbox
      not used for TCP: adjust TCP_WND instead! */

Variable recv_avail

int recv_avail;
/** number of bytes currently in recvmbox to be received,
      tested against recv_bufsize to limit bytes on recvmbox
      for UDP and RAW, used for FIONREAD */

Variable linger

s16_t linger;
/** values <0 mean linger is disabled, values > 0 are seconds to linger */

Variable flags

u8_t flags;
/** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */

Variable api_msg

struct api_msg *current_msg;
/** TCP: when data passed to netconn_write doesn't fit into the send buffer,
      this temporarily stores the message.
      Also used during connect and close. */

Variable callback

netconn_callback callback;
/** A callback function that is informed about events for this netconn */

Variable netconn

struct netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto,
                                            netconn_callback callback);


      

Variable fs_file

struct fs_file;
/* we have to prototype this struct here to make it available for the handler */

Variable char

char **pcParam, char **pcValue
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
                                    , void *connection_state
#endif /* LWIP_HTTPD_FILE_STATE */
                                    );


      

Variable altcp_tls_config

struct altcp_tls_config;


      

Variable mdns_host

struct mdns_host;


      

Variable mdns_service

struct mdns_service;


      

Variable altcp_tls_config

struct altcp_tls_config;


      

Variable altcp_tls_config

struct altcp_tls_config;


      

Variable snmp_node_instance

struct snmp_node_instance;


      

Variable netif

struct netif;


      

Variable snmp_node_instance

struct snmp_node_instance proxy_instance;


      

Variable s32_t

s32_t snmpv3_get_engine_time_internal(void);


      

Variable char

char* lwip_strnstr(const char* buffer, const char* token, size_t n);
/* This can be #defined to strnstr() depending on your platform */

Variable char

char * lwip_if_indextoname(unsigned int ifindex, char *ifname);


      

Variable igmp_group

struct igmp_group *igmp_lookfor_group(struct netif *ifp, const ip4_addr_t *addr);


      

Variable netif

struct netif *ip4_route(const ip4_addr_t *dest);


      

Variable netif

struct netif *ip4_route_src(const ip4_addr_t *src, const ip4_addr_t *dest);


      

Variable netif

struct netif;
/* Forward declaration to not include netif.h */

Variable char

char *ip4addr_ntoa(const ip4_addr_t *addr);
/** returns ptr to static buffer; not reentrant! */

Variable char

char *ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen);


      

Variable pbuf

struct pbuf * ip4_reass(struct pbuf *p);


      

Variable netif

struct netif *ip6_route(const ip6_addr_t *src, const ip6_addr_t *dest);


      

Variable char

char *ip6addr_ntoa(const ip6_addr_t *addr);
/** returns ptr to static buffer; not reentrant! */

Variable char

char *ip6addr_ntoa_r(const ip6_addr_t *addr, char *buf, int buflen);


      

Variable pbuf

struct pbuf *ip6_reass(struct pbuf *p);


      

Variable type

u8_t type;
/** @ref lwip_ip_addr_type */

Variable char

char *ipaddr_ntoa(const ip_addr_t *addr);


      

Variable char

char *ipaddr_ntoa_r(const ip_addr_t *addr, char *buf, int buflen);


      

Variable mld_group

struct mld_group *mld6_lookfor_group(struct netif *ifp, const ip6_addr_t *addr);


      

Variable pbuf

struct pbuf;


      

Variable netif

struct netif;


      

Variable netif

struct netif *nd6_find_route(const ip6_addr_t *ip6addr);


      

Variable netbuf

struct netbuf *  netbuf_new     (void);
/* Network buffer functions: */

Variable netbuf_delete

void             netbuf_delete  (struct netbuf *buf);


      

Variable netbuf_alloc

void *           netbuf_alloc   (struct netbuf *buf, u16_t size);


      

Variable netbuf_free

void             netbuf_free    (struct netbuf *buf);


      

Variable netbuf_ref

err_t            netbuf_ref     (struct netbuf *buf,
                                  const void *dataptr, u16_t size);


      

Variable netbuf_chain

void             netbuf_chain   (struct netbuf *head, struct netbuf *tail);


      

Variable netbuf_data

err_t            netbuf_data    (struct netbuf *buf,
                                  void **dataptr, u16_t *len);


      

Variable netbuf_next

s8_t             netbuf_next    (struct netbuf *buf);


      

Variable netbuf_first

void             netbuf_first   (struct netbuf *buf);


      

Variable hostent

struct hostent *lwip_gethostbyname(const char *name);


      

Variable netif

struct netif;


      

Variable netif

struct netif *netif_add_noaddr(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input);


      

Variable netif

struct netif *netif_add(struct netif *netif,
                           const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw,
                           void *state, netif_init_fn init, netif_input_fn input);


      

Variable netif

struct netif *netif_add(struct netif *netif, void *state, netif_init_fn init, netif_input_fn input);


      

Variable netif

struct netif *netif_find(const char *name);
/* Returns a network interface given its name. The name is of the form
   "et0", where the first two letters are the "name" field in the
   netif structure, and the digit is in the num field in the same
   structure. */

Variable char

char * netif_index_to_name(u8_t idx, char *name);


      

Variable netif

struct netif* netif_get_by_index(u8_t idx);


      

Variable netif_ext_callback

struct netif_ext_callback;


      

Variable pbuf

struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type);


      

Variable pbuf

struct pbuf *pbuf_alloc_reference(void *payload, u16_t length, pbuf_type type);


      

Variable pbuf

struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type,
                                struct pbuf_custom *p, void *payload_mem,
                                u16_t payload_mem_len);


      

Variable pbuf

struct pbuf *pbuf_free_header(struct pbuf *q, u16_t size);


      

Variable pbuf

struct pbuf *pbuf_dechain(struct pbuf *p);


      

Variable pbuf

struct pbuf *pbuf_skip(struct pbuf* in, u16_t in_offset, u16_t* out_offset);


      

Variable pbuf

struct pbuf *pbuf_coalesce(struct pbuf *p, pbuf_layer layer);


      

Variable pbuf

struct pbuf *pbuf_clone(pbuf_layer l, pbuf_type type, struct pbuf *p);


      

Variable op_completed_sem

sys_sem_t* op_completed_sem;


      

Variable lwip_netconn_do_newconn

void lwip_netconn_do_newconn        (void *m);


      

Variable lwip_netconn_do_delconn

void lwip_netconn_do_delconn        (void *m);


      

Variable lwip_netconn_do_bind

void lwip_netconn_do_bind           (void *m);


      

Variable lwip_netconn_do_bind_if

void lwip_netconn_do_bind_if        (void *m);


      

Variable lwip_netconn_do_connect

void lwip_netconn_do_connect        (void *m);


      

Variable lwip_netconn_do_disconnect

void lwip_netconn_do_disconnect     (void *m);


      

Variable lwip_netconn_do_listen

void lwip_netconn_do_listen         (void *m);


      

Variable lwip_netconn_do_send

void lwip_netconn_do_send           (void *m);


      

Variable lwip_netconn_do_recv

void lwip_netconn_do_recv           (void *m);


      

Variable lwip_netconn_do_accepted

void lwip_netconn_do_accepted       (void *m);


      

Variable lwip_netconn_do_write

void lwip_netconn_do_write          (void *m);


      

Variable lwip_netconn_do_getaddr

void lwip_netconn_do_getaddr        (void *m);


      

Variable lwip_netconn_do_close

void lwip_netconn_do_close          (void *m);


      

Variable lwip_netconn_do_shutdown

void lwip_netconn_do_shutdown       (void *m);


      

Variable netconn

struct netconn* netconn_alloc(enum netconn_type t, netconn_callback callback);


      

Variable raw_input_state_t

raw_input_state_t raw_input(struct pbuf *p, struct netif *inp);
/* The following functions are the lower layer interface to RAW. */

Variable optlen

socklen_t optlen;
/** size of *optval */

Variable err

int err;
/** if an error occurs, it is temporarily stored here */

Variable completed_sem

void* completed_sem;
/** semaphore to wake up the calling task */

Variable lwip_sock

struct lwip_sock* lwip_socket_dbg_get_socket(int fd);


      

Variable tcp_init

void            tcp_init   (void);
/* Lower layer interface to TCP: */

Variable tcp_tmr

void            tcp_tmr    (void);
/* Initialize this module. */

Variable tcp_txnow

void            tcp_txnow  (void);
/* Call this from a netif driver (watch out for threading issues!) that has
   returned a memory error on transmit and now has free buffers to send more.
   This iterates all active pcbs that had an error and tries to call
   tcp_output, so use this with care as it might slow down the system. */

Variable tcp_input

void            tcp_input  (struct pbuf *p, struct netif *inp);
/* Only used by IP to pass a TCP segment to TCP: */

Variable tcp_pcb

struct tcp_pcb * tcp_alloc  (u8_t prio);
/* Used within the TCP code only: */

Variable tcp_free

void            tcp_free   (struct tcp_pcb *pcb);


      

Variable tcp_pcb

struct tcp_pcb *tcp_pcb_copy(struct tcp_pcb *pcb);
/* Internal functions: */

Variable tcp_seg

struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg);


      

Variable pbuf

struct pbuf;


      

Variable netif

struct netif;


      

Variable PACK_STRUCT_END

PACK_STRUCT_END
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/epstruct.h"
#endif


/* DHCP client states */
typedef enum {
 DHCP_STATE_OFF            = 0,
 DHCP_STATE_REQUESTING     = 1,
 DHCP_STATE_INIT           = 2,
 DHCP_STATE_REBOOTING      = 3,
 DHCP_STATE_REBINDING      = 4,
 DHCP_STATE_RENEWING       = 5,
 DHCP_STATE_SELECTING      = 6,
 DHCP_STATE_INFORMING      = 7,
 DHCP_STATE_CHECKING       = 8,
 DHCP_STATE_PERMANENT      = 9, /* not yet implemented */
 DHCP_STATE_BOUND          = 10,
 DHCP_STATE_RELEASING      = 11, /* not yet implemented */
 DHCP_STATE_BACKING_OFF    = 12
} dhcp_state_enum_t;


      

Variable PACK_STRUCT_END

PACK_STRUCT_END
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/epstruct.h"
#endif


/* DHCP6 client states */
typedef enum {
 DHCP6_STATE_OFF              = 0,
 DHCP6_STATE_STATELESS_IDLE   = 1,
 DHCP6_STATE_REQUESTING_CONFIG = 2
} dhcp6_state_enum_t;


      

Variable PACK_STRUCT_END

PACK_STRUCT_END
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/epstruct.h"
#endif

typedef struct ip4_addr_packed ip4_addr_p_t;


      

Variable PACK_STRUCT_END

PACK_STRUCT_END
#ifdef PACK_STRUCT_USE_INCLUDES
# include "arch/epstruct.h"
#endif
typedef struct ip6_addr_packed ip6_addr_p_t;


      

Variable raw_pcb

struct raw_pcb;


      

Variable raw_pcb

struct raw_pcb * raw_new       (u8_t proto);
/* The following functions is the application layer interface to the
   RAW code. */

Variable raw_pcb

struct raw_pcb * raw_new_ip_type(u8_t type, u8_t proto);


      

Variable raw_remove

void            raw_remove    (struct raw_pcb *pcb);


      

Variable raw_bind

err_t           raw_bind      (struct raw_pcb *pcb, const ip_addr_t *ipaddr);


      

Variable raw_connect

err_t           raw_connect   (struct raw_pcb *pcb, const ip_addr_t *ipaddr);


      

Variable raw_sendto

err_t           raw_sendto    (struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr);


      

Variable raw_send

err_t           raw_send      (struct raw_pcb *pcb, struct pbuf *p);


      

Variable raw_recv

void            raw_recv      (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg);


      

Variable udp_pcb

struct udp_pcb;


      

Variable netif

struct netif;


      

Variable sys_thread_t

sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio);
/**
 * @ingroup sys_misc
 * The only thread function:
 * Starts a new thread named "name" with priority "prio" that will begin its
 * execution in the function "thread()". The "arg" argument will be passed as an
 * argument to the thread() function. The stack size to used for this thread is
 * the "stacksize" parameter. The id of the new thread is returned. Both the id
 * and the priority are system dependent.
 * ATTENTION: although this function returns a value, it MUST NOT FAIL (ports have to assert this!)
 * 
 * @param name human-readable name for the thread (used for debugging purposes)
 * @param thread thread-function
 * @param arg parameter passed to 'thread'
 * @param stacksize stack size in bytes for the new thread (may be ignored by ports)
 * @param prio priority of the new thread (may be ignored by ports) */

Variable sys_prot_t

sys_prot_t sys_arch_protect(void);


      

Variable tcp_pcb

struct tcp_pcb;


      

Variable tcp_pcb_listen

struct tcp_pcb_listen;


      

Variable tcp_pcb

struct tcp_pcb * tcp_new    (void);
/* Application program's interface: */

Variable tcp_pcb

struct tcp_pcb * tcp_new_ip_type (u8_t type);


      

Variable tcp_arg

void            tcp_arg    (struct tcp_pcb *pcb, void *arg);


      

Variable tcp_recv

void            tcp_recv   (struct tcp_pcb *pcb, tcp_recv_fn recv);


      

Variable tcp_sent

void            tcp_sent   (struct tcp_pcb *pcb, tcp_sent_fn sent);


      

Variable tcp_err

void            tcp_err    (struct tcp_pcb *pcb, tcp_err_fn err);


      

Variable tcp_poll

void            tcp_poll   (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval);


      

Variable tcp_bind

err_t           tcp_bind   (struct tcp_pcb *pcb, const ip_addr_t *ipaddr,
                             u16_t port);


      

Variable tcp_pcb

struct tcp_pcb * tcp_listen_with_backlog_and_err(struct tcp_pcb *pcb, u8_t backlog, err_t *err);


      

Variable tcp_pcb

struct tcp_pcb * tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog);


      

Variable tcp_close

err_t           tcp_close  (struct tcp_pcb *pcb);


      

Variable tcp_write

err_t           tcp_write  (struct tcp_pcb *pcb, const void *dataptr, u16_t len,
                             u8_t apiflags);


      

Variable pbuf

struct pbuf;


      

Variable netif

struct netif;


      

Variable tcpip_callback_msg

struct tcpip_callback_msg;
/* Forward declarations */

Variable tcpip_callback_msg

struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx);


      

Variable sys_timeo

struct sys_timeo** sys_timeouts_get_next_timeout(void);


      

Variable udp_pcb

struct udp_pcb;


      

Variable udp_pcb

struct udp_pcb * udp_new       (void);
/* The following functions is the application layer interface to the
   UDP code. */

Variable udp_pcb

struct udp_pcb * udp_new_ip_type(u8_t type);


      

Variable udp_remove

void            udp_remove    (struct udp_pcb *pcb);


      

Variable udp_bind

err_t           udp_bind      (struct udp_pcb *pcb, const ip_addr_t *ipaddr,
                                u16_t port);


      

Variable udp_connect

err_t           udp_connect   (struct udp_pcb *pcb, const ip_addr_t *ipaddr,
                                u16_t port);


      

Variable udp_recv

void            udp_recv      (struct udp_pcb *pcb, udp_recv_fn recv,
                                void *recv_arg);


      

Variable udp_sendto

err_t           udp_sendto    (struct udp_pcb *pcb, struct pbuf *p,
                                const ip_addr_t *dst_ip, u16_t dst_port);


      

Variable udp_send

err_t           udp_send      (struct udp_pcb *pcb, struct pbuf *p);


      

Variable udp_input

void            udp_input     (struct pbuf *p, struct netif *inp);
/* The following functions are the lower layer interface to UDP. */

Variable udp_init

void            udp_init      (void);


      

Variable netif

struct netif;


      

Variable pbuf

struct pbuf *lowpan6_decompress(struct pbuf *p, u16_t datagram_size, ip6_addr_t *lowpan6_contexts,
                               struct lowpan6_link_addr *src, struct lowpan6_link_addr *dest);


      

Variable char

char *eui64_ntoa(eui64_t);


      

Variable char

char *ip_ntoa (u32_t);


      

Variable char

char *epdisc_to_str (struct epdisc *);


      

Variable tuya_adc_init

int tuya_adc_init    (tuya_adc_t *adc);
/**
 * @brief adc init
 * 
 * @param[in] adc refer to tuya_adc_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_adc_control

int tuya_adc_control   (tuya_adc_t *adc, uint8_t cmd, void *arg);
/**
 * @brief adc control
 * 
 * @param[in] adc refer to tuya_adc_t
 * @param[in] cmd control command
 * @param[in] arg argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_adc_deinit

int tuya_adc_deinit    (tuya_adc_t *adc);
/**
 * @brief adc reinit
 * 
 * @param[in] adc refer to tuya_adc_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_adc_convert

int tuya_adc_convert   (tuya_adc_t *adc, uint16_t *data, uint16_t num);
/**
 * @brief adc covert
 * 
 * @param[in] adc refer to tuya_adc_t
 * @param[in] data data
 * @param[in] num numver
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_adc_voltage

int tuya_adc_voltage   (tuya_adc_t *adc, uint16_t *data, uint16_t *voltage, uint16_t count);
/**
 * @brief adc control
 * 
 * @param[in] adc refer to tuya_adc_t
 * @param[in] data data
 * @param[in] voltage voltage
 * @param[in] count voltage number
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2c_init

int tuya_i2c_init   (tuya_i2c_t *i2c);
/**
 * @brief i2c init
 * 
 * @param[in] i2c refer to tuya_i2c_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2c_xfer

int tuya_i2c_xfer    (tuya_i2c_t *i2c, tuya_i2c_msg_t *msg, uint8_t num);
/**
 * @brief i2c transfer
 * 
 * @param[in] i2c refer to tuya_i2c_t
 * @param[in] msg refer to tuya_i2c_msg_t
 * @param[in] num i2c number
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2c_control

int tuya_i2c_control     (tuya_i2c_t *i2c, uint8_t cmd, void *arg);
/**
 * @brief i2c control
 * 
 * @param[in] i2c refer to tuya_i2c_t
 * @param[in] cmd control command
 * @param[in] arg control argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2c_deinit

int tuya_i2c_deinit    (tuya_i2c_t *i2c);
/**
 * @brief i2c deinit
 * 
 * @param[in] i2c refer to tuya_i2c_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2c_master_send

int tuya_i2c_master_send   (tuya_i2c_t *i2c, uint16_t addr, uint16_t flags, void *buf, uint16_t count);
/**
 * @brief i2c master send 
 * 
 * @param[in] i2c refer to tuya_i2c_t
 * @param[in] addr message address
 * @param[in] flags read or write
 * @param[in] buf send buf
 * @param[in] count send length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2c_master_recv

int tuya_i2c_master_recv   (tuya_i2c_t *i2c, uint16_t addr, uint16_t flags, void *buf, uint16_t count);
/**
 * @brief i2c master receive 
 * 
 * @param[in] i2c refer to tuya_i2c_t
 * @param[in] addr message address
 * @param[in] flags read or write
 * @param[in] buf receive buf
 * @param[in] count receive length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_sw_i2c_register

int tuya_sw_i2c_register   (tuya_i2c_port_t port, tuya_i2c_sw_cfg_t *cfg);
/**
 * @brief i2c register 
 * 
 * @param[in] port refer to tuya_i2c_port_t
 * @param[in] cfg refer to tuya_i2c_sw_cfg_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2s_write

int tuya_i2s_write    (tuya_i2s_t *i2s, void *data, uint32_t length);
/**
 * @brief i2s write
 * 
 * @param[in] i2s refer to tuya_i2s_t
 * @param[in] data buffer
 * @param[in] length buffer length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2s_read

int tuya_i2s_read    (tuya_i2s_t *i2s, void *data, uint32_t length);
/**
 * @brief i2s read
 * 
 * @param[in] i2s refer to tuya_i2s_t
 * @param[out] data buffer
 * @param[out] length buffer length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2s_control

int tuya_i2s_control     (tuya_i2s_t *i2s, UINT8_T cmd, void *arg);
/**
 * @brief i2s control
 * 
 * @param[in] i2s refer to tuya_i2s_t
 * @param[in] cmd control command
 * @param[in] arg command argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_i2s_deinit

int tuya_i2s_deinit     (tuya_i2s_t *i2s);
/**
 * @brief i2s deinit
 * 
 * @param[in] i2s refer to tuya_i2s_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pin_init

int tuya_pin_init    (tuya_pin_name_t pin, tuya_pin_mode_t mode);
/**
 * @brief pin init
 * 
 * @param[in] pin refer to tuya_pin_name_t
 * @param[in] mode refer to tuya_pin_mode_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pin_write

int tuya_pin_write    (tuya_pin_name_t pin, tuya_pin_level_t level);
/**
 * @brief pin write
 * 
 * @param[in] pin refer to tuya_pin_name_t
 * @param[in] level refer to tuya_pin_level_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pin_read

int tuya_pin_read    (tuya_pin_name_t pin);
/**
 * @brief pin read
 * 
 * @param[in] pin refer to tuya_pin_name_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pin_control

int tuya_pin_control     (tuya_pin_name_t pin, uint8_t cmd, void *arg);
/**
 * @brief pin control
 * 
 * @param[in] pin refer to tuya_pin_name_t
 * @param[in] cmd control command
 * @param[in] arg command argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pin_irq_init

int tuya_pin_irq_init    (tuya_pin_name_t pin, tuya_pin_mode_t irq_mode, tuya_pin_irq_cb cb, void *arg);
/**
 * @brief pin irq init
 * 
 * @param[in] pin refer to tuya_pin_name_t
 * @param[in] irq_mode refer to tuya_pin_mode_t
 * @param[in] cb irq callback
 * @param[in] arg callback argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pin_irq_enable

int tuya_pin_irq_enable  (tuya_pin_name_t pin);
/**
 * @brief pin irq enable
 * 
 * @param[in] pin refer to tuya_pin_name_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pin_register

int tuya_pin_register    (tuya_pin_ops_t *ops);
/**
 * @brief pin irq register
 * 
 * @param[in] ops refer to tuya_pin_ops_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pwm_init

int tuya_pwm_init    (tuya_pwm_t *pwm);
/**
 * @brief pwm init
 * 
 * @param[in] pwm refer to tuya_pwm_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pwm_start

int tuya_pwm_start    (tuya_pwm_t *pwm);
/**
 * @brief pwm start
 * 
 * @param[in] pwm refer to tuya_pwm_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pwm_stop

int tuya_pwm_stop    (tuya_pwm_t *pwm);
/**
 * @brief pwm stop
 * 
 * @param[in] pwm refer to tuya_pwm_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pwm_control

int tuya_pwm_control     (tuya_pwm_t *pwm, uint8_t cmd, void *arg);
/**
 * @brief pwm control
 * 
 * @param[in] pwm refer to tuya_pwm_t
 * @param[in] cmd control command
 * @param[in] arg command argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pwm_deinit

int tuya_pwm_deinit    (tuya_pwm_t *pwm);
/**
 * @brief pwm deinit
 * 
 * @param[in] pwm refer to tuya_pwm_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pwm_set

int tuya_pwm_set   (tuya_pwm_t *pwm, float frequency, float percent);
/**
 * @brief pwm set
 * 
 * @param[in] pwm refer to tuya_pwm_t
 * @param[in] frequency frequency
 * @param[in] percent percent
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pwm_duty_set

int tuya_pwm_duty_set     (tuya_pwm_t *pwm, float percent);
/**
 * @brief set duty
 * 
 * @param[in] pwm refer to tuya_pwm_t
 * @param[in] percent percent
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_pwm_polarity_set

int tuya_pwm_polarity_set  (tuya_pwm_t *pwm, tuya_pwm_polarity_t polarity);
/**
 * @brief set polarity
 * 
 * @param[in] pwm refer to tuya_pwm_t
 * @param[in] polarity refer to tuya_pwm_polarity_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_rtc_init

int tuya_rtc_init    (void);
/**
 * @brief rtc init
 *
 */

Variable tuya_rtc_time_set

int tuya_rtc_time_set   (time_t  timestamp);
/**
 * @brief time set
 * 
 * @param[in] timestamp time
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_rtc_time_get

int tuya_rtc_time_get   (time_t  *timestamp);
/**
 * @brief time get
 * 
 * @param[in] timestamp time
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_rtc_control

int tuya_rtc_control    (uint8_t cmd, void *arg);
/**
 * @brief time control
 * 
 * @param[in] cmd command
 * @param[in] arg command argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_rtc_deinit

int tuya_rtc_deinit    (void);
/**
 * @brief rtc deinit
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_spi_bus_init

int tuya_spi_bus_init     (tuya_spi_bus_t *spi_bus);
/**
 * @brief spi init
 * 
 * @param[in] spi_bus refer to tuya_spi_bus_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_spi_xfer

int tuya_spi_xfer    (tuya_spi_t *spi, void *send_buf, void *recv_buf, uint32_t length);
/**
 * @brief spi transfer
 * 
 * @param[in] spi refer to tuya_spi_t
 * @param[in] send_buf used to send
 * @param[in] recv_buf used to recv
 * @param[in] length message length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_spi_xfer_msg

int tuya_spi_xfer_msg     (tuya_spi_t *spi, tuya_spi_msg_t *msg, uint8_t num);
/**
 * @brief spi xfer msg
 * 
 * @param[in] spi refer to tuya_spi_t
 * @param[in] msg refer to tuya_spi_msg_t
 * @param[in] num message number
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_spi_exchange

int tuya_spi_exchange     (tuya_spi_t *spi, uint16_t out, uint16_t *in);
/**
 * @brief spi exchange
 * 
 * @param[in] spi refer to tuya_spi_t
 * @param[in] out message send buf
 * @param[in] in message recv buf
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_spi_control

int tuya_spi_control     (tuya_spi_t *spi, uint8_t cmd, void *arg);
/**
 * @brief spi control
 * 
 * @param[in] spi refer to tuya_spi_t
 * @param[in] cmd control command
 * @param[in] arg command argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_spi_deinit

int tuya_spi_deinit    (tuya_spi_t *spi);
/**
 * @brief spi deinit
 * 
 * @param[in] spi refer to tuya_spi_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_timer_init

int tuya_timer_init    (tuya_timer_t *timer);
/**
 * @brief timer init
 * 
 * @param[in] timer refer to tuya_timer_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_timer_start

int tuya_timer_start    (tuya_timer_t *timer, uint32_t us);
/**
 * @brief timer start
 * 
 * @param[in] timer refer to tuya_timer_t
 * @param[in] us when to start
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_timer_stop

int tuya_timer_stop    (tuya_timer_t *timer);
/**
 * @brief timer stop
 * 
 * @param[in] timer refer to tuya_timer_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_timer_control

int tuya_timer_control   (tuya_timer_t  *timer, uint8_t cmd, void *arg);
/**
 * @brief timer control
 * 
 * @param[in] timer refer to tuya_timer_t
 * @param[in] cmd control command
 * @param[in] arg command argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_timer_deinit

int tuya_timer_deinit    (tuya_timer_t *timer);
/**
 * @brief timer deinit
 * 
 * @param[in] timer refer to tuya_timer_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_uart_init

int tuya_uart_init    (tuya_uart_t *uart);
/**
 * @brief uart init
 * 
 * @param[in] uart refer to tuya_uart_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_uart_read

int tuya_uart_read    (tuya_uart_t *uart, void *data, uint16_t len);
/**
 * @brief uart read
 * 
 * @param[in] uart refer to tuya_uart_t
 * @param[out] data read buf
 * @param[in] len read length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_uart_write

int tuya_uart_write    (tuya_uart_t *uart, void *data, uint16_t len);
/**
 * @brief uart write
 * 
 * @param[in] uart refer to tuya_uart_t
 * @param[in] data write buf
 * @param[in] len write length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_uart_control

int tuya_uart_control  (tuya_uart_t *uart, uint8_t cmd, void *arg);
/**
 * @brief uart control
 * 
 * @param[in] uart refer to tuya_uart_t
 * @param[in] cmd control command
 * @param[in] arg command argument
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable tuya_uart_deinit

int tuya_uart_deinit   (tuya_uart_t *uart);
/**
 * @brief uart deinit
 * 
 * @param[in] uart refer to tuya_uart_t
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable TUYA_IOT_API_PRE_HANDLE_CBS_S

TUYA_IOT_API_PRE_HANDLE_CBS_S *tuya_iot_api_pre_handle_cb_get();
/**
 * @brief tuya_iot_api_pre_handle_cb_get 
 *
 * @return handler of callbacks
 */

Variable DP_DESC_IF_S

DP_DESC_IF_S *tuya_iot_get_dp_desc(IN CONST CHAR_T *dev_id,IN CONST BYTE_T dpid);
/**
 * @brief tuya_iot_get_dp_desc 
 * @desc get dp info of a sub-device and a dp id
 *
 * @param[in] dev_id: sub-device id
 * @param[in] dpid: dp id
 *
 * @return (DP_DESC_IF_S *): success  NULL: fail
 */

Variable DP_PROP_VALUE_U

DP_PROP_VALUE_U *tuya_iot_get_dp_prop_value(IN CONST CHAR_T *dev_id,IN CONST BYTE_T dpid);
/**
 * @brief tuya_iot_get_dp_prop_value 
 * @desc get dp value of a sub-device and a dp id
 *
 * @param[in] dev_id: sub-device id
 * @param[in] dpid: dp id
 *
 * @return (DP_PROP_VALUE_U *): success  NULL: fail
 */

Variable TUYA_BT_CONN_STAT

TUYA_BT_CONN_STAT tuya_bt_get_connect_status(VOID);
/**
 * @brief Get connection status of bluetooth
 *
 * @param VOID
 *
 * @note This API is used for getting the connection status of bluetooth
 *
 * @return connection status
 */

Variable GW_DESC_IF_S

GW_DESC_IF_S *get_gw_dev_if(VOID);
/**
 * @brief Get gateway description
 * 
 * @return Gateway description, see GW_DESC_IF_S
 */

Variable DP_CNTL_S

DP_CNTL_S *get_dev_dp_cntl(IN CHAR_T *id,IN CONST BYTE_T dpid);
/**
 * @brief Get DP cntl
 * 
 * @param[in] id Device id
 * @param[in] dpid DP id
 * 
 * @return DP cntl, see DP_CNTL_S
 */

Variable GW_CNTL_S

GW_CNTL_S *get_gw_cntl(VOID);
/**
 * @brief Get gateway cntl
 * 
 * @return Gateway cntl, see GW_CNTL_S
 */

Variable GW_STRIDE_UPDATE_S

GW_STRIDE_UPDATE_S* gw_get_new_pid_key(VOID);
/**
 * @brief Get stride info
 *
 * @return NULL on faile, others see GW_STRIDE_UPDATE_S
 */

Variable DP_REPT_FLOW_CTRL_UNIT

DP_REPT_FLOW_CTRL_UNIT* get_all_dp_flow_ctrl_rule(VOID);
/**
 * @brief Get DP flow control rules
 * 
 * @return See DP_REPT_FLOW_CTRL_UNIT, NULL on error
 */

Variable TUYA_COUNTRY_CODE_E

TUYA_COUNTRY_CODE_E tuya_wifi_get_country_code(VOID_T);
/**
 * @brief Get Wi-Fi country code
 * 
 * @return Country code, see TUYA_COUNTRY_CODE_E
 */

Variable DP_CNTL_S

DP_CNTL_S * sf_dp_data_get(IN CHAR_T *id, IN CONST CHAR_T dp_id);
/**
 * @brief Get dp control information
 *
 * @param[in] id: device id
 * @param[in] dp_id: dp id
 *
 * @note This API is used for getting dp control information by device id and dp id.
 *
 * @return the dp control information
 */

Variable __ACTION_EXT

__ACTION_EXT \
OPERATE_RET actions_parse(IN ty_cJSON *root,OUT ACTION_SET_S **act_set);
/***********************************************************
*  Function: actions_parse
*  Input: root
*  Output: cond_set 
*  Return: OPERATE_RET
***********************************************************/

Variable __ACTION_EXT

__ACTION_EXT \
VOID free_action_set(INOUT ACTION_SET_S *action_set);
/***********************************************************
*  Function: free_action_set
*  Input: action_set
*  Output: action_set 
*  Return: OPERATE_RET
***********************************************************/

Variable __ACTION_EXT

__ACTION_EXT \
VOID actions_dump_print(ACTION_SET_S *p_act_set);


      

Variable __ACTION_EXT

__ACTION_EXT \
OPERATE_RET actions_check_gw_id(IN CONST ty_cJSON *root, IN ACTION_CHECK_GW_ID_FUNC check_func);


      

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET scene_linkage_module_init(VOID);
/***********************************************************
*  Function: scene_linkage_module_init
*  Input: none
*  Output: none
*  Return: OPERATE_RET
*  Note:
***********************************************************/

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
VOID scene_linkage_module_uninit(VOID);
/***********************************************************
*  Function: scene_linkage_module_uninit
*  Input: none
*  Output: none
*  Return: none
*  Note:
***********************************************************/

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
VOID scene_linkage_update_from_server(LINKAGE_RULE_TYPE_T linkage_type, INT_T delaymS);


      

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
VOID scene_linkage_scene_exe(CHAR_T *sceneId);


      

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET scene_linkage_scene_exe_by_name(const CHAR_T *scene_name);
//否则返回不存在 OPRT_NOT_FOUND

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET dp_condition_detect(IN CONST CHAR_T *id,IN CONST CHAR_T *dp_cmd, IN CONST CHAR_T *gw_id, IN LINKAGE_RULE_TYPE_T rule_type);
// dp_cmd:{"cid":"xxxxxx",dps:{"1":2,"2":"111"}} or {"devid":"xxxxxx",dps:{"1":2,"2":"111"}}

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET scene_linkage_reg_lan_action(IN LAN_ACTION_SET_EXECUTE func);


      

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET scene_linkage_reg_lan_toggle_action(IN LAN_TOGGLE_ACTION_EXECUTE func);


      

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET scene_linkage_reg_lan_scene_action(LAN_SCENE_EXECUTE func);


      

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET scene_linkage_reg_lan_local_scene_action(LAN_LOCAL_SCENE_EXECUTE func);


      

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET scene_linkage_reg_lan_dpstep_action(IN LAN_DPSTEP_ACTION_EXECUTE func);


      

Variable __SCENE_LINKAGE_EXT

__SCENE_LINKAGE_EXT \
OPERATE_RET scene_linkage_reg_lan_group_action(IN LAN_GROUP_ACTION_EXECUTE func);


      

Variable __SCENE_LINKAGE_ENGR_EXT

__SCENE_LINKAGE_ENGR_EXT \
OPERATE_RET engr_scene_linkage_module_init(VOID);
/***********************************************************
*  Function: engr_scene_linkage_module_init
*  Input: none
*  Output: none
*  Return: OPERATE_RET
*  Note:
***********************************************************/

Variable __SCENE_LINKAGE_ENGR_EXT

__SCENE_LINKAGE_ENGR_EXT \
VOID engr_scene_linkage_module_uninit(VOID);
/***********************************************************
*  Function: scene_linkage_module_uninit
*  Input: none
*  Output: none
*  Return: none
*  Note:
***********************************************************/

Variable __SCENE_LINKAGE_ENGR_EXT

__SCENE_LINKAGE_ENGR_EXT \
OPERATE_RET engr_dp_condition_detect(IN CONST CHAR_T *id,IN CONST CHAR_T *dp_cmd, IN CONST CHAR_T *gw_id, IN LINKAGE_RULE_TYPE_T rule_type);
// dp_cmd:{"cid":"xxxxxx",dps:{"1":2,"2":"111"}} or {"devid":"xxxxxx",dps:{"1":2,"2":"111"}}

Variable __SCENE_LINKAGE_ENGR_EXT

__SCENE_LINKAGE_ENGR_EXT \
OPERATE_RET engr_scene_linkage_module_reinit(VOID);


      

Variable __SCENE_LINKAGE_ENGR_EXT

__SCENE_LINKAGE_ENGR_EXT \
VOID engr_reset_scene_info_to_disk(VOID);


      

Variable __SCENE_LINKAGE_ENGR_EXT

__SCENE_LINKAGE_ENGR_EXT \
BOOL_T engr_check_modify_time_changed(INT_T input_last_mod_time);


      

Variable __SCENE_LINKAGE_ENGR_EXT

__SCENE_LINKAGE_ENGR_EXT \
VOID engr_load_scene_info_from_disk(VOID);


      

Variable __SCENE_LINKAGE_ENGR_EXT

__SCENE_LINKAGE_ENGR_EXT \
OPERATE_RET engr_save_scene_link(INT_T total_cnt, INT_T sl_last_mod_time, ty_cJSON *rules);


      

Variable ptrWifiNetcfgFrameSniffer_t

ptrWifiNetcfgFrameSniffer_t getWifiNetcfgFrameSniffer();
/*获取wifi_netcfg_frame_sniffer的实例*/

Variable ptrWifiNetcfgFrameTransporter_t

ptrWifiNetcfgFrameTransporter_t getWifiNetcfgFrameTransporter();
/*
	获取或创建wifi_netcfg_frame_transporter的实例,线程安全
*/

Variable WLAN_MANAGEMENT_S

WLAN_MANAGEMENT_S *pegasus_find_oui(uint8_t *buf, int buf_len, uint8_t *oui);


      

Variable message_t

message_t * msg_init(UINT_T max_items);
/**
 * @brief create a new msg
 * 
 * @param[in] max_items item
 *
 * @return refer to message_t
 */

Variable tlv_t

tlv_t * msg_append(message_t *msg, tlv_type_t type, UINT16_T id, VOID *value, UINT16_T length);
/**
 * @brief add itme to msg
 * 
 * @param[in] msg refer to message_t
 * @param[in] type refer to tlv_type_t
 * @param[in] id id
 * @param[in] value value
 * @param[in] length length
 *
 * @return refer to tlv_t
 */

Variable message_t

message_t * msg_unpack(UINT8_T *packed, UINT_T size);
/**
 * @brief unpack stream to message
 * 
 * @param[in] packed stream
 * @param[in] size stream size
 *
 * @return refer to message_t
 */

Variable uint16_t

uint16_t port;


      

Variable return

return 0;


      

Variable dst

dst->addr.sin = src->addr.sin;


      

Variable coap_async_state_t

coap_async_state_t *
coap_register_async(coap_context_t *context,
                   coap_session_t *session,
                   coap_pdu_t *request,
                   unsigned char flags,
                   void *data);
/**
 * Allocates a new coap_async_state_t object and fills its fields according to
 * the given @p request. The @p flags are used to control generation of empty
 * ACK responses to stop retransmissions and to release registered @p data when
 * the resource is deleted by coap_free_async(). This function returns a pointer
 * to the registered coap_async_t object or @c NULL on error. Note that this
 * function will return @c NULL in case that an object with the same identifier
 * is already registered.
 *
 * @param context  The context to use.
 * @param session  The session that is used for asynchronous transmissions.
 * @param request  The request that is handled asynchronously.
 * @param flags    Flags to control state management.
 * @param data     Opaque application data to register. Note that the
 *                 storage occupied by @p data is released on destruction
 *                 only if flag COAP_ASYNC_RELEASE_DATA is set.
 *
 * @return         A pointer to the registered coap_async_state_t object or @c
 *                 NULL in case of an error.
 */

Variable coap_async_state_t

coap_async_state_t *coap_find_async(coap_context_t *context, coap_session_t *session, coap_tid_t id);
/**
 * Retrieves the object identified by @p id from the list of asynchronous
 * transactions that are registered with @p context. This function returns a
 * pointer to that object or @c NULL if not found.
 *
 * @param context The context where the asynchronous objects are registered
 *                with.
 * @param session  The session that is used for asynchronous transmissions.
 * @param id      The id of the object to retrieve.
 *
 * @return        A pointer to the object identified by @p id or @c NULL if
 *                not found.
 */

Variable coap_resource_t

struct coap_resource_t;


      

Variable coap_session_t

struct coap_session_t;


      

Variable coap_log_t

coap_log_t coap_get_log_level(void);
/**
 * Get the current logging level.
 *
 * @return One of the LOG_* values.
 */

Variable char

char *coap_string_tls_version(char *buffer, size_t bufsize);
/**
 * Build a string containing the current (D)TLS library linked with and
 * built for version.
 *
 * @param buffer The buffer to put the string into.
 * @param bufsize The size of the buffer to put the string into.
 *
 * @return A pointer to the provided buffer.
 */

Variable coap_address_t

struct coap_address_t;


      

Variable coap_tls_version_t

coap_tls_version_t *coap_get_tls_library_version(void);
/**
 * Determine the type and version of the underlying (D)TLS library.
 *
 * @return The version and type of library libcoap was compiled against.
 */

Variable coap_dtls_pki_t

struct coap_dtls_pki_t;


      

Variable coap_context_t

struct coap_context_t;


      

Variable coap_session_t

struct coap_session_t;


      

Variable COAP_DEPRECATED

COAP_DEPRECATED
void coap_set_event_handler(struct coap_context_t *context,
                           coap_event_handler_t hnd);
/**
 * Registers the function @p hnd as callback for events from the given
 * CoAP context @p context. Any event handler that has previously been
 * registered with @p context will be overwritten by this operation.
 *
 * @deprecated Use coap_register_event_handler() instead.
 *
 * @param context The CoAP context to register the event handler with.
 * @param hnd     The event handler to be registered.
 */

Variable COAP_DEPRECATED

COAP_DEPRECATED
void coap_clear_event_handler(struct coap_context_t *context);
/**
 * Clears the event handler registered with @p context.
 *
 * @deprecated Use coap_register_event_handler() instead with NULL for hnd.
 *
 * @param context The CoAP context whose event handler is to be removed.
 */

Variable

struct coap_packet_t;


      

Variable coap_session_t

struct coap_session_t;


      

Variable coap_pdu_t

struct coap_pdu_t;


      

Variable coap_endpoint_t

struct coap_endpoint_t *coap_malloc_endpoint( void );


      

Variable pbuf

struct pbuf *coap_packet_extract_pbuf(struct coap_packet_t *packet);
/**
 * Get the pbuf of a packet. The caller takes over responsibility for freeing
 * the pbuf.
 */

Variable coap_queue_t

struct coap_queue_t;


      

Variable coap_queue_t

coap_queue_t *coap_new_node(void);
/**
 * Creates a new node suitable for adding to the CoAP sendqueue.
 *
 * @return New node entry, or @c NULL if failure.
 */

Variable coap_resource_t

struct coap_resource_t;


      

Variable coap_context_t

struct coap_context_t;


      

Variable coap_async_state_t

struct coap_async_state_t;


      

Variable coap_queue_t

coap_queue_t *coap_peek_next( coap_context_t *context );
/**
 * Returns the next pdu to send without removing from sendqeue.
 */

Variable coap_queue_t

coap_queue_t *coap_pop_next( coap_context_t *context );
/**
 * Returns the next pdu to send and removes it from the sendqeue.
 */

Variable coap_context_t

coap_context_t *coap_new_context(const coap_address_t *listen_addr);
/**
 * Creates a new coap_context_t object that will hold the CoAP stack status.
 */

Variable coap_pdu_t

coap_pdu_t *coap_new_error_response(coap_pdu_t *request,
                                   unsigned char code,
                                   coap_opt_filter_t opts);
/**
 * Creates a new ACK PDU with specified error @p code. The options specified by
 * the filter expression @p opts will be copied from the original request
 * contained in @p request. Unless @c SHORT_ERROR_RESPONSE was defined at build
 * time, the textual reason phrase for @p code will be added as payload, with
 * Content-Type @c 0.
 * This function returns a pointer to the new response message, or @c NULL on
 * error. The storage allocated for the new message must be relased with
 * coap_free().
 *
 * @param request Specification of the received (confirmable) request.
 * @param code    The error code to set.
 * @param opts    An option filter that specifies which options to copy from
 *                the original request in @p node.
 *
 * @return        A pointer to the new message or @c NULL on error.
 */

Variable coap_queue_t

coap_queue_t *coap_find_transaction(coap_queue_t *queue, coap_session_t *session, coap_tid_t id);
/**
 * Retrieves transaction from the queue.
 *
 * @param queue The transaction queue to be searched.
 * @param session The session to find.
 * @param id    The transaction id to find.
 *
 * @return      A pointer to the transaction object or @c NULL if not found.
 */

Variable coap_pdu_t

coap_pdu_t *coap_wellknown_response(coap_context_t *context,
                                   coap_session_t *session,
                                   coap_pdu_t *request);
/**
 * Creates a new response for given @p request with the contents of @c
 * .well-known/core. The result is NULL on error or a newly allocated PDU that
 * must be either sent with coap_sent() or released by coap_delete_pdu().
 *
 * @param context The current coap context to use.
 * @param session The CoAP session.
 * @param request The request for @c .well-known/core .
 *
 * @return        A new 2.05 response for @c .well-known/core or NULL on error.
 */

Variable coap_endpoint_t

struct coap_endpoint_t;


      

Variable coap_context_t

struct coap_context_t;


      

Variable coap_queue_t

struct coap_queue_t;


      

Variable coap_session_t

coap_session_t *coap_session_reference(coap_session_t *session);
/**
* Increment reference counter on a session.
*
* @param session The CoAP session.
* @return same as session
*/

Variable coap_session_t

coap_session_t *coap_new_client_session(
 struct coap_context_t *ctx,
 const coap_address_t *local_if,
 const coap_address_t *server,
 coap_proto_t proto
);
/**
* Creates a new client session to the designated server.
* @param ctx The CoAP context.
* @param local_if Address of local interface. It is recommended to use NULL to let the operating system choose a suitable local interface. If an address is specified, the port number should be zero, which means that a free port is automatically selected.
* @param server The server's address. If the port number is zero, the default port for the protocol will be used.
* @param proto Protocol.
*
* @return A new CoAP session or NULL if failed. Call coap_session_release to free.
*/

Variable coap_session_t

coap_session_t *coap_new_client_session_psk(
 struct coap_context_t *ctx,
 const coap_address_t *local_if,
 const coap_address_t *server,
 coap_proto_t proto,
 const char *identity,
 const uint8_t *key,
 unsigned key_len
);
/**
* Creates a new client session to the designated server with PSK credentials
* @param ctx The CoAP context.
* @param local_if Address of local interface. It is recommended to use NULL to let the operating system choose a suitable local interface. If an address is specified, the port number should be zero, which means that a free port is automatically selected.
* @param server The server's address. If the port number is zero, the default port for the protocol will be used.
* @param proto Protocol.
* @param identity PSK client identity
* @param key PSK shared key
* @param key_len PSK shared key length
*
* @return A new CoAP session or NULL if failed. Call coap_session_release to free.
*/

Variable coap_dtls_pki_t

struct coap_dtls_pki_t;


      

Variable coap_session_t

coap_session_t *coap_new_client_session_pki(
 struct coap_context_t *ctx,
 const coap_address_t *local_if,
 const coap_address_t *server,
 coap_proto_t proto,
 struct coap_dtls_pki_t *setup_data
);
/**
* Creates a new client session to the designated server with PKI credentials
* @param ctx The CoAP context.
* @param local_if Address of local interface. It is recommended to use NULL to
*                 let the operating system choose a suitable local interface.
*                 If an address is specified, the port number should be zero,
*                 which means that a free port is automatically selected.
* @param server The server's address. If the port number is zero, the default
*               port for the protocol will be used.
* @param proto CoAP Protocol.
* @param setup_data PKI parameters.
*
* @return A new CoAP session or NULL if failed. Call coap_session_release()
*         to free.
*/

Variable coap_session_t

coap_session_t *coap_new_server_session(
 struct coap_context_t *ctx,
 struct coap_endpoint_t *ep
);
/**
* Creates a new server session for the specified endpoint.
* @param ctx The CoAP context.
* @param ep An endpoint where an incoming connection request is pending.
*
* @return A new CoAP session or NULL if failed. Call coap_session_release to free.
*/

Variable coap_endpoint_t

coap_endpoint_t *coap_new_endpoint(struct coap_context_t *context, const coap_address_t *listen_addr, coap_proto_t proto);


      

Variable coap_session_t

coap_session_t *coap_endpoint_get_session(coap_endpoint_t *endpoint,
 const struct coap_packet_t *packet, coap_tick_t now);
/**
* Lookup the server session for the packet received on an endpoint, or create
* a new one.
*
* @param endpoint Active endpoint the packet was received on.
* @param packet Received packet.
* @param now The current time in ticks.
* @return The CoAP session.
*/

Variable coap_session_t

coap_session_t *coap_endpoint_new_dtls_session(coap_endpoint_t *endpoint,
 const struct coap_packet_t *packet, coap_tick_t now);
/**
 * Create a new DTLS session for the @p endpoint.
 *
 * @ingroup dtls_internal
 *
 * @param endpoint  Endpoint to add DTLS session to
 * @param packet    Received packet information to base session on.
 * @param now       The current time in ticks.
 *
 * @return Created CoAP session or @c NULL if error.
 */

Variable coap_session_t

coap_session_t *coap_session_get_by_peer(struct coap_context_t *ctx,
 const struct coap_address_t *remote_addr, int ifindex);


      

Variable coap_fixed_point_t

coap_fixed_point_t coap_session_get_ack_timeout(coap_session_t *session);
/**
* Get the CoAP initial ack response timeout before the next re-transmit
*
* Number of seconds when to expect an ACK or a response to an
* outstanding CON message.
*
* @param session The CoAP session.
*
* @return Current ack response timeout value
*/

Variable coap_fixed_point_t

coap_fixed_point_t coap_session_get_ack_random_factor(coap_session_t *session);
/**
* Get the CoAP ack randomize factor
*
* A factor that is used to randomize the wait time before a message
* is retransmitted to prevent synchronization effects.
*
* @param session The CoAP session.
*
* @return Current ack randomize value
*/

Variable uint64_t

uint64_t coap_ticks_to_rt_us(coap_tick_t t);
/**
* Helper function that converts coap ticks to POSIX wallclock time in us.
*
* @param t Internal system ticks.
*
* @return  The number of seconds that has passed since a specific reference
*          point (seconds since epoch on POSIX).
*/

Variable coap_opt_iterator_t

coap_opt_iterator_t *coap_option_iterator_init(const coap_pdu_t *pdu,
                                              coap_opt_iterator_t *oi,
                                              const coap_opt_filter_t filter);
/**
 * Initializes the given option iterator @p oi to point to the beginning of the
 * @p pdu's option list. This function returns @p oi on success, @c NULL
 * otherwise (i.e. when no options exist). Note that a length check on the
 * option list must be performed before coap_option_iterator_init() is called.
 *
 * @param pdu    The PDU the options of which should be walked through.
 * @param oi     An iterator object that will be initilized.
 * @param filter An optional option type filter.
 *               With @p type != @c COAP_OPT_ALL, coap_option_next()
 *               will return only options matching this bitmask.
 *               Fence-post options @c 14, @c 28, @c 42, ... are always
 *               skipped.
 *
 * @return       The iterator object @p oi on success, @c NULL otherwise.
 */

Variable coap_opt_t

coap_opt_t *coap_option_next(coap_opt_iterator_t *oi);
/**
 * Updates the iterator @p oi to point to the next option. This function returns
 * a pointer to that option or @c NULL if no more options exist. The contents of
 * @p oi will be updated. In particular, @c oi->n specifies the current option's
 * ordinal number (counted from @c 1), @c oi->type is the option's type code,
 * and @c oi->option points to the beginning of the current option itself. When
 * advanced past the last option, @c oi->option will be @c NULL.
 *
 * Note that options are skipped whose corresponding bits in the filter
 * specified with coap_option_iterator_init() are @c 0. Options with type codes
 * that do not fit in this filter hence will always be returned.
 *
 * @param oi The option iterator to update.
 *
 * @return   The next option or @c NULL if no more options exist.
 */

Variable coap_opt_t

coap_opt_t *coap_check_option(coap_pdu_t *pdu,
                             uint16_t type,
                             coap_opt_iterator_t *oi);
/**
 * Retrieves the first option of type @p type from @p pdu. @p oi must point to a
 * coap_opt_iterator_t object that will be initialized by this function to
 * filter only options with code @p type. This function returns the first option
 * with this type, or @c NULL if not found.
 *
 * @param pdu  The PDU to parse for options.
 * @param type The option type code to search for.
 * @param oi   An iterator object to use.
 *
 * @return     A pointer to the first option of type @p type, or @c NULL if
 *             not found.
 */

Variable uint16_t

uint16_t coap_opt_delta(const coap_opt_t *opt);
/**
 * Decodes the delta value of the next option. This function returns the number
 * of bytes read or @c 0 on error. The caller of this function must ensure that
 * it does not read over the boundaries of @p opt (e.g. by calling
 * coap_opt_check_delta().
 *
 * @param opt The option to examine.
 *
 * @return    The number of bytes read or @c 0 on error.
 */

Variable uint16_t

uint16_t coap_opt_length(const coap_opt_t *opt);
/**
 * Returns the length of the given option. @p opt must point to an option jump
 * or the beginning of the option. This function returns @c 0 when @p opt is not
 * an option or the actual length of @p opt (which can be @c 0 as well).
 *
 * @note {The rationale for using @c 0 in case of an error is that in most
 * contexts, the result of this function is used to skip the next
 * coap_opt_length() bytes.}
 *
 * @param opt  The option whose length should be returned.
 *
 * @return     The option's length or @c 0 when undefined.
 */

Variable coap_optlist_t

coap_optlist_t *coap_new_optlist(uint16_t number,
                                size_t length,
                                const uint8_t *data);
/**
 * Create a new optlist entry.
 *
 * @param number    The option number (COAP_OPTION_*)
 * @param length    The option length
 * @param data      The option value data
 *
 * @return          A pointer to the new optlist entry, or @c NULL if error
 */

Variable coap_session_t

struct coap_session_t;


      

Variable COAP_DEPRECATED

COAP_DEPRECATED typedef struct {
 uint16_t key;          /* the option key (no delta coding) */
 unsigned int length;
} coap_option;
/**
 * @deprecated Use coap_optlist_t instead.
 *
 * Structures for more convenient handling of options. (To be used with ordered
 * coap_list_t.) The option's data will be added to the end of the coap_option
 * structure (see macro COAP_OPTION_DATA).
 */

Variable coap_pdu_t

coap_pdu_t * coap_pdu_from_pbuf(struct pbuf *pbuf);
/**
 * Creates a CoAP PDU from an lwIP @p pbuf, whose reference is passed on to this
 * function.
 *
 * The pbuf is checked for being contiguous, and for having only one reference.
 * The reference is stored in the PDU and will be freed when the PDU is freed.
 *
 * (For now, these are fatal errors; in future, a new pbuf might be allocated,
 * the data copied and the passed pbuf freed).
 *
 * This behaves like coap_pdu_init(0, 0, 0, pbuf->tot_len), and afterwards
 * copying the contents of the pbuf to the pdu.
 *
 * @return A pointer to the new PDU object or @c NULL on error.
 */

Variable coap_pdu_t

coap_pdu_t *
coap_pdu_init(uint8_t type, uint8_t code, uint16_t tid, size_t size);
/**
 * Creates a new CoAP PDU with at least enough storage space for the given
 * @p size maximum message size. The function returns a pointer to the
 * node coap_pdu_t object on success, or @c NULL on error. The storage allocated
 * for the result must be released with coap_delete_pdu() if coap_send() is not
 * called.
 *
 * @param type The type of the PDU (one of COAP_MESSAGE_CON, COAP_MESSAGE_NON,
 *             COAP_MESSAGE_ACK, COAP_MESSAGE_RST).
 * @param code The message code.
 * @param tid  The transcation id to set or 0 if unknown / not applicable.
 * @param size The maximum allowed number of byte for the message.
 * @return     A pointer to the new PDU object or @c NULL on error.
 */

Variable coap_pdu_t

coap_pdu_t *coap_new_pdu(const struct coap_session_t *session);
/**
 * Creates a new CoAP PDU.
 */

Variable return

return 1;


      

Variable return

return 1;


      

Variable errno_t

errno_t __cdecl rand_s( _Out_ unsigned int* _RandomValue );


      

Variable len

len -= i;


      

Variable return

return 1;


      

Variable coap_resource_t

coap_resource_t *coap_resource_init(coap_str_const_t *uri_path,
                                   int flags);
/**
 * Creates a new resource object and initializes the link field to the string
 * @p uri_path. This function returns the new coap_resource_t object.
 *
 * If the string is going to be freed off by coap_delete_resource() when
 * COAP_RESOURCE_FLAGS_RELEASE_URI is set in @p flags, then either the 's'
 * variable of coap_str_const_t has to point to constant text, or point to data
 * within the allocated coap_str_const_t parameter.
 *
 * @param uri_path The string URI path of the new resource.
 * @param flags    Flags for memory management (in particular release of
 *                 memory). Possible values:@n
 *
 *                 COAP_RESOURCE_FLAGS_RELEASE_URI
 *                  If this flag is set, the URI passed to
 *                  coap_resource_init() is free'd by
 *                  coap_delete_resource()@n
 *
 *                 COAP_RESOURCE_FLAGS_NOTIFY_CON
 *                  If this flag is set, coap-observe notifications
 *                  will be sent confirmable by default.@n
 *
 *                 COAP_RESOURCE_FLAGS_NOTIFY_NON (default)
 *                  If this flag is set, coap-observe notifications
 *                  will be sent non-confirmable by default.@n
 *
 *                  If flags is set to 0 then the
 *                  COAP_RESOURCE_FLAGS_NOTIFY_NON is considered.
 *
 * @return         A pointer to the new object or @c NULL on error.
 */

Variable coap_resource_t

coap_resource_t *coap_resource_unknown_init(coap_method_handler_t put_handler);
/**
 * Creates a new resource object for the unknown resource handler with support
 * for PUT.
 *
 * In the same way that additional handlers can be added to the resource
 * created by coap_resource_init() by using coap_register_handler(), POST,
 * GET, DELETE etc. handlers can be added to this resource. It is the
 * responsibility of the application to manage the unknown resources by either
 * creating new resources with coap_resource_init() (which should have a
 * DELETE handler specified for the resource removal) or by maintaining an
 * active resource list.
 *
 * Note: There can only be one unknown resource handler per context - attaching
 *       a new one overrides the previous definition.
 *
 * Note: It is not possible to observe the unknown resource with a GET request
 *       - a separate resource needs to be reated by the PUT (or POST) handler,
 *       and make that resource observable.
 *
 * This function returns the new coap_resource_t object.
 *
 * @param put_handler The PUT handler to register with @p resource for
 *                    unknown Uri-Path.
 *
 * @return       A pointer to the new object or @c NULL on error.
 */

Variable coap_attr_t

coap_attr_t *coap_add_attr(coap_resource_t *resource,
                          coap_str_const_t *name,
                          coap_str_const_t *value,
                          int flags);
/**
 * Registers a new attribute with the given @p resource. As the
 * attribute's coap_str_const_ fields will point to @p name and @p value the
 * caller must ensure that these pointers are valid during the
 * attribute's lifetime.

 * If the @p name and/or @p value string is going to be freed off at attribute
 * removal time by the setting of COAP_ATTR_FLAGS_RELEASE_NAME or
 * COAP_ATTR_FLAGS_RELEASE_VALUE in @p flags, then either the 's'
 * variable of coap_str_const_t has to point to constant text, or point to data
 * within the allocated coap_str_const_t parameter.
 *
 * @param resource The resource to register the attribute with.
 * @param name     The attribute's name as a string.
 * @param value    The attribute's value as a string or @c NULL if none.
 * @param flags    Flags for memory management (in particular release of
 *                 memory). Possible values:@n
 *
 *                 COAP_ATTR_FLAGS_RELEASE_NAME
 *                  If this flag is set, the name passed to
 *                  coap_add_attr_release() is free'd
 *                  when the attribute is deleted@n
 *
 *                 COAP_ATTR_FLAGS_RELEASE_VALUE
 *                  If this flag is set, the value passed to
 *                  coap_add_attr_release() is free'd
 *                  when the attribute is deleted@n
 *
 * @return         A pointer to the new attribute or @c NULL on error.
 */

Variable coap_attr_t

coap_attr_t *coap_find_attr(coap_resource_t *resource,
                           coap_str_const_t *name);
/**
 * Returns @p resource's coap_attr_t object with given @p name if found, @c NULL
 * otherwise.
 *
 * @param resource The resource to search for attribute @p name.
 * @param name     Name of the requested attribute as a string.
 * @return         The first attribute with specified @p name or @c NULL if none
 *                 was found.
 */

Variable coap_resource_t

coap_resource_t *coap_get_resource_from_uri_path(coap_context_t *context,
                                               coap_str_const_t *uri_path);
/**
 * Returns the resource identified by the unique string @p uri_path. If no
 * resource was found, this function returns @c NULL.
 *
 * @param context  The context to look for this resource.
 * @param uri_path  The unique string uri of the resource.
 *
 * @return         A pointer to the resource or @c NULL if not found.
 */

Variable coap_subscription_t

coap_subscription_t *coap_add_observer(coap_resource_t *resource,
                                      coap_session_t *session,
                                      const coap_binary_t *token,
                                      coap_string_t *query,
                                      int has_block2,
                                      coap_block_t block2);
/**
 * Adds the specified peer as observer for @p resource. The subscription is
 * identified by the given @p token. This function returns the registered
 * subscription information if the @p observer has been added, or @c NULL on
 * error.
 *
 * @param resource        The observed resource.
 * @param session         The observer's session
 * @param token           The token that identifies this subscription.
 * @param query           The query string, if any. subscription will
                          take ownership of the string.
 * @param has_block2      If Option Block2 defined.
 * @param block2          Contents of Block2 if Block 2 defined.
 * @return                A pointer to the added/updated subscription
 *                        information or @c NULL on error.
 */

Variable coap_subscription_t

coap_subscription_t *coap_find_observer(coap_resource_t *resource,
                                       coap_session_t *session,
                                       const coap_binary_t *token);
/**
 * Returns a subscription object for given @p peer.
 *
 * @param resource The observed resource.
 * @param session  The observer's session
 * @param token    The token that identifies this subscription or @c NULL for
 *                 any token.
 * @return         A valid subscription if exists or @c NULL otherwise.
 */

Variable COAP_DEPRECATED

COAP_DEPRECATED int
coap_resource_set_dirty(coap_resource_t *r,
                       const coap_string_t *query);
/**
 * @deprecated use coap_resource_notify_observers() instead.
 */

Variable coap_string_t

coap_string_t *coap_new_string(size_t size);
/**
 * Returns a new string object with at least size+1 bytes storage allocated.
 * The string must be released using coap_delete_string().
 *
 * @param size The size to allocate for the binary string data.
 *
 * @return       A pointer to the new object or @c NULL on error.
 */

Variable coap_str_const_t

coap_str_const_t *coap_new_str_const(const uint8_t *data, size_t size);
/**
 * Returns a new const string object with at least size+1 bytes storage
 * allocated, and the provided data copied into the string object.
 * The string must be released using coap_delete_str_const().
 *
 * @param data The data to put in the new string object.
 * @param size The size to allocate for the binary string data.
 *
 * @return       A pointer to the new object or @c NULL on error.
 */

Variable coap_pdu_t

struct coap_pdu_t;


      

Variable coap_uri_t

coap_uri_t *coap_new_uri(const uint8_t *uri, unsigned int length);
/**
 * Creates a new coap_uri_t object from the specified URI. Returns the new
 * object or NULL on error. The memory allocated by the new coap_uri_t
 * must be released using coap_free().
 *
 * @param uri The URI path to copy.
 * @param length The length of uri.
 *
 * @return New URI object or NULL on error.
 */

Variable coap_uri_t

coap_uri_t *coap_clone_uri(const coap_uri_t *uri);
/**
 * Clones the specified coap_uri_t object. Thie function allocates sufficient
 * memory to hold the coap_uri_t structure and its contents. The object must
 * be released with coap_free(). */

Variable coap_string_t

coap_string_t *coap_get_query(const struct coap_pdu_t *request);
/**
 * Extract query string from request PDU according to escape rules in 6.5.8.
 * @param request Request PDU.
 * @return        Reconstructed and escaped query string part.
 */

Variable coap_string_t

coap_string_t *coap_get_uri_path(const struct coap_pdu_t *request);
/**
 * Extract uri_path string from request PDU
 * @param request Request PDU.
 * @return        Reconstructed and escaped uri path string part.
 */

Variable HTTP_URL_H_S

HTTP_URL_H_S *create_http_url_h(IN CONST USHORT_T buf_len, IN CONST USHORT_T param_cnt);
/**
 * @brief Create url of HTTP request
 * 
 * @param[in] buf_len max lenth of URL(include params)
 * @param[in] param_cnt max count of url params
 *
 * @return NULL on error. Pointer to HTTP_URL_H_S on success
 */

Variable S_HTTP_MANAGER

S_HTTP_MANAGER *get_http_manager_instance(VOID_T);
/**
 * @brief Retrieve instance of HTTP session manager
 * 
 * @note HTTP manager is singleton, multiple call to this API will return the same instance
 *
 * @return NULL on error. Instance on success, please refer to S_HTTP_MANAGER
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_aes_encrypt( mbedtls_aes_context *ctx,
                                            const unsigned char input[16],
                                            unsigned char output[16] );
/**
 * \brief           Deprecated internal AES block encryption function
 *                  without return value.
 *
 * \deprecated      Superseded by mbedtls_internal_aes_encrypt()
 *
 * \param ctx       The AES context to use for encryption.
 * \param input     Plaintext block.
 * \param output    Output (ciphertext) block.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
                                            const unsigned char input[16],
                                            unsigned char output[16] );
/**
 * \brief           Deprecated internal AES block decryption function
 *                  without return value.
 *
 * \deprecated      Superseded by mbedtls_internal_aes_decrypt()
 *
 * \param ctx       The AES context to use for decryption.
 * \param input     Ciphertext block.
 * \param output    Output (plaintext) block.
 */

Variable mbedtls_asn1_named_data

mbedtls_asn1_named_data *mbedtls_asn1_find_named_data( mbedtls_asn1_named_data *list,
                                      const char *oid, size_t len );
/**
 * \brief       Find a specific named_data entry in a sequence or list based on
 *              the OID.
 *
 * \param list  The list to seek through
 * \param oid   The OID to look for
 * \param len   Size of the OID
 *
 * \return      NULL if not found, or a pointer to the existing entry.
 */

Variable mbedtls_asn1_named_data

mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list,
                                       const char *oid, size_t oid_len,
                                       const unsigned char *val,
                                       size_t val_len );
/**
 * \brief           Create or find a specific named_data entry for writing in a
 *                  sequence or list based on the OID. If not already in there,
 *                  a new entry is added to the head of the list.
 *                  Warning: Destructive behaviour for the val data!
 *
 * \param list      The pointer to the location of the head of the list to seek
 *                  through (will be updated in case of a new entry).
 * \param oid       The OID to look for.
 * \param oid_len   The size of the OID.
 * \param val       The data to store (can be \c NULL if you want to fill
 *                  it by hand).
 * \param val_len   The minimum length of the data buffer needed.
 *
 * \return          A pointer to the new / existing entry on success.
 * \return          \c NULL if if there was a memory allocation error.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED int mbedtls_mpi_is_prime( const mbedtls_mpi *X,
                         int (*f_rng)(void *, unsigned char *, size_t),
                         void *p_rng );
/**
 * \brief          Perform a Miller-Rabin primality test with error
 *                 probability of 2-80.
 *
 * \deprecated     Superseded by mbedtls_mpi_is_prime_ext() which allows
 *                 specifying the number of Miller-Rabin rounds.
 *
 * \param X        The MPI to check for primality.
 *                 This must point to an initialized MPI.
 * \param f_rng    The RNG function to use. This must not be \c NULL.
 * \param p_rng    The RNG parameter to be passed to \p f_rng.
 *                 This may be \c NULL if \p f_rng doesn't use a
 *                 context parameter.
 *
 * \return         \c 0 if successful, i.e. \p X is probably prime.
 * \return         #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed.
 * \return         #MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if \p X is not prime.
 * \return         Another negative error code on other kinds of failure.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_ctr_drbg_update(
   mbedtls_ctr_drbg_context *ctx,
   const unsigned char *additional,
   size_t add_len );
/**
 * \brief              This function updates the state of the CTR_DRBG context.
 *
 * \deprecated         Superseded by mbedtls_ctr_drbg_update_ret()
 *                     in 2.16.0.
 *
 * \note               If \p add_len is greater than
 *                     #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT, only the first
 *                     #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT Bytes are used.
 *                     The remaining Bytes are silently discarded.
 *
 * \param ctx          The CTR_DRBG context.
 * \param additional   The data to update the state with.
 * \param add_len      Length of \p additional data.
 */

Variable char

unsigned char mbedtls_internal_ecp_grp_capable( const mbedtls_ecp_group *grp );
/**
 * \brief           Indicate if the Elliptic Curve Point module extension can
 *                  handle the group.
 *
 * \param grp       The pointer to the elliptic curve group that will be the
 *                  basis of the cryptographic computations.
 *
 * \return          Non-zero if successful.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_hmac_drbg_update(
   mbedtls_hmac_drbg_context *ctx,
   const unsigned char *additional, size_t add_len );
/**
 * \brief               HMAC_DRBG update state
 *
 * \deprecated          Superseded by mbedtls_hmac_drbg_update_ret()
 *                      in 2.16.0.
 *
 * \param ctx           HMAC_DRBG context
 * \param additional    Additional data to update state with, or NULL
 * \param add_len       Length of additional data, or 0
 *
 * \note                Additional data is optional, pass NULL and 0 as second
 *                      third argument if no additional data is being used.
 */

Variable char

unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info );
/**
 * \brief           This function extracts the message-digest size from the
 *                  message-digest information structure.
 *
 * \param md_info   The information structure of the message-digest algorithm
 *                  to use.
 *
 * \return          The size of the message-digest output in Bytes.
 */

Variable mbedtls_md_type_t

mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info );
/**
 * \brief           This function extracts the message-digest type from the
 *                  message-digest information structure.
 *
 * \param md_info   The information structure of the message-digest algorithm
 *                  to use.
 *
 * \return          The type of the message digest.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md2_starts( mbedtls_md2_context *ctx );
/**
 * \brief          MD2 context setup
 *
 * \deprecated     Superseded by mbedtls_md2_starts_ret() in 2.7.0
 *
 * \param ctx      context to be initialized
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md2_update( mbedtls_md2_context *ctx,
                                           const unsigned char *input,
                                           size_t ilen );
/**
 * \brief          MD2 process buffer
 *
 * \deprecated     Superseded by mbedtls_md2_update_ret() in 2.7.0
 *
 * \param ctx      MD2 context
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md2_finish( mbedtls_md2_context *ctx,
                                           unsigned char output[16] );
/**
 * \brief          MD2 final digest
 *
 * \deprecated     Superseded by mbedtls_md2_finish_ret() in 2.7.0
 *
 * \param ctx      MD2 context
 * \param output   MD2 checksum result
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md2_process( mbedtls_md2_context *ctx );
/**
 * \brief          MD2 process data block (internal use only)
 *
 * \deprecated     Superseded by mbedtls_internal_md2_process() in 2.7.0
 *
 * \param ctx      MD2 context
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input,
                                    size_t ilen,
                                    unsigned char output[16] );
/**
 * \brief          Output = MD2( input buffer )
 *
 * \deprecated     Superseded by mbedtls_md2_ret() in 2.7.0
 *
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 * \param output   MD2 checksum result
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md4_starts( mbedtls_md4_context *ctx );
/**
 * \brief          MD4 context setup
 *
 * \deprecated     Superseded by mbedtls_md4_starts_ret() in 2.7.0
 *
 * \param ctx      context to be initialized
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md4_update( mbedtls_md4_context *ctx,
                                           const unsigned char *input,
                                           size_t ilen );
/**
 * \brief          MD4 process buffer
 *
 * \deprecated     Superseded by mbedtls_md4_update_ret() in 2.7.0
 *
 * \param ctx      MD4 context
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md4_finish( mbedtls_md4_context *ctx,
                                           unsigned char output[16] );
/**
 * \brief          MD4 final digest
 *
 * \deprecated     Superseded by mbedtls_md4_finish_ret() in 2.7.0
 *
 * \param ctx      MD4 context
 * \param output   MD4 checksum result
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md4_process( mbedtls_md4_context *ctx,
                                            const unsigned char data[64] );
/**
 * \brief          MD4 process data block (internal use only)
 *
 * \deprecated     Superseded by mbedtls_internal_md4_process() in 2.7.0
 *
 * \param ctx      MD4 context
 * \param data     buffer holding one block of data
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md4( const unsigned char *input,
                                    size_t ilen,
                                    unsigned char output[16] );
/**
 * \brief          Output = MD4( input buffer )
 *
 * \deprecated     Superseded by mbedtls_md4_ret() in 2.7.0
 *
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 * \param output   MD4 checksum result
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md5_starts( mbedtls_md5_context *ctx );
/**
 * \brief          MD5 context setup
 *
 * \deprecated     Superseded by mbedtls_md5_starts_ret() in 2.7.0
 *
 * \param ctx      context to be initialized
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md5_update( mbedtls_md5_context *ctx,
                                           const unsigned char *input,
                                           size_t ilen );
/**
 * \brief          MD5 process buffer
 *
 * \deprecated     Superseded by mbedtls_md5_update_ret() in 2.7.0
 *
 * \param ctx      MD5 context
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md5_finish( mbedtls_md5_context *ctx,
                                           unsigned char output[16] );
/**
 * \brief          MD5 final digest
 *
 * \deprecated     Superseded by mbedtls_md5_finish_ret() in 2.7.0
 *
 * \param ctx      MD5 context
 * \param output   MD5 checksum result
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md5_process( mbedtls_md5_context *ctx,
                                            const unsigned char data[64] );
/**
 * \brief          MD5 process data block (internal use only)
 *
 * \deprecated     Superseded by mbedtls_internal_md5_process() in 2.7.0
 *
 * \param ctx      MD5 context
 * \param data     buffer holding one block of data
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input,
                                    size_t ilen,
                                    unsigned char output[16] );
/**
 * \brief          Output = MD5( input buffer )
 *
 * \deprecated     Superseded by mbedtls_md5_ret() in 2.7.0
 *
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 * \param output   MD5 checksum result
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Variable mbedtls_pk_type_t

mbedtls_pk_type_t mbedtls_pk_get_type( const mbedtls_pk_context *ctx );
/**
 * \brief           Get the key type
 *
 * \param ctx       The PK context to use. It must have been initialized.
 *
 * \return          Type on success.
 * \return          #MBEDTLS_PK_NONE for a context that has not been set up.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED typedef char const * mbedtls_deprecated_string_constant_t;
#define MBEDTLS_DEPRECATED_STRING_CONSTANT( VAL )      \
   ( (mbedtls_deprecated_string_constant_t) ( VAL ) )
MBEDTLS_DEPRECATED typedef int mbedtls_deprecated_numeric_constant_t;
#define MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( VAL )      \
   ( (mbedtls_deprecated_numeric_constant_t) ( VAL ) )
#undef MBEDTLS_DEPRECATED
#else /* MBEDTLS_DEPRECATED_WARNING */
#define MBEDTLS_DEPRECATED_STRING_CONSTANT( VAL ) VAL
#define MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( VAL ) VAL


      

Variable tm

struct tm *mbedtls_platform_gmtime_r( const mbedtls_time_t *tt,
                                     struct tm *tm_buf );
/**
 * \brief      Platform-specific implementation of gmtime_r()
 *
 *             The function is a thread-safe abstraction that behaves
 *             similarly to the gmtime_r() function from Unix/POSIX.
 *
 *             Mbed TLS will try to identify the underlying platform and
 *             make use of an appropriate underlying implementation (e.g.
 *             gmtime_r() for POSIX and gmtime_s() for Windows). If this is
 *             not possible, then gmtime() will be used. In this case, calls
 *             from the library to gmtime() will be guarded by the mutex
 *             mbedtls_threading_gmtime_mutex if MBEDTLS_THREADING_C is
 *             enabled. It is recommended that calls from outside the library
 *             are also guarded by this mutex.
 *
 *             If MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, then Mbed TLS will
 *             unconditionally use the alternative implementation for
 *             mbedtls_platform_gmtime_r() supplied by the user at compile time.
 *
 * \param tt     Pointer to an object containing time (in seconds) since the
 *               epoch to be converted
 * \param tm_buf Pointer to an object where the results will be stored
 *
 * \return      Pointer to an object of type struct tm on success, otherwise
 *              NULL
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_ripemd160_starts(
                                           mbedtls_ripemd160_context *ctx );
/**
 * \brief          RIPEMD-160 context setup
 *
 * \deprecated     Superseded by mbedtls_ripemd160_starts_ret() in 2.7.0
 *
 * \param ctx      context to be initialized
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_ripemd160_update(
                                               mbedtls_ripemd160_context *ctx,
                                               const unsigned char *input,
                                               size_t ilen );
/**
 * \brief          RIPEMD-160 process buffer
 *
 * \deprecated     Superseded by mbedtls_ripemd160_update_ret() in 2.7.0
 *
 * \param ctx      RIPEMD-160 context
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_ripemd160_finish(
                                               mbedtls_ripemd160_context *ctx,
                                               unsigned char output[20] );
/**
 * \brief          RIPEMD-160 final digest
 *
 * \deprecated     Superseded by mbedtls_ripemd160_finish_ret() in 2.7.0
 *
 * \param ctx      RIPEMD-160 context
 * \param output   RIPEMD-160 checksum result
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_ripemd160_process(
                                           mbedtls_ripemd160_context *ctx,
                                           const unsigned char data[64] );
/**
 * \brief          RIPEMD-160 process data block (internal use only)
 *
 * \deprecated     Superseded by mbedtls_internal_ripemd160_process() in 2.7.0
 *
 * \param ctx      RIPEMD-160 context
 * \param data     buffer holding one block of data
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_ripemd160( const unsigned char *input,
                                          size_t ilen,
                                          unsigned char output[20] );
/**
 * \brief          Output = RIPEMD-160( input buffer )
 *
 * \deprecated     Superseded by mbedtls_ripemd160_ret() in 2.7.0
 *
 * \param input    buffer holding the data
 * \param ilen     length of the input data
 * \param output   RIPEMD-160 checksum result
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha1_starts( mbedtls_sha1_context *ctx );
/**
 * \brief          This function starts a SHA-1 checksum calculation.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \deprecated     Superseded by mbedtls_sha1_starts_ret() in 2.7.0.
 *
 * \param ctx      The SHA-1 context to initialize. This must be initialized.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha1_update( mbedtls_sha1_context *ctx,
                                            const unsigned char *input,
                                            size_t ilen );
/**
 * \brief          This function feeds an input buffer into an ongoing SHA-1
 *                 checksum calculation.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \deprecated     Superseded by mbedtls_sha1_update_ret() in 2.7.0.
 *
 * \param ctx      The SHA-1 context. This must be initialized and
 *                 have a hash operation started.
 * \param input    The buffer holding the input data.
 *                 This must be a readable buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data \p input in Bytes.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha1_finish( mbedtls_sha1_context *ctx,
                                            unsigned char output[20] );
/**
 * \brief          This function finishes the SHA-1 operation, and writes
 *                 the result to the output buffer.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \deprecated     Superseded by mbedtls_sha1_finish_ret() in 2.7.0.
 *
 * \param ctx      The SHA-1 context. This must be initialized and
 *                 have a hash operation started.
 * \param output   The SHA-1 checksum result.
 *                 This must be a writable buffer of length \c 20 Bytes.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha1_process( mbedtls_sha1_context *ctx,
                                             const unsigned char data[64] );
/**
 * \brief          SHA-1 process data block (internal use only).
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \deprecated     Superseded by mbedtls_internal_sha1_process() in 2.7.0.
 *
 * \param ctx      The SHA-1 context. This must be initialized.
 * \param data     The data block being processed.
 *                 This must be a readable buffer of length \c 64 bytes.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha1( const unsigned char *input,
                                     size_t ilen,
                                     unsigned char output[20] );
/**
 * \brief          This function calculates the SHA-1 checksum of a buffer.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The SHA-1 result is calculated as
 *                 output = SHA-1(input buffer).
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 * \deprecated     Superseded by mbedtls_sha1_ret() in 2.7.0
 *
 * \param input    The buffer holding the input data.
 *                 This must be a readable buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data \p input in Bytes.
 * \param output   The SHA-1 checksum result. This must be a writable
 *                 buffer of size \c 20 Bytes.
 *
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha256_starts( mbedtls_sha256_context *ctx,
                                              int is224 );
/**
 * \brief          This function starts a SHA-224 or SHA-256 checksum
 *                 calculation.
 *
 * \deprecated     Superseded by mbedtls_sha256_starts_ret() in 2.7.0.
 *
 * \param ctx      The context to use. This must be initialized.
 * \param is224    Determines which function to use. This must be
 *                 either \c 0 for SHA-256, or \c 1 for SHA-224.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha256_update( mbedtls_sha256_context *ctx,
                                              const unsigned char *input,
                                              size_t ilen );
/**
 * \brief          This function feeds an input buffer into an ongoing
 *                 SHA-256 checksum calculation.
 *
 * \deprecated     Superseded by mbedtls_sha256_update_ret() in 2.7.0.
 *
 * \param ctx      The SHA-256 context to use. This must be
 *                 initialized and have a hash operation started.
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha256_finish( mbedtls_sha256_context *ctx,
                                              unsigned char output[32] );
/**
 * \brief          This function finishes the SHA-256 operation, and writes
 *                 the result to the output buffer.
 *
 * \deprecated     Superseded by mbedtls_sha256_finish_ret() in 2.7.0.
 *
 * \param ctx      The SHA-256 context. This must be initialized and
 *                 have a hash operation started.
 * \param output   The SHA-224 or SHA-256 checksum result. This must be
 *                 a writable buffer of length \c 32 Bytes.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha256_process( mbedtls_sha256_context *ctx,
                                               const unsigned char data[64] );
/**
 * \brief          This function processes a single data block within
 *                 the ongoing SHA-256 computation. This function is for
 *                 internal use only.
 *
 * \deprecated     Superseded by mbedtls_internal_sha256_process() in 2.7.0.
 *
 * \param ctx      The SHA-256 context. This must be initialized.
 * \param data     The buffer holding one block of data. This must be
 *                 a readable buffer of size \c 64 Bytes.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha256( const unsigned char *input,
                                       size_t ilen,
                                       unsigned char output[32],
                                       int is224 );
/**
 * \brief          This function calculates the SHA-224 or SHA-256 checksum
 *                 of a buffer.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The SHA-256 result is calculated as
 *                 output = SHA-256(input buffer).
 *
 * \deprecated     Superseded by mbedtls_sha256_ret() in 2.7.0.
 *
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 * \param output   The SHA-224 or SHA-256 checksum result. This must be
 *                 a writable buffer of length \c 32 Bytes.
 * \param is224    Determines which function to use. This must be either
 *                 \c 0 for SHA-256, or \c 1 for SHA-224.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha512_starts( mbedtls_sha512_context *ctx,
                                              int is384 );
/**
 * \brief          This function starts a SHA-384 or SHA-512 checksum
 *                 calculation.
 *
 * \deprecated     Superseded by mbedtls_sha512_starts_ret() in 2.7.0
 *
 * \param ctx      The SHA-512 context to use. This must be initialized.
 * \param is384    Determines which function to use. This must be either
 *                 \c 0 for SHA-512 or \c 1 for SHA-384.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha512_update( mbedtls_sha512_context *ctx,
                                              const unsigned char *input,
                                              size_t ilen );
/**
 * \brief          This function feeds an input buffer into an ongoing
 *                 SHA-512 checksum calculation.
 *
 * \deprecated     Superseded by mbedtls_sha512_update_ret() in 2.7.0.
 *
 * \param ctx      The SHA-512 context. This must be initialized
 *                 and have a hash operation started.
 * \param input    The buffer holding the data. This must be a readable
 *                 buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha512_finish( mbedtls_sha512_context *ctx,
                                              unsigned char output[64] );
/**
 * \brief          This function finishes the SHA-512 operation, and writes
 *                 the result to the output buffer.
 *
 * \deprecated     Superseded by mbedtls_sha512_finish_ret() in 2.7.0.
 *
 * \param ctx      The SHA-512 context. This must be initialized
 *                 and have a hash operation started.
 * \param output   The SHA-384 or SHA-512 checksum result. This must
 *                 be a writable buffer of size \c 64 Bytes.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha512_process(
                                           mbedtls_sha512_context *ctx,
                                           const unsigned char data[128] );
/**
 * \brief          This function processes a single data block within
 *                 the ongoing SHA-512 computation. This function is for
 *                 internal use only.
 *
 * \deprecated     Superseded by mbedtls_internal_sha512_process() in 2.7.0.
 *
 * \param ctx      The SHA-512 context. This must be initialized.
 * \param data     The buffer holding one block of data. This must be
 *                 a readable buffer of length \c 128 Bytes.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input,
                                       size_t ilen,
                                       unsigned char output[64],
                                       int is384 );
/**
 * \brief          This function calculates the SHA-512 or SHA-384
 *                 checksum of a buffer.
 *
 *                 The function allocates the context, performs the
 *                 calculation, and frees the context.
 *
 *                 The SHA-512 result is calculated as
 *                 output = SHA-512(input buffer).
 *
 * \deprecated     Superseded by mbedtls_sha512_ret() in 2.7.0
 *
 * \param input    The buffer holding the data. This must be a
 *                 readable buffer of length \p ilen Bytes.
 * \param ilen     The length of the input data in Bytes.
 * \param output   The SHA-384 or SHA-512 checksum result. This must
 *                 be a writable buffer of length \c 64 Bytes.
 * \param is384    Determines which function to use. This must be either
 *                 \c 0 for SHA-512, or \c 1 for SHA-384.
 */

Variable MBEDTLS_DEPRECATED

MBEDTLS_DEPRECATED int mbedtls_ssl_conf_dh_param( mbedtls_ssl_config *conf,
                                                 const char *dhm_P,
                                                 const char *dhm_G );
/**
 * \brief          Set the Diffie-Hellman public P and G values,
 *                 read as hexadecimal strings (server-side only)
 *                 (Default values: MBEDTLS_DHM_RFC3526_MODP_2048_[PG])
 *
 * \param conf     SSL configuration
 * \param dhm_P    Diffie-Hellman-Merkle modulus
 * \param dhm_G    Diffie-Hellman-Merkle generator
 *
 * \deprecated     Superseded by \c mbedtls_ssl_conf_dh_param_bin.
 *
 * \return         0 if successful
 */

Variable mbedtls_ssl_srtp_profile

mbedtls_ssl_srtp_profile mbedtls_ssl_get_dtls_srtp_protection_profile( const mbedtls_ssl_context *ssl );
/**
 * \brief          Get the negotiated DTLS-SRTP Protection Profile.
 *                 This function should be called after the handshake is
 *                 completed.
 *
 * \param ssl      SSL context
 *
 * \return         Protection Profile enum member,
 *                 MBEDTLS_SRTP_UNSET_PROFILE if no protocol was negotiated.
 */

Variable mbedtls_pk_type_t

mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg( const mbedtls_ssl_ciphersuite_t *info );


      

Variable mbedtls_pk_type_t

mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_alg( const mbedtls_ssl_ciphersuite_t *info );


      
      
mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write;
/**
 * \brief          Generate cookie, see \c mbedtls_ssl_cookie_write_t
 */
mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check;
/**
 * \brief          Verify cookie, see \c mbedtls_ssl_cookie_write_t
 */

Variable ecrs_n

size_t ecrs_n;


      

Variable out_msg_seq

unsigned int out_msg_seq;


      

Variable in_msg_seq

unsigned int in_msg_seq;
/*!<  Outgoing handshake sequence number */

Variable char

unsigned char *verify_cookie;


      

Variable char

unsigned char verify_cookie_len;
/*!<  Cli: HelloVerifyRequest cookie
                                              Srv: unused                    */

Variable retransmit_timeout

uint32_t retransmit_timeout;


      

Variable char

unsigned char retransmit_state;
/*!<  Current value of timeout       */

Variable flight

mbedtls_ssl_flight_item *flight;
/*!<  Retransmission state           */

Variable cur_msg

mbedtls_ssl_flight_item *cur_msg;
/*!<  Current outgoing flight        */

Variable char

unsigned char *cur_msg_p;
/*!<  Current message in flight      */

Variable in_flight_start_seq

unsigned int in_flight_start_seq;
/*!<  Position in current message    */

Variable alt_transform_out

mbedtls_ssl_transform *alt_transform_out;
/*!<  Minimum message sequence in the
                                              flight being received          */

Variable char

unsigned char alt_out_ctr[8];
/*!<  Alternative transform for
                                              resending messages             */

Variable uint16_t

uint16_t mtu;


      

Variable mbedtls_md5_context

mbedtls_md5_context fin_md5;


      

Variable mbedtls_sha1_context

mbedtls_sha1_context fin_sha1;


      

Variable mbedtls_sha256_context

mbedtls_sha256_context fin_sha256;


      

Variable mbedtls_sha512_context

mbedtls_sha512_context fin_sha512;


      

Variable update_checksum

void (*update_checksum)(mbedtls_ssl_context *, const unsigned char *, size_t);


      

Variable calc_verify

void (*calc_verify)(mbedtls_ssl_context *, unsigned char *);


      

Variable calc_finished

void (*calc_finished)(mbedtls_ssl_context *, unsigned char *, int);


      

Variable tls_prf

int (*tls_prf)(const unsigned char *, size_t, const char *,
                   const unsigned char *, size_t,
                   unsigned char *, size_t);


      

Variable pmslen

size_t pmslen;


      

Variable char

unsigned char randbytes[64];


      

Variable char

unsigned char premaster[MBEDTLS_PREMASTER_SIZE];
/*!<  random bytes            */

Variable resume

int resume;


      

Variable max_major_ver

int max_major_ver;
/*!<  session resume indicator*/

Variable max_minor_ver

int max_minor_ver;
/*!< max. major version client*/

Variable cli_exts

int cli_exts;
/*!< max. minor version client*/

Variable new_session_ticket

int new_session_ticket;


      

Variable extended_ms

int extended_ms;


      

Variable async_in_progress

unsigned int async_in_progress : 1;


      

Variable user_async_ctx

void *user_async_ctx;
/** Asynchronous operation context. This field is meant for use by the
     * asynchronous operation callbacks (mbedtls_ssl_config::f_async_sign_start,
     * mbedtls_ssl_config::f_async_decrypt_start,
     * mbedtls_ssl_config::f_async_resume, mbedtls_ssl_config::f_async_cancel).
     * The library does not use it internally. */

Variable mbedtls_md_type_t

mbedtls_md_type_t mbedtls_ssl_sig_hash_set_find( mbedtls_ssl_sig_hash_set_t *set,
                                                mbedtls_pk_type_t sig_alg );
/* Find an entry in a signature-hash set matching a given hash algorithm. */

Variable char

unsigned char mbedtls_ssl_sig_from_pk( mbedtls_pk_context *pk );


      

Variable char

unsigned char mbedtls_ssl_sig_from_pk_alg( mbedtls_pk_type_t type );


      

Variable mbedtls_pk_type_t

mbedtls_pk_type_t mbedtls_ssl_pk_alg_from_sig( unsigned char sig );


      

Variable mbedtls_md_type_t

mbedtls_md_type_t mbedtls_ssl_md_alg_from_hash( unsigned char hash );


      

Variable char

unsigned char mbedtls_ssl_hash_from_md_alg( int md );


      

Variable mbedtls_ssl_ticket_write

mbedtls_ssl_ticket_write_t mbedtls_ssl_ticket_write;
/**
 * \brief           Implementation of the ticket write callback
 *
 * \note            See \c mbedlts_ssl_ticket_write_t for description
 */

Variable mbedtls_ssl_ticket_parse

mbedtls_ssl_ticket_parse_t mbedtls_ssl_ticket_parse;
/**
 * \brief           Implementation of the ticket parse callback
 *
 * \note            See \c mbedlts_ssl_ticket_parse_t for description
 */

Variable mbedtls_x509_crt_verify_chain

mbedtls_x509_crt_verify_chain ver_chain;


      

Variable s_tm_msg

struct s_tm_msg;


      

Variable char

char* tuya_hal_net_addr2str(UNW_IP_ADDR_T ipaddr);
/**
* @brief Change ip address to string
*
* @param[in] ipaddr: ip address
*
* @note This API is used to change ip address(in host byte order) to string(in IPv4 numbers-and-dots(xx.xx.xx.xx) notion).
*
* @return ip string
*/

Variable UNI_STORAGE_DESC_S

UNI_STORAGE_DESC_S* tuya_hal_storage_get_desc(void);
/**
* @brief Get description of storage
*
* @param void
*
* @note This API is used to get description of storage.
*
* @return the description of storage
*/

Variable UF_PARTITION_TABLE_S

UF_PARTITION_TABLE_S* tuya_hal_uf_get_desc(void);
/**
* @brief Get UF file description
*
* @param void
*
* @note This API is used to get UF file description.
*
* @return the UF file description
*/

Variable TY_RST_REASON_E

TY_RST_REASON_E tuya_hal_system_get_rst_info(VOID_T);
/**
* @brief Get system reset reason
*
* @param VOID
*
* @note This API is used for getting system reset reason.
*
* @return reset reason of system
*/

Variable TY_IPADDR_LOOPBACK

/* tuya sdk definition of 127.0.0.1 */
#define TY_IPADDR_LOOPBACK    ((uint32_t)0x7f000001UL)
/* tuya sdk definition of 0.0.0.0 */
#define TY_IPADDR_ANY         ((uint32_t)0x00000000UL)
/* tuya sdk definition of 255.255.255.255 */
#define TY_IPADDR_BROADCAST   ((uint32_t)0xffffffffUL)

/* tuya sdk definition of shutdown type */
#define UNW_SHUT_RD  0
#define UNW_SHUT_WR  1
#define UNW_SHUT_RDWR 2

#if defined(OPERATING_SYSTEM) && ((OPERATING_SYSTEM == SYSTEM_LINUX) || (OPERATING_SYSTEM == SYSTEM_LITEOS))
/* fd 最大个数, 不同平台根据实际情况定义 */
#define UNW_FD_MAX_COUNT   (1024)
#else
#define UNW_FD_MAX_COUNT   (64)
#endif
/* tuya sdk definition of fd operations */
typedef struct {
   UINT8_T placeholder[(UNW_FD_MAX_COUNT+7)/8];
} UNW_FD_SET_T;
/********************************************************************************
 *********************************tuya_os_network_intf***************************
 ********************************************************************************/

Variable QUEUE_HANDLE

/* tuya sdk definition of queue context */
typedef void* QUEUE_HANDLE;
/********************************************************************************
 *********************************tuya_os_queue_intf****************************
 ********************************************************************************/

Variable __CRC_16_MODULE_EXT

__CRC_16_MODULE_EXT \
unsigned short get_crc_16(unsigned char *data,unsigned short size);
/**
 * @brief get_crc_16 
 *
 * @param[in] data
 * @param[in] size
 *
 * @return unsigned short
 */

Variable __CRC_8_MODULE_EXT

__CRC_8_MODULE_EXT \
unsigned char get_crc_8(unsigned char *data,unsigned short size);
/***********************************************************
*   Function: get_crc_8
*   Input: none
*   Output: none 
*   Return: none
***********************************************************/

Variable char

char * tuya_base64_encode( const unsigned char * bindata, char * base64, int binlength );
/**
 * @brief tuya_base64_encode 
 *
 * @param[in] bindata
 * @param[out] base64
 * @param[in] binlength
 *
 * @return 
 */

Variable endif

{
#endif

#include "ty_cJSON.h"

/* ty_cJSON Types: */
#define cJSON_False       ty_cJSON_False
#define cJSON_True        ty_cJSON_True
#define cJSON_NULL        ty_cJSON_NULL
#define cJSON_Number      ty_cJSON_Number
#define cJSON_String      ty_cJSON_String
#define cJSON_Array       ty_cJSON_Array
#define cJSON_Object      ty_cJSON_Object

#define cJSON_IsReference ty_cJSON_IsReference

/* The cJSON structure: */
typedef struct ty_cJSON cJSON;

typedef struct ty_cJSON_Hooks cJSON_Hooks;



//#define cJSON_InitHooks ty_cJSON_InitHooks
#define cJSON_Parse ty_cJSON_Parse
#define cJSON_Print ty_cJSON_Print
#define cJSON_PrintUnformatted ty_cJSON_PrintUnformatted
#define cJSON_FreeBuffer ty_cJSON_FreeBuffer
#define cJSON_Delete ty_cJSON_Delete
#define cJSON_GetArraySize ty_cJSON_GetArraySize
#define cJSON_GetArrayItem ty_cJSON_GetArrayItem

#define cJSON_GetObjectItem ty_cJSON_GetObjectItem
#define cJSON_GetErrorPtr ty_cJSON_GetErrorPtr

#define cJSON_CreateNull   ty_cJSON_CreateNull
#define cJSON_CreateTrue   ty_cJSON_CreateTrue
#define cJSON_CreateFalse  ty_cJSON_CreateFalse
#define cJSON_CreateBool   ty_cJSON_CreateBool
#define cJSON_CreateNumber ty_cJSON_CreateNumber
#define cJSON_CreateString ty_cJSON_CreateString
#define cJSON_CreateArray  ty_cJSON_CreateArray
#define cJSON_CreateObject ty_cJSON_CreateObject

#define cJSON_CreateIntArray    ty_cJSON_CreateIntArray
#define cJSON_CreateFloatArray  ty_cJSON_CreateFloatArray
#define cJSON_CreateDoubleArray ty_cJSON_CreateDoubleArray
#define cJSON_CreateStringArray ty_cJSON_CreateStringArray

#define cJSON_AddItemToArray          ty_cJSON_AddItemToArray
#define cJSON_AddItemToObject         ty_cJSON_AddItemToObject
#define cJSON_AddItemReferenceToArray ty_cJSON_AddItemReferenceToArray
#define cJSON_AddItemReferenceToObject ty_cJSON_AddItemReferenceToObject

#define cJSON_DetachItemFromArray  ty_cJSON_DetachItemFromArray
#define cJSON_DeleteItemFromArray  ty_cJSON_DeleteItemFromArray
#define cJSON_DetachItemFromObject ty_cJSON_DetachItemFromObject
#define cJSON_DeleteItemFromObject ty_cJSON_DeleteItemFromObject

#define cJSON_ReplaceItemInArray   ty_cJSON_ReplaceItemInArray
#define cJSON_ReplaceItemInObject  ty_cJSON_ReplaceItemInObject

#define cJSON_Duplicate       ty_cJSON_Duplicate
#define cJSON_ParseWithOpts   ty_cJSON_ParseWithOpts

#define cJSON_Minify ty_cJSON_Minify

#define cJSON_IsArray ty_cJSON_IsArray
#define cJSON_IsObject ty_cJSON_IsObject
#define cJSON_GetObjectItemCaseSensitive ty_cJSON_GetObjectItemCaseSensitive
#define cJSON_IsString ty_cJSON_IsString
#define cJSON_IsNumber ty_cJSON_IsNumber
#define cJSON_IsBool ty_cJSON_IsBool



#define cJSON_AddNullToObject(object,name)	ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name)	ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object,name)	ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateFalse())
#define cJSON_AddBoolToObject(object,name,b)   ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateBool(b))
#define cJSON_AddNumberToObject(object,name,n) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateNumber(n))
#define cJSON_AddStringToObject(object,name,s) ty_cJSON_AddItemToObject(object, name, ty_cJSON_CreateString(s))

#define cJSON_SetIntValue(object,val)		((object)?(object)->valueint=(object)->valuedouble=(val):(val))

#define cJSON_ArrayForEach(pos, head)           for(pos = (head)->child; pos != NULL; pos = pos->next)

#ifdef __cplusplus
}
#endif

#endif


      

Variable char

unsigned char asc2hex(char asccode);
/**
 * @brief convert character to hex, if '0'-'f'/'F' -> 0-15, else 0
 * 
 * @param[in] asccode the input character
 * @return the hex value
 */

Variable char

char *mm_strdup(const char *str);
/**
 * @brief  duplicate input string, will malloc a new block of memory
 * 
 * @param[in] str the input string need to duplicate
 * @return new string  
 */

Variable endif

{
#endif

#include 

/* ty_cJSON Types: */
#define ty_cJSON_False 0
#define ty_cJSON_True 1
#define ty_cJSON_NULL 2
#define ty_cJSON_Number 3
#define ty_cJSON_String 4
#define ty_cJSON_Array 5
#define ty_cJSON_Object 6

#define ty_cJSON_IsReference 256

/* The ty_cJSON structure: */
typedef struct ty_cJSON {
   struct ty_cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
   struct ty_cJSON *child;	/* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */

   int type;				/* The type of the item, as above. */

   char *valuestring;		/* The item's string, if type==ty_cJSON_String */
   int valueint;			/* The item's number, if type==ty_cJSON_Number */
   double valuedouble;		/* The item's number, if type==ty_cJSON_Number */

   char *string;			/* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
} ty_cJSON;


      

Variable P_QUEUE_CLASS

P_QUEUE_CLASS CreateQueueObj(const unsigned int queTolNum, const unsigned int queUnitSize);
/**
 * @brief create and initialize a queue 
 * 
 * @param[in] queTolNum the total number of the queue
 * @param[in] queUnitSize the unit size of the queue
 * @return the queue handle 
 */

Variable char

unsigned char RegisterQueueObj(P_QUEUE_CLASS pQueObj, const unsigned char *pQueData, const unsigned int queTolNum, const unsigned int queUnitSize);
/**
 * @brief register a queue, the queue handle and queue buffer malloc from other place
 * 
 * @param[in] pQueObj the queue handle
 * @param[in] pQueData the queue unit buffer
 * @param[in] queTolNum the total number of queue
 * @param[in] queUnitSize the unit size of queue
 * @return 1 on success, 0 on failed
 * 
 * @warning this API was NOT USED!!!
 */

Variable char

unsigned char InQueue(P_QUEUE_CLASS pQueObj, const unsigned char *pQueUnit, const unsigned int queNum);
/**
 * @brief unit inqueue
 * 
 * @param[in] pQueObj the queue handle
 * @param[in] pQueUnit the inqueue unit buffer
 * @param[in] queNum the inqueue unit counts
 * @return 1 on success, 0 on failed
 */

Variable char

unsigned char OutQueue(P_QUEUE_CLASS pQueObj,unsigned char *pQueUnit, const unsigned int queNum);
/**
 * @brief unit outqueue
 * 
 * @param[in] pQueObj the queue handle
 * @param[in] pQueUnit the outqueue unit buffer
 * @param[in] queNum the outqueue unit counts
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h 
 */

Variable char

unsigned char GetQueueMember(P_QUEUE_CLASS pQueObj, const unsigned int start, unsigned char *pQueUnit, const unsigned int queNum);
/**
 * @brief get the unit from start postion, not outqueue
 * 
 * @param[in] pQueObj the queue handle
 * @param[in] start the outqueue start postion
 * @param[in] pQueUnit the outqueue unit buffer
 * @param[in] queNum the outqueue unit counts
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h  
 */

Variable char

unsigned char ClearQueue(P_QUEUE_CLASS pQueObj);
/**
 * @brief clear all unit of the queue
 * 
 * @param[in] pQueObj the queue handle
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h   
 */

Variable char

unsigned char DelQueueMember(P_QUEUE_CLASS pQueObj,const unsigned int queNum);
/**
 * @brief delete the unit from the queue out position
 * 
 * @param[in] pQueObj the queue handle
 * @param[in] queNum the delete unit counts
 * @return OPRT_OK on success, others on failed, please refer to tuya_error_code.h  
 */

Variable RFC_DATA_S

RFC_DATA_S *cr_rfc_data(IN VOID *data,IN CONST UINT_T data_len, IN CONST BOOL_T malk,IN CONST UINT_T cnt);
/**
 * @brief create a reference data
 * 
 * @param[in] data the data buffer
 * @param[in] data_len the date length
 * @param[in] malk need malloc memory for the data
 * @param[in] cnt the Initial value of the reference
 * @return the reference data address
 */

Variable last

last->next = pos->next;
// success find and delete

Variable node

node->next = NULL;


      

Variable break

break;


      

Variable last

last->next = n;


      

Variable POSIX_TM_S

POSIX_TM_S *uni_gmtime_r(IN CONST TIME_T *tm, OUT POSIX_TM_S *result);
/**
 * @brief change TIME_T to posix time, redefine the std C func gmtime_r
 * 
 * @param[in] tm the time in TIME_T format
 * @param[out] result the time in posix time format
 * @return the time in posix time format
 */

Variable _WIFI_MGNT_EXT

_WIFI_MGNT_EXT \
OPERATE_RET ty_wf_send_probe_request_mgnt(IN CONST UCHAR_T *in_buf, IN CONST UINT_T in_len,IN UCHAR_T* ssid,NW_MAC_S *srcmac,NW_MAC_S *dstmac);
/**
 * @brief send wifi management packets probe request.
 *
 * @param[in] in_buf data to be sent in tuya vsie 
 * @param[in] in_len data length to be sent
 * @param[in] ssid the ssid of the probe request
 * @param[in] source mac address of probe request
 * @param[in] destination mac address of probe request
 *
 * @note send probe request packets.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable _WIFI_MGNT_EXT

_WIFI_MGNT_EXT \
OPERATE_RET ty_wf_send_probe_response_mgnt(IN CONST UCHAR_T *in_buf, IN CONST UINT_T in_len,IN UCHAR_T* ssid,NW_MAC_S *srcmac,NW_MAC_S *dstmac);
/**
 * @brief send wifi management packets probe response.
 *
 * @param[in] in_buf data to be sent in tuya vsie 
 * @param[in] in_len data length to be sent
 * @param[in] ssid the ssid of the probe request
 * @param[in] source mac address of probe request
 * @param[in] destination mac address of probe request
 *
 * @note send probe request packets.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable _WIFI_MGNT_EXT

_WIFI_MGNT_EXT \
OPERATE_RET ty_wf_register_recv_mgnt_callback(BOOL_T enbale,WIFI_REV_MGNT_CB recv_cb);
/**
 * @brief enable wifi management packets reception in wifi station mode.
 *
 * @param[in] enbale disable or enable wifi management packets reception 
 * @param[in] recv_cb callback function to receive management packets
 *
 * @note called in wifi station mode, register callback function to process wifi management packets.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable _WIFI_MGNT_EXT

_WIFI_MGNT_EXT \
OPERATE_RET ty_wf_send_beacon(UCHAR_T* ssid, UCHAR_T chan, BYTE_T* src_mac, BYTE_T* vsie_data, UINT_T vsie_data_len);
/**
 * @brief send wifi beacon packets.
 *
 * @param[in] ssid the beacon ssid 
 * @param[in] chan the beacon's wifi channel
 * @param[in] src_mac the beacon's bssid
 * @param[in] vsie_data tuya vsie data to be inserted into beacon
 * @param[in] vsie_data_len length of vsie data
 *
 * @note called to send beacon frame.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_all_ap_scan(OUT AP_IF_S **ap_ary,OUT UINT_T *num);


      

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_assign_ap_scan(IN CONST CHAR_T *ssid,OUT AP_IF_S **ap);
/**
 * @brief do wifi Scan with specificed SSID.
 *
 * @param[in] ssid the ssid to be scaned 
 * @param[out] ap ap info of the ssid
 *
 * @note must set station mode first.
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_release_ap(IN AP_IF_S *ap);
/**
 * @brief free ap memory.
 *
 * @param[in] ap the ap info to be free 
 *
 * @note called after wf_all_ap_scan or wf_assign_ap_scan
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_set_cur_channel(IN CONST BYTE_T chan);


      

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_get_cur_channel(OUT BYTE_T *chan);


      

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_sniffer_set(IN CONST BOOL_T en,IN CONST SNIFFER_CALLBACK cb);


      

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_get_ip(IN CONST WF_IF_E wf,OUT NW_IP_S *ip);
/**
 * @brief get wifi ip.
 *
 * @param[in] wf station or ap  
 *
 * @param[out] ip ip address of station or ap
 *
 * @note called in station mode or ap mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_get_mac(IN CONST WF_IF_E wf,OUT NW_MAC_S *mac);
/**
 * @brief get wifi mac address.
 *
 * @param[in] wf station or ap  
 *
 * @param[out] mac mac address of station or ap
 *
 * @note called in station mode or ap mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_set_mac(IN CONST WF_IF_E wf,IN CONST NW_MAC_S *mac);


      

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_wk_mode_set(IN CONST WF_WK_MD_E mode);
/**
 * @brief set wifi work mode.
 *
 * @param[in] mode wifi work mode,such as station, soft ap...
 *
 * @note called before other wifi operation
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_wk_mode_get(OUT WF_WK_MD_E *mode);
/**
 * @brief get wifi work mode.
 *
 * @param[out] mode current wifi work mode
 *
 * @note 
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_get_connected_ap_info(OUT FAST_WF_CONNECTED_AP_INFO_V2_S **fast_ap_info);
/**
 * @brief get connect ap info.
 *
 * @param[out] fast_ap_info the ap infomation of the connected ap
 *
 * @note called after wifi connection has established in station mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_fast_station_connect(IN FAST_WF_CONNECTED_AP_INFO_V2_S *fast_ap_info);
/**
 * @brief do fast wifi connect.
 *
 * @param[in] fast_ap_info the ap infomation of the ap to be connected
 *
 * @note called after wf_get_connected_ap_info is called
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_station_connect(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd);
/**
 * @brief do wifi connect in station mode.
 *
 * @param[in] ssid the ssid of the ap to be connected
 *
 * @param[in] passwd the passwd of the ap to be connected
 *
 * @note called in station mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_station_disconnect(VOID);


      

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_station_get_conn_ap_rssi(OUT SCHAR_T *rssi);
/**
 * @brief get rssi of the connected ap.
 *
 * @param[out] rssi the rssi of the connected ap
 *
 * @note called after connection has established in station mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_station_stat_get(OUT WF_STATION_STAT_E *stat);
/**
 * @brief get wifi station stat.
 *
 * @param[out] stat the stat in the station mode,refer to WF_STATION_STAT_E 
 *
 * @note called after wf_station_connect
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_ap_start(IN CONST WF_AP_CFG_IF_S *cfg);
/**
 * @brief start ap in ap mode.
 *
 * @param[in] cfg the configuration of the ap 
 *
 * @note called in wifi ap mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_ap_stop(VOID);
/**
 * @brief stop ap in ap mode.
 *
 * @note called in wifi ap mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_get_ap_mac(INOUT NW_MAC_S *mac);
/**
 * @brief get the ap mac address.
 *
 * @note called in wifi ap mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_set_country_code(IN CONST CHAR_T *p_country_code);
/**
 * @brief set the wifi country code.
 *
 * @note called in wifi ap mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET wf_get_country_code(IN CONST CHAR_T *p_country_code);
/**
 * @brief get the wifi country code.
 *
 * @note called after wf_set_country_code
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
VOID_T tuya_wifi_set_lps_dtim(const unsigned int dtim);
/**
 * @brief set the wifi low power dtim.
 *
 * @note called before enter wifi low power mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET tuya_wifi_lp_disable(VOID);
/**
 * @brief disable the wifi low power mode.
 *
 * @note called when exiting wifi low power mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET tuya_wifi_lp_enable(VOID);
/**
 * @brief enable the wifi low power mode.
 *
 * @note called when entering wifi low power mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET tuya_cpu_lp_disable(VOID);
/**
 * @brief disable the cpu low power mode.
 *
 * @note called when exiting wifi low power mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
OPERATE_RET tuya_cpu_lp_enable(VOID);
/**
 * @brief enable the cpu low power mode.
 *
 * @note called when entering wifi low power mode
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Variable __WF_BASIC_INTF_EXT

__WF_BASIC_INTF_EXT \
BOOL_T wf_rf_calibrated(VOID_T);


      

Variable char

char* tuya_ffs_dss_get_token();


      

Variable char

char* tuya_ffs_dss_get_endpoint();


      

Variable tuya_ffs_stream_t

tuya_ffs_stream_t *tuya_ffs_stream_new(INT_T buf_len);


      

Variable __AIRKISS_BC_MODULE_EXT

__AIRKISS_BC_MODULE_EXT \
OPERATE_RET ak_bc_init(IN CONST LOCK_CHAN_CALLBACK lc_cb,IN CONST FN_NETCFG_CB ncf_cb,IN CONST int netcfg_type
                      /*,IN CONST AP_IF_S *scan_ap,IN CONST BYTE_T scan_ap_num*/);
/***********************************************************
*  Function: ak_bc_init
*  Input: lc_cb ncf_cb
*  Output: 
*  Return: OPERATE_RET
***********************************************************/

Variable __AIRKISS_BC_MODULE_EXT

__AIRKISS_BC_MODULE_EXT \
OPERATE_RET ak_bc_parse(IN CONST BYTE_T *src,IN CONST BYTE_T *bssid,\
                   IN CONST USHORT_T len,IN CONST BYTE_T chan,
                   IN CONST BC_DA_CHAN_T from);
/***********************************************************
*  Function: ak_bc_parse
*  Input: dest src bssid len chan(1-14)
*  Output: 
*  Return: none
***********************************************************/

Variable __AIRKISS_BC_MODULE_EXT

__AIRKISS_BC_MODULE_EXT \
INT_T get_airkiss_random(VOID);
/***********************************************************
*  Function: get_airkiss_random
*  Input: none
*  Output: 
*  Return: <0 fail else success
***********************************************************/

Variable __AIRKISS_BC_MODULE_EXT

__AIRKISS_BC_MODULE_EXT \
VOID ak_bc_uninit(VOID);
/***********************************************************
*  Function: ak_bc_uninit
*  Input: none
*  Output: 
*  Return: none
***********************************************************/

Variable __EZ_MC_MODULE_EXT

__EZ_MC_MODULE_EXT \
OPERATE_RET ez_mc_init(IN CONST LOCK_CHAN_CALLBACK lc_cb,IN CONST FN_NETCFG_CB ncf_cb,IN CONST int netcfg_type);
/***********************************************************
*  Function: ez_mc_init
*  Input: lc_cb ncf_cb
*  Output: 
*  Return: OPERATE_RET
***********************************************************/

Variable __EZ_MC_MODULE_EXT

__EZ_MC_MODULE_EXT \
OPERATE_RET ez_mc_parse(IN CONST BYTE_T *dest,IN CONST BYTE_T *src,IN CONST BYTE_T *bssid,\
                IN CONST USHORT_T len,IN CONST BYTE_T chan);
/***********************************************************
*  Function: ez_mc_parse
*  Input: dest src bssid len chan(1-14)
*  Output: 
*  Return: none
***********************************************************/

Variable __EZ_MC_MODULE_EXT

__EZ_MC_MODULE_EXT \
VOID ez_mc_uninit(VOID);
/***********************************************************
*  Function: ez_mc_uninit
*  Input: none
*  Output: 
*  Return: none
***********************************************************/
__TLINK_BC_MODULE_EXT \
OPERATE_RET tlk_bc_init(IN CONST LOCK_CHAN_CALLBACK lc_cb,IN CONST FN_NETCFG_CB ncf_cb,IN CONST int netcfg_type);
/***********************************************************
*  Function: tlk_bc_init
*  Input: lc_cb ncf_cb
*  Output: 
*  Return: OPERATE_RET
***********************************************************/
__TLINK_BC_MODULE_EXT \
OPERATE_RET tlk_bc_parse(IN CONST BYTE_T*src,IN CONST BYTE_T*bssid,\
                              IN CONST USHORT_T len,IN CONST BYTE_T chan, \
                              IN CONST BC_DA_CHAN_T from);
/***********************************************************
*  Function: tlk_bc_parse
*  Input: dest src bssid len chan(1-14)
*  Output: 
*  Return: none
***********************************************************/
__TLINK_BC_MODULE_EXT \
VOID tlk_bc_uninit(VOID);
/***********************************************************
*  Function: tlk_bc_uninit
*  Input: none
*  Output: 
*  Return: none
***********************************************************/
__TLINK_BC_MODULE_EXT \
OPERATE_RET mimo_tlk_bc_parse(IN CONST SCHAR_T rssi,IN CONST MIMO_TYPE_E type,\
                                     IN CONST BYTE_T mcs,IN CONST USHORT_T len,IN CONST BYTE_T chan);
/***********************************************************
*  Function: mimo_tlk_bc_parse
*  Input: rssi type mcs len chan(1-14)
*  Output:
*  Return: none
***********************************************************/

Consts

Const

const char* smtp_result_str(u8_t smtp_result);


      

Const

const struct snmp_obj_id* snmp_get_device_enterprise_oid(void);


      

Const

const char * snmp_get_community(void);


      

Const

const char * snmp_get_community_write(void);


      

Const

const char * snmp_get_community_trap(void);


      

Const

const struct snmp_threadsync_node *threadsync_node;


      

Const

const ip_addr_t* sntp_getserver(u8_t idx);


      

Const

const char *sntp_getservername(u8_t idx);


      

Const

const ip_addr_t* dns_getserver(u8_t numdns);


      

Const

const ip_addr_t *ip6_select_source_address(struct netif *netif, const ip6_addr_t * dest);


      

Const

const char *lwip_inet_ntop(int af, const void *src, char *dst, socklen_t size);


      

Const

const char* tcp_debug_state_str(enum tcp_state s);


      

Const

const struct chap_digest_type *digest,
		unsigned char *challenge, unsigned char *response,
		char *message, int message_space);


      

Const

const char * protocol_name(int proto);


      

Const

const char *coap_package_name(void);
/**
 * Get the library package name.
 *
 * @return Zero-terminated string with the name of this library.
 */

Const

const char *coap_package_version(void);
/**
 * Get the library package version.
 *
 * @return Zero-terminated string with the library version.
 */

Const

const char *coap_socket_strerror( void );


      

Const

const char *coap_session_str(const coap_session_t *session);
/**
 * @ingroup logging
 * Get session description.
 *
 * @param session  The CoAP session.
 * @return description string.
 */

Const

const char *coap_endpoint_str(const coap_endpoint_t *endpoint);
/**
 * @ingroup logging
* Get endpoint description.
*
* @param endpoint  The CoAP endpoint.
* @return description string.
*/

Const

const uint8_t *coap_opt_value(const coap_opt_t *opt);
/**
 * Returns a pointer to the value of the given option. @p opt must point to an
 * option jump or the beginning of the option. This function returns @c NULL if
 * @p opt is not a valid option.
 *
 * @param opt The option whose value should be returned.
 *
 * @return    A pointer to the option value or @c NULL on error.
 */

Const

const char *coap_response_phrase(unsigned char code);
/**
 * Returns a human-readable response phrase for the specified CoAP response @p
 * code. This function returns @c NULL if not found.
 *
 * @param code The response code for which the literal phrase should be
 *             retrieved.
 *
 * @return     A zero-terminated string describing the error, or @c NULL if not
 *             found.
 */

Const

const int *mbedtls_cipher_list( void );
/**
 * \brief This function retrieves the list of ciphers supported by the generic
 * cipher module.
 *
 * \return      A statically-allocated array of ciphers. The last entry
 *              is zero.
 */

Const

const mbedtls_cipher_info_t *mbedtls_cipher_info_from_string( const char *cipher_name );
/**
 * \brief               This function retrieves the cipher-information
 *                      structure associated with the given cipher name.
 *
 * \param cipher_name   Name of the cipher to search for. This must not be
 *                      \c NULL.
 *
 * \return              The cipher information structure associated with the
 *                      given \p cipher_name.
 * \return              \c NULL if the associated cipher information is not found.
 */

Const

const mbedtls_cipher_info_t *mbedtls_cipher_info_from_type( const mbedtls_cipher_type_t cipher_type );
/**
 * \brief               This function retrieves the cipher-information
 *                      structure associated with the given cipher type.
 *
 * \param cipher_type   Type of the cipher to search for.
 *
 * \return              The cipher information structure associated with the
 *                      given \p cipher_type.
 * \return              \c NULL if the associated cipher information is not found.
 */

Const

const mbedtls_cipher_info_t *mbedtls_cipher_info_from_values( const mbedtls_cipher_id_t cipher_id,
                                             int key_bitlen,
                                             const mbedtls_cipher_mode_t mode );
/**
 * \brief               This function retrieves the cipher-information
 *                      structure associated with the given cipher ID,
 *                      key size and mode.
 *
 * \param cipher_id     The ID of the cipher to search for. For example,
 *                      #MBEDTLS_CIPHER_ID_AES.
 * \param key_bitlen    The length of the key in bits.
 * \param mode          The cipher mode. For example, #MBEDTLS_MODE_CBC.
 *
 * \return              The cipher information structure associated with the
 *                      given \p cipher_id.
 * \return              \c NULL if the associated cipher information is not found.
 */

Const

const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list( void );
/**
 * \brief           This function retrieves the information defined in
 *                  mbedtls_ecp_curve_info() for all supported curves in order
 *                  of preference.
 *
 * \return          A statically allocated array. The last entry is 0.
 */

Const

const mbedtls_ecp_group_id *mbedtls_ecp_grp_id_list( void );
/**
 * \brief           This function retrieves the list of internal group
 *                  identifiers of all supported curves in the order of
 *                  preference.
 *
 * \return          A statically allocated array,
 *                  terminated with MBEDTLS_ECP_DP_NONE.
 */

Const

const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_grp_id( mbedtls_ecp_group_id grp_id );
/**
 * \brief           This function retrieves curve information from an internal
 *                  group identifier.
 *
 * \param grp_id    An \c MBEDTLS_ECP_DP_XXX value.
 *
 * \return          The associated curve information on success.
 * \return          NULL on failure.
 */

Const

const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_tls_id( uint16_t tls_id );
/**
 * \brief           This function retrieves curve information from a TLS
 *                  NamedCurve value.
 *
 * \param tls_id    An \c MBEDTLS_ECP_DP_XXX value.
 *
 * \return          The associated curve information on success.
 * \return          NULL on failure.
 */

Const

const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_name( const char *name );
/**
 * \brief           This function retrieves curve information from a
 *                  human-readable name.
 *
 * \param name      The human-readable name.
 *
 * \return          The associated curve information on success.
 * \return          NULL on failure.
 */

Const

const int *mbedtls_md_list( void );
/**
 * \brief           This function returns the list of digests supported by the
 *                  generic digest module.
 *
 * \return          A statically allocated array of digests. Each element
 *                  in the returned list is an integer belonging to the
 *                  message-digest enumeration #mbedtls_md_type_t.
 *                  The last entry is 0.
 */

Const

const mbedtls_md_info_t *mbedtls_md_info_from_string( const char *md_name );
/**
 * \brief           This function returns the message-digest information
 *                  associated with the given digest name.
 *
 * \param md_name   The name of the digest to search for.
 *
 * \return          The message-digest information associated with \p md_name.
 * \return          NULL if the associated message-digest information is not found.
 */

Const

const mbedtls_md_info_t *mbedtls_md_info_from_type( mbedtls_md_type_t md_type );
/**
 * \brief           This function returns the message-digest information
 *                  associated with the given digest type.
 *
 * \param md_type   The type of digest to search for.
 *
 * \return          The message-digest information associated with \p md_type.
 * \return          NULL if the associated message-digest information is not found.
 */

Const

const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info );
/**
 * \brief           This function extracts the message-digest name from the
 *                  message-digest information structure.
 *
 * \param md_info   The information structure of the message-digest algorithm
 *                  to use.
 *
 * \return          The name of the message digest.
 */

Const

const mbedtls_pk_info_t *mbedtls_pk_info_from_type( mbedtls_pk_type_t pk_type );
/**
 * \brief           Return information associated with the given PK type
 *
 * \param pk_type   PK type to search for.
 *
 * \return          The PK info associated with the type or NULL if not found.
 */

Const

const char * mbedtls_pk_get_name( const mbedtls_pk_context *ctx );
/**
 * \brief           Access the type name
 *
 * \param ctx       The PK context to use. It must have been initialized.
 *
 * \return          Type name on success, or "invalid PK"
 */

Const

const unsigned char *key_enc, const unsigned char *key_dec,
               size_t keylen,
               const unsigned char *iv_enc, const unsigned char *iv_dec,
               size_t ivlen,
               const unsigned char *mac_enc, const unsigned char *mac_dec,
               size_t maclen);


      

Const

const char *mbedtls_ssl_get_ciphersuite_name( const int ciphersuite_id );
/**
 * \brief               Return the name of the ciphersuite associated with the
 *                      given ID
 *
 * \param ciphersuite_id SSL ciphersuite ID
 *
 * \return              a string containing the ciphersuite name
 */

Const

const char *mbedtls_ssl_get_alpn_protocol( const mbedtls_ssl_context *ssl );
/**
 * \brief          Get the name of the negotiated Application Layer Protocol.
 *                 This function should be called after the handshake is
 *                 completed.
 *
 * \param ssl      SSL context
 *
 * \return         Protcol name, or NULL if no protocol was negotiated.
 */

Const

const mbedtls_ssl_srtp_profile_info *mbedtls_ssl_dtls_srtp_profile_info_from_id( mbedtls_ssl_srtp_profile profile );
/**
 * \brief                  Utility function to get information on dtls srtp profile.
 *
 * \param profile          The dtls-srtp profile id to get info on.
 *
 * \return         mbedtls_ssl_srtp_profile_info* on success, NULL if not found
 */

Const

const char *mbedtls_ssl_get_ciphersuite( const mbedtls_ssl_context *ssl );
/**
 * \brief          Return the name of the current ciphersuite
 *
 * \param ssl      SSL context
 *
 * \return         a string containing the ciphersuite name
 */

Const

const char *mbedtls_ssl_get_version( const mbedtls_ssl_context *ssl );
/**
 * \brief          Return the current SSL version (SSLv3/TLSv1/etc)
 *
 * \param ssl      SSL context
 *
 * \return         a string containing the SSL version
 */

Const

const mbedtls_x509_crt *mbedtls_ssl_get_peer_cert( const mbedtls_ssl_context *ssl );
/**
 * \brief          Return the peer certificate from the current connection
 *
 *                 Note: Can be NULL in case no certificate was sent during
 *                 the handshake. Different calls for the same connection can
 *                 return the same or different pointers for the same
 *                 certificate and even a different certificate altogether.
 *                 The peer cert CAN change in a single connection if
 *                 renegotiation is performed.
 *
 * \param ssl      SSL context
 *
 * \return         the current peer certificate
 */

Const

const int *mbedtls_ssl_list_ciphersuites( void );


      

Const

const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string( const char *ciphersuite_name );


      

Const

const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_id( int ciphersuite_id );


      

Const

const CHAR_T *cloud_public_key = \
"-----BEGIN PUBLIC KEY-----\r\n" \
"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7qIHbKAKLmYo2IFuZ391KWXLhY51\r\n"
"KeLCfxxaUGRQ2+Ipuey9raXWS+BxscQRtqw242fEs9kfaRYT+t+tAeQjaw==\r\n"
"-----END PUBLIC KEY-----\r\n";


      

Const

const CHAR_T *dev_private_key = \
"-----BEGIN PRIVATE KEY-----\r\n"\
"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgww1aKS8dQv/CiiY9\r\n"
"H2WvFBAibCkvjRqEwMDPoa4xwRGhRANCAARlskqMIPfYfSH4MW9Jk7dId/AqJt1K\r\n"
"6jqs82LR9KKOGxcPQS1A2U9tcKNBgwDnrWIyXcOhrpbYUEFA1r80Nuum\r\n"
"-----END PRIVATE KEY-----";


      

Const

const CHAR_T amazon_cert[] = \
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIB7zCCAZWgAwIBAgIEKuP5mzAKBggqhkjOPQQDAjCBjjELMAkGA1UEBhMCVVMx\r\n"\
"EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxGDAWBgNVBAoM\r\n"\
"D0FtYXpvbi5jb20gSW5jLjEaMBgGA1UECwwRRGV2aWNlIE1hbmFnZW1lbnQxIjAg\r\n"\
"BgNVBAMMGURBSyBDQSBmb3IgQTNHN0w4Wk9QQ01MU1owHhcNMjAwMzE2MDI0MjEz\r\n"\
"WhcNNDAwMzE2MDI0MjEzWjAfMR0wGwYJKwYBBAGlawEDDA5BM0c3TDhaT1BDTUxT\r\n"\
"WjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGWySowg99h9Ifgxb0mTt0h38Com\r\n"\
"3UrqOqzzYtH0oo4bFw9BLUDZT21wo0GDAOetYjJdw6GulthQQUDWvzQ266ajTzBN\r\n"\
"MB0GA1UdDgQWBBQhGYzuj4qc7zzGJgThX70lIEygPDAfBgNVHSMEGDAWgBRt/d4w\r\n"\
"tk20QwCrH3vpt47oCpw6tzALBgNVHQ8EBAMCA6gwCgYIKoZIzj0EAwIDSAAwRQIh\r\n"\
"AJYysHdXcLBYkbkF7JV84t4N4IWXNUvNcreU9UDPRcHtAiBga2SXBiNIgkrM68gm\r\n"\
"jsGFHiLFMvNftMbDHa9MKCnIsQ==\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDVDCCAvqgAwIBAgIOAMbo00n8Whivijn5xjAwCgYIKoZIzj0EAwIwgaYxCzAJ\r\n"\
"BgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxl\r\n"\
"MRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5h\r\n"\
"Z2VtZW50MTowOAYDVQQDDDFBbWF6b25ESEEgVHV5YV9Qcm9kdWN0X0EzRzdMOFpP\r\n"\
"UENNTFNaIENlcnRpZmljYXRlMB4XDTE5MTIwOTIwMjY1M1oXDTM5MTIwOTIwMjY1\r\n"\
"M1owgY4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH\r\n"\
"DAdTZWF0dGxlMRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURl\r\n"\
"dmljZSBNYW5hZ2VtZW50MSIwIAYDVQQDDBlEQUsgQ0EgZm9yIEEzRzdMOFpPUENN\r\n"\
"TFNaMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2mnT36IJ8nhXXVPbru0NjlGn\r\n"\
"uYglVNVhCJSjJ5tBuf7Yeyzy6Kpqt58kAu/YQUNgahNHbnpBbPcORb017+4FKaOC\r\n"\
"ASAwggEcMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFG393jC2TbRDAKsf\r\n"\
"e+m3jugKnDq3MIHWBgNVHSMEgc4wgcuAFJicBJERH1rDqspSeVE+d5L5Qu5EoYGi\r\n"\
"pIGfMIGcMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UE\r\n"\
"BwwHU2VhdHRsZTEYMBYGA1UECgwPQW1hem9uLmNvbSBJbmMuMRowGAYDVQQLDBFE\r\n"\
"ZXZpY2UgTWFuYWdlbWVudDEwMC4GA1UEAwwnQW1hem9uREhBIFR1eWFfTWFudWZh\r\n"\
"Y3R1cmVyIENlcnRpZmljYXRlgg4AxujSxL+8WFgMkdK2mzAOBgNVHQ8BAf8EBAMC\r\n"\
"AoQwCgYIKoZIzj0EAwIDSAAwRQIhANhJdpDuHVHXE3DJo7WYTHyECsANwrcYA9CD\r\n"\
"gvGQXsmBAiB9nejkOcBlDJaMUkLyT12go0IVn4Bcxs85uIDJb5vrGA==\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDVjCCAv2gAwIBAgIOAMbo0sS/vFhYDJHStpswCgYIKoZIzj0EAwIwgZwxCzAJ\r\n"\
"BgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxl\r\n"\
"MRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5h\r\n"\
"Z2VtZW50MTAwLgYDVQQDDCdBbWF6b25ESEEgVHV5YV9NYW51ZmFjdHVyZXIgQ2Vy\r\n"\
"dGlmaWNhdGUwHhcNMTkxMjA5MjAyNTUwWhcNMzkxMjA5MjAyNTUwWjCBpjELMAkG\r\n"\
"A1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUx\r\n"\
"GDAWBgNVBAoMD0FtYXpvbi5jb20gSW5jLjEaMBgGA1UECwwRRGV2aWNlIE1hbmFn\r\n"\
"ZW1lbnQxOjA4BgNVBAMMMUFtYXpvbkRIQSBUdXlhX1Byb2R1Y3RfQTNHN0w4Wk9Q\r\n"\
"Q01MU1ogQ2VydGlmaWNhdGUwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT6x5p2\r\n"\
"gMF55IxHIhYeZYvi9JHoIgf0f5DZFhLRew/4cyvp35/gg4qmS5TyJj/w0/kRlWlQ\r\n"\
"92xqUSXCmV5Z7mz2o4IBFTCCAREwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU\r\n"\
"mJwEkREfWsOqylJ5UT53kvlC7kQwgc4GA1UdIwSBxjCBw4AU8RzI5oQ+OsSvsUub\r\n"\
"ORRuOEETp/ShgZqkgZcwgZQxFDASBgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQL\r\n"\
"DBpEZXZpY2UgTWFuYWdlbWVudCBTZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTET\r\n"\
"MBEGA1UECAwKV2FzaGluZ3RvbjELMAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpv\r\n"\
"bkRIQSBSb290IENlcnRpZmljYXRlgg4AxujSrs5VP8cNqAB3ZjAOBgNVHQ8BAf8E\r\n"\
"BAMCAYYwCgYIKoZIzj0EAwIDRwAwRAIgIUDhICIQzclWoZXHGFMIkFajYIO0DcYk\r\n"\
"lFJVx5d+uHACIGy3fKfqenETqIH5snJsFR7QnEQ47Qq3K9ceGh2Azz1m\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDQDCCAuagAwIBAgIOAMbo0q7OVT/HDagAd2YwCgYIKoZIzj0EAwIwgZQxFDAS\r\n"\
"BgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVudCBT\r\n"\
"ZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEL\r\n"\
"MAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmljYXRl\r\n"\
"MB4XDTE5MTIwOTIwMjU0MFoXDTM5MTIwOTIwMjU0MFowgZwxCzAJBgNVBAYTAlVT\r\n"\
"MRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMRgwFgYDVQQK\r\n"\
"DA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5hZ2VtZW50MTAw\r\n"\
"LgYDVQQDDCdBbWF6b25ESEEgVHV5YV9NYW51ZmFjdHVyZXIgQ2VydGlmaWNhdGUw\r\n"\
"WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARBmDa+6dYNG2/KBpLv08bn6e1lmoKf\r\n"\
"1hv0e8W3tQW97u1kFpiq3BF1MaQqrAiV0vqFItWOeWCXwV7oy3hz+6Q7o4IBEDCC\r\n"\
"AQwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU8RzI5oQ+OsSvsUubORRuOEET\r\n"\
"p/QwgckGA1UdIwSBwTCBvoAUYYvcTyRKpW7uCmW8vHSaUZXqq2ChgZqkgZcwgZQx\r\n"\
"FDASBgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVu\r\n"\
"dCBTZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3Rv\r\n"\
"bjELMAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmlj\r\n"\
"YXRlggkAqkHFg3IfxuIwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA0gAMEUC\r\n"\
"IQDnRZkmmDemoO+Mk7yutOIpp0mF2Cj4+1Y35uHLnobBfQIgOuZdBZK4Pab8TD2g\r\n"\
"9TzvlsmQkQqm1VTNyqwykH0o+5g=\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDNjCCAtugAwIBAgIJAKpBxYNyH8biMAoGCCqGSM49BAMCMIGUMRQwEgYDVQQK\r\n"\
"DAtBbWF6b24gSW5jLjEjMCEGA1UECwwaRGV2aWNlIE1hbmFnZW1lbnQgU2Vydmlj\r\n"\
"ZXMxEDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xCzAJBgNV\r\n"\
"BAYTAlVTMSMwIQYDVQQDDBpBbWF6b25ESEEgUm9vdCBDZXJ0aWZpY2F0ZTAgFw0x\r\n"\
"NzExMTYwNjI3MDlaGA8yMTE3MTEwODA2MjcwOVowgZQxFDASBgNVBAoMC0FtYXpv\r\n"\
"biBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVudCBTZXJ2aWNlczEQMA4G\r\n"\
"A1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjELMAkGA1UEBhMCVVMx\r\n"\
"IzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmljYXRlMFkwEwYHKoZIzj0C\r\n"\
"AQYIKoZIzj0DAQcDQgAEv7+Zfvkc+qvUaKgaGxQMZoDFHQ18Z5OSXB4BNkYRszgR\r\n"\
"PQ82o54KVb0RKkkq0e3niRn1gUZ8jozePEPrpPV5yaOCARAwggEMMA8GA1UdEwEB\r\n"\
"/wQFMAMBAf8wHQYDVR0OBBYEFGGL3E8kSqVu7gplvLx0mlGV6qtgMIHJBgNVHSME\r\n"\
"gcEwgb6AFGGL3E8kSqVu7gplvLx0mlGV6qtgoYGapIGXMIGUMRQwEgYDVQQKDAtB\r\n"\
"bWF6b24gSW5jLjEjMCEGA1UECwwaRGV2aWNlIE1hbmFnZW1lbnQgU2VydmljZXMx\r\n"\
"EDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xCzAJBgNVBAYT\r\n"\
"AlVTMSMwIQYDVQQDDBpBbWF6b25ESEEgUm9vdCBDZXJ0aWZpY2F0ZYIJAKpBxYNy\r\n"\
"H8biMA4GA1UdDwEB/wQEAwIBhjAKBggqhkjOPQQDAgNJADBGAiEAoCM4t1cMuTeu\r\n"\
"8yIlw/1BUIUb1Q4MYXp+LyfjcbmVz8ECIQDuKW8gQZjUS8Z7GcgNYnFup3UjTznj\r\n"\
"5ja4/PmvDx0Glw==\r\n"\
"-----END CERTIFICATE-----";


      

Const

const CHAR_T *cloud_public_key = \
"-----BEGIN PUBLIC KEY-----\r\n" \
"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7qIHbKAKLmYo2IFuZ391KWXLhY51\r\n" \
"KeLCfxxaUGRQ2+Ipuey9raXWS+BxscQRtqw242fEs9kfaRYT+t+tAeQjaw==\r\n" \
"-----END PUBLIC KEY-----\r\n";


      

Const

const CHAR_T *dev_private_key = \
"-----BEGIN PRIVATE KEY-----\r\n"\
"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgSmg4ZmkOnnfbkr6e\r\n"\
"J9olSiOQcI3In90o7Z5mc5jBNNKhRANCAARI/h6GgB26LzS91sy44FOL1Xk3Uw28\r\n"\
"e6DKlLtz57PH6qT1HriuQbsqyJUGtwaNS2GuTjBRtUfU4pxtR3x8QvAp\r\n"\
"-----END PRIVATE KEY-----";


      

Const

const CHAR_T amazon_cert[] = \
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIB7zCCAZWgAwIBAgIEf5abBDAKBggqhkjOPQQDAjCBjjELMAkGA1UEBhMCVVMx\r\n"\
"EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxGDAWBgNVBAoM\r\n"\
"D0FtYXpvbi5jb20gSW5jLjEaMBgGA1UECwwRRGV2aWNlIE1hbmFnZW1lbnQxIjAg\r\n"\
"BgNVBAMMGURBSyBDQSBmb3IgQTEwMU5VVlZOUzc2MzQwHhcNMjAwNTIxMDQwODIy\r\n"\
"WhcNNDAwNTIxMDQwODIyWjAfMR0wGwYJKwYBBAGlawEDDA5BMTAxTlVWVk5TNzYz\r\n"\
"NDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABEj+HoaAHbovNL3WzLjgU4vVeTdT\r\n"\
"Dbx7oMqUu3Pns8fqpPUeuK5BuyrIlQa3Bo1LYa5OMFG1R9TinG1HfHxC8CmjTzBN\r\n"\
"MB0GA1UdDgQWBBRXoaVEB5rcaYsf3zF/SIesWIoHxTAfBgNVHSMEGDAWgBTPYP0y\r\n"\
"cVxp8p67ybjjw1nHIeXPzjALBgNVHQ8EBAMCA6gwCgYIKoZIzj0EAwIDSAAwRQIh\r\n"\
"AIEuXNXw+A8RIJrbGIFf1TzlQ0/mYplWKwFuC27jpWdGAiAInPm8uB9QaTM3Nr8z\r\n"\
"zp4O5vZQrCYMRFcvUreNIglTrw==\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDVDCCAvqgAwIBAgIOAMh0yNgkaQl0BGq/jbUwCgYIKoZIzj0EAwIwgaYxCzAJ\r\n"\
"BgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxl\r\n"\
"MRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5h\r\n"\
"Z2VtZW50MTowOAYDVQQDDDFBbWF6b25ESEEgdHV5YV9Qcm9kdWN0X0ExMDFOVVZW\r\n"\
"TlM3NjM0IENlcnRpZmljYXRlMB4XDTIwMDQyOTE2MjU1NloXDTQwMDQyOTE2MjU1\r\n"\
"NlowgY4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH\r\n"\
"DAdTZWF0dGxlMRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURl\r\n"\
"dmljZSBNYW5hZ2VtZW50MSIwIAYDVQQDDBlEQUsgQ0EgZm9yIEExMDFOVVZWTlM3\r\n"\
"NjM0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiD3cM+GTfNsfcJSO1zHbafKe\r\n"\
"MbdsHCU5vHzdD3IURcteJgnvQqjSMce/A82EmfL8G6GcHgq63j1Cik7dYPL5qKOC\r\n"\
"ASAwggEcMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFM9g/TJxXGnynrvJ\r\n"\
"uOPDWcch5c/OMIHWBgNVHSMEgc4wgcuAFBKrjoX+A7DTDyRzm5td9WGz91TYoYGi\r\n"\
"pIGfMIGcMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UE\r\n"\
"BwwHU2VhdHRsZTEYMBYGA1UECgwPQW1hem9uLmNvbSBJbmMuMRowGAYDVQQLDBFE\r\n"\
"ZXZpY2UgTWFuYWdlbWVudDEwMC4GA1UEAwwnQW1hem9uREhBIFR1eWFfTWFudWZh\r\n"\
"Y3R1cmVyIENlcnRpZmljYXRlgg4AyHTIzjPtVZWdZb0jGDAOBgNVHQ8BAf8EBAMC\r\n"\
"AoQwCgYIKoZIzj0EAwIDSAAwRQIgBA7X5ncLg8Uwht+segzN0zSi2AwDpcOWIa4D\r\n"\
"9DcA3WoCIQCgsqkBjYr60zfyF0irOgJrlh+HgulKudfc/ESTSJs0aQ==\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDWDCCAv2gAwIBAgIOAMh0yM4z7VWVnWW9IxgwCgYIKoZIzj0EAwIwgZwxCzAJ\r\n"\
"BgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxl\r\n"\
"MRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5h\r\n"\
"Z2VtZW50MTAwLgYDVQQDDCdBbWF6b25ESEEgVHV5YV9NYW51ZmFjdHVyZXIgQ2Vy\r\n"\
"dGlmaWNhdGUwHhcNMjAwNDI5MTYyNTUyWhcNNDAwNDI5MTYyNTUyWjCBpjELMAkG\r\n"\
"A1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUx\r\n"\
"GDAWBgNVBAoMD0FtYXpvbi5jb20gSW5jLjEaMBgGA1UECwwRRGV2aWNlIE1hbmFn\r\n"\
"ZW1lbnQxOjA4BgNVBAMMMUFtYXpvbkRIQSB0dXlhX1Byb2R1Y3RfQTEwMU5VVlZO\r\n"\
"Uzc2MzQgQ2VydGlmaWNhdGUwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQPXnAv\r\n"\
"MfkLIPa36y1tytRiQnM6EML+KAS4yuDjN+WiqsjzAbmmrJISd0FOdaiKZLRy1CqQ\r\n"\
"8LPlnLeWN+ez75N6o4IBFTCCAREwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU\r\n"\
"EquOhf4DsNMPJHObm131YbP3VNgwgc4GA1UdIwSBxjCBw4AU8RzI5oQ+OsSvsUub\r\n"\
"ORRuOEETp/ShgZqkgZcwgZQxFDASBgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQL\r\n"\
"DBpEZXZpY2UgTWFuYWdlbWVudCBTZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTET\r\n"\
"MBEGA1UECAwKV2FzaGluZ3RvbjELMAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpv\r\n"\
"bkRIQSBSb290IENlcnRpZmljYXRlgg4AxujSrs5VP8cNqAB3ZjAOBgNVHQ8BAf8E\r\n"\
"BAMCAYYwCgYIKoZIzj0EAwIDSQAwRgIhALak4BjOMpaXW+ZnrMnfJQMfhyfDCw4r\r\n"\
"n2k6AlIJOb6KAiEAtZd1Xbp/qn7h16tosTdbeJCO9AYBURUDpiR1f6tKI4Q=\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDQDCCAuagAwIBAgIOAMbo0q7OVT/HDagAd2YwCgYIKoZIzj0EAwIwgZQxFDAS\r\n"\
"BgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVudCBT\r\n"\
"ZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEL\r\n"\
"MAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmljYXRl\r\n"\
"MB4XDTE5MTIwOTIwMjU0MFoXDTM5MTIwOTIwMjU0MFowgZwxCzAJBgNVBAYTAlVT\r\n"\
"MRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMRgwFgYDVQQK\r\n"\
"DA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5hZ2VtZW50MTAw\r\n"\
"LgYDVQQDDCdBbWF6b25ESEEgVHV5YV9NYW51ZmFjdHVyZXIgQ2VydGlmaWNhdGUw\r\n"\
"WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARBmDa+6dYNG2/KBpLv08bn6e1lmoKf\r\n"\
"1hv0e8W3tQW97u1kFpiq3BF1MaQqrAiV0vqFItWOeWCXwV7oy3hz+6Q7o4IBEDCC\r\n"\
"AQwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU8RzI5oQ+OsSvsUubORRuOEET\r\n"\
"p/QwgckGA1UdIwSBwTCBvoAUYYvcTyRKpW7uCmW8vHSaUZXqq2ChgZqkgZcwgZQx\r\n"\
"FDASBgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVu\r\n"\
"dCBTZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3Rv\r\n"\
"bjELMAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmlj\r\n"\
"YXRlggkAqkHFg3IfxuIwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA0gAMEUC\r\n"\
"IQDnRZkmmDemoO+Mk7yutOIpp0mF2Cj4+1Y35uHLnobBfQIgOuZdBZK4Pab8TD2g\r\n"\
"9TzvlsmQkQqm1VTNyqwykH0o+5g=\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDNjCCAtugAwIBAgIJAKpBxYNyH8biMAoGCCqGSM49BAMCMIGUMRQwEgYDVQQK\r\n"\
"DAtBbWF6b24gSW5jLjEjMCEGA1UECwwaRGV2aWNlIE1hbmFnZW1lbnQgU2Vydmlj\r\n"\
"ZXMxEDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xCzAJBgNV\r\n"\
"BAYTAlVTMSMwIQYDVQQDDBpBbWF6b25ESEEgUm9vdCBDZXJ0aWZpY2F0ZTAgFw0x\r\n"\
"NzExMTYwNjI3MDlaGA8yMTE3MTEwODA2MjcwOVowgZQxFDASBgNVBAoMC0FtYXpv\r\n"\
"biBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVudCBTZXJ2aWNlczEQMA4G\r\n"\
"A1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjELMAkGA1UEBhMCVVMx\r\n"\
"IzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmljYXRlMFkwEwYHKoZIzj0C\r\n"\
"AQYIKoZIzj0DAQcDQgAEv7+Zfvkc+qvUaKgaGxQMZoDFHQ18Z5OSXB4BNkYRszgR\r\n"\
"PQ82o54KVb0RKkkq0e3niRn1gUZ8jozePEPrpPV5yaOCARAwggEMMA8GA1UdEwEB\r\n"\
"/wQFMAMBAf8wHQYDVR0OBBYEFGGL3E8kSqVu7gplvLx0mlGV6qtgMIHJBgNVHSME\r\n"\
"gcEwgb6AFGGL3E8kSqVu7gplvLx0mlGV6qtgoYGapIGXMIGUMRQwEgYDVQQKDAtB\r\n"\
"bWF6b24gSW5jLjEjMCEGA1UECwwaRGV2aWNlIE1hbmFnZW1lbnQgU2VydmljZXMx\r\n"\
"EDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xCzAJBgNVBAYT\r\n"\
"AlVTMSMwIQYDVQQDDBpBbWF6b25ESEEgUm9vdCBDZXJ0aWZpY2F0ZYIJAKpBxYNy\r\n"\
"H8biMA4GA1UdDwEB/wQEAwIBhjAKBggqhkjOPQQDAgNJADBGAiEAoCM4t1cMuTeu\r\n"\
"8yIlw/1BUIUb1Q4MYXp+LyfjcbmVz8ECIQDuKW8gQZjUS8Z7GcgNYnFup3UjTznj\r\n"\
"5ja4/PmvDx0Glw==\r\n"\
"-----END CERTIFICATE-----";


      

Const

const CHAR_T *cloud_public_key = \
"-----BEGIN PUBLIC KEY-----\r\n" \
"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7qIHbKAKLmYo2IFuZ391KWXLhY51\r\n" \
"KeLCfxxaUGRQ2+Ipuey9raXWS+BxscQRtqw242fEs9kfaRYT+t+tAeQjaw==\r\n" \
"-----END PUBLIC KEY-----\r\n";


      

Const

const CHAR_T *dev_private_key = \
"-----BEGIN PRIVATE KEY-----\r\n"\
"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgoGpApBXm4Z+W3EU0\r\n"\
"s39nwC2QZTG7S6aBKNzH+HCqv+ShRANCAARpsjgot5sLEfRBuH7KxMhpX37LeABd\r\n"\
"I0lT/T+vi+rEnqI2JKNKNrCVWJ9EIb0nUHBxXEcjG/wO+J7doGrqc6Xb\r\n"\
"-----END PRIVATE KEY-----";


      

Const

const CHAR_T amazon_cert[] = \
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIB7jCCAZWgAwIBAgIES7/b+jAKBggqhkjOPQQDAjCBjjELMAkGA1UEBhMCVVMx\r\n"\
"EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxGDAWBgNVBAoM\r\n"\
"D0FtYXpvbi5jb20gSW5jLjEaMBgGA1UECwwRRGV2aWNlIE1hbmFnZW1lbnQxIjAg\r\n"\
"BgNVBAMMGURBSyBDQSBmb3IgQTNHN0w4Wk9QQ01MU1owHhcNMjAwMzE2MDI0MTQ5\r\n"\
"WhcNNDAwMzE2MDI0MTQ5WjAfMR0wGwYJKwYBBAGlawEDDA5BM0c3TDhaT1BDTUxT\r\n"\
"WjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGmyOCi3mwsR9EG4fsrEyGlffst4\r\n"\
"AF0jSVP9P6+L6sSeojYko0o2sJVYn0QhvSdQcHFcRyMb/A74nt2gaupzpdujTzBN\r\n"\
"MB0GA1UdDgQWBBRS97MOyh37ZBeBpkVhoyXkLTiErDAfBgNVHSMEGDAWgBRt/d4w\r\n"\
"tk20QwCrH3vpt47oCpw6tzALBgNVHQ8EBAMCA6gwCgYIKoZIzj0EAwIDRwAwRAIg\r\n"\
"BEpjMv3xJHDnqYbK0LDkGWJIQcML3phDjylDyhuLVV4CIANnU/Y+bYdz+KKWIbVS\r\n"\
"rPJamALOzWPJdaoSzNnai2Ph\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDVDCCAvqgAwIBAgIOAMbo00n8Whivijn5xjAwCgYIKoZIzj0EAwIwgaYxCzAJ\r\n"\
"BgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxl\r\n"\
"MRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5h\r\n"\
"Z2VtZW50MTowOAYDVQQDDDFBbWF6b25ESEEgVHV5YV9Qcm9kdWN0X0EzRzdMOFpP\r\n"\
"UENNTFNaIENlcnRpZmljYXRlMB4XDTE5MTIwOTIwMjY1M1oXDTM5MTIwOTIwMjY1\r\n"\
"M1owgY4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQH\r\n"\
"DAdTZWF0dGxlMRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURl\r\n"\
"dmljZSBNYW5hZ2VtZW50MSIwIAYDVQQDDBlEQUsgQ0EgZm9yIEEzRzdMOFpPUENN\r\n"\
"TFNaMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2mnT36IJ8nhXXVPbru0NjlGn\r\n"\
"uYglVNVhCJSjJ5tBuf7Yeyzy6Kpqt58kAu/YQUNgahNHbnpBbPcORb017+4FKaOC\r\n"\
"ASAwggEcMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFG393jC2TbRDAKsf\r\n"\
"e+m3jugKnDq3MIHWBgNVHSMEgc4wgcuAFJicBJERH1rDqspSeVE+d5L5Qu5EoYGi\r\n"\
"pIGfMIGcMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjEQMA4GA1UE\r\n"\
"BwwHU2VhdHRsZTEYMBYGA1UECgwPQW1hem9uLmNvbSBJbmMuMRowGAYDVQQLDBFE\r\n"\
"ZXZpY2UgTWFuYWdlbWVudDEwMC4GA1UEAwwnQW1hem9uREhBIFR1eWFfTWFudWZh\r\n"\
"Y3R1cmVyIENlcnRpZmljYXRlgg4AxujSxL+8WFgMkdK2mzAOBgNVHQ8BAf8EBAMC\r\n"\
"AoQwCgYIKoZIzj0EAwIDSAAwRQIhANhJdpDuHVHXE3DJo7WYTHyECsANwrcYA9CD\r\n"\
"gvGQXsmBAiB9nejkOcBlDJaMUkLyT12go0IVn4Bcxs85uIDJb5vrGA==\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDVjCCAv2gAwIBAgIOAMbo0sS/vFhYDJHStpswCgYIKoZIzj0EAwIwgZwxCzAJ\r\n"\
"BgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxl\r\n"\
"MRgwFgYDVQQKDA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5h\r\n"\
"Z2VtZW50MTAwLgYDVQQDDCdBbWF6b25ESEEgVHV5YV9NYW51ZmFjdHVyZXIgQ2Vy\r\n"\
"dGlmaWNhdGUwHhcNMTkxMjA5MjAyNTUwWhcNMzkxMjA5MjAyNTUwWjCBpjELMAkG\r\n"\
"A1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUx\r\n"\
"GDAWBgNVBAoMD0FtYXpvbi5jb20gSW5jLjEaMBgGA1UECwwRRGV2aWNlIE1hbmFn\r\n"\
"ZW1lbnQxOjA4BgNVBAMMMUFtYXpvbkRIQSBUdXlhX1Byb2R1Y3RfQTNHN0w4Wk9Q\r\n"\
"Q01MU1ogQ2VydGlmaWNhdGUwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT6x5p2\r\n"\
"gMF55IxHIhYeZYvi9JHoIgf0f5DZFhLRew/4cyvp35/gg4qmS5TyJj/w0/kRlWlQ\r\n"\
"92xqUSXCmV5Z7mz2o4IBFTCCAREwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU\r\n"\
"mJwEkREfWsOqylJ5UT53kvlC7kQwgc4GA1UdIwSBxjCBw4AU8RzI5oQ+OsSvsUub\r\n"\
"ORRuOEETp/ShgZqkgZcwgZQxFDASBgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQL\r\n"\
"DBpEZXZpY2UgTWFuYWdlbWVudCBTZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTET\r\n"\
"MBEGA1UECAwKV2FzaGluZ3RvbjELMAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpv\r\n"\
"bkRIQSBSb290IENlcnRpZmljYXRlgg4AxujSrs5VP8cNqAB3ZjAOBgNVHQ8BAf8E\r\n"\
"BAMCAYYwCgYIKoZIzj0EAwIDRwAwRAIgIUDhICIQzclWoZXHGFMIkFajYIO0DcYk\r\n"\
"lFJVx5d+uHACIGy3fKfqenETqIH5snJsFR7QnEQ47Qq3K9ceGh2Azz1m\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDQDCCAuagAwIBAgIOAMbo0q7OVT/HDagAd2YwCgYIKoZIzj0EAwIwgZQxFDAS\r\n"\
"BgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVudCBT\r\n"\
"ZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEL\r\n"\
"MAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmljYXRl\r\n"\
"MB4XDTE5MTIwOTIwMjU0MFoXDTM5MTIwOTIwMjU0MFowgZwxCzAJBgNVBAYTAlVT\r\n"\
"MRMwEQYDVQQIDApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMRgwFgYDVQQK\r\n"\
"DA9BbWF6b24uY29tIEluYy4xGjAYBgNVBAsMEURldmljZSBNYW5hZ2VtZW50MTAw\r\n"\
"LgYDVQQDDCdBbWF6b25ESEEgVHV5YV9NYW51ZmFjdHVyZXIgQ2VydGlmaWNhdGUw\r\n"\
"WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARBmDa+6dYNG2/KBpLv08bn6e1lmoKf\r\n"\
"1hv0e8W3tQW97u1kFpiq3BF1MaQqrAiV0vqFItWOeWCXwV7oy3hz+6Q7o4IBEDCC\r\n"\
"AQwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU8RzI5oQ+OsSvsUubORRuOEET\r\n"\
"p/QwgckGA1UdIwSBwTCBvoAUYYvcTyRKpW7uCmW8vHSaUZXqq2ChgZqkgZcwgZQx\r\n"\
"FDASBgNVBAoMC0FtYXpvbiBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVu\r\n"\
"dCBTZXJ2aWNlczEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3Rv\r\n"\
"bjELMAkGA1UEBhMCVVMxIzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmlj\r\n"\
"YXRlggkAqkHFg3IfxuIwDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA0gAMEUC\r\n"\
"IQDnRZkmmDemoO+Mk7yutOIpp0mF2Cj4+1Y35uHLnobBfQIgOuZdBZK4Pab8TD2g\r\n"\
"9TzvlsmQkQqm1VTNyqwykH0o+5g=\r\n"\
"-----END CERTIFICATE-----\r\n"\
"-----BEGIN CERTIFICATE-----\r\n"\
"MIIDNjCCAtugAwIBAgIJAKpBxYNyH8biMAoGCCqGSM49BAMCMIGUMRQwEgYDVQQK\r\n"\
"DAtBbWF6b24gSW5jLjEjMCEGA1UECwwaRGV2aWNlIE1hbmFnZW1lbnQgU2Vydmlj\r\n"\
"ZXMxEDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xCzAJBgNV\r\n"\
"BAYTAlVTMSMwIQYDVQQDDBpBbWF6b25ESEEgUm9vdCBDZXJ0aWZpY2F0ZTAgFw0x\r\n"\
"NzExMTYwNjI3MDlaGA8yMTE3MTEwODA2MjcwOVowgZQxFDASBgNVBAoMC0FtYXpv\r\n"\
"biBJbmMuMSMwIQYDVQQLDBpEZXZpY2UgTWFuYWdlbWVudCBTZXJ2aWNlczEQMA4G\r\n"\
"A1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjELMAkGA1UEBhMCVVMx\r\n"\
"IzAhBgNVBAMMGkFtYXpvbkRIQSBSb290IENlcnRpZmljYXRlMFkwEwYHKoZIzj0C\r\n"\
"AQYIKoZIzj0DAQcDQgAEv7+Zfvkc+qvUaKgaGxQMZoDFHQ18Z5OSXB4BNkYRszgR\r\n"\
"PQ82o54KVb0RKkkq0e3niRn1gUZ8jozePEPrpPV5yaOCARAwggEMMA8GA1UdEwEB\r\n"\
"/wQFMAMBAf8wHQYDVR0OBBYEFGGL3E8kSqVu7gplvLx0mlGV6qtgMIHJBgNVHSME\r\n"\
"gcEwgb6AFGGL3E8kSqVu7gplvLx0mlGV6qtgoYGapIGXMIGUMRQwEgYDVQQKDAtB\r\n"\
"bWF6b24gSW5jLjEjMCEGA1UECwwaRGV2aWNlIE1hbmFnZW1lbnQgU2VydmljZXMx\r\n"\
"EDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xCzAJBgNVBAYT\r\n"\
"AlVTMSMwIQYDVQQDDBpBbWF6b25ESEEgUm9vdCBDZXJ0aWZpY2F0ZYIJAKpBxYNy\r\n"\
"H8biMA4GA1UdDwEB/wQEAwIBhjAKBggqhkjOPQQDAgNJADBGAiEAoCM4t1cMuTeu\r\n"\
"8yIlw/1BUIUb1Q4MYXp+LyfjcbmVz8ECIQDuKW8gQZjUS8Z7GcgNYnFup3UjTznj\r\n"\
"5ja4/PmvDx0Glw==\r\n"\
"-----END CERTIFICATE-----";

      

Types

Type

enum tcp_state altcp_dbg_get_tcp_state(struct altcp_pcb *conn);


      

Type

enum tcp_state altcp_default_dbg_get_tcp_state(struct altcp_pcb *conn);

      

Typedefs

Typedef PUSH_KEY_TYPE_E;

typedef enum {
   /** one shot */
   NORMAL_KEY = 0,
   /** continual shot */
   SEQ_KEY,
   /** long press */
   LONG_KEY,
}PUSH_KEY_TYPE_E;
/**
 * @brief Definition of KEY type
 */

Typedef KEY_LONG_PRESS_TP_E;

typedef enum {
   /** long press invalid */
   LP_INVALID = 0,
   /** long press once trigger */
   LP_ONCE_TRIG,
   /** long press more normal trigger */
   LP_MORE_NORMAL_TRIG,
   /** press key immedialtely trigger */
   FALLING_EDGE_TRIG,
   /** press key immedialtely trigger & LONG */
   FALLING_LONG_TRIG,
}KEY_LONG_PRESS_TP_E;
/**
 * Definitioin of long pross type
 */

Typedef VOID

typedef VOID(* KEY_CALLBACK)(tuya_pin_name_t port,PUSH_KEY_TYPE_E type,INT_T cnt);
/**
 * @brief Handler of KEY event
 * 
 * @param[in] port PIN ID that got the event
 * @param[in] type Press type, see PUSH_KEY_TYPE_E
 * @param[in] cnt Count of continual. 
 * 
 * @note (cnt >= 2) ==> SEQ_KEY,
 * time < long_key_time && (cnt == 1) ==> NORMAL_KEY,
 * time >= long_key_time && (cnt == 1) ==> LONG_KEY
 */

Typedef KEY_USER_DEF_S;

typedef struct {
   /** PIN ID */
   tuya_pin_name_t port;
   /** whether low level trigger */
   BOOL_T low_level_detect;
   /** long press type, see KEY_LONG_PRESS_TP_E */
   KEY_LONG_PRESS_TP_E lp_tp;
   /** unit: ms, lp_tp == LP_ONCE_TRIG then valid and must >= 1000ms */
   USHORT_T long_key_time;
   /** unit:ms , 0:disable default:400ms */
   USHORT_T seq_key_detect_time;
   /** handler of KEY event */
   KEY_CALLBACK call_back;
}KEY_USER_DEF_S;
/**
 * @brief Definition of user defined key
 */

Typedef LED_HANDLE

typedef PVOID_T LED_HANDLE; // led handle


      

Typedef LED_LT_E;

typedef enum {
   OL_LOW = 0,   // output level low
   OL_HIGH,      // output level high
   OL_FLASH_LOW, // when led flash,the level output low first.
                  // when led flash end,the the level output low.
   OL_FLASH_HIGH, // when led flash,the level output high first.
                  // when led flash end,the the level output high.
}LED_LT_E;
/**
 * @brief Definition of LED output level
 */

Typedef DLONG_T

typedef long long DLONG_T;


      

Typedef *PDLONG_T

typedef DLONG_T *PDLONG_T;


      

Typedef DDWORD_T

typedef unsigned long long DDWORD_T;


      

Typedef *PDDWORD_T

typedef DDWORD_T *PDDWORD_T;


      

Typedef FLOAT_T

typedef float FLOAT_T;


      

Typedef *PFLOAT_T

typedef FLOAT_T *PFLOAT_T;


      

Typedef INT_T

typedef signed int INT_T;


      

Typedef *PINT_T

typedef int *PINT_T;


      

Typedef *PVOID_T

typedef void *PVOID_T;


      

Typedef CHAR_T

typedef char CHAR_T;


      

Typedef *PCHAR_T

typedef char *PCHAR_T;


      

Typedef SCHAR_T

typedef signed char SCHAR_T;


      

Typedef UCHAR_T

typedef unsigned char UCHAR_T;


      

Typedef SHORT_T

typedef short SHORT_T;


      

Typedef USHORT_T

typedef unsigned short USHORT_T;


      

Typedef *PSHORT_T

typedef short *PSHORT_T;


      

Typedef LONG_T

typedef long LONG_T;


      

Typedef ULONG_T

typedef unsigned long ULONG_T;


      

Typedef *PLONG_T

typedef long *PLONG_T;


      

Typedef BYTE_T

typedef unsigned char BYTE_T;


      

Typedef *PBYTE_T

typedef BYTE_T *PBYTE_T;


      

Typedef WORD_T

typedef unsigned short WORD_T;


      

Typedef *PWORD_T

typedef WORD_T *PWORD_T;


      

Typedef DWORD_T

typedef unsigned int DWORD_T;


      

Typedef *PDWORD_T

typedef DWORD_T *PDWORD_T;


      

Typedef UINT_T

typedef unsigned int UINT_T;


      

Typedef *PUINT_T

typedef unsigned int *PUINT_T;


      

Typedef BOOL_T

typedef int BOOL_T;


      

Typedef *PBOOL_T

typedef BOOL_T *PBOOL_T;


      

Typedef INT64_T

typedef long long int INT64_T;


      

Typedef *PINT64_T

typedef INT64_T *PINT64_T;


      

Typedef UINT64_T

typedef unsigned long long int UINT64_T;


      

Typedef *PUINT64_T

typedef UINT64_T *PUINT64_T;


      

Typedef INT16_T

typedef short INT16_T;


      

Typedef *PINT16_T

typedef INT16_T *PINT16_T;


      

Typedef UINT16_T

typedef unsigned short UINT16_T;


      

Typedef *PUINT16_T

typedef UINT16_T *PUINT16_T;


      

Typedef INT8_T

typedef char INT8_T;


      

Typedef *PINT8_T

typedef INT8_T *PINT8_T;


      

Typedef UINT8_T

typedef unsigned char UINT8_T;


      

Typedef *PUINT8_T

typedef UINT8_T *PUINT8_T;


      

Typedef TIME_MS

typedef ULONG_T TIME_MS;


      

Typedef TIME_S

typedef ULONG_T TIME_S;


      

Typedef TIME_T

typedef unsigned int TIME_T;


      

Typedef bool_t

typedef int bool_t;


      

Typedef SIZE_T

typedef size_t SIZE_T;


      

Typedef OPERATE_RET

typedef int OPERATE_RET;


      

Typedef err_t

typedef err_t (*altcp_accept_fn)(void *arg, struct altcp_pcb *new_conn, err_t err);


      

Typedef altcp_connected_fn

typedef err_t (*altcp_connected_fn)(void *arg, struct altcp_pcb *conn, err_t err);


      

Typedef altcp_recv_fn

typedef err_t (*altcp_recv_fn)(void *arg, struct altcp_pcb *conn, struct pbuf *p, err_t err);


      

Typedef altcp_sent_fn

typedef err_t (*altcp_sent_fn)(void *arg, struct altcp_pcb *conn, u16_t len);


      

Typedef altcp_poll_fn

typedef err_t (*altcp_poll_fn)(void *arg, struct altcp_pcb *conn);


      

Typedef altcp_err_fn

typedef void (*altcp_err_fn)(void *arg, err_t err);


      

Typedef altcp_pcb

typedef struct altcp_pcb* (*altcp_new_fn)(void *arg, u8_t ip_type);


      

Typedef altcp_allocator_t;

typedef struct altcp_allocator_s {
 /** Allocator function */
 altcp_new_fn alloc;
 /** Argument to allocator function */
 void        *arg;
} altcp_allocator_t;
/** @ingroup altcp */

Typedef netconn_callback

typedef void (* netconn_callback)(struct netconn *, enum netconn_evt, u16_t len);
/** A callback prototype to inform about events for a netconn */

Typedef fs_file_extension

typedef void fs_file_extension;


      

Typedef fs_wait_cb

typedef void (*fs_wait_cb)(void *arg);


      

Typedef httpc_result_t;

typedef enum ehttpc_result {
 /** File successfully received */
 HTTPC_RESULT_OK           = 0,
 /** Unknown error */
 HTTPC_RESULT_ERR_UNKNOWN  = 1,
 /** Connection to server failed */
 HTTPC_RESULT_ERR_CONNECT  = 2,
 /** Failed to resolve server hostname */
 HTTPC_RESULT_ERR_HOSTNAME = 3,
 /** Connection unexpectedly closed by remote server */
 HTTPC_RESULT_ERR_CLOSED   = 4,
 /** Connection timed out (server didn't respond in time) */
 HTTPC_RESULT_ERR_TIMEOUT  = 5,
 /** Server responded with an error code */
 HTTPC_RESULT_ERR_SVR_RESP = 6,
 /** Local memory error */
 HTTPC_RESULT_ERR_MEM      = 7,
 /** Local abort */
 HTTPC_RESULT_LOCAL_ABORT  = 8,
 /** Content length mismatch */
 HTTPC_RESULT_ERR_CONTENT_LEN = 9
} httpc_result_t;
/**
 * @ingroup httpc 
 * HTTP client result codes
 */

Typedef httpc_state_t

typedef struct _httpc_state httpc_state_t;


      

Typedef httpc_result_fn

typedef void (*httpc_result_fn)(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err);
/**
 * @ingroup httpc 
 * Prototype of a http client callback function
 *
 * @param arg argument specified when initiating the request
 * @param httpc_result result of the http transfer (see enum httpc_result_t)
 * @param rx_content_len number of bytes received (without headers)
 * @param srv_res this contains the http status code received (if any)
 * @param err an error returned by internal lwip functions, can help to specify
 *            the source of the error but must not necessarily be != ERR_OK
 */

Typedef httpc_headers_done_fn

typedef err_t (*httpc_headers_done_fn)(httpc_state_t *connection, void *arg, struct pbuf *hdr, u16_t hdr_len, u32_t content_len);
/**
 * @ingroup httpc 
 * Prototype of http client callback: called when the headers are received
 *
 * @param connection http client connection
 * @param arg argument specified when initiating the request
 * @param hdr header pbuf(s) (may contain data also)
 * @param hdr_len length of the heders in 'hdr'
 * @param content_len content length as received in the headers (-1 if not received)
 * @return if != ERR_OK is returned, the connection is aborted
 */

Typedef httpc_connection_t;

typedef struct _httpc_connection {
 ip_addr_t proxy_addr;
 u16_t proxy_port;
 u8_t use_proxy;
 /* @todo: add username:pass? */

#if LWIP_ALTCP
 altcp_allocator_t *altcp_allocator;
#endif

 /* this callback is called when the transfer is finished (or aborted) */
 httpc_result_fn result_fn;
 /* this callback is called after receiving the http headers
     It can abort the connection by returning != ERR_OK */
 httpc_headers_done_fn headers_done_fn;
} httpc_connection_t;


      

Typedef const

typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[],
                            char *pcValue[]);
/**
 * @ingroup httpd
 * Function pointer for a CGI script handler.
 *
 * This function is called each time the HTTPD server is asked for a file
 * whose name was previously registered as a CGI function using a call to
 * http_set_cgi_handlers. The iIndex parameter provides the index of the
 * CGI within the cgis array passed to http_set_cgi_handlers. Parameters
 * pcParam and pcValue provide access to the parameters provided along with
 * the URI. iNumParams provides a count of the entries in the pcParam and
 * pcValue arrays. Each entry in the pcParam array contains the name of a
 * parameter with the corresponding entry in the pcValue array containing the
 * value for that parameter. Note that pcParam may contain multiple elements
 * with the same name if, for example, a multi-selection list control is used
 * in the form generating the data.
 *
 * The function should return a pointer to a character string which is the
 * path and filename of the response that is to be sent to the connected
 * browser, for example "/thanks.htm" or "/response/error.ssi".
 *
 * The maximum number of parameters that will be passed to this function via
 * iNumParams is defined by LWIP_HTTPD_MAX_CGI_PARAMETERS. Any parameters in
 * the incoming HTTP request above this number will be discarded.
 *
 * Requests intended for use by this CGI mechanism must be sent using the GET
 * method (which encodes all parameters within the URI rather than in a block
 * later in the request). Attempts to use the POST method will result in the
 * request being ignored.
 *
 */

Typedef tCGI;

typedef struct
{
   const char *pcCGIName;
   tCGIHandler pfnCGIHandler;
} tCGI;
/**
 * @ingroup httpd
 * Structure defining the base filename (URL) of a CGI and the associated
 * function which is to be called when that URL is requested.
 */

Typedef u16_t

typedef u16_t (*tSSIHandler)(
#if LWIP_HTTPD_SSI_RAW
                            const char* ssi_tag_name,
#else /* LWIP_HTTPD_SSI_RAW */
                            int iIndex,
#endif /* LWIP_HTTPD_SSI_RAW */
                            char *pcInsert, int iInsertLen
#if LWIP_HTTPD_SSI_MULTIPART
                            , u16_t current_tag_part, u16_t *next_tag_part
#endif /* LWIP_HTTPD_SSI_MULTIPART */
#if defined(LWIP_HTTPD_FILE_STATE) && LWIP_HTTPD_FILE_STATE
                            , void *connection_state
#endif /* LWIP_HTTPD_FILE_STATE */
                            );
/**
 * @ingroup httpd
 * Function pointer for the SSI tag handler callback.
 *
 * This function will be called each time the HTTPD server detects a tag of the
 * form  in files with extensions mentioned in the g_pcSSIExtensions
 * array (currently .shtml, .shtm, .ssi, .xml, .json) where "name" appears as
 * one of the tags supplied to http_set_ssi_handler in the tags array.  The
 * returned insert string, which will be appended after the the string
 * "" in file sent back to the client, should be written to pointer
 * pcInsert. iInsertLen contains the size of the buffer pointed to by
 * pcInsert. The iIndex parameter provides the zero-based index of the tag as
 * found in the tags array and identifies the tag that is to be processed.
 *
 * The handler returns the number of characters written to pcInsert excluding
 * any terminating NULL or HTTPD_SSI_TAG_UNKNOWN when tag is not recognized.
 *
 * Note that the behavior of this SSI mechanism is somewhat different from the
 * "normal" SSI processing as found in, for example, the Apache web server.  In
 * this case, the inserted text is appended following the SSI tag rather than
 * replacing the tag entirely.  This allows for an implementation that does not
 * require significant additional buffering of output data yet which will still
 * offer usable SSI functionality. One downside to this approach is when
 * attempting to use SSI within JavaScript.  The SSI tag is structured to
 * resemble an HTML comment but this syntax does not constitute a comment
 * within JavaScript and, hence, leaving the tag in place will result in
 * problems in these cases. In order to avoid these problems, define
 * LWIP_HTTPD_SSI_INCLUDE_TAG as zero in your lwip options file, or use JavaScript
 * style block comments in the form / * # name * / (without the spaces).
 */

Typedef lwiperf_report_fn

typedef void (*lwiperf_report_fn)(void *arg, enum lwiperf_report_type report_type,
 const ip_addr_t* local_addr, u16_t local_port, const ip_addr_t* remote_addr, u16_t remote_port,
 u32_t bytes_transferred, u32_t ms_duration, u32_t bandwidth_kbitpsec);
/** Prototype of a report function that is called when a session is finished.
    This report function can show the test results.
    @param report_type contains the test result */

Typedef service_get_txt_fn_t

typedef void (*service_get_txt_fn_t)(struct mdns_service *service, void *txt_userdata);
/** Callback function to add text to a reply, called when generating the reply */

Typedef mdns_name_result_cb_t

typedef void (*mdns_name_result_cb_t)(struct netif* netif, u8_t result);
/** Callback function to let application know the result of probing network for name
 * uniqueness, called with result MDNS_PROBING_SUCCESSFUL if no other node claimed
 * use for the name for the netif or a service and is safe to use, or MDNS_PROBING_CONFLICT
 * if another node is already using it and mdns is disabled on this interface */

Typedef mqtt_client_t

typedef struct mqtt_client_s mqtt_client_t;


      

Typedef mqtt_connection_status_t;

typedef enum
{
 /** Accepted */
 MQTT_CONNECT_ACCEPTED                = 0,
 /** Refused protocol version */
 MQTT_CONNECT_REFUSED_PROTOCOL_VERSION = 1,
 /** Refused identifier */
 MQTT_CONNECT_REFUSED_IDENTIFIER      = 2,
 /** Refused server */
 MQTT_CONNECT_REFUSED_SERVER          = 3,
 /** Refused user credentials */
 MQTT_CONNECT_REFUSED_USERNAME_PASS   = 4,
 /** Refused not authorized */
 MQTT_CONNECT_REFUSED_NOT_AUTHORIZED_ = 5,
 /** Disconnected */
 MQTT_CONNECT_DISCONNECTED            = 256,
 /** Timeout */
 MQTT_CONNECT_TIMEOUT                 = 257
} mqtt_connection_status_t;
/**
 * @ingroup mqtt
 * Connection status codes */

Typedef mqtt_connection_cb_t

typedef void (*mqtt_connection_cb_t)(mqtt_client_t *client, void *arg, mqtt_connection_status_t status);
/**
 * @ingroup mqtt
 * Function prototype for mqtt connection status callback. Called when
 * client has connected to the server after initiating a mqtt connection attempt by
 * calling mqtt_client_connect() or when connection is closed by server or an error
 *
 * @param client MQTT client itself
 * @param arg Additional argument to pass to the callback function
 * @param status Connect result code or disconnection notification @see mqtt_connection_status_t
 *
 */

Typedef mqtt_incoming_data_cb_t

typedef void (*mqtt_incoming_data_cb_t)(void *arg, const u8_t *data, u16_t len, u8_t flags);
/** 
 * @ingroup mqtt
 * Function prototype for MQTT incoming publish data callback function. Called when data
 * arrives to a subscribed topic @see mqtt_subscribe
 *
 * @param arg Additional argument to pass to the callback function
 * @param data User data, pointed object, data may not be referenced after callback return,
          NULL is passed when all publish data are delivered
 * @param len Length of publish data fragment
 * @param flags MQTT_DATA_FLAG_LAST set when this call contains the last part of data from publish message
 *
 */

Typedef mqtt_incoming_publish_cb_t

typedef void (*mqtt_incoming_publish_cb_t)(void *arg, const char *topic, u32_t tot_len);
/** 
 * @ingroup mqtt
 * Function prototype for MQTT incoming publish function. Called when an incoming publish
 * arrives to a subscribed topic @see mqtt_subscribe
 *
 * @param arg Additional argument to pass to the callback function
 * @param topic Zero terminated Topic text string, topic may not be referenced after callback return
 * @param tot_len Total length of publish data, if set to 0 (no publish payload) data callback will not be invoked
 */

Typedef mqtt_request_cb_t

typedef void (*mqtt_request_cb_t)(void *arg, err_t err);
/**
 * @ingroup mqtt
 * Function prototype for mqtt request callback. Called when a subscribe, unsubscribe
 * or publish request has completed
 * @param arg Pointer to user data supplied when invoking request
 * @param err ERR_OK on success
 *            ERR_TIMEOUT if no response was received within timeout,
 *            ERR_ABRT if (un)subscribe was denied
 */

Typedef smtp_result_fn

typedef void (*smtp_result_fn)(void *arg, u8_t smtp_result, u16_t srv_err, err_t err);
/** Prototype of an smtp callback function
 *
 * @param arg argument specified when initiating the email
 * @param smtp_result result of the mail transfer (see defines SMTP_RESULT_*)
 * @param srv_err if aborted by the server, this contains the error code received
 * @param err an error returned by internal lwip functions, can help to specify
 *            the source of the error but must not necessarily be != ERR_OK
 */

Typedef smtp_bodycback_fn

typedef int (*smtp_bodycback_fn)(void *arg, struct smtp_bodydh *bodydh);
/** Prototype of an smtp body callback function
 * It receives a struct smtp_bodydh, and a buffer to write data,
 * must return BDH_WORKING to be called again and BDH_DONE when
 * it has finished processing. This one tries to fill one TCP buffer with
 * data, your function will be repeatedly called until that happens; so if you
 * know you'll be taking too long to serve your request, pause once in a while
 * by writing length=0 to avoid hogging system resources
 *
 * @param arg argument specified when initiating the email
 * @param smtp_bodydh state handling + buffer structure
 */

Typedef snmp_write_callback_fct

typedef void (*snmp_write_callback_fct)(const u32_t* oid, u8_t oid_len, void* callback_arg);


      

Typedef snmp_err_t;

typedef enum {
 SNMP_ERR_NOERROR            = 0,
/* 
outdated v1 error codes. do not use anmore!
#define SNMP_ERR_NOSUCHNAME 2  use SNMP_ERR_NOSUCHINSTANCE instead
#define SNMP_ERR_BADVALUE   3  use SNMP_ERR_WRONGTYPE,SNMP_ERR_WRONGLENGTH,SNMP_ERR_WRONGENCODING or SNMP_ERR_WRONGVALUE instead
#define SNMP_ERR_READONLY   4  use SNMP_ERR_NOTWRITABLE instead
*/
 SNMP_ERR_GENERROR           = 5,
 SNMP_ERR_NOACCESS           = 6,
 SNMP_ERR_WRONGTYPE          = 7,
 SNMP_ERR_WRONGLENGTH        = 8,
 SNMP_ERR_WRONGENCODING      = 9,
 SNMP_ERR_WRONGVALUE         = 10,
 SNMP_ERR_NOCREATION         = 11,
 SNMP_ERR_INCONSISTENTVALUE  = 12,
 SNMP_ERR_RESOURCEUNAVAILABLE = 13,
 SNMP_ERR_COMMITFAILED       = 14,
 SNMP_ERR_UNDOFAILED         = 15,
 SNMP_ERR_NOTWRITABLE        = 17,
 SNMP_ERR_INCONSISTENTNAME   = 18,

 SNMP_ERR_NOSUCHINSTANCE     = SNMP_VARBIND_EXCEPTION_OFFSET + SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_INSTANCE
} snmp_err_t;
/** error codes predefined by SNMP prot. */

Typedef snmp_access_t;

typedef enum {
 SNMP_NODE_INSTANCE_ACCESS_READ   = 1,
 SNMP_NODE_INSTANCE_ACCESS_WRITE  = 2,
 SNMP_NODE_INSTANCE_READ_ONLY     = SNMP_NODE_INSTANCE_ACCESS_READ,
 SNMP_NODE_INSTANCE_READ_WRITE    = (SNMP_NODE_INSTANCE_ACCESS_READ | SNMP_NODE_INSTANCE_ACCESS_WRITE),
 SNMP_NODE_INSTANCE_WRITE_ONLY    = SNMP_NODE_INSTANCE_ACCESS_WRITE,
 SNMP_NODE_INSTANCE_NOT_ACCESSIBLE = 0
} snmp_access_t;
/** SNMP node instance access types */

Typedef node_instance_get_value_method

typedef s16_t (*node_instance_get_value_method)(struct snmp_node_instance*, void*);


      

Typedef node_instance_set_test_method

typedef snmp_err_t (*node_instance_set_test_method)(struct snmp_node_instance*, u16_t, void*);


      

Typedef node_instance_set_value_method

typedef snmp_err_t (*node_instance_set_value_method)(struct snmp_node_instance*, u16_t, void*);


      

Typedef node_instance_release_method

typedef void (*node_instance_release_method)(struct snmp_node_instance*);


      

Typedef snmp_next_oid_status_t;

typedef enum {
 SNMP_NEXT_OID_STATUS_SUCCESS,
 SNMP_NEXT_OID_STATUS_NO_MATCH,
 SNMP_NEXT_OID_STATUS_BUF_TO_SMALL
} snmp_next_oid_status_t;


      

Typedef s16_t

typedef s16_t (*snmp_scalar_array_get_value_method)(const struct snmp_scalar_array_node_def*, void*);


      

Typedef snmp_err_t

typedef snmp_err_t (*snmp_scalar_array_set_test_method)(const struct snmp_scalar_array_node_def*, u16_t, void*);


      

Typedef snmp_scalar_array_set_value_method

typedef snmp_err_t (*snmp_scalar_array_set_value_method)(const struct snmp_scalar_array_node_def*, u16_t, void*);


      

Typedef snmp_table_column_data_type_t;

typedef enum {
 SNMP_VARIANT_VALUE_TYPE_U32,
 SNMP_VARIANT_VALUE_TYPE_S32,
 SNMP_VARIANT_VALUE_TYPE_PTR,
 SNMP_VARIANT_VALUE_TYPE_CONST_PTR
} snmp_table_column_data_type_t;
/** simple read-only table */

Typedef snmp_threadsync_called_fn

typedef void (*snmp_threadsync_called_fn)(void* arg);


      

Typedef snmp_threadsync_synchronizer_fn

typedef void (*snmp_threadsync_synchronizer_fn)(snmp_threadsync_called_fn fn, void* arg);


      

Typedef snmpv3_auth_algo_t;

typedef enum
{
 SNMP_V3_AUTH_ALGO_INVAL = 0,
 SNMP_V3_AUTH_ALGO_MD5  = 1,
 SNMP_V3_AUTH_ALGO_SHA  = 2
} snmpv3_auth_algo_t;


      

Typedef snmpv3_priv_algo_t;

typedef enum
{
 SNMP_V3_PRIV_ALGO_INVAL = 0,
 SNMP_V3_PRIV_ALGO_DES  = 1,
 SNMP_V3_PRIV_ALGO_AES  = 2
} snmpv3_priv_algo_t;


      

Typedef snmpv3_user_storagetype_t;

typedef enum
{
 SNMP_V3_USER_STORAGETYPE_OTHER      = 1,
 SNMP_V3_USER_STORAGETYPE_VOLATILE   = 2,
 SNMP_V3_USER_STORAGETYPE_NONVOLATILE = 3,
 SNMP_V3_USER_STORAGETYPE_PERMANENT  = 4,
 SNMP_V3_USER_STORAGETYPE_READONLY   = 5
} snmpv3_user_storagetype_t;


      

Typedef u8_t

typedef uint8_t  u8_t;


      

Typedef s8_t

typedef int8_t   s8_t;


      

Typedef u16_t

typedef uint16_t u16_t;


      

Typedef s16_t

typedef int16_t  s16_t;


      

Typedef u32_t

typedef uint32_t u32_t;


      

Typedef s64_t

typedef int32_t  s32_t;
#if LWIP_HAVE_INT64
typedef uint64_t u64_t;
typedef int64_t  s64_t;


      

Typedef mem_ptr_t

typedef uintptr_t mem_ptr_t;


      

Typedef ssize_t

typedef int ssize_t;
#define SSIZE_MAX INT_MAX


      

Typedef dhcp_autoip_coop_state_enum_t;

typedef enum {
 DHCP_AUTOIP_COOP_STATE_OFF = 0,
 DHCP_AUTOIP_COOP_STATE_ON  = 1
} dhcp_autoip_coop_state_enum_t;
/* AutoIP cooperation flags (struct dhcp.autoip_coop_state) */

Typedef dns_found_callback

typedef void (*dns_found_callback)(const char *name, const ip_addr_t *ipaddr, void *callback_arg);
/** Callback which is invoked when a hostname is found.
 * A function of this type must be implemented by the application using the DNS resolver.
 * @param name pointer to the name that was looked up.
 * @param ipaddr pointer to an ip_addr_t containing the IP address of the hostname,
 *        or NULL if the name could not be found (or on any other error).
 * @param callback_arg a user-specified callback argument passed to dns_gethostbyname
*/

Typedef err_enum_t;

typedef enum {
/** No error, everything OK. */
 ERR_OK        = 0,
/** Out of memory error.     */
 ERR_MEM       = -1,
/** Buffer error.            */
 ERR_BUF       = -2,
/** Timeout.                 */
 ERR_TIMEOUT   = -3,
/** Routing problem.         */
 ERR_RTE       = -4,
/** Operation in progress    */
 ERR_INPROGRESS = -5,
/** Illegal value.           */
 ERR_VAL       = -6,
/** Operation would block.   */
 ERR_WOULDBLOCK = -7,
/** Address in use.          */
 ERR_USE       = -8,
/** Already connecting.      */
 ERR_ALREADY   = -9,
/** Conn already established.*/
 ERR_ISCONN    = -10,
/** Not connected.           */
 ERR_CONN      = -11,
/** Low-level netif error    */
 ERR_IF        = -12,

/** Connection aborted.      */
 ERR_ABRT      = -13,
/** Connection reset.        */
 ERR_RST       = -14,
/** Connection closed.       */
 ERR_CLSD      = -15,
/** Illegal argument.        */
 ERR_ARG       = -16
} err_enum_t;
/** Definitions for error constants. */

Typedef err_t

typedef LWIP_ERR_T err_t;
#else /* LWIP_ERR_T */
typedef s8_t err_t;


      

Typedef in_addr_t

typedef u32_t in_addr_t;


      

Typedef ip4_addr_t

typedef struct ip4_addr ip4_addr_t;
/** ip4_addr_t uses a struct for convenience only, so that the same defines can
 * operate both on ip4_addr_t as well as on ip4_addr_p_t. */

Typedef ip6_addr_t

typedef struct ip6_addr ip6_addr_t;
/** IPv6 address */

Typedef u_addr;

typedef struct ip_addr {
 union {
   ip6_addr_t ip6;
   ip4_addr_t ip4;
 } u_addr;
/**
 * @ingroup ipaddr
 * A union struct for both IP version's addresses.
 * ATTENTION: watch out for its size when adding IPv6 address scope!
 */

Typedef define

typedef ip4_addr_t ip_addr_t;
#define IPADDR4_INIT(u32val)                   { u32val }
#define IPADDR4_INIT_BYTES(a,b,c,d)            IPADDR4_INIT(PP_HTONL(LWIP_MAKEU32(a,b,c,d)))
#define IP_IS_V4_VAL(ipaddr)                   1
#define IP_IS_V6_VAL(ipaddr)                   0
#define IP_IS_V4(ipaddr)                       1
#define IP_IS_V6(ipaddr)                       0
#define IP_IS_ANY_TYPE_VAL(ipaddr)             0
#define IP_SET_TYPE_VAL(ipaddr, iptype)
#define IP_SET_TYPE(ipaddr, iptype)
#define IP_GET_TYPE(ipaddr)                    IPADDR_TYPE_V4
#define IP_ADDR_RAW_SIZE(ipaddr)               sizeof(ip4_addr_t)
#define ip_2_ip4(ipaddr)                       (ipaddr)
#define IP_ADDR4(ipaddr,a,b,c,d)               IP4_ADDR(ipaddr,a,b,c,d)



      

Typedef IPADDR6_INIT

typedef ip6_addr_t ip_addr_t;
#define IPADDR6_INIT(a, b, c, d)               { { a, b, c, d } IPADDR6_ZONE_INIT }
#define IPADDR6_INIT_HOST(a, b, c, d)          { { PP_HTONL(a), PP_HTONL(b), PP_HTONL(c), PP_HTONL(d) } IPADDR6_ZONE_INIT }
#define IP_IS_V4_VAL(ipaddr)                   0
#define IP_IS_V6_VAL(ipaddr)                   1
#define IP_IS_V4(ipaddr)                       0
#define IP_IS_V6(ipaddr)                       1
#define IP_IS_ANY_TYPE_VAL(ipaddr)             0
#define IP_SET_TYPE_VAL(ipaddr, iptype)
#define IP_SET_TYPE(ipaddr, iptype)
#define IP_GET_TYPE(ipaddr)                    IPADDR_TYPE_V6
#define IP_ADDR_RAW_SIZE(ipaddr)               sizeof(ip6_addr_t)
#define ip_2_ip6(ipaddr)                       (ipaddr)
#define IP_ADDR6(ipaddr,i0,i1,i2,i3)           IP6_ADDR(ipaddr,i0,i1,i2,i3)
#define IP_ADDR6_HOST(ipaddr,i0,i1,i2,i3)      IP_ADDR6(ipaddr,PP_HTONL(i0),PP_HTONL(i1),PP_HTONL(i2),PP_HTONL(i3))



      

Typedef mem_size_t

typedef size_t mem_size_t;
#define MEM_SIZE_F SZT_F



      

Typedef mem_size_t

typedef u16_t mem_size_t;
#define MEM_SIZE_F U16_F



      

Typedef mem_size_t

typedef u32_t mem_size_t;
#define MEM_SIZE_F U32_F
#else
typedef u16_t mem_size_t;
#define MEM_SIZE_F U16_F


      

Typedef memp_t;

typedef enum {
#define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,
#include "lwip/priv/memp_std.h"
 MEMP_MAX
} memp_t;
/** Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */

Typedef netif_init_fn

typedef err_t (*netif_init_fn)(struct netif *netif);
/** Function prototype for netif init functions. Set up flags and output/linkoutput
 * callback functions in this function.
 *
 * @param netif The netif to initialize
 */

Typedef netif_input_fn

typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp);
/** Function prototype for netif->input functions. This function is saved as 'input'
 * callback function in the netif struct. Call it when a packet has been received.
 *
 * @param p The received packet, copied into a pbuf
 * @param inp The netif which received the packet
 * @return ERR_OK if the packet was handled
 *         != ERR_OK is the packet was NOT handled, in this case, the caller has
 *                   to free the pbuf
 */

Typedef netif_output_fn

typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p,
      const ip4_addr_t *ipaddr);
/** Function prototype for netif->output functions. Called by lwIP when a packet
 * shall be sent. For ethernet netif, set this to 'etharp_output' and set
 * 'linkoutput'.
 *
 * @param netif The netif which shall send a packet
 * @param p The packet to send (p->payload points to IP header)
 * @param ipaddr The IP address to which the packet shall be sent
 */

Typedef netif_output_ip6_fn

typedef err_t (*netif_output_ip6_fn)(struct netif *netif, struct pbuf *p,
      const ip6_addr_t *ipaddr);
/** Function prototype for netif->output_ip6 functions. Called by lwIP when a packet
 * shall be sent. For ethernet netif, set this to 'ethip6_output' and set
 * 'linkoutput'.
 *
 * @param netif The netif which shall send a packet
 * @param p The packet to send (p->payload points to IP header)
 * @param ipaddr The IPv6 address to which the packet shall be sent
 */

Typedef netif_linkoutput_fn

typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p);
/** Function prototype for netif->linkoutput functions. Only used for ethernet
 * netifs. This function is called by ARP when a packet shall be sent.
 *
 * @param netif The netif which shall send a packet
 * @param p The packet to send (raw ethernet packet)
 */

Typedef netif_status_callback_fn

typedef void (*netif_status_callback_fn)(struct netif *netif);
#if LWIP_IPV4 && LWIP_IGMP
/** Function prototype for netif igmp_mac_filter functions */
typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif,
      const ip4_addr_t *group, enum netif_mac_filter_action action);
/** Function prototype for netif status- or link-callback functions. */

Typedef netif_mld_mac_filter_fn

typedef err_t (*netif_mld_mac_filter_fn)(struct netif *netif,
      const ip6_addr_t *group, enum netif_mac_filter_action action);
/** Function prototype for netif mld_mac_filter functions */

Typedef netif_addr_idx_t

typedef u16_t netif_addr_idx_t;
#define NETIF_ADDR_IDX_MAX 32767
#else
typedef u8_t netif_addr_idx_t;
#define NETIF_ADDR_IDX_MAX 127


      

Typedef netif_nsc_reason_t

typedef u16_t netif_nsc_reason_t;
/**
 * @ingroup netif
 * Extended netif status callback (NSC) reasons flags.
 * May be extended in the future!
 */
typedef union
{
 /** Args to LWIP_NSC_LINK_CHANGED callback */
 struct link_changed_s
 {
   /** 1: up; 0: down */
   u8_t state;
 } link_changed;
/** @ingroup netif
 * Argument supplied to netif_ext_callback_fn.
 */

Typedef netif_ext_callback_fn

typedef void (*netif_ext_callback_fn)(struct netif* netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t* args);
/**
 * @ingroup netif
 * Function used for extended netif status callbacks
 * Note: When parsing reason argument, keep in mind that more reasons may be added in the future!
 * @param netif netif that is affected by change
 * @param reason change reason
 * @param args depends on reason, see reason description
 */

Typedef netif_ext_callback_t;

typedef struct netif_ext_callback
{
 netif_ext_callback_fn callback_fn;
 struct netif_ext_callback* next;
} netif_ext_callback_t;


      

Typedef pbuf_layer;

typedef enum {
 /** Includes spare room for transport layer header, e.g. UDP header.
   * Use this if you intend to pass the pbuf to functions like udp_send().
   */
 PBUF_TRANSPORT = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN,
 /** Includes spare room for IP header.
   * Use this if you intend to pass the pbuf to functions like raw_send().
   */
 PBUF_IP = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN,
 /** Includes spare room for link layer header (ethernet header).
   * Use this if you intend to pass the pbuf to functions like ethernet_output().
   * @see PBUF_LINK_HLEN
   */
 PBUF_LINK = PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN,
 /** Includes spare room for additional encapsulation header before ethernet
   * headers (e.g. 802.11).
   * Use this if you intend to pass the pbuf to functions like netif->linkoutput().
   * @see PBUF_LINK_ENCAPSULATION_HLEN
   */
 PBUF_RAW_TX = PBUF_LINK_ENCAPSULATION_HLEN,
 /** Use this for input packets in a netif driver when calling netif->input()
   * in the most common case - ethernet-layer netif driver. */
 PBUF_RAW = 0
} pbuf_layer;
/**
 * @ingroup pbuf
 * Enumeration of pbuf layers
 */

Typedef pbuf_type;

typedef enum {
 /** pbuf data is stored in RAM, used for TX mostly, struct pbuf and its payload
      are allocated in one piece of contiguous memory (so the first payload byte
      can be calculated from struct pbuf).
      pbuf_alloc() allocates PBUF_RAM pbufs as unchained pbufs (although that might
      change in future versions).
      This should be used for all OUTGOING packets (TX).*/
 PBUF_RAM = (PBUF_ALLOC_FLAG_DATA_CONTIGUOUS | PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS | PBUF_TYPE_ALLOC_SRC_MASK_STD_HEAP),
 /** pbuf data is stored in ROM, i.e. struct pbuf and its payload are located in
      totally different memory areas. Since it points to ROM, payload does not
      have to be copied when queued for transmission. */
 PBUF_ROM = PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF,
 /** pbuf comes from the pbuf pool. Much like PBUF_ROM but payload might change
      so it has to be duplicated when queued before transmitting, depending on
      who has a 'ref' to it. */
 PBUF_REF = (PBUF_TYPE_FLAG_DATA_VOLATILE | PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF),
 /** pbuf payload refers to RAM. This one comes from a pool and should be used
      for RX. Payload can be chained (scatter-gather RX) but like PBUF_RAM, struct
      pbuf and its payload are allocated in one piece of contiguous memory (so
      the first payload byte can be calculated from struct pbuf).
      Don't use this for TX, if the pool becomes empty e.g. because of TCP queuing,
      you are unable to receive TCP acks! */
 PBUF_POOL = (PBUF_ALLOC_FLAG_RX | PBUF_TYPE_FLAG_STRUCT_DATA_CONTIGUOUS | PBUF_TYPE_ALLOC_SRC_MASK_STD_MEMP_PBUF_POOL)
} pbuf_type;
/**
 * @ingroup pbuf
 * Enumeration of pbuf types
 */

Typedef pbuf_free_custom_fn

typedef void (*pbuf_free_custom_fn)(struct pbuf *p);
/** Prototype for a function to free a custom pbuf */

Typedef altcp_set_poll_fn

typedef void (*altcp_set_poll_fn)(struct altcp_pcb *conn, u8_t interval);
/* Function prototypes for application layers */

Typedef altcp_recved_fn

typedef void (*altcp_recved_fn)(struct altcp_pcb *conn, u16_t len);


      

Typedef altcp_bind_fn

typedef err_t (*altcp_bind_fn)(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port);


      

Typedef altcp_connect_fn

typedef err_t (*altcp_connect_fn)(struct altcp_pcb *conn, const ip_addr_t *ipaddr, u16_t port, altcp_connected_fn connected);


      

Typedef altcp_listen_fn

typedef struct altcp_pcb *(*altcp_listen_fn)(struct altcp_pcb *conn, u8_t backlog, err_t *err);


      

Typedef altcp_abort_fn

typedef void (*altcp_abort_fn)(struct altcp_pcb *conn);


      

Typedef altcp_close_fn

typedef err_t (*altcp_close_fn)(struct altcp_pcb *conn);


      

Typedef altcp_shutdown_fn

typedef err_t (*altcp_shutdown_fn)(struct altcp_pcb *conn, int shut_rx, int shut_tx);


      

Typedef altcp_write_fn

typedef err_t (*altcp_write_fn)(struct altcp_pcb *conn, const void *dataptr, u16_t len, u8_t apiflags);


      

Typedef altcp_output_fn

typedef err_t (*altcp_output_fn)(struct altcp_pcb *conn);


      

Typedef altcp_mss_fn

typedef u16_t (*altcp_mss_fn)(struct altcp_pcb *conn);


      

Typedef altcp_sndbuf_fn

typedef u16_t (*altcp_sndbuf_fn)(struct altcp_pcb *conn);


      

Typedef altcp_sndqueuelen_fn

typedef u16_t (*altcp_sndqueuelen_fn)(struct altcp_pcb *conn);


      

Typedef altcp_nagle_disable_fn

typedef void (*altcp_nagle_disable_fn)(struct altcp_pcb *conn);


      

Typedef altcp_nagle_enable_fn

typedef void (*altcp_nagle_enable_fn)(struct altcp_pcb *conn);


      

Typedef altcp_nagle_disabled_fn

typedef int  (*altcp_nagle_disabled_fn)(struct altcp_pcb *conn);


      

Typedef altcp_setprio_fn

typedef void (*altcp_setprio_fn)(struct altcp_pcb *conn, u8_t prio);


      

Typedef altcp_dealloc_fn

typedef void (*altcp_dealloc_fn)(struct altcp_pcb *conn);


      

Typedef altcp_get_tcp_addrinfo_fn

typedef err_t (*altcp_get_tcp_addrinfo_fn)(struct altcp_pcb *conn, int local, ip_addr_t *addr, u16_t *port);


      

Typedef ip_addr_t

typedef ip_addr_t *(*altcp_get_ip_fn)(struct altcp_pcb *conn, int local);


      

Typedef altcp_get_port_fn

typedef u16_t (*altcp_get_port_fn)(struct altcp_pcb *conn, int local);


      

Typedef tcp_state

typedef enum tcp_state (*altcp_dbg_get_tcp_state_fn)(struct altcp_pcb *conn);


      

Typedef netifapi_void_fn

typedef void (*netifapi_void_fn)(struct netif *netif);


      

Typedef netifapi_errt_fn

typedef err_t (*netifapi_errt_fn)(struct netif *netif);


      

Typedef memp_pool_helper_t;

typedef enum {
   /* Get the first (via:
       MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/
   MEMP_POOL_HELPER_FIRST = ((u8_t)
#define LWIP_MEMPOOL(name,num,size,desc)
#define LWIP_MALLOC_MEMPOOL_START 1
#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
#define LWIP_MALLOC_MEMPOOL_END
#include "lwip/priv/memp_std.h"
   ) ,
   /* Get the last (via:
       MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */
   MEMP_POOL_HELPER_LAST = ((u8_t)
#define LWIP_MEMPOOL(name,num,size,desc)
#define LWIP_MALLOC_MEMPOOL_START
#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
#define LWIP_MALLOC_MEMPOOL_END 1
#include "lwip/priv/memp_std.h"
   )
} memp_pool_helper_t;
/* Use a helper type to get the start and end of the user "memory pools" for mem_malloc */

Typedef raw_input_state_t;

typedef enum raw_input_state
{
 RAW_INPUT_NONE = 0, /* pbuf did not match any pcbs */
 RAW_INPUT_EATEN,   /* pbuf handed off and delivered to pcb */
 RAW_INPUT_DELIVERED /* pbuf only delivered to pcb (pbuf can still be referenced) */
} raw_input_state_t;
/** return codes for raw_input */

Typedef tcpip_api_call_fn

typedef err_t (*tcpip_api_call_fn)(struct tcpip_api_call_data* call);


      

Typedef autoip_state_enum_t;

typedef enum {
 AUTOIP_STATE_OFF       = 0,
 AUTOIP_STATE_PROBING   = 1,
 AUTOIP_STATE_ANNOUNCING = 2,
 AUTOIP_STATE_BOUND     = 3
} autoip_state_enum_t;
/* AutoIP client states */

Typedef raw_recv_fn

typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p,
   const ip_addr_t *addr);
/** Function prototype for raw pcb receive callback functions.
 * @param arg user supplied argument (raw_pcb.recv_arg)
 * @param pcb the raw_pcb which received data
 * @param p the packet buffer that was received
 * @param addr the remote IP address from which the packet was received
 * @return 1 if the packet was 'eaten' (aka. deleted),
 *         0 if the packet lives on
 * If returning 1, the callback is responsible for freeing the pbuf
 * if it's not used any more.
 */

Typedef sio_fd_t

typedef void * sio_fd_t;


      

Typedef sa_family_t

typedef u8_t sa_family_t;


      

Typedef in_port_t

typedef u16_t in_port_t;


      

Typedef socklen_t

typedef u32_t socklen_t;


      

Typedef ip_mreq;

typedef struct ip_mreq {
   struct in_addr imr_multiaddr; /* IP multicast address of group */
   struct in_addr imr_interface; /* local IP address of interface */
} ip_mreq;


      

Typedef ipv6_mreq;

typedef struct ipv6_mreq {
 struct in6_addr ipv6mr_multiaddr; /*  IPv6 multicast addr */
 unsigned int   ipv6mr_interface; /*  interface index, or 0 */
} ipv6_mreq;


      

Typedef fd_set;

typedef struct fd_set
{
 unsigned char fd_bits [(FD_SETSIZE+7)/8];
} fd_set;


      

Typedef nfds_t

typedef unsigned int nfds_t;


      

Typedef sys_sem_t

typedef u8_t sys_sem_t;
/* For a totally minimal and standalone system, we provide null
   definitions of the sys_ functions. */

Typedef sys_mutex_t

typedef u8_t sys_mutex_t;


      

Typedef sys_mbox_t

typedef u8_t sys_mbox_t;


      

Typedef lwip_thread_fn

typedef void (*lwip_thread_fn)(void *arg);
/** Function prototype for thread functions */

Typedef tcp_accept_fn

typedef err_t (*tcp_accept_fn)(void *arg, struct tcp_pcb *newpcb, err_t err);
/** Function prototype for tcp accept callback functions. Called when a new
 * connection can be accepted on a listening pcb.
 *
 * @param arg Additional argument to pass to the callback function (@see tcp_arg())
 * @param newpcb The new connection pcb
 * @param err An error code if there has been an error accepting.
 *            Only return ERR_ABRT if you have called tcp_abort from within the
 *            callback function!
 */

Typedef tcp_recv_fn

typedef err_t (*tcp_recv_fn)(void *arg, struct tcp_pcb *tpcb,
                            struct pbuf *p, err_t err);
/** Function prototype for tcp receive callback functions. Called when data has
 * been received.
 *
 * @param arg Additional argument to pass to the callback function (@see tcp_arg())
 * @param tpcb The connection pcb which received data
 * @param p The received data (or NULL when the connection has been closed!)
 * @param err An error code if there has been an error receiving
 *            Only return ERR_ABRT if you have called tcp_abort from within the
 *            callback function!
 */

Typedef tcp_sent_fn

typedef err_t (*tcp_sent_fn)(void *arg, struct tcp_pcb *tpcb,
                             u16_t len);
/** Function prototype for tcp sent callback functions. Called when sent data has
 * been acknowledged by the remote side. Use it to free corresponding resources.
 * This also means that the pcb has now space available to send new data.
 *
 * @param arg Additional argument to pass to the callback function (@see tcp_arg())
 * @param tpcb The connection pcb for which data has been acknowledged
 * @param len The amount of bytes acknowledged
 * @return ERR_OK: try to send some data by calling tcp_output
 *            Only return ERR_ABRT if you have called tcp_abort from within the
 *            callback function!
 */

Typedef tcp_poll_fn

typedef err_t (*tcp_poll_fn)(void *arg, struct tcp_pcb *tpcb);
/** Function prototype for tcp poll callback functions. Called periodically as
 * specified by @see tcp_poll.
 *
 * @param arg Additional argument to pass to the callback function (@see tcp_arg())
 * @param tpcb tcp pcb
 * @return ERR_OK: try to send some data by calling tcp_output
 *            Only return ERR_ABRT if you have called tcp_abort from within the
 *            callback function!
 */

Typedef tcp_err_fn

typedef void (*tcp_err_fn)(void *arg, err_t err);
/** Function prototype for tcp error callback functions. Called when the pcb
 * receives a RST or is unexpectedly closed for any other reason.
 *
 * @note The corresponding pcb is already freed when this callback is called!
 *
 * @param arg Additional argument to pass to the callback function (@see tcp_arg())
 * @param err Error code to indicate why the pcb has been closed
 *            ERR_ABRT: aborted through tcp_abort or by a TCP timer
 *            ERR_RST: the connection was reset by the remote host
 */

Typedef tcp_connected_fn

typedef err_t (*tcp_connected_fn)(void *arg, struct tcp_pcb *tpcb, err_t err);
/** Function prototype for tcp connected callback functions. Called when a pcb
 * is connected to the remote side after initiating a connection attempt by
 * calling tcp_connect().
 *
 * @param arg Additional argument to pass to the callback function (@see tcp_arg())
 * @param tpcb The connection pcb which is connected
 * @param err An unused error code, always ERR_OK currently ;-) @todo!
 *            Only return ERR_ABRT if you have called tcp_abort from within the
 *            callback function!
 *
 * @note When a connection attempt fails, the error callback is currently called!
 */

Typedef tcp_extarg_callback_pcb_destroyed_fn

typedef void (*tcp_extarg_callback_pcb_destroyed_fn)(u8_t id, void *data);
/** Function prototype for deallocation of arguments. Called *just before* the
 * pcb is freed, so don't expect to be able to do anything with this pcb!
 *
 * @param id ext arg id (allocated via @ref tcp_ext_arg_alloc_id)
 * @param data pointer to the data (set via @ref tcp_ext_arg_set before)
 */

Typedef tcp_extarg_callback_passive_open_fn

typedef err_t (*tcp_extarg_callback_passive_open_fn)(u8_t id, struct tcp_pcb_listen *lpcb, struct tcp_pcb *cpcb);
/** Function prototype to transition arguments from a listening pcb to an accepted pcb
 *
 * @param id ext arg id (allocated via @ref tcp_ext_arg_alloc_id)
 * @param lpcb the listening pcb accepting a connection
 * @param cpcb the newly allocated connection pcb
 * @return ERR_OK if OK, any error if connection should be dropped
 */

Typedef tcpflags_t

typedef u16_t tcpflags_t;
#define TCP_ALLFLAGS 0xffffU



      

Typedef tcpwnd_size_t

typedef u32_t tcpwnd_size_t;
#else
typedef u16_t tcpwnd_size_t;


      

Typedef tcpip_init_done_fn

typedef void (*tcpip_init_done_fn)(void *arg);
/** Function prototype for the init_done function passed to tcpip_init */

Typedef tcpip_callback_fn

typedef void (*tcpip_callback_fn)(void *ctx);
/** Function prototype for functions passed to tcpip_callback() */

Typedef lwip_cyclic_timer_handler

typedef void (* lwip_cyclic_timer_handler)(void);
/** Function prototype for a stack-internal timer function that has to be
 * called at a defined interval */

Typedef sys_timeout_handler

typedef void (* sys_timeout_handler)(void *arg);
/** Function prototype for a timeout callback function. Register such a function
 * using sys_timeout().
 *
 * @param arg Additional argument to pass to the function - set up by sys_timeout()
 */

Typedef udp_recv_fn

typedef void (*udp_recv_fn)(void *arg, struct udp_pcb *pcb, struct pbuf *p,
   const ip_addr_t *addr, u16_t port);
/** Function prototype for udp pcb receive callback functions
 * addr and port are in same byte order as in the pcb
 * The callback is responsible for freeing the pbuf
 * if it's not used any more.
 *
 * ATTENTION: Be aware that 'addr' might point into the pbuf 'p' so freeing this pbuf
 *            can make 'addr' invalid, too.
 *
 * @param arg user supplied argument (udp_pcb.recv_arg)
 * @param pcb the udp_pcb which received data
 * @param p the packet buffer that was received
 * @param addr the remote IP address from which the packet was received
 * @param port the remote port from which the packet was received
 */

Typedef bridgeif_portmask_t

typedef u8_t bridgeif_portmask_t;
#elif BRIDGEIF_MAX_PORTS < 16
typedef u16_t bridgeif_portmask_t;
#elif BRIDGEIF_MAX_PORTS < 32
typedef u32_t bridgeif_portmask_t;
#elif BRIDGEIF_MAX_PORTS < 64
typedef u64_t bridgeif_portmask_t;


      

Typedef bridgeif_initdata_t;

typedef struct bridgeif_initdata_s {
 /** MAC address of the bridge (cannot use the netif's addresses) */
 struct eth_addr ethaddr;
 /** Maximum number of ports in the bridge (ports are stored in an array, this
      influences memory allocated for netif->state of the bridge netif). */
 u8_t           max_ports;
 /** Maximum number of dynamic/learning entries in the bridge's forwarding database.
      In the default implementation, this controls memory consumption only. */
 u16_t          max_fdb_dynamic_entries;
 /** Maximum number of static forwarding entries. Influences memory consumption! */
 u16_t          max_fdb_static_entries;
} bridgeif_initdata_t;
/** @ingroup bridgeif
 * Initialisation data for @ref bridgeif_init.
 * An instance of this type must be passed as parameter 'state' to @ref netif_add
 * when the bridge is added.
 */

Typedef ccp_options;

typedef struct ccp_options {
#if DEFLATE_SUPPORT
   unsigned int deflate         :1; /* do Deflate? */
   unsigned int deflate_correct :1; /* use correct code for deflate? */
   unsigned int deflate_draft   :1; /* use draft RFC code for deflate? */
#endif /* DEFLATE_SUPPORT */
#if BSDCOMPRESS_SUPPORT
   unsigned int bsd_compress    :1; /* do BSD Compress? */
#endif /* BSDCOMPRESS_SUPPORT */
#if PREDICTOR_SUPPORT
   unsigned int predictor_1     :1; /* do Predictor-1? */
   unsigned int predictor_2     :1; /* do Predictor-2? */
#endif /* PREDICTOR_SUPPORT */

#if MPPE_SUPPORT
   u8_t mppe;		/* MPPE bitfield */
#endif /* MPPE_SUPPORT */
#if BSDCOMPRESS_SUPPORT
   u_short bsd_bits;	/* # bits/code for BSD Compress */
#endif /* BSDCOMPRESS_SUPPORT */
#if DEFLATE_SUPPORT
   u_short deflate_size; /* lg(window size) for Deflate */
#endif /* DEFLATE_SUPPORT */
   u8_t method;	/* code for chosen compression method */
} ccp_options;


      

Typedef chap_client_state;

typedef struct chap_client_state {
 u8_t flags;
 const char *name;
 const struct chap_digest_type *digest;
 unsigned char priv[64];	/* private area for digest's use */
} chap_client_state;


      

Typedef chap_server_state;

typedef struct chap_server_state {
 u8_t flags;
 u8_t id;
 const char *name;
 const struct chap_digest_type *digest;
 int challenge_xmits;
 int challenge_pktlen;
 unsigned char challenge[CHAL_MAX_PKTLEN];
} chap_server_state;


      

Typedef eap_state;

typedef struct eap_state {
 struct eap_auth es_client; /* Client (authenticatee) data */
#if PPP_SERVER
 struct eap_auth es_server; /* Server (authenticator) data */
#endif /* PPP_SERVER */
 int es_savedtime;	/* Saved timeout */
 int es_rechallenge;	/* EAP rechallenge interval */
 int es_lwrechallenge;	/* SRP lightweight rechallenge inter */
 u8_t es_usepseudo;	/* Use SRP Pseudonym if offered one */
 int es_usedpseudo;	/* Set if we already sent PN */
 int es_challen;		/* Length of challenge string */
 u_char es_challenge[EAP_MAX_CHALLENGE_LENGTH];
} eap_state;


      

Typedef ecp_options;

typedef struct ecp_options {
   bool required;	/* Is ECP required? */
   unsigned enctype;	/* Encryption type */
} ecp_options;


      

Typedef eui64_t;

typedef union
{
   u8_t e8[8];
   u16_t e16[4];
   u32_t e32[2];
} eui64_t;
/*
 * @todo:
 *
 * Maybe this should be done by processing struct in6_addr directly...
 */

Typedef fsm;

typedef struct fsm {
   ppp_pcb *pcb;	/* PPP Interface */
   const struct fsm_callbacks *callbacks; /* Callback routines */
   const char *term_reason; /* Reason for closing protocol */
   u8_t seen_ack;	/* Have received valid Ack/Nak/Rej to Req */
			  /* -- This is our only flag, we might use u_int :1 if we have more flags */
   u16_t protocol;	/* Data Link Layer Protocol field value */
   u8_t state;		/* State */
   u8_t flags;		/* Contains option bits */
   u8_t id;		/* Current id */
   u8_t reqid;		/* Current request id */
   u8_t retransmits;	/* Number of retransmissions left */
   u8_t nakloops;	/* Number of nak loops since last ack */
   u8_t rnakloops;	/* Number of naks received */
   u8_t maxnakloops;	/* Maximum number of nak loops tolerated
				   (necessary because IPCP require a custom large max nak loops value) */
   u8_t term_reason_len; /* Length of term_reason */
} fsm;
/*
 * Each FSM is described by an fsm structure and fsm callbacks.
 */

Typedef fsm_callbacks;

typedef struct fsm_callbacks {
   void (*resetci)	/* Reset our Configuration Information */
	(fsm *);
   int (*cilen)	/* Length of our Configuration Information */
	(fsm *);
   void (*addci)		/* Add our Configuration Information */
	(fsm *, u_char *, int *);
   int (*ackci)	/* ACK our Configuration Information */
	(fsm *, u_char *, int);
   int (*nakci)	/* NAK our Configuration Information */
	(fsm *, u_char *, int, int);
   int (*rejci)	/* Reject our Configuration Information */
	(fsm *, u_char *, int);
   int (*reqci)	/* Request peer's Configuration Information */
	(fsm *, u_char *, int *, int);
   void (*up)		/* Called when fsm reaches PPP_FSM_OPENED state */
	(fsm *);
   void (*down)	/* Called when fsm leaves PPP_FSM_OPENED state */
	(fsm *);
   void (*starting)	/* Called when we want the lower layer */
	(fsm *);
   void (*finished)	/* Called when we don't want the lower layer */
	(fsm *);
   void (*protreject)	/* Called when Protocol-Reject received */
	(int);
   void (*retransmit)	/* Retransmission is necessary */
	(fsm *);
   int (*extcode)	/* Called when unknown code received */
	(fsm *, int, int, u_char *, int);
   const char *proto_name; /* String name for protocol (for messages) */
} fsm_callbacks;


      

Typedef ipcp_options;

typedef struct ipcp_options {
   unsigned int neg_addr              :1; /* Negotiate IP Address? */
   unsigned int old_addrs             :1; /* Use old (IP-Addresses) option? */
   unsigned int req_addr              :1; /* Ask peer to send IP address? */
#if 0 /* UNUSED */
   unsigned int default_route         :1; /* Assign default route through interface? */
   unsigned int replace_default_route :1; /* Replace default route through interface? */
#endif /* UNUSED */
#if 0 /* UNUSED - PROXY ARP */
   unsigned int proxy_arp             :1; /* Make proxy ARP entry for peer? */
#endif /* UNUSED - PROXY ARP */
#if VJ_SUPPORT
   unsigned int neg_vj                :1; /* Van Jacobson Compression? */
   unsigned int old_vj                :1; /* use old (short) form of VJ option? */
   unsigned int cflag                 :1;
#endif /* VJ_SUPPORT */
   unsigned int accept_local          :1; /* accept peer's value for ouraddr */
   unsigned int accept_remote         :1; /* accept peer's value for hisaddr */
#if LWIP_DNS
   unsigned int req_dns1              :1; /* Ask peer to send primary DNS address? */
   unsigned int req_dns2              :1; /* Ask peer to send secondary DNS address? */
#endif /* LWIP_DNS */

   u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
#if LWIP_DNS
   u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
#endif /* LWIP_DNS */
#if 0 /* UNUSED - WINS */
   u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
#endif /* UNUSED - WINS */

#if VJ_SUPPORT
   u16_t vj_protocol;	/* protocol value to use in VJ option */
   u8_t maxslotindex;	/* values for RFC1332 VJ compression neg. */
#endif /* VJ_SUPPORT */
} ipcp_options;


      

Typedef ipv6cp_options;

typedef struct ipv6cp_options {
   unsigned int neg_ifaceid   :1; /* Negotiate interface identifier? */
   unsigned int req_ifaceid   :1; /* Ask peer to send interface identifier? */
   unsigned int accept_local  :1; /* accept peer's value for iface id? */
   unsigned int opt_local     :1; /* ourtoken set by option */
   unsigned int opt_remote    :1; /* histoken set by option */
   unsigned int use_ip        :1; /* use IP as interface identifier */
#if 0
   unsigned int use_persistent :1; /* use uniquely persistent value for address */
#endif
#ifdef IPV6CP_COMP
   unsigned int neg_vj        :1; /* Van Jacobson Compression? */
#endif /* IPV6CP_COMP */

#ifdef IPV6CP_COMP
   u_short vj_protocol;       /* protocol value to use in VJ option */
#endif /* IPV6CP_COMP */
   eui64_t ourid, hisid;      /* Interface identifiers */
} ipv6cp_options;
/* No compression types yet defined.
 *#define IPV6CP_COMP	0x004f
 */

Typedef lcp_options;

typedef struct lcp_options {
   unsigned int passive          :1; /* Don't die if we don't get a response */
   unsigned int silent           :1; /* Wait for the other end to start first */
#if 0 /* UNUSED */
   unsigned int restart          :1; /* Restart vs. exit after close */
#endif /* UNUSED */
   unsigned int neg_mru          :1; /* Negotiate the MRU? */
   unsigned int neg_asyncmap     :1; /* Negotiate the async map? */
#if PAP_SUPPORT
   unsigned int neg_upap         :1; /* Ask for UPAP authentication? */
#endif /* PAP_SUPPORT */
#if CHAP_SUPPORT
   unsigned int neg_chap         :1; /* Ask for CHAP authentication? */
#endif /* CHAP_SUPPORT */
#if EAP_SUPPORT
   unsigned int neg_eap          :1; /* Ask for EAP authentication? */
#endif /* EAP_SUPPORT */
   unsigned int neg_magicnumber  :1; /* Ask for magic number? */
   unsigned int neg_pcompression :1; /* HDLC Protocol Field Compression? */
   unsigned int neg_accompression :1; /* HDLC Address/Control Field Compression? */
#if LQR_SUPPORT
   unsigned int neg_lqr          :1; /* Negotiate use of Link Quality Reports */
#endif /* LQR_SUPPORT */
   unsigned int neg_cbcp         :1; /* Negotiate use of CBCP */
#ifdef HAVE_MULTILINK
   unsigned int neg_mrru         :1; /* negotiate multilink MRRU */
#endif /* HAVE_MULTILINK */
   unsigned int neg_ssnhf        :1; /* negotiate short sequence numbers */
   unsigned int neg_endpoint     :1; /* negotiate endpoint discriminator */

   u16_t mru;		/* Value of MRU */
#ifdef HAVE_MULTILINK
   u16_t mrru;		/* Value of MRRU, and multilink enable */
#endif /* MULTILINK */
#if CHAP_SUPPORT
   u8_t chap_mdtype;	/* which MD types (hashing algorithm) */
#endif /* CHAP_SUPPORT */
   u32_t asyncmap;	/* Value of async map */
   u32_t magicnumber;
   u8_t numloops;	/* Number of loops during magic number neg. */
#if LQR_SUPPORT
   u32_t lqr_period; /* Reporting period for LQR 1/100ths second */
#endif /* LQR_SUPPORT */
   struct epdisc endpoint; /* endpoint discriminator */
} lcp_options;
/*
 * The state of options is described by an lcp_options structure.
 */

Typedef ppp_mppe_state;

typedef struct ppp_mppe_state {
 lwip_arc4_context arc4;
 u8_t master_key[MPPE_MAX_KEY_LEN];
 u8_t session_key[MPPE_MAX_KEY_LEN];
 u8_t keylen;               /* key length in bytes */
 /* NB: 128-bit == 16, 40-bit == 8!
	 * If we want to support 56-bit, the unit has to change to bits
	 */
 u8_t bits;                 /* MPPE control bits */
 u16_t ccount;              /* 12-bit coherency count (seqno)  */
 u16_t sanity_errors;       /* take down LCP if too many */
 unsigned int stateful :1; /* stateful mode flag */
 unsigned int discard  :1; /* stateful mode packet loss flag */
} ppp_mppe_state;
/*
 * State for an MPPE (de)compressor.
 */

Typedef arc4_context;

typedef struct
{
   int x;                     /*!< permutation index */
   int y;                     /*!< permutation index */
   unsigned char m[256];      /*!< permutation table */
}
arc4_context;
/**
 * \brief          ARC4 context structure
 */

Typedef des_context;

typedef struct
{
   int mode;                  /*!<  encrypt/decrypt   */
   unsigned long sk[32];      /*!<  DES subkeys       */
}
des_context;
/**
 * \brief          DES context structure
 */

Typedef md4_context;

typedef struct
{
   unsigned long total[2];    /*!< number of bytes processed  */
   unsigned long state[4];    /*!< intermediate digest state  */
   unsigned char buffer[64];  /*!< data block being processed */
}
md4_context;
/**
 * \brief          MD4 context structure
 */

Typedef md5_context;

typedef struct
{
   unsigned long total[2];    /*!< number of bytes processed  */
   unsigned long state[4];    /*!< intermediate digest state  */
   unsigned char buffer[64];  /*!< data block being processed */
}
md5_context;
/**
 * \brief          MD5 context structure
 */

Typedef sha1_context;

typedef struct
{
   unsigned long total[2];    /*!< number of bytes processed  */
   unsigned long state[5];    /*!< intermediate digest state  */
   unsigned char buffer[64];  /*!< data block being processed */
}
sha1_context;
/**
 * \brief          SHA-1 context structure
 */

Typedef ppp_pcb

typedef struct ppp_pcb_s ppp_pcb;
/*
 * Other headers require ppp_pcb definition for prototypes, but ppp_pcb
 * require some structure definition from other headers as well, we are
 * fixing the dependency loop here by declaring the ppp_pcb type then
 * by including headers containing necessary struct definition for ppp_pcb
 */

Typedef u_long

typedef unsigned long u_long;


      

Typedef u_int

typedef unsigned int  u_int;


      

Typedef u_short

typedef unsigned short u_short;


      

Typedef u_char

typedef unsigned char u_char;


      
      
typedef void (*ppp_link_status_cb_fn)(ppp_pcb *pcb, int err_code, void *ctx);
/* Link status callback function prototype */

Typedef ppp_settings;

typedef struct ppp_settings_s {

#if PPP_SERVER && PPP_AUTH_SUPPORT
 unsigned int auth_required      :1;     /* Peer is required to authenticate */
 unsigned int null_login         :1;     /* Username of "" and a password of "" are acceptable */
#endif /* PPP_SERVER && PPP_AUTH_SUPPORT */
#if PPP_REMOTENAME
 unsigned int explicit_remote    :1;     /* remote_name specified with remotename opt */
#endif /* PPP_REMOTENAME */
#if PAP_SUPPORT
 unsigned int refuse_pap         :1;     /* Don't proceed auth. with PAP */
#endif /* PAP_SUPPORT */
#if CHAP_SUPPORT
 unsigned int refuse_chap        :1;     /* Don't proceed auth. with CHAP */
#endif /* CHAP_SUPPORT */
#if MSCHAP_SUPPORT
 unsigned int refuse_mschap      :1;     /* Don't proceed auth. with MS-CHAP */
 unsigned int refuse_mschap_v2   :1;     /* Don't proceed auth. with MS-CHAPv2 */
#endif /* MSCHAP_SUPPORT */
#if EAP_SUPPORT
 unsigned int refuse_eap         :1;     /* Don't proceed auth. with EAP */
#endif /* EAP_SUPPORT */
#if LWIP_DNS
 unsigned int usepeerdns         :1;     /* Ask peer for DNS adds */
#endif /* LWIP_DNS */
 unsigned int persist            :1;     /* Persist mode, always try to open the connection */
#if PRINTPKT_SUPPORT
 unsigned int hide_password      :1;     /* Hide password in dumped packets */
#endif /* PRINTPKT_SUPPORT */
 unsigned int noremoteip         :1;     /* Let him have no IP address */
 unsigned int lax_recv           :1;     /* accept control chars in asyncmap */
 unsigned int noendpoint         :1;     /* don't send/accept endpoint discriminator */
#if PPP_LCP_ADAPTIVE
 unsigned int lcp_echo_adaptive   :1;     /* request echo only if the link was idle */
#endif /* PPP_LCP_ADAPTIVE */
#if MPPE_SUPPORT
 unsigned int require_mppe        :1;     /* Require MPPE (Microsoft Point to Point Encryption) */
 unsigned int refuse_mppe_40      :1;     /* Allow MPPE 40-bit mode? */
 unsigned int refuse_mppe_128     :1;     /* Allow MPPE 128-bit mode? */
 unsigned int refuse_mppe_stateful :1;     /* Allow MPPE stateful mode? */
#endif /* MPPE_SUPPORT */

 u16_t listen_time;                /* time to listen first (ms), waiting for peer to send LCP packet */

#if PPP_IDLETIMELIMIT
 u16_t idle_time_limit;            /* Disconnect if idle for this many seconds */
#endif /* PPP_IDLETIMELIMIT */
#if PPP_MAXCONNECT
 u32_t maxconnect;                 /* Maximum connect time (seconds) */
#endif /* PPP_MAXCONNECT */

#if PPP_AUTH_SUPPORT
 /* auth data */
 const char *user;                  /* Username for PAP */
 const char *passwd;                /* Password for PAP, secret for CHAP */
#if PPP_REMOTENAME
 char remote_name[MAXNAMELEN  + 1]; /* Peer's name for authentication */
#endif /* PPP_REMOTENAME */

#if PAP_SUPPORT
 u8_t pap_timeout_time;       /* Timeout (seconds) for auth-req retrans. */
 u8_t pap_max_transmits;      /* Number of auth-reqs sent */
#if PPP_SERVER
 u8_t pap_req_timeout;        /* Time to wait for auth-req from peer */
#endif /* PPP_SERVER */
#endif /* PAP_SUPPPORT */

#if CHAP_SUPPORT
 u8_t chap_timeout_time;      /* Timeout (seconds) for retransmitting req */
 u8_t chap_max_transmits;     /* max # times to send challenge */
#if PPP_SERVER
 u8_t chap_rechallenge_time;  /* Time to wait for auth-req from peer */
#endif /* PPP_SERVER */
#endif /* CHAP_SUPPPORT */

#if EAP_SUPPORT
 u8_t eap_req_time;           /* Time to wait (for retransmit/fail) */
 u8_t eap_allow_req;          /* Max Requests allowed */
#if PPP_SERVER
 u8_t eap_timeout_time;       /* Time to wait (for retransmit/fail) */
 u8_t eap_max_transmits;      /* Max Requests allowed */
#endif /* PPP_SERVER */
#endif /* EAP_SUPPORT */

#endif /* PPP_AUTH_SUPPORT */

 u8_t fsm_timeout_time;           /* Timeout time in seconds */
 u8_t fsm_max_conf_req_transmits; /* Maximum Configure-Request transmissions */
 u8_t fsm_max_term_transmits;     /* Maximum Terminate-Request transmissions */
 u8_t fsm_max_nak_loops;          /* Maximum number of nak loops tolerated */

 u8_t lcp_loopbackfail;    /* Number of times we receive our magic number from the peer
                                 before deciding the link is looped-back. */
 u8_t lcp_echo_interval;   /* Interval between LCP echo-requests */
 u8_t lcp_echo_fails;      /* Tolerance to unanswered echo-requests */

} ppp_settings;
/*
 * PPP configuration.
 */

Typedef ppp_notify_phase_cb_fn

typedef void (*ppp_notify_phase_cb_fn)(ppp_pcb *pcb, u8_t phase, void *ctx);
/*
 * Set a PPP notify phase callback.
 *
 * This can be used for example to set a LED pattern depending on the
 * current phase of the PPP session.
 */

Typedef pppol2tp_pcb

typedef struct pppol2tp_pcb_s pppol2tp_pcb;
/*
 * PPPoL2TP interface control block.
 */

Typedef pppos_output_cb_fn

typedef u32_t (*pppos_output_cb_fn)(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx);
/* PPPoS serial output callback function prototype */

Typedef ext_accm[32]

typedef u8_t ext_accm[32];
/*
 * Extended asyncmap - allows any character to be escaped.
 */

Typedef pppos_pcb

typedef struct pppos_pcb_s pppos_pcb;
/*
 * PPPoS interface control block.
 */

Typedef upap_state;

typedef struct upap_state {
   const char *us_user; /* User */
   u8_t us_userlen;	/* User length */
   const char *us_passwd; /* Password */
   u8_t us_passwdlen;	/* Password length */
   u8_t us_clientstate; /* Client state */
#if PPP_SERVER
   u8_t us_serverstate; /* Server state */
#endif /* PPP_SERVER */
   u8_t us_id;	        /* Current id */
   u8_t us_transmits;	/* Number of auth-reqs sent */
} upap_state;


      

Typedef tuya_adc_port_t;

typedef enum {
   TUYA_ADC0 = 0,                 
   TUYA_ADC1,      
   TUYA_ADC2,         
} tuya_adc_port_t;


      

Typedef tuya_adc_cfg_t;

typedef struct {
   uint8_t    pin;
   uint8_t    flag;
} tuya_adc_cfg_t;


      

Typedef tuya_adc_t

typedef struct tuya_adc tuya_adc_t;


      

Typedef tuya_adc_ops_t;

typedef struct {
   int (*init)        (tuya_adc_t *adc, tuya_adc_cfg_t *cfg);
   int (*convert)     (tuya_adc_t *adc, uint16_t *result);
   int (*control)     (tuya_adc_t *adc, uint8_t cmd, VOID *arg);
   int (*deinit)      (tuya_adc_t *adc);
} tuya_adc_ops_t;


      

Typedef tuya_adc_cmd_t;

typedef enum {
   TUYA_ADC_VOLTAGE_CMD = TUYA_DRV_CUSTOM_CMD,
} tuya_adc_cmd_t;


      

Typedef tuya_adc_voltage_t;

typedef struct {
   uint16_t  *data;
   uint16_t  *voltage;
} tuya_adc_voltage_t;


      

Typedef tuya_drv_flag_t;

typedef enum {
   TUYA_DRV_INT_RX_FLAG    = 1,
   TUYA_DRV_INT_TX_FLAG    = 2,
   TUYA_DRV_DMA_RX_FLAG    = 4,         
   TUYA_DRV_DMA_TX_FLAG    = 8,
   TUYA_DRV_NONBLOCK_FLAG  = 16,
} tuya_drv_flag_t;


      

Typedef tuya_drv_cmd_t;

typedef enum {
   TUYA_DRV_RESUME_CMD     = 1,
   TUYA_DRV_SUSPEND_CMD,
   TUYA_DRV_SET_INT_CMD,         
   TUYA_DRV_CLR_INT_CMD,
   TUYA_DRV_SET_ISR_CMD,
   TUYA_DRV_CONFIG_CMD,
   TUYA_DRV_ISR_MODE_CMD,
   TUYA_DRV_CUSTOM_CMD,
} tuya_drv_cmd_t;


      

Typedef tuya_drv_type_t;

typedef enum {
   TUYA_DRV_PIN            = 1,
   TUYA_DRV_UART,
   TUYA_DRV_PWM,
   TUYA_DRV_TIMER,
   TUYA_DRV_ADC,         
   TUYA_DRV_I2C,
   TUYA_DRV_RTC,
   TUYA_DRV_CUSTOM,
} tuya_drv_type_t;


      

Typedef tuya_drv_event_t;

typedef enum {
   TUYA_DRV_TX_EVENT       = 1,
   TUYA_DRV_RX_EVENT,
   TUYA_DRV_DMARX_EVENT,
   TUYA_DRV_DMATX_EVENT
} tuya_drv_event_t;


      

Typedef SLIST_HEAD_DRIVER;

typedef struct slist_head_driver {
   struct slist_head *next;
}SLIST_HEAD_DRIVER;


      

Typedef tuya_drv_node_t;

typedef struct {
   SLIST_HEAD_DRIVER   list;
   uint8_t             port;
   uint8_t             type;
} tuya_drv_node_t;


      

Typedef TY_GPIO_PORT_E;

typedef enum {
   TY_GPIOA_0 = 0,
   TY_GPIOA_1,
   TY_GPIOA_2,
   TY_GPIOA_3,
   TY_GPIOA_4,
   TY_GPIOA_5,
   TY_GPIOA_6,
   TY_GPIOA_7,
   TY_GPIOA_8,
   TY_GPIOA_9,
   TY_GPIOA_10,
   TY_GPIOA_11,
   TY_GPIOA_12,
   TY_GPIOA_13,
   TY_GPIOA_14,
   TY_GPIOA_15,
   TY_GPIOA_16,
   TY_GPIOA_17,
   TY_GPIOA_18,
   TY_GPIOA_19,
   TY_GPIOA_20,
   TY_GPIOA_21,
   TY_GPIOA_22,
   TY_GPIOA_23,
   TY_GPIOA_24,
   TY_GPIOA_25,
   TY_GPIOA_26,
   TY_GPIOA_27,
   TY_GPIOA_28,
   TY_GPIOA_29,
   TY_GPIOA_30,
   TY_GPIOA_31,
   TY_GPIOB_0 = 32,
   TY_GPIOB_1,
   TY_GPIOB_2,
   TY_GPIOB_3,
   TY_GPIOB_4,
   TY_GPIOB_5,
   TY_GPIOB_6,
   TY_GPIOB_7,
   TY_GPIOB_8,
   TY_GPIOB_9,
   TY_GPIOB_10,
   TY_GPIOB_11,
   TY_GPIOB_12,
   TY_GPIOB_13,
   TY_GPIOB_14,
   TY_GPIOB_15,
   TY_GPIOB_16,
   TY_GPIOB_17,
   TY_GPIOB_18,
   TY_GPIOB_19,
   TY_GPIOB_20,
   TY_GPIOB_21,
   TY_GPIOB_22,
   TY_GPIOB_23,
   TY_GPIOB_24,
   TY_GPIOB_25,
   TY_GPIOB_26,
   TY_GPIOB_27,
   TY_GPIOB_28,
   TY_GPIOB_29,
   TY_GPIOB_30,
   TY_GPIOB_31
}TY_GPIO_PORT_E;


      

Typedef TY_GPIO_MODE_E;

typedef enum {
   TY_GPIO_PULLUP,                   // Pad pull up 
   TY_GPIO_PULLDOWN,                 // Pad pull down
   TY_GPIO_PULLUP_PULLDOWN,          // Pad pull up + pull down
   TY_GPIO_OPENDRAIN,                // Pad open drain
   TY_GPIO_FLOATING,                 // Pad floating
} TY_GPIO_MODE_E;


      

Typedef TY_GPIO_IRQ_TRIG_E;

typedef enum {
   TY_IRQ_NONE,
   /** IRQ occurs on rising edge */
   TY_IRQ_RISE,
   /** IRQ occurs on falling edge */
   TY_IRQ_FALL,
   /** IRQ occurs on either edge */
   TY_IRQ_BOTH,
   /** IRQ occurs when line is low */
   TY_IRQ_HIGH,
   /** IRQ occurs when line is high */
   TY_IRQ_LOW
} TY_GPIO_IRQ_TRIG_E;


      

Typedef TY_GPIO_IRQ_CB

typedef VOID (*TY_GPIO_IRQ_CB)(VOID *args);
/**
 * @brief gpio irq callback
 * 
 * @param[in] args argument
 *
 */

Typedef tuya_i2c_port_t;

typedef enum {
   TUYA_I2C0 = 0,
   TUYA_I2C1,
   TUYA_I2C2,
   TUYA_I2C3,
} tuya_i2c_port_t;


      

Typedef tuya_i2c_mode_t;

typedef enum {
   TUYA_I2C_MODE_MASTER = 0,
   TUYA_I2C_MODE_SLAVE,
} tuya_i2c_mode_t;


      

Typedef tuya_i2c_type_t;

typedef enum {
   TUYA_I2C_TYPE_SW = 0,
   TUYA_I2C_TYPE_HD,
} tuya_i2c_type_t;


      

Typedef tuya_i2c_sw_cfg_t;

typedef struct {
   uint8_t            sda_pin;
   uint8_t            scl_pin;
   uint32_t           delay_count;
   uint32_t           timeout;   
} tuya_i2c_sw_cfg_t;


      

Typedef tuya_i2c_cfg_t;

typedef struct {
   uint8_t            mode;
   uint16_t           dev_addr;
} tuya_i2c_cfg_t;


      

Typedef tuya_i2c_msg_t;

typedef struct {
   uint16_t           addr;
   uint16_t           flags;
   uint16_t           len;
   uint8_t            *buf;
} tuya_i2c_msg_t;


      

Typedef tuya_i2c_t

typedef struct tuya_i2c tuya_i2c_t;


      

Typedef tuya_i2c_ops_t;

typedef struct {
   int  (*init)      (tuya_i2c_t *i2c, tuya_i2c_cfg_t *cfg);
   int  (*xfer)      (tuya_i2c_t *i2c, tuya_i2c_msg_t *msg, uint8_t num);
   int  (*control)   (tuya_i2c_t *i2c, uint8_t cmd, void *arg);
   int  (*deinit)    (tuya_i2c_t *i2c);
} tuya_i2c_ops_t;


      

Typedef tuya_i2s_port_t;

typedef enum {
   TUYA_I2S0 = 0,                 
   TUYA_I2S1,      
} tuya_i2s_port_t;


      

Typedef tuya_i2s_freq_t;

typedef enum {
   TUYA_I2S_FREQ_8K        = 8000,       
   TUYA_I2S_FREQ_16K       = 16000,                 
   TUYA_I2S_FREQ_22K       = 22050, 
   TUYA_I2S_FREQ_32K       = 32000, 
   TUYA_I2S_FREQ_44K       = 44100, 
   TUYA_I2S_FREQ_48K       = 48000, 
} tuya_i2s_freq_t;


      

Typedef tuya_i2c_databit_t;

typedef enum {
   TUYA_I2S_DATA_BIT8       = 8,                 
   TUYA_I2S_DATA_BIT16      = 16,
   TUYA_I2S_DATA_BIT24      = 24,     
   TUYA_I2S_DATA_BIT32      = 32,       
} tuya_i2c_databit_t;


      

Typedef tuya_i2s_channel_t;

typedef enum {
   TUYA_I2S_CHANNEL_MONO    = 1,                 
   TUYA_I2S_CHANNEL_STEREO  = 2,
} tuya_i2s_channel_t;


      

Typedef tuya_i2s_standard_t;

typedef enum {
   TUYA_I2S_STANDARD_PHILIPS = 1,              
   TUYA_I2S_STANDARD_MSB,
   TUYA_I2S_STANDARD_LSB,
} tuya_i2s_standard_t;


      

Typedef tuya_i2s_mode_t;

typedef enum {
   TUYA_I2S_MODE_TX = 1,              
   TUYA_I2S_MODE_RX,
   TUYA_I2S_MODE_TXRX,
} tuya_i2s_mode_t;


      

Typedef tuya_i2s_cmd_t;

typedef enum {
   TUYA_I2S_START_CMD = 32,              
   TUYA_I2S_STOP_CMD,
} tuya_i2s_cmd_t;


      

Typedef tuya_i2s_cfg_t;

typedef struct {
   tuya_i2s_mode_t      mode;
   tuya_i2s_freq_t      freq;
   tuya_i2s_channel_t   cahnnel;
   tuya_i2s_standard_t  standard;
   tuya_i2c_databit_t   databits;
} tuya_i2s_cfg_t;


      

Typedef tuya_i2s_t

typedef struct tuya_i2s tuya_i2s_t;


      

Typedef tuya_i2s_ops_t;

typedef struct {
   int (*init)        (tuya_i2s_t *i2s, tuya_i2s_cfg_t *cfg);
   int (*write)       (tuya_i2s_t *i2s, void *data, uint32_t length);
   int (*read)        (tuya_i2s_t *i2s, void *data, uint32_t length);
   int (*control)     (tuya_i2s_t *i2s, uint32_t cmd, void *arg);
   int (*deinit)      (tuya_i2s_t *i2s);
} tuya_i2s_ops_t;


      

Typedef tuya_pin_port_t;

typedef enum {
   TUYA_PA = 0,
   TUYA_PB = 1,
   TUYA_PC = 2,
   TUYA_PD = 3,
   TUYA_PE = 4,
} tuya_pin_port_t;
// 3bit(bit7-bit5) port   5bit(bit4-bit0) pinmun

Typedef tuya_pin_name_t;

typedef enum {
   TUYA_PINS_NAME(TUYA_PA),
   TUYA_PINS_NAME(TUYA_PB),
   TUYA_PINS_NAME(TUYA_PC),
   TUYA_PINS_NAME(TUYA_PD),
   TUYA_PINS_NAME(TUYA_PE),
} tuya_pin_name_t;
// TUYA_PE ->  TUYA_PE0 - TUYA_PE31

Typedef tuya_pin_level_t;

typedef enum {
   TUYA_PIN_LOW = 0,
   TUYA_PIN_HIGH
} tuya_pin_level_t;


      

Typedef tuya_pin_mode_t;

typedef enum {
   TUYA_PIN_MODE_IN_PU              = TUYA_PIN_IN    | TUYA_PIN_PULL_UP,
   TUYA_PIN_MODE_IN_PD              = TUYA_PIN_IN    | TUYA_PIN_PULL_DOWN,
   TUYA_PIN_MODE_IN_FL              = TUYA_PIN_IN_FL,
   TUYA_PIN_MODE_IN_IRQ_RISE        = TUYA_PIN_IN_IRQ | TUYA_PIN_IRQ_RISE | TUYA_PIN_PULL_UP, 
   TUYA_PIN_MODE_IN_IRQ_FALL        = TUYA_PIN_IN_IRQ | TUYA_PIN_IRQ_FALL | TUYA_PIN_PULL_UP,
   TUYA_PIN_MODE_IN_IRQ_RISE_FALL   = TUYA_PIN_IN_IRQ | TUYA_PIN_IRQ_RISE_FALL | TUYA_PIN_PULL_UP,
   TUYA_PIN_MODE_IN_IRQ_LOW         = TUYA_PIN_IN_IRQ | TUYA_PIN_IRQ_LOW  | TUYA_PIN_PULL_UP,
   TUYA_PIN_MODE_IN_IRQ_HIGH        = TUYA_PIN_IN_IRQ | TUYA_PIN_IRQ_HIGH | TUYA_PIN_PULL_UP,
   TUYA_PIN_MODE_OUT_PP_LOW         = TUYA_PIN_OUT_PP | TUYA_PIN_INIT_LOW,
   TUYA_PIN_MODE_OUT_PP_HIGH        = TUYA_PIN_OUT_PP | TUYA_PIN_INIT_HIGH,
   TUYA_PIN_MODE_OUT_PP_PU_LOW      = TUYA_PIN_OUT_PP | TUYA_PIN_PULL_UP | TUYA_PIN_INIT_LOW,
   TUYA_PIN_MODE_OUT_PP_PU_HIGH     = TUYA_PIN_OUT_PP | TUYA_PIN_PULL_UP | TUYA_PIN_INIT_HIGH,
   TUYA_PIN_MODE_OUT_PP_PD_LOW      = TUYA_PIN_OUT_PP | TUYA_PIN_PULL_DOWN | TUYA_PIN_INIT_LOW,
   TUYA_PIN_MODE_OUT_PP_PD_HIGH     = TUYA_PIN_OUT_PP | TUYA_PIN_PULL_DOWN | TUYA_PIN_INIT_HIGH,
   TUYA_PIN_MODE_OUT_OD_LOW         = TUYA_PIN_OUT_OD | TUYA_PIN_INIT_LOW,
   TUYA_PIN_MODE_OUT_OD_HIZ         = TUYA_PIN_OUT_OD | TUYA_PIN_INIT_HIGH,
   TUYA_PIN_MODE_OUT_OD_PU_LOW      = TUYA_PIN_OUT_OD | TUYA_PIN_PULL_UP | TUYA_PIN_INIT_LOW,
   TUYA_PIN_MODE_OUT_OD_PU_HIGH     = TUYA_PIN_OUT_OD | TUYA_PIN_PULL_UP | TUYA_PIN_INIT_HIGH,
} tuya_pin_mode_t;
// hiz ->  high-impedance level

Typedef tuya_pin_irq_cb

typedef void (*tuya_pin_irq_cb)(void *args);


      

Typedef tuya_pin_irq_t;

typedef struct {
   tuya_pin_mode_t    mode;
   tuya_pin_irq_cb    cb;
   void               *arg;
} tuya_pin_irq_t;


      

Typedef tuya_pin_ops_t;

typedef struct {
   int  (*init)      (tuya_pin_name_t pin, tuya_pin_mode_t mode);
   int  (*write)     (tuya_pin_name_t pin, tuya_pin_level_t level);
   int  (*read)      (tuya_pin_name_t pin);
   int  (*toggle)    (tuya_pin_name_t pin);
   int  (*control)   (tuya_pin_name_t pin, uint8_t cmd, void *arg);
} tuya_pin_ops_t;


      

Typedef tuya_pwm_port_t;

typedef enum {
   TUYA_PWM0 = 0,
   TUYA_PWM1,
   TUYA_PWM2,
   TUYA_PWM3,
   TUYA_PWM4,
   TUYA_PWM5,
   TUYA_PWM6,
   TUYA_PWM7,
   TUYA_PWM8,
} tuya_pwm_port_t;


      

Typedef tuya_pwm_polarity_t;

typedef enum {
   TUYA_PWM_POSITIVE = 0,
   TUYA_PWM_NEGATIVE,
} tuya_pwm_polarity_t;


      

Typedef tuya_pwm_cmd_t;

typedef enum {
   TUYA_PWM_SET_CMD       = TUYA_DRV_CUSTOM_CMD,
   TUYA_PWM_PERIOD_SET_CMD,
   TUYA_PWM_PULSE_SET_CMD,
   TUYA_PWM_POLARIITY_SET_CMD,
} tuya_pwm_cmd_t;


      

Typedef tuya_pwm_cfg_t;

typedef struct {
   uint8_t        pin;
   uint8_t        polarity;
   uint32_t       period_ns;
   uint32_t       pulse_ns;
   float          percent;
} tuya_pwm_cfg_t;


      

Typedef tuya_pwm_t

typedef struct tuya_pwm tuya_pwm_t;


      

Typedef tuya_pwm_ops_t;

typedef struct {
   int (*init)    (tuya_pwm_t *pwm, tuya_pwm_cfg_t *cfg);
   int (*start)   (tuya_pwm_t *pwm);
   int (*stop)    (tuya_pwm_t *pwm);
   int (*control) (tuya_pwm_t *pwm, uint8_t cmd, void *arg);
   int (*deinit)  (tuya_pwm_t *pwm);
} tuya_pwm_ops_t;


      

Typedef tuya_rtc_ops_t;

typedef struct {
   int (*init)      (void);
   int (*time_get)  (time_t *timestamp);
   int (*time_set)  (time_t timestamp);
   int (*control)   (uint8_t cmd, void *arg);
   int (*deinit)    (void);
} tuya_rtc_ops_t;


      

Typedef tuya_spi_port_t;

typedef enum {
   TUYA_SPI0 = 1,
   TUYA_SPI1,
} tuya_spi_port_t;


      

Typedef tuya_spi_mode_t;

typedef enum {
   TUYA_SPI_MODE0 = (0 | 0),                         // CPOL = 0, CPHA = 0
   TUYA_SPI_MODE1 = (0 | TUYA_SPI_CPHA),             // CPOL = 0, CPHA = 1
   TUYA_SPI_MODE2 = (TUYA_SPI_CPOL | 0),             // CPOL = 1, CPHA = 0
   TUYA_SPI_MODE3 = (TUYA_SPI_CPOL | TUYA_SPI_CPHA)  // CPOL = 1, CPHA = 1
} tuya_spi_mode_t;


      

Typedef tuya_spi_databits_t;

typedef enum {
   TUYA_SPI_DATA_BIT8 = 0,
   TUYA_SPI_DATA_BIT16,
} tuya_spi_databits_t;


      

Typedef tuya_spi_cs_mode_t;

typedef enum {
   TUYA_SPI_CS_MODE_AUTO = 0,          // hardware auto set
   TUYA_SPI_CS_MODE_SOFT,               // software manual set
} tuya_spi_cs_mode_t;


      

Typedef tuya_spi_cfg_t;

typedef struct {
   uint8_t        cs_pin;
} tuya_spi_cfg_t;


      

Typedef tuya_spi_msg_t;

typedef struct {
   void           *send_buf;
   void           *recv_buf;
   uint32_t        length;
} tuya_spi_msg_t;


      

Typedef tuya_spi_bus_cfg_t;

typedef struct {
   uint8_t                  flag;
   tuya_spi_mode_t          mode;
   tuya_spi_databits_t      databits;
   tuya_spi_cs_mode_t       cs_mode;
   uint32_t                 freq_hz;
} tuya_spi_bus_cfg_t;


      

Typedef tuya_spi_bus_t

typedef struct tuya_spi_bus tuya_spi_bus_t;


      

Typedef tuya_spi_ops_t;

typedef struct {
   int (*init)        (tuya_spi_bus_t *spi, tuya_spi_bus_cfg_t *cfg);
   int (*xfer)        (tuya_spi_bus_t *spi, tuya_spi_msg_t *msg);
   int (*control)     (tuya_spi_bus_t *spi, uint8_t cmd, void *arg);
   int (*deinit)      (tuya_spi_bus_t *spi);
} tuya_spi_ops_t;


      

Typedef tuya_spi_t;

typedef struct {
   tuya_spi_cfg_t           cfg;   
   tuya_spi_bus_t           *bus;
} tuya_spi_t;


      

Typedef tuya_timer_port_t;

typedef enum {
   TUYA_TIMER0 = 0,
   TUYA_TIMER1,
   TUYA_TIMER2,
   TUYA_TIMER3,
   TUYA_TIMER4,
   TUYA_TIMER5,
} tuya_timer_port_t;


      

Typedef tuya_timer_mode_t;

typedef enum {
   TUYA_TIMER_MODE_ONCE = 0,
   TUYA_TIMER_MODE_PERIOD
} tuya_timer_mode_t;


      

Typedef tuya_timer_isr_cb

typedef void (*tuya_timer_isr_cb)(void *args);


      

Typedef tuya_timer_cmd_t;

typedef enum {
   TUYA_TIMER_GET_COUNT_CMD   = TUYA_DRV_CUSTOM_CMD,
} tuya_timer_cmd_t;


      

Typedef tuya_timer_cfg_t;

typedef struct {
   tuya_timer_mode_t   mode;
   tuya_timer_isr_cb   cb;
   void               *arg;
} tuya_timer_cfg_t;


      

Typedef tuya_timer_info_t;

typedef struct {
   uint8_t            support_freq;
   uint32_t           maxcount;
} tuya_timer_info_t;


      

Typedef tuya_timer_t

typedef struct tuya_timer tuya_timer_t;


      

Typedef tuya_timer_ops_t;

typedef struct {
   int (*init)    (tuya_timer_t  *timer, tuya_timer_cfg_t *cfg);
   int (*start)   (tuya_timer_t  *timer, uint32_t us);
   int (*stop)    (tuya_timer_t  *timer);
   int (*control) (tuya_timer_t  *timer, uint8_t cmd, void *arg);
   int (*deinit)  (tuya_timer_t  *timer);
} tuya_timer_ops_t;
// FOR PORT

Typedef tuya_uart_port_t;

typedef enum {
   TUYA_UART0 = 0,
   TUYA_UART1,
   TUYA_UART2,
   TUYA_UART3,
} tuya_uart_port_t;


      

Typedef tuya_uart_baudrate_t;

typedef enum {
   TUYA_UART_BAUDRATE_300       = 300,
   TUYA_UART_BAUDRATE_600       = 600,
   TUYA_UART_BAUDRATE_1200      = 1200,
   TUYA_UART_BAUDRATE_2400      = 2400,
   TUYA_UART_BAUDRATE_4800      = 4800,
   TUYA_UART_BAUDRATE_9600      = 9600,
   TUYA_UART_BAUDRATE_19200     = 19200,
   TUYA_UART_BAUDRATE_38400     = 38400,
   TUYA_UART_BAUDRATE_57600     = 57600,
   TUYA_UART_BAUDRATE_74880     = 74880,
   TUYA_UART_BAUDRATE_115200    = 115200,
   TUYA_UART_BAUDRATE_230400    = 230400,
   TUYA_UART_BAUDRATE_460800    = 460800,
   TUYA_UART_BAUDRATE_921600    = 921600,
   TUYA_UART_BAUDRATE_1500000   = 1500000,
   TUYA_UART_BAUDRATE_1843200   = 1843200,
   TUYA_UART_BAUDRATE_3686400   = 3686400,
} tuya_uart_baudrate_t;


      

Typedef tuya_uart_databits_t;

typedef enum {
   TUYA_UART_DATA_BIT5          = 5,
   TUYA_UART_DATA_BIT6          = 6,
   TUYA_UART_DATA_BIT7          = 7,
   TUYA_UART_DATA_BIT8          = 8,
} tuya_uart_databits_t;


      

Typedef tuya_uart_stopbits_t;

typedef enum {
   TUYA_UART_STOP_BIT1          = 1,
   TUYA_UART_STOP_BIT1_5        = 2,
   TUYA_UART_STOP_BIT2          = 3,
} tuya_uart_stopbits_t;


      

Typedef tuya_uart_parity_t;

typedef enum {
   TUYA_UART_PARITY_NONE        = 0,  
   TUYA_UART_PARITY_ODD         = 1, 
   TUYA_UART_PARITY_EVEN        = 2,  
} tuya_uart_parity_t;


      

Typedef tuya_uart_event_t;

typedef enum {
   TUYA_UART_INT_TX_EVENT       = 1,  
   TUYA_UART_INT_RX_EVENT       = 2,  
} tuya_uart_event_t;


      

Typedef tuya_uart_flowctrl_t;

typedef enum {
   TUYA_UART_FLOWCTRL_NONE      = 0,
   TUYA_UART_FLOWCTRL_ENABLE    = 1,
} tuya_uart_flowctrl_t;


      

Typedef tuya_uart_cfg_t;

typedef struct {
   uint16_t               flag;
   uint16_t               bufsz;
   tuya_uart_baudrate_t   baudrate;
   tuya_uart_databits_t   databits;
   tuya_uart_stopbits_t   stopbits;
   tuya_uart_parity_t     parity;
   tuya_uart_flowctrl_t   flowctrl;
} tuya_uart_cfg_t;


      

Typedef tuya_uart_cmd_t;

typedef enum {
   TUYA_UART_RXBUF_SIZE_CMD = TUYA_DRV_CUSTOM_CMD,
   TUYA_UART_FLUSH_CMD,
   TUYA_UART_RECONFIG_CMD,
} tuya_uart_cmd_t;


      

Typedef tuya_uart_t

typedef struct tuya_uart tuya_uart_t;


      

Typedef tuya_uart_isr_cb

typedef void (*tuya_uart_isr_cb)(tuya_uart_t *uart, uint32_t event);


      

Typedef tuya_uart_cb_t;

typedef struct {
   int  (*tx_finish) (tuya_uart_t *uart, void *buffer);
   int  (*rx_notify) (tuya_uart_t *uart, uint16_t size);
} tuya_uart_cb_t;


      

Typedef tuya_uart_ops_t;

typedef struct {
   int  (*init)      (tuya_uart_t *uart, tuya_uart_cfg_t *cfg);
   int  (*read_byte) (tuya_uart_t *uart, uint8_t *byte);
   int  (*write_byte) (tuya_uart_t *uart, uint8_t byte);
   int  (*control)   (tuya_uart_t *uart, uint8_t cmd, void *arg);
   int  (*deinit)    (tuya_uart_t *uart);
} tuya_uart_ops_t;


      

Typedef TY_UART_BAUD_E;

typedef enum {
   TYU_RATE_300    = 300,
   TYU_RATE_600    = 600,
   TYU_RATE_1200   = 1200,
   TYU_RATE_2400   = 2400,
   TYU_RATE_4800   = 4800,
   TYU_RATE_9600   = 9600,
   TYU_RATE_19200  = 19200,
   TYU_RATE_38400  = 38400,
   TYU_RATE_57600  = 57600,
   TYU_RATE_74880  = 74880,
   TYU_RATE_115200 = 115200,
   TYU_RATE_230400 = 230400,
   TYU_RATE_460800 = 460800,
   TYU_RATE_921600 = 921600,
   TYU_RATE_1500000 = 1500000,
   TYU_RATE_1843200 = 1843200,
   TYU_RATE_3686400 = 3686400,
}TY_UART_BAUD_E;


      

Typedef TY_UART_PORT_E;

typedef enum {
   TY_UART0 = 0,
   TY_UART1,
   TY_UART_NUM,
}TY_UART_PORT_E;


      

Typedef TY_DATA_BIT_E;

typedef enum {
   TYWL_5B = 0,
   TYWL_6B = 1,
   TYWL_7B = 2,
   TYWL_8B = 3,
}TY_DATA_BIT_E;


      

Typedef TY_STOPBITS_E;

typedef enum {
   TYS_STOPBIT1 = 1,
   TYS_STOPBIT1_5 = 2,
   TYS_STOPBIT2 = 3,
}TY_STOPBITS_E;


      

Typedef TY_PARITY_E;

typedef enum {
   TYP_NONE = 0,  // parity disable
   TYP_ODD = 1,   // odd parity enable
   TYP_EVEN = 2,  // even paroty enable
}TY_PARITY_E;


      

Typedef REV_BIND_TOKEN_CB

typedef VOID (*REV_BIND_TOKEN_CB)(IN CONST CHAR_T *token);
/**
 * @brief callback when received token
 * 
 * @param[in] token send from cloud
 * 
 */

Typedef DIRECT_CON_INPUT_S;

typedef struct {
   /** uuid, assigned by TUYA */
   CHAR_T *p_uuid;
   /** key, assigned by TUYA */
   CHAR_T *p_authkey;
   /** region, assigned by TUYA */
   CHAR_T *p_region;
   /** region, assigned by TUYA */
   CHAR_T *p_env;
   /** received token callback */
   REV_BIND_TOKEN_CB rev_token_cb;
}DIRECT_CON_INPUT_S;
/**
 * @brief connect tuya could struct info
 */

Typedef tuya_iot_upgrade_gw_notify_cb

typedef OPERATE_RET (*tuya_iot_upgrade_gw_notify_cb)(IN CONST FW_UG_S *fw,
                                      IN CONST GET_FILE_DATA_CB get_file_cb,\
                                      IN CONST UPGRADE_NOTIFY_CB upgrd_nofity_cb,\
                                      IN CONST PVOID_T pri_data,\
                                      BOOL_T notify, UINT_T download_buf_size, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_refuse_upgrade_cb

typedef OPERATE_RET (*tuya_iot_refuse_upgrade_cb)(IN CONST FW_UG_S *fw, IN CONST CHAR_T *dev_id, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_reset_upgrade_detect_timer_cb

typedef OPERATE_RET (*tuya_iot_reset_upgrade_detect_timer_cb)(IN CONST INT_T time_ms, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_gw_version_update_cb

typedef OPERATE_RET (*tuya_iot_gw_version_update_cb)(IN GW_PERMIT_DEV_TP_T type, IN CONST CHAR_T *ver, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_dev_upgd_progress_rept_cb

typedef OPERATE_RET (*tuya_iot_dev_upgd_progress_rept_cb)(IN CONST UINT_T percent, IN CONST CHAR_T *devid, IN CONST DEV_TYPE_T tp, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_dev_upgd_result_report_cb

typedef OPERATE_RET (*tuya_iot_dev_upgd_result_report_cb)(IN CONST CHAR_T *dev_id, IN CONST DEV_TYPE_T type, IN CONST INT_T result, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_get_wakeup_data_cb

typedef OPERATE_RET (*tuya_iot_get_wakeup_data_cb)(INOUT BYTE_T *wakeup_data_arr, INOUT UINT_T *p_len, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_get_heartbeat_data_cb

typedef OPERATE_RET (*tuya_iot_get_heartbeat_data_cb)(INOUT BYTE_T *heartbeat_data_arr, INOUT UINT_T *p_len, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_get_heartbeat_interval_cb

typedef INT_T (*tuya_iot_get_heartbeat_interval_cb)(OUT BOOL_T *b_finish);


      

Typedef tuya_iot_book_wakeup_topic_cb

typedef OPERATE_RET (*tuya_iot_book_wakeup_topic_cb)(OUT BOOL_T *b_finish);


      

Typedef tuya_iot_book_additional_topic_cb

typedef OPERATE_RET (*tuya_iot_book_additional_topic_cb)(IN CHAR_T *topic, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_get_mqtt_socket_fd_cb

typedef INT_T (*tuya_iot_get_mqtt_socket_fd_cb)(OUT BOOL_T *b_finish);


      

Typedef tuya_iot_send_custom_mqtt_msg_cb

typedef OPERATE_RET (*tuya_iot_send_custom_mqtt_msg_cb)(IN CONST UINT_T protocol, IN CONST BYTE_T *p_data, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_send_mqtt_msg_with_topic_cb

typedef OPERATE_RET (*tuya_iot_send_mqtt_msg_with_topic_cb)(IN CONST CHAR_T *topic, IN CONST UINT_T protocol, IN CONST BYTE_T *p_data, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_upload_incre_data_cb

typedef OPERATE_RET (*tuya_iot_upload_incre_data_cb)(IN CONST USHORT_T map_id, CONST UINT_T offset,IN CONST BYTE_T *pbuffer, IN CONST USHORT_T buf_len, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_media_data_report_cb

typedef OPERATE_RET (*tuya_iot_media_data_report_cb)(IN CONST FLOW_BODY_ST *dt_body,IN CONST UINT_T timeout, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_media_data_report_v2_cb

typedef OPERATE_RET (*tuya_iot_media_data_report_v2_cb)(IN CONST FLOW_BODY_V2_ST *dt_body,IN CONST UINT_T timeout, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_get_custom_cfg_cb

typedef OPERATE_RET (*tuya_iot_get_custom_cfg_cb)(IN CONST TY_CUSTOM_CFG_E type, OUT CHAR_T **pp_cfg_str, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_get_location_info_cb

typedef OPERATE_RET (*tuya_iot_get_location_info_cb)(INOUT TY_LOCATION_INFO_S *p_location, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_custom_data_report_sync_cb

typedef OPERATE_RET (*tuya_iot_custom_data_report_sync_cb)(IN CONST BYTE_T *data, IN CONST INT_T len, IN CONST CHAR_T *topic,
                                                       IN CONST BYTE_T qos, IN CONST UINT_T timeout, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_custom_data_report_async_cb

typedef OPERATE_RET (*tuya_iot_custom_data_report_async_cb)(IN CONST BYTE_T *data, IN CONST INT_T len, IN CONST CHAR_T *topic,
                                                           IN CONST BYTE_T qos, IN CONST UINT_T timeout, OUT BOOL_T *b_finish);


      

Typedef tuya_iot_dp_low_power_query_cb

typedef OPERATE_RET (*tuya_iot_dp_low_power_query_cb)(IN CONST UCHAR_T *dps, IN CONST UINT_T cnt,
                                   OUT TY_RECV_OBJ_DP_S **obj_dps, OUT TY_RECV_RAW_DP_S **raw_dps, OUT BOOL_T *b_finish);


      

Typedef TUYA_IOT_API_PRE_HANDLE_CBS_S;

typedef struct {
   tuya_iot_upgrade_gw_notify_cb	upgrade_gw_notify_cb ;
   tuya_iot_refuse_upgrade_cb refuse_upgrade_cb;
   tuya_iot_reset_upgrade_detect_timer_cb reset_upgrade_detect_timer_cb;
   tuya_iot_gw_version_update_cb gw_version_update_cb;
   tuya_iot_dev_upgd_progress_rept_cb dev_upgd_progress_rept_cb;
   tuya_iot_dev_upgd_result_report_cb dev_upgd_result_report_cb;
   tuya_iot_get_wakeup_data_cb get_wakeup_data_cb;
   tuya_iot_get_heartbeat_data_cb get_heartbeat_data_cb;
   tuya_iot_get_heartbeat_interval_cb get_heartbeat_interval_cb;
   tuya_iot_book_wakeup_topic_cb book_wakeup_topic_cb;
   tuya_iot_book_additional_topic_cb book_additional_topic_cb;
   tuya_iot_get_mqtt_socket_fd_cb get_mqtt_socket_fd_cb;
   tuya_iot_send_custom_mqtt_msg_cb send_custom_mqtt_msg_cb;
   tuya_iot_send_mqtt_msg_with_topic_cb send_mqtt_msg_with_topic_cb;
   tuya_iot_upload_incre_data_cb upload_incre_data_cb;
   tuya_iot_media_data_report_cb media_data_report_cb;
   tuya_iot_media_data_report_v2_cb media_data_report_v2_cb;
   tuya_iot_get_custom_cfg_cb get_custom_cfg_cb;
   tuya_iot_get_location_info_cb get_location_info_cb;
   tuya_iot_custom_data_report_sync_cb custom_data_report_sync_cb;
   tuya_iot_custom_data_report_async_cb custom_data_report_async_cb;
   tuya_iot_dp_low_power_query_cb dp_low_power_query_cb;
} TUYA_IOT_API_PRE_HANDLE_CBS_S;


      

Typedef IOT_HTTP_GET_FILE_DATA_CB

typedef OPERATE_RET (*IOT_HTTP_GET_FILE_DATA_CB)(IN PVOID_T priv_data, IN CONST UINT_T total_len,IN CONST UINT_T offset,\
                                           IN CONST BYTE_T *data,IN CONST UINT_T len,OUT UINT_T *remain_len);


      

Typedef iot_mqc_protocol_handler_cb

typedef OPERATE_RET (*iot_mqc_protocol_handler_cb)(IN ty_cJSON *root_json);
/* mqtt api */

Typedef iot_mqc_publish_result_cb

typedef VOID (*iot_mqc_publish_result_cb)(IN CONST OPERATE_RET op_ret,IN CONST VOID *prv_data);


      

Typedef IOT_VAR_TP_T

typedef BYTE_T IOT_VAR_TP_T;
#define VT_CHAR 0
#define VT_BYTE 1
#define VT_SHORT 2
#define VT_USHORT 3
#define VT_INT 4
#define VT_BOOL 5
#define VT_STRING 6
#define VT_RAW 7



      

Typedef IOT_TY_DB_RW_S;

typedef struct {
   CHAR_T *key;
   IOT_VAR_TP_T vt;
   VOID *val;
   USHORT_T len;
}IOT_TY_DB_RW_S;


      

Typedef PRE_GW_UG_INFORM_CB

typedef VOID (*PRE_GW_UG_INFORM_CB)(INOUT BOOL_T *handled, IN CONST FW_UG_S *fw);
/***********************************************************
网关升级时增加的前置过滤处理函数
如果*handled返回为TRUE,那么就不在通过正常的用户回调通知用户升级
如果*handled返回为FALSE,那么仍然通过正常的用户回调通知用户升级
***********************************************************/

Typedef IOT_RAW_HTTP_S

typedef PVOID_T IOT_RAW_HTTP_S;


      

Typedef iot_special_dp_cb

typedef OPERATE_RET (*iot_special_dp_cb)(IN CONST UINT16_T dpid, IN CONST ty_cJSON *dp_obj);


      

Typedef TUYA_BT_CONN_STAT;

typedef enum{
   TUYA_BT_UNBONDING_UNCONN = 0,
   TUYA_BT_UNBONDING_CONN,
   TUYA_BT_BONDING_UNCONN,
   TUYA_BT_BONDING_CONN,
   TUYA_BT_UNKNOW_STATUS
}TUYA_BT_CONN_STAT;
/**
 * @brief connection status for bluetooth
 */

Typedef TUYA_BLE_BIND_TYPE;

typedef enum{
   TUYA_BLE_OP_UNBIND = 0,
   TUYA_BLE_OP_BIND,
}TUYA_BLE_BIND_TYPE;
/**
 * @brief bind type for bluetooth remote controller
 */

Typedef TY_BT_SDK_PARAM_S;

typedef struct {
   CHAR_T *uuid;   //uuid
   CHAR_T *auth_key;//authentication key
}TY_BT_SDK_PARAM_S;
/**
 * @brief parameters for bluetooth
 */

Typedef BT_DP_QUERY_CB

typedef VOID_T (*BT_DP_QUERY_CB)(VOID_T);
//callback function for user dp query

Typedef BT_DP_GET_TM_CB

typedef UINT_T (*BT_DP_GET_TM_CB)(CHAR_T*      time_str);


      

Typedef TUYA_BLE_BT_PARA;

typedef struct {
   UINT8_T priority_flag;     //0:wifi first  1:bt first
   UINT8_T share_flag;        //0:no shared device  1:tuya shared device
   UINT8_T dp_rept_with_time; //0:without time  1:with time
   UINT8_T rsvd;
   BT_DP_QUERY_CB query_dp_cb; //callback function for dp query
   BT_DP_GET_TM_CB get_timestamp_cb;
}TUYA_BLE_BT_PARA;


      

Typedef GET_BT_CONN_STAT_CB

typedef VOID (*GET_BT_CONN_STAT_CB)(IN CONST TUYA_BT_CONN_STAT stat);
//callback function for getting the connection status of bluetooth

Typedef TUYA_BLE_APP_SCAN_HANDLE

typedef VOID (*TUYA_BLE_APP_SCAN_HANDLE)(UCHAR_T *data, UCHAR_T len, UCHAR_T type, UCHAR_T* mac);
//callback function for advertisement scanning data processing

Typedef BLE_SCAN_ADV_BIND_CHECK_CB

typedef OPERATE_RET (*BLE_SCAN_ADV_BIND_CHECK_CB)(TUYA_BLE_BIND_TYPE type, UCHAR_T *data, UCHAR_T len);
//callback function for validity check for bind or unbind operation

Typedef BLE_SCAN_ADV_BIND_RSLT_NOTIFY_CB

typedef VOID_T (*BLE_SCAN_ADV_BIND_RSLT_NOTIFY_CB)(TUYA_BLE_BIND_TYPE type, int rslt);
//callback function for result notify for bind or unbind operation

Typedef TUYA_BLE_SCAN_ADV_HANDLE_CBS;

typedef struct {
   BLE_SCAN_ADV_BIND_CHECK_CB      bind_check; 
   BLE_SCAN_ADV_BIND_RSLT_NOTIFY_CB bind_notify;
}TUYA_BLE_SCAN_ADV_HANDLE_CBS;


      

Typedef SECURITY_CHIP_S;

typedef struct
{
   /** chip id */
   CHAR_T chipId1[32 + 1];
   /** security Code 1 */
   CHAR_T securityCode1[16 + 1];
   /** random A */
   CHAR_T randomA[8 + 1];
   /** Temp Key */
   CHAR_T getTempKey[32];
   /** cbc iv */
   CHAR_T cbc_iv[16];
}SECURITY_CHIP_S;
/**
 * @brief Definition of security chip info
 */

Typedef GW_AUTH_INFO_S;

typedef struct {
   /** uuid */
   CHAR_T uuid[GW_UUID_LEN+1];
   /** auth_key */
   CHAR_T auth_key[AUTH_KEY_LEN+1];
   /** whether get data from security chip */
   BOOL_T is_security_chip_ok;
}GW_AUTH_INFO_S;
/**
 * @brief gw BASE information
 */

Typedef GW_CFG_S;

typedef struct {
   /** device ability, see GW_ABI */
   GW_ABI abi;
#if defined(WIFI_GW) && (WIFI_GW==1)
   /** network config type, see GW_WF_CFG_MTHD_SEL */
   GW_WF_CFG_MTHD_SEL mthd;
   /** enable station-ap or not */
   BOOL_T enable_station_ap;
   /** Wi-Fi start mod, see GW_WF_START_MODE */
   GW_WF_START_MODE wifi_start_mode;
#endif
#if defined(GW_SUPPORT_WIRED_WIFI) && (GW_SUPPORT_WIRED_WIFI==1)
   /** network mode, see IOT_GW_NET_TYPE_T */
   IOT_GW_NET_TYPE_T net_mode;
#endif
}GW_CFG_S;
/**
 * @brief gateway network attribute decribe
 */

Typedef GW_BASE_IF_S;

typedef struct {
   /** uuid, assigned by TUYA */
 CHAR_T uuid[GW_UUID_LEN+1];
   /** psk key */
 CHAR_T psk_key[PSK_KEY_LEN+1];
#if !TY_SECURITY_CHIP
   /** auth key */
   CHAR_T auth_key[AUTH_KEY_LEN+1]; 
#else
   /** has auth or not */
   BOOL_T has_auth;
#endif
#if defined(WIFI_GW) && (WIFI_GW==1)
   /** ap ssid info */
   CHAR_T ap_ssid[WIFI_SSID_LEN+1];
   /** ap passwd info */
   CHAR_T ap_passwd[WIFI_PASSWD_LEN+1];
   
#endif
#if (defined(WIFI_GW) && (WIFI_GW==1)) || (defined(GW_SUPPORT_COUNTRY_CODE) && (GW_SUPPORT_COUNTRY_CODE==1))
   /** country code */
 CHAR_T country_code[COUNTRY_CODE_LEN];
#endif
#if defined(GPRS_GW) && (GPRS_GW==1)
   /** imei */
   CHAR_T imei[TUYA_IMEI_LEN+1];
   /** sn */
   CHAR_T sn[TUYA_SN_LEN+1];
#endif
   /** production test */
   BOOL_T prod_test;
#if defined(TY_BT_MOD) && TY_BT_MOD == 1
   /** bt mac */
   CHAR_T bt_mac[BT_MAC_LEN+1];
   /** bt hid */
   CHAR_T bt_hid[BT_HID_LEN+1];
#endif
   /** fac_pin == pid */
   CHAR_T fac_pin[20 + 1];
}GW_BASE_IF_S;
/**
 * @brief Definition gw BASE information
 */

Typedef GW_WF_MD_T

typedef BYTE_T GW_WF_MD_T;
#define GWM_NORMAL				0  // Normal
#define GWM_SPECIAL_SMT_CFG	1  // special smart cfg
#define GWM_SPECIAL_AP_CFG		2  // special ap cfg
#define GWM_SPECIAL_SMT_AP_CFG	3  // special smart and ap cfg


      

Typedef GW_WORK_STAT_T

typedef BYTE_T GW_WORK_STAT_T;
#define UNREGISTERED 0 // unregistered
#define REGISTERED 1 // registered & activate start
#define ACTIVATED 2 // already active
#define BLE_ACTIVING   (3)//start ble active
#define BLE_ACTIVATED  (4) // ble actived

// gw register status

Typedef GW_WORK_STAT_MAG_S;

typedef struct {
#if defined(WIFI_GW) && (WIFI_GW==1)
   /** see GW_WF_NWC_STAT_T, valid when gateway is wireless */
   GW_WF_NWC_STAT_T nc_tp;
   /** see GW_WF_MD_T */
   GW_WF_MD_T md;
   /** ssid */
   CHAR_T ssid[WIFI_SSID_LEN+1];
   /** passwd */
   CHAR_T passwd[WIFI_PASSWD_LEN+1];
   /** used to save airkiss random */
   BYTE_T random;
#endif
   /** dns priority, see TY_DNS_PRIO_T */
   TY_DNS_PRIO_T dns_prio;
   /** work state, see GW_WORK_STAT_T */
   GW_WORK_STAT_T stat;
   /** token, recvive from app */
   CHAR_T token[TOKEN_LEN+1];
   /** region, recvive from app */
   CHAR_T region[REGION_LEN + 1];
   /** regist key, recvive from app */
   CHAR_T regist_key[REGIST_KEY_LEN + 1];
}GW_WORK_STAT_MAG_S;
/**
 * @brief Definition of device work state
 */

Typedef GW_DESC_IF_S;

typedef struct {
   /** ability, see GW_ABI */
   GW_ABI abi;
   /** virtual id */
   CHAR_T id[GW_ID_LEN+1];
   /** firmware ver, format xx.xx.xx */
   CHAR_T sw_ver[SW_VER_LEN+1];
   /** base version xx.xx */
   CHAR_T bs_ver[SW_VER_LEN+1];
   /** protocol version */
   CHAR_T prtl_ver[SW_VER_LEN+1];
   /** lan protocol version */
   CHAR_T lan_prtl_ver[SW_VER_LEN+1];
   /** cad version */
   CHAR_T cad_ver[SW_VER_LEN+1];
   /** cd version */
   CHAR_T cd_ver[SW_VER_LEN+1];
   /** KEY of product */
   CHAR_T product_key[PRODUCT_KEY_LEN+1];
   /** KEY of firmware */
   CHAR_T firmware_key[PRODUCT_KEY_LEN+1];

   /** networklink module single device struct */
   CHAR_T dev_sw_ver[SW_VER_LEN+1];
   /** schema id */
   CHAR_T schema_id[SCHEMA_ID_LEN+1];
   /** device ota channel */
   DEV_TYPE_T tp;

   /** count of GW attach attribute */
   BYTE_T attr_num;
   /** GW attach attribute */
   GW_ATTACH_ATTR_T attr[GW_ATTACH_ATTR_LMT];

   /** need sync or not */
   BOOL_T sync;
#if defined(TUYA_GW_OPERATOR) && (TUYA_GW_OPERATOR==1)
   /** operator info */
   CH_CODE_ST ch_dminfo;
#endif
}GW_DESC_IF_S;
/**
 * @brief Definition of device description info
 */

Typedef GW_STRIDE_UPDATE_S;

typedef struct {
   /** KEY of product */
   CHAR_T product_key[PRODUCT_KEY_LEN+1];
   /** KEY of firmware */
   CHAR_T firmware_key[PRODUCT_KEY_LEN+1];
}GW_STRIDE_UPDATE_S;
/**
 * @brief Definition of stride update info
 */

Typedef GW_ACTV_IF_S;

typedef struct {
   /** key used by HTTP */
   CHAR_T key[SEC_KEY_LEN+1];
   /** key used by lan/mqtt/... */
   CHAR_T local_key[LOCAL_KEY_LEN+1];
   /** psk21 */
   CHAR_T psk21_key[TUYA_PSK21_LEN+1];
   /** domain of http */
   CHAR_T http_url[HTTP_URL_LMT+1];
   /** ip of http */
   CHAR_T http_ip[HTTP_URL_LMT+1];
   /** domain of https */
   CHAR_T https_url[HTTP_URL_LMT+1];
   /** ip of https */
   CHAR_T https_ip[HTTP_URL_LMT+1];
   /** domain of https-psk */
   CHAR_T httpsPSK_url[HTTP_URL_LMT+1];
   /** ip of https-psk */
   CHAR_T httpsPSK_ip[HTTP_URL_LMT+1];

   /** domain of mqtt psk */
   CHAR_T mq_psk_url[MQ_URL_LMT+1];
   /** ip of mqtt psk */
   CHAR_T mq_psk_ip[MQ_URL_LMT+1];
   /** domain of mqtts */
   CHAR_T mq_tls_url[MQ_URL_LMT+1];
   /** ip of mqtts */
   CHAR_T mq_tls_ip[MQ_URL_LMT+1];
   /** domain of mqtt */
   CHAR_T mq_proto_url[MQ_URL_LMT+1];
   /** ip of mqtt */
   CHAR_T mq_proto_ip[MQ_URL_LMT+1];
   /** domain of ai speech */
   CHAR_T ai_speech_url[HTTP_URL_LMT+1];
   /** ip of ai speech */
   CHAR_T ai_speech_ip[HTTP_URL_LMT+1];
   /** domain of lowpower */
   CHAR_T lowpower_url[MQ_URL_LMT+1];
   /** ip of lowpower */
   CHAR_T lowpower_ip[MQ_URL_LMT+1];

   /** timezone */
   CHAR_T time_zone[TIME_ZONE_LEN+1];
   /** summer timezone */
   CHAR_T summer_time_zone[SUMMER_TM_ZONE_LEN+1];

   /** app id, assigned by WX */
   CHAR_T wx_app_id[WXAPPID_LEN+1];
   /** uuid of wx */
   CHAR_T wx_uuid[WXUUID_LEN+1];
   /** cloud capability */
   INT_T cloud_capability;

   /** 0:invalid 1:disable 2:psk_only 3:ecc_psk 4:ecc_only 6:client auth */
   BYTE_T dynamic_tls_mode;
}GW_ACTV_IF_S;
/**
 * @brief Definition of active info
 */

Typedef DP_PV_STAT_E

typedef BYTE_T DP_PV_STAT_E;
#define INVALID 0      // dp is invalid
#define VALID_LC 1     // dp is valid in local
#define VALID_ULING 2  // dp is uploading to cloud
#define VALID_CLOUD 3  // dp is synced with cloud

/**
 * @brief Definiton of DP status
 */

Typedef DEVICE_ACTIVE_STAGE_E

typedef BYTE_T DEVICE_ACTIVE_STAGE_E;
#define DEV_NW_CFG_INITED        (1)  // inited
#define DEV_NW_CFG_STARTED     (2)    // network config started
#define DEV_NW_CONNNECTING     (3)    // network config complete, connecting
#define DEV_ACTIVE_GET_URL     (4)    // connected, getting url
#define DEV_WIFI_ACTIVE_ING         (5) // got url, activating
#define DEV_WIFI_ACTIVE_DONE        (6) // activated
#define DEV_BLE_ACTIVE_START   (7)    // ble activaing start
#define DEV_BLE_ACTIVE_DONE    (8)    // ble activated

/**
 * @brief Definiton of status when network config and activate
 */

Typedef DP_REPT_FLOW_CTRL_UNIT;

typedef struct {
   UINT_T  period; // long filter period
   UINT_T  limit; // dpcount limit in long filter period
   UINT_T  rept_cnt; // report counter
   TIME_S  fir_rept_timestamp;//the first report success timestamp
}DP_REPT_FLOW_CTRL_UNIT;
/**
 * @brief Definition of dp report flow control unit
 */

Typedef DP_REPT_FLOW_CTRL;

typedef struct { 
   DP_REPT_FLOW_CTRL_UNIT filter_short;//flow control rules for short period
   DP_REPT_FLOW_CTRL_UNIT filter_long;//flow control rules for long period
}DP_REPT_FLOW_CTRL;
/**
 * @brief Definition of dp report flow control
 */

Typedef DP_CUR_SET_REPT_CNTL_S;

typedef struct {
   /** cur set time */
   TIME_S cur_set_time;
   /** cur set rept num */
   UINT_T cur_set_rept_num;
}DP_CUR_SET_REPT_CNTL_S;
/**
 * @brief Definition of dp current set report control
 */

Typedef DP_CNTL_S;

typedef struct {
   /** see DP_DESC_IF_S */
   DP_DESC_IF_S dp_desc;
   /** see DP_PROP_VALUE_U */
   DP_PROP_VALUE_U prop;
   /** cache status, see DP_PV_STAT_E */
   DP_PV_STAT_E pv_stat;
   /** see DP_REPT_FLOW_CTRL */
   DP_REPT_FLOW_CTRL rept_flow_ctrl;
#if defined(RELIABLE_TRANSFER) && (RELIABLE_TRANSFER==1)
   /** see TIME_S */
   TIME_S rept_new_time;
   /** current dp cmd value, see DP_PROP_VALUE_U  */
   DP_PROP_VALUE_U cur_set;
   /** see DP_CUR_SET_REPT_CNTL_S */
   DP_CUR_SET_REPT_CNTL_S cur_set_rept;
   /** whether to check consistency between dp cmd value and actual state */
   BYTE_T is_set_flag;//是否要检查当前下发的值与实际状态是否一样
#endif
}DP_CNTL_S;
/**
 * @brief Definition of dp  control
 */

Typedef SCHEMA_OTHER_ATTR_S;

typedef struct {
   /** need preprecess or not */
   BOOL_T preprocess;
} SCHEMA_OTHER_ATTR_S;
/**
 * @brief Definition of schema other attribute
 */

Typedef GRP_REC_S;

typedef struct {
   /** group id */
   CHAR_T gid[GRP_ID_LEN+1];
}GRP_REC_S;
/**
 * @brief Definition of group info
 */

Typedef SCENE_REC_S;

typedef struct {
   /** secene id */
   CHAR_T s_id[SCENE_ID_LEN+1];
   /** group id */
   CHAR_T g_id[GRP_ID_LEN+1];
}SCENE_REC_S;
/**
 * @brief Definition of scene info
 */

Typedef GRP_MAG_S;

typedef struct {
   /** group info */
   GRP_REC_S g_rec[GRP_LMT];
   /** group count */
   BYTE_T cnt;
}GRP_MAG_S;
/**
 * @brief Definition of group management
 */

Typedef SCENE_MAG_S;

typedef struct {
   /** secene info */
   SCENE_REC_S s_rec[SCENE_LMT];
   /** secene count */
   BYTE_T cnt;
}SCENE_MAG_S;
/**
 * @brief Definition of scene management
 */

Typedef DEV_ACTV_ATTR_S;

typedef struct {
   /** is attach dp info or not */
   BOOL_T attach_dp_if;
   /** need preprecess or not */
   BOOL_T preprocess;
}DEV_ACTV_ATTR_S;


      

Typedef DEV_CNTL_N_S;

typedef struct dev_cntl_n_s {
   /** virtual id */
   CHAR_T id[DEV_ID_LEN+1];
   /** device attribute, see DEV_ACTV_ATTR_S */
   DEV_ACTV_ATTR_S attr;
#if defined(RELIABLE_TRANSFER) && (RELIABLE_TRANSFER==1)
   /** support reliable transfer or not */
   BYTE_T reliable_transfer_flag;//1表示要可靠性检测
#endif

   /** exclusive access to dp */
   MUTEX_HANDLE dp_mutex;//dp本地缓存互斥锁
   /** count of dp */
   BYTE_T dp_num;
   /** dp info */
   DP_CNTL_S dp[0];
} DEV_CNTL_N_S;
/**
 * @brief Definition of device control info
 */

Typedef DEV_CNTL_N_S

typedef DEV_CNTL_N_S * (*subdev_dev_cntl_get_cb)(IN CHAR_T *id);
/**
 * @brief Handler to get sub-device control info
 * 
 * @param[in] id Virtual id of sub-device
 * 
 * @return See DEV_CNTL_N_S, NULL on error
 */

Typedef GW_CNTL_S;

typedef struct {
   /** serial num */
   CHAR_T *serial_no;
   /** see DEV_ATTRIBUTE */
   UINT_T ext_attribute;

   /** Wi-Fi network config method, see GW_WF_CFG_MTHD_SEL */
   GW_WF_CFG_MTHD_SEL mthd;
   /** Enable station ap or not */
   BOOL_T enable_station_ap;
   /** Wi-Fi start mode, see GW_WF_START_MODE */
   GW_WF_START_MODE wifi_start_mode;

   /** Extension state, see GW_EXT_STAT_T */
   GW_EXT_STAT_T ext_stat;

   /** Is oem device or not */
   BOOL_T is_oem;
   /** Inited or not */
   BOOL_T is_init;
   /** Is stride(pid/key) or not */
   BOOL_T is_stride;
   /** Is need recovery or not */
   BOOL_T is_need_recovery;

#if TY_SECURITY_CHIP
   /** see GW_AUTH_INFO_S */
   GW_AUTH_INFO_S secu_auth_info;
#endif

   /** device base info, see GW_BASE_IF_S */
   GW_BASE_IF_S gw_base;
   /** device work state management, see GW_WORK_STAT_MAG_S */
   GW_WORK_STAT_MAG_S gw_wsm;
   /** device description info, see GW_DESC_IF_S */
   GW_DESC_IF_S gw_if;
   /** device active info, see GW_ACTV_IF_S */
   GW_ACTV_IF_S gw_actv;

   /** device manage */
   DEV_CNTL_N_S *dev_cntl; 

   /** nofity callback */
   TY_IOT_CBS_S cbs;

   /** network linkage monitor */
   TM_MSG_S *nw_stat_moni_tm;

#if defined(TY_BT_MOD) && (TY_BT_MOD==1) && defined(BT_ACTIVE) && (BT_ACTIVE==1)
   /** see DEVICE_ACTIVE_STAGE_E */
   DEVICE_ACTIVE_STAGE_E dev_nw_cfg_active_stage;
#endif

#if defined(WIFI_GW) && (WIFI_GW==1)
   /** handler for network state change */
   GET_WF_NW_STAT_CB get_wf_nw_stat_cb;
   /** handler when network configuration error happens */
 WF_NW_CFG_ERR_CODE_CB wf_nw_err_code_cb;
   /** error code for network config  */
 NW_CFG_ERR_CODE_E wf_nw_cfg_err_code;
#if defined(GW_SUPPORT_WIRED_WIFI) && (GW_SUPPORT_WIRED_WIFI==1)
   /** network mode, see IOT_GW_NET_TYPE_T */
   IOT_GW_NET_TYPE_T net_mode;
   /** network status, see CUR_NET_STATUS_T */
   CUR_NET_STATUS_T current_net;
   /** handler for network state */
   GET_NW_STAT_CB get_nw_stat_cb;
#endif
#else
   /** handler for network state */
   GET_NW_STAT_CB get_nw_stat_cb;
#endif

   /** global data update time */
   TIME_S data_update_time;
   /** sub-device related info */
   subdev_dev_cntl_get_cb subdev_dev_get_cb;
}GW_CNTL_S;
/**
 * @brief Definition of core device management
 */

Typedef GW_RESET_TP_T

typedef BYTE_T GW_RESET_TP_T;
#define GRT_LOCAL 0    // reset is triggerd by device itself
#define GRT_REMOTE 1   // reset is triggerd by cloud/app



      

Typedef GW_RESET_S;

typedef struct {
   /** reset type, see GW_RESET_TP_T */
   GW_RESET_TP_T gw_rst_tp;
}GW_RESET_S;
/**
 * @brief Definition of gateway device reset info
 */

Typedef DEV_RESET_S;

typedef struct {
   /** reset type, see GW_RESET_TP_T */
   GW_RESET_TP_T tp;
   /** virtual id of sub-device */
   CHAR_T dev_id[DEV_ID_LEN+1];
}DEV_RESET_S;
/**
 * @brief Definition of sub-device reset info
 */

Typedef TUYA_COUNTRY_CODE_E;

typedef enum {
   /** China */
   TY_COUNTRY_CODE_CN,
   /** USA */
   TY_COUNTRY_CODE_US,
   /** Japan */
   TY_COUNTRY_CODE_JP,
   /** Europe */
   TY_COUNTRY_CODE_EU
} TUYA_COUNTRY_CODE_E;
/**
 * @brief Definition Wi-Fi country code
 */

Typedef GW_PROD_INFO_S;

typedef struct {
   CHAR_T *uuid;       // strlen(uuid) <= 16,must not be null
   CHAR_T *auth_key;   // strlen(auth_key) <= 32,must not be null
}GW_PROD_INFO_S;
/**
 * @brief Definition of product info(wired)
 */

Typedef GET_NW_STAT_CB

typedef VOID (*GET_NW_STAT_CB)(IN CONST GW_BASE_NW_STAT_T stat);
/**
 * @brief Handler when network state error happens(wired)
 *
 * @param[in] stat State code, see GW_BASE_NW_STAT_T
 */

Typedef GW_ABI

typedef BYTE_T GW_ABI;
#define GW_VIRTUAL 0 // product doesn't have subdevices functions,it only has device function. For example: SOC or MCU
#define GW_ENTITY_ATTH_DEV 1 // Product has subdevices functions and it also has device function.
#define GW_ENTITY 2 // Product only has subdevices functions.

// Product Function Specification

Typedef GW_NW_STAT_T

typedef BYTE_T GW_NW_STAT_T;
#define GNS_UNVALID 0   // product is offline in LAN and WAN
#define GNS_LAN_VALID 1 // product is online in LAN but offline in WAN
#define GNS_WAN_VALID 2 // product is online in LAN and WAN

// Product Network Connection

Typedef GW_EXT_STAT_T

typedef BYTE_T GW_EXT_STAT_T;
#define EXT_UNAUTH 0           // UNAUTH
#define EXT_PROD_TEST 1        // PROD_TEST
#define EXT_NORMAL_S 2         // NORMAL_S
#define EXT_GW_UPGRD 3         // GW_UPGRD
#define EXT_DEV_UPGRD 4        // DEV_UPGRD
#define EXT_DEV_ADD 5          // DEV_ADD
#define EXT_REG_FAIL 6         // REG_FAIL
#define EXT_NET_FAIL 7         // NET_FAIL
#define EXT_CONFIG_BACK_UP 8   // CONFIG_BACK_UP
#define EXT_CONFIG_RESTORE 9   // CONFIG_RESTORE

// Product Extend State

Typedef DEV_TYPE_T

typedef BYTE_T DEV_TYPE_T;
#define DEV_NM_ATH_SNGL    0  // main netlink module
#define DEV_BLE_SNGL       1  // ble
#define DEV_ZB_SNGL        3  // ZigBee
#define DEV_NM_NOT_ATH_SNGL 9  // MCU
#define DEV_ATTACH_MOD_1 10    // attach 1
#define DEV_ATTACH_MOD_2 11    // attach 2
#define DEV_ATTACH_MOD_3 12    // attach 3
#define DEV_ATTACH_MOD_4 13    // attach 4
#define DEV_ATTACH_MOD_5 14    // attach 5
#define DEV_ATTACH_MOD_6 15    // attach 6
#define DEV_ATTACH_MOD_7 16    // attach 7
#define DEV_ATTACH_MOD_8 17    // attach 8
#define DEV_ATTACH_MOD_9 18    // attach 9
#define DEV_ATTACH_MOD_10 19   // attach 10

/**
 * @brief Definition of device ota channel
 * 
 * @note 0~9 are consistent among all TUYA devices
 * 10~19 are customized by device itself
 */

Typedef IOT_GW_NET_TYPE_T

typedef BYTE_T IOT_GW_NET_TYPE_T;
#define IOT_GW_NET_WIRED      0  // only support wried
#define IOT_GW_NET_WIFI       1  // only support wifi
#define IOT_GW_NET_WIRED_WIFI 2  // support wired and wifi



      

Typedef CUR_NET_STATUS_T

typedef BYTE_T CUR_NET_STATUS_T;
#define NET_WIRED 0 // wired
#define NET_WIFI 1 // wifi


      

Typedef USER_DEV_DTL_DEF_T

typedef UINT_T USER_DEV_DTL_DEF_T; // user detial type define
// sub-device detail type

Typedef GW_PERMIT_DEV_TP_T

typedef BYTE_T GW_PERMIT_DEV_TP_T;
#define GP_DEV_DEF 255                // default device type
#define GP_DEV_ZB DEV_ZB_SNGL          // zigbee
#define GP_DEV_BLE DEV_BLE_SNGL        // ble
#define GP_DEV_MCU DEV_NM_NOT_ATH_SNGL // mcu
#define GP_DEV_ATH_1 DEV_ATTACH_MOD_1  // attach 1
#define GP_DEV_ATH_2 DEV_ATTACH_MOD_2  // attach 2
#define GP_DEV_ATH_3 DEV_ATTACH_MOD_3  // attach 3
#define GP_DEV_ATH_4 DEV_ATTACH_MOD_4  // attach 4
#define GP_DEV_ATH_5 DEV_ATTACH_MOD_5  // attach 5
#define GP_DEV_ATH_6 DEV_ATTACH_MOD_6  // attach 6
#define GP_DEV_ATH_7 DEV_ATTACH_MOD_7  // attach 7
#define GP_DEV_ATH_8 DEV_ATTACH_MOD_8  // attach 8
#define GP_DEV_ATH_9 DEV_ATTACH_MOD_9  // attach 9
#define GP_DEV_ATH_10 DEV_ATTACH_MOD_10 // attach 10

/**
 * @brief Definition of all attache types
 */

Typedef TY_DP_REPT_CHAN_TP_T

typedef BYTE_T TY_DP_REPT_CHAN_TP_T;
#define TY_DP_REPT_CHAN_LAN      0
#define TY_DP_REPT_CHAN_MQTT     1
#define TY_DP_REPT_CHAN_HTTP     2
#define TY_DP_REPT_CHAN_BLE      3
#define TY_DP_REPT_CHAN_SIGMESH  4
#define TY_DP_REPT_CHAN_TUYA_MESH 5
#define TY_DP_REPT_CHAN_BEACON   6
#define TY_DP_REPT_CHAN_MAX      7



      

Typedef TY_INIT_PARAMS_S;

typedef struct {
   /** kv init or not */
   BOOL_T init_db;
   /** sys env settings */
   CHAR_T sys_env[SYS_ENV_LEN];
   /** log seq path */
   CHAR_T log_seq_path[LOG_SEQ_PATH_LEN];
}TY_INIT_PARAMS_S;
/**
 * @brief Definition of TUYA DevOS init param
 */

Typedef GW_ATTACH_ATTR_T;

typedef struct {
   /** attach ota channel */
   GW_PERMIT_DEV_TP_T tp;
   /** attach version, format xx.xx.xx */
   CHAR_T ver[SW_VER_LEN+1];
   CHAR_T md5[SW_MD5_LEN+1];
}GW_ATTACH_ATTR_T;
/**
 * @brief Definition of attach moudule attribute
 */

Typedef CH_CODE_ST;

typedef struct{
   /** operator name */
   CHAR_T ch_name[CH_NAME_LMT+1];
   /** operator code */ 
   CHAR_T ch_code[CH_CODE_LMT+1];
   /** device sn */
   CHAR_T ch_sn[CH_SN_LMT+1];
   /** report code */
   CHAR_T ch_report_code[CH_REPORT_CODE_LMT+1];
   /** manufacture id */
   CHAR_T ch_manu_id[CH_MANU_ID_LMT+1];
   /** sw version */
   CHAR_T ch_version[CH_VERSION_LMT+1];
   /** encrypt key */
   CHAR_T ch_encrype_key[CH_ENCRYPT_KEY_LMT+1];
}CH_CODE_ST;
/**
 * @brief Definition of operator code info
 */

Typedef DEV_QOS_ST;

typedef struct{
   /** short nodeID */
   USHORT_T sNodeID;
   /** father short nodeID */
   USHORT_T fNodeID;
   /** RSSI */
   CHAR_T  rssi;
   /** lqi info */
   UCHAR_T lqi;
   /** father node ID str */
   CHAR_T  fid[DEV_ID_LEN+1];
}DEV_QOS_ST;
/**
 * @brief Definition of device Quaility of Service
 */

Typedef DP_REPT_TYPE_E

typedef BYTE_T DP_REPT_TYPE_E;
#define T_OBJ_REPT     0          // dp is value,str,enum,bool,bitmap
#define T_RAW_REPT     1          // raw type
#define T_STAT_REPT    2          // stat type
#define T_RE_TRANS_REPT 10         // repeat report

/**
 * @brief  Definition of dp report type
 */

Typedef DP_TYPE_E

typedef BYTE_T DP_TYPE_E;
#define T_OBJ          0          // dp is value,str,enum,bool,bitmap
#define T_RAW          1          // raw type
#define T_FILE         2          // file type

/**
 * @brief  Definition of dp type
 */

Typedef DP_MODE_E

typedef BYTE_T DP_MODE_E;
#define M_RW           0         // cloud/app can read and write
#define M_WR           1         // cloud/app can only write to device
#define M_RO           2         // cloud/app can only read from device

/**
 * @brief  Definition of dp mode
 */

Typedef DP_PROP_TP_E

typedef BYTE_T DP_PROP_TP_E;
#define PROP_BOOL 0
#define PROP_VALUE 1
#define PROP_STR 2
#define PROP_ENUM 3
#define PROP_BITMAP 4

/**
 * @brief  Definition of dp property type
 */

Typedef UP_MAP_TYPE_E

typedef BYTE_T UP_MAP_TYPE_E;
#define UP_CLEANER_MAP  0
#define UP_CLEANER_PATH 1
#define UP_CLEANER_MAP_PATH 2

/**
 * @brief  Definition of map type
 */

Typedef UPGRADE_TYPE_T

typedef BYTE_T UPGRADE_TYPE_T;
#define UPGRADE_TYPE_NORMAL 0
#define UPGRADE_TYPE_SILENT 1

/**
 * @brief  Definition of upgrade type
 */

Typedef DP_PROP_VAL_S;

typedef struct {
   /** min value */
   INT_T min;
   /** max value */
   INT_T max;
   /** step */
   SHORT_T step;
   /** scale */
   USHORT_T scale;
   /** dp value */
   INT_T value;
}DP_PROP_VAL_S;
/**
 * @brief  Definition of dp prop
 */

Typedef DP_PROP_ENUM_S;

typedef struct {
   /** enum count */
   INT_T cnt;
   /** enum value */
   CHAR_T **pp_enum;
   /** current value */
   INT_T value;
}DP_PROP_ENUM_S;
/**
 * @brief  Definition of dp prop
 */

Typedef DP_PROP_STR_S;

typedef struct {
   /** max len */
   INT_T max_len;
   /** cur len */
   INT_T cur_len;
   /** mutex */
   void* dp_str_mutex;
   /** dp value */
   CHAR_T *value;
}DP_PROP_STR_S;
/**
 * @brief  Definition of dp prop
 */

Typedef DP_BOOL_S;

typedef struct {
   /** bool value */
   BOOL_T value;
}DP_BOOL_S;
/**
 * @brief  Definition of dp prop
 */

Typedef DP_PROP_BITMAP;

typedef struct {
   /** max len */
   UINT_T max_len;
   /** value */
   UINT_T value;
}DP_PROP_BITMAP;
/**
 * @brief  Definition of dp prop
 */

Typedef DP_PROP_VALUE_U;

typedef union {
   /** see DP_PROP_VAL_S */
   DP_PROP_VAL_S prop_value;
   /** see DP_PROP_ENUM_S */
   DP_PROP_ENUM_S prop_enum;
   /** see DP_PROP_STR_S */
   DP_PROP_STR_S prop_str;
   /** see DP_BOOL_S */
   DP_BOOL_S prop_bool;
   /** see DP_PROP_BITMAP */
   DP_PROP_BITMAP prop_bitmap;
}DP_PROP_VALUE_U;
/**
 * @brief  Definition of dp prop value
 */

Typedef DP_TRIG_T_E

typedef BYTE_T DP_TRIG_T_E;
#define TRIG_PULSE     0  // upload when value changes
#define TRIG_DIRECT    1  // upload without value change check

/**
 * @brief  Definition of dp trigger type
 */

Typedef DP_PSV_E

typedef BYTE_T DP_PSV_E;
#define PSV_FALSE 0   /* disabled */
#define PSV_TRUE 1    /* app hasn't query yet */
#define PSV_F_ONCE 2  /* app has queryed, shoulb report */

/**
 * @brief  Definition of dp positive upload policy
 */

Typedef DP_STAT_TP_T

typedef BYTE_T DP_STAT_TP_T;
#define DST_NONE 0 // no need statistics
#define DST_INC 1 // dp statistics increase
#define DST_TOTAL 2 // dp statistics total

/**
 * @brief  Definition of dp statistics type
 */

Typedef DP_DESC_IF_S;

typedef struct {
   /** dp id */
   BYTE_T dp_id;
   /** see DP_MODE_E */
   DP_MODE_E mode;
   /** see DP_PSV_E */
   DP_PSV_E passive;
   /** see DP_TYPE_E */
   DP_TYPE_E type;
   /** see DP_PROP_TP_E */
   DP_PROP_TP_E prop_tp;
   /** see DP_TRIG_T_E */
   DP_TRIG_T_E trig_t;
   /** see DP_STAT_TP_T */
   DP_STAT_TP_T stat;
}DP_DESC_IF_S;
/**
 * @brief Definition of dp description
 */

Typedef DP_CMD_TYPE_E

typedef BYTE_T DP_CMD_TYPE_E;
#define DP_CMD_LAN     0      // cmd from LAN
#define DP_CMD_MQ      1      // cmd from MQTT
#define DP_CMD_TIMER   2      // cmd from Local Timer
#define DP_CMD_SCENE_LINKAGE 3 // cmd from scene linkage
#define DP_CMD_RELIABLE_TRANSFER 4 // cmd from reliable transfer
#define DP_CMD_BT      5     // cmd from bt
#define DP_CMD_SCENE_LINKAGE_LAN 6 // cmd from lan scene linkage
#define DP_CMD_FFC     7      // cmd from ffc

/**
 * @brief tuya sdk dp cmd type
 */

Typedef DP_TRANS_TYPE_T

typedef BYTE_T DP_TRANS_TYPE_T;
#define DTT_SCT_UNC    0      // unicast
#define DTT_SCT_BNC    1      // boardcast
#define DTT_SCT_MNC    2      // multicast
#define DTT_SCT_SCENE  3      // scene

/**
 * @brief tuya sdk dp trans type
 */

Typedef TY_OBJ_DP_VALUE_U;

typedef union {
   INT_T dp_value;            // valid when dp type is value
   UINT_T dp_enum;            // valid when dp type is enum
   CHAR_T *dp_str;            // valid when dp type is str
   BOOL_T dp_bool;            // valid when dp type is bool
   UINT_T dp_bitmap;          // valid when dp type is bitmap
}TY_OBJ_DP_VALUE_U;
/**
 * @brief tuya sdk dp value union
 */

Typedef TY_OBJ_DP_S;

typedef struct {
   /** dp id */
   BYTE_T dpid;
   /** dp type, see DP_PROP_TP_E */
   DP_PROP_TP_E type;
   /** dp value, see TY_OBJ_DP_VALUE_U */
   TY_OBJ_DP_VALUE_U value;
   /** dp happen time. if 0, mean now */
   UINT_T time_stamp;
}TY_OBJ_DP_S;
/**
 * @brief Definition of structured dp
 */

Typedef TY_RECV_OBJ_DP_S;

typedef struct {
   /** see DP_CMD_TYPE_E */
   DP_CMD_TYPE_E cmd_tp;
   /** see DP_TRANS_TYPE_T */
   DP_TRANS_TYPE_T dtt_tp;
   /** if(NULL == cid) then then the cid represents gwid */
   CHAR_T *cid;
   /** mb id */
   CHAR_T *mb_id;
   /** count of dp */
   UINT_T dps_cnt;
   /** the dp data */
   TY_OBJ_DP_S dps[0];
}TY_RECV_OBJ_DP_S;
/**
 * @brief Definition of recved structured dp
 */

Typedef TY_RECV_RAW_DP_S;

typedef struct {
   /** see DP_CMD_TYPE_E */
   DP_CMD_TYPE_E cmd_tp;
   /** see DP_TRANS_TYPE_T */
   DP_TRANS_TYPE_T dtt_tp;
   /** if(NULL == cid) then then the cid represents gwid */
   CHAR_T *cid;
   /** dp id */
   BYTE_T dpid;
   /** mb id */
   CHAR_T *mb_id;
   /** data len */
   UINT_T len;
   /** the data */
   BYTE_T data[0];
}TY_RECV_RAW_DP_S;
/**
 * @brief Definition of recved raw dp
 */

Typedef TY_DP_QUERY_S;

typedef struct {
   /** if(NULL == cid) then then the cid represents gwid */
   CHAR_T *cid;
   /** dpid cnt if(0 == cnt) then query all object dp */
   UINT_T cnt;
   /** dpid */
   BYTE_T dpid[0];
}TY_DP_QUERY_S;
/**
 * @brief Definition of DP query
 */

Typedef DP_REPT_CB_DATA;

typedef struct{
   /** report type, see DP_REPT_TYPE_E */
   DP_REPT_TYPE_E dp_rept_type;
   /** obj:为TY_OBJ_DP_REPT_S,stat:dp为TY_STAT_DP_REPT_S,RAW:TY_RAW_DP_REPT_S */
   VOID_T*        dp_data;
   /** Json decoded dp string */
   CHAR_T*        dp_data_json;
   /** is query or not */
   BOOL_T         is_query;
}DP_REPT_CB_DATA;
/**
 * @brief Definition of DP report callbak
 */

Typedef DP_REPT_PRE_HANDLE

typedef OPERATE_RET (*DP_REPT_PRE_HANDLE)(IN CONST DP_REPT_CB_DATA* dp_data);
/**
 * @brief Handler of dp report pre-process
 * 
 * @param[in] dp_rslt Default report result
 * @param[in] dp_data DP data, see DP_REPT_CB_DATA
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef DP_REPT_POST_HANDLE

typedef OPERATE_RET (*DP_REPT_POST_HANDLE)(IN CONST OPERATE_RET dp_rslt, IN CONST DP_REPT_CB_DATA* dp_data);
/**
 * @brief Handler of dp report post-process
 * 
 * @param[in] dp_rslt Default report result
 * @param[in] dp_data DP data, see DP_REPT_CB_DATA
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef DP_REPT_HADLE_CB_S;

typedef struct{
   /** handler of pre-precess */
   DP_REPT_PRE_HANDLE dp_rept_pre_cb;
   /** handler of post-precess */
   DP_REPT_POST_HANDLE dp_rept_post_cb;
   /** send dp force or not */
   BOOL_T need_dp_force;
}DP_REPT_HADLE_CB_S;
/**
 * @brief Definition of DP handlers
*/

Typedef FW_UG_S;

typedef struct {
   /** firmware type */
   DEV_TYPE_T tp;
   /** upgrade type, see UPGRADE_TYPE_T */
   UPGRADE_TYPE_T type;
   /** firmware download url */
   CHAR_T fw_url[FW_URL_LEN+1];
   /** firmware version */
   CHAR_T sw_ver[SW_VER_LEN+1];
   /** firmware size in BYTE */
   UINT_T file_size;
   /** firmware hmac */
   CHAR_T fw_hmac[FW_HMAC_LEN+1];
   /** firmware md5 */
   CHAR_T fw_md5[FW_MD5_LEN+1];
   /** is difference ota or not */
   BOOL_T diff_ota;
}FW_UG_S;
/**
 * @brief tuya sdk ota firmware info 
 */

Typedef GW_STATUS_E

typedef BYTE_T GW_STATUS_E;
#define GW_RESET           0 // gw reset
#define GW_ACTIVED         1 // gw actived
#define GW_FIRST_START     2 // start tuya-sdk in the first time.
#define GW_NORMAL          3 // tuya-sdk is actived and started
#define GW_BLE_ACTIVED         4 // gw ble actived
/**
 * @brief Handler to process gateway state change
 * 
 * @param[in] status Gateway status, see GW_STATUS_E
 */
typedef VOID (*GW_STATUS_CHANGED_CB)(IN CONST GW_STATUS_E status);

/**
 * @brief tuya sdk gateway status info
 */

Typedef DEV_OBJ_DP_CMD_CB

typedef VOID (*DEV_OBJ_DP_CMD_CB)(IN CONST TY_RECV_OBJ_DP_S *dp);
/**
 * @brief Handler to process structured DP info
 * 
 * @param[in] dp DP query info, see TY_RECV_OBJ_DP_S
 */

Typedef DEV_RAW_DP_CMD_CB

typedef VOID (*DEV_RAW_DP_CMD_CB)(IN CONST TY_RECV_RAW_DP_S *dp);
/**
 * @brief Handler to process raw DP info
 * 
 * @param[in] dp DP query info, see TY_RECV_RAW_DP_S
 */

Typedef DEV_DP_QUERY_CB

typedef VOID (*DEV_DP_QUERY_CB)(IN CONST TY_DP_QUERY_S *dp_qry);
/**
 * @brief Handler to process structured DP query info
 * 
 * @param[in] dp_qry DP query info, see TY_DP_QUERY_S
 */

Typedef GW_UG_INFORM_CB

typedef int (*GW_UG_INFORM_CB)(IN CONST FW_UG_S *fw);
/**
 * @brief Handler to process gateway upgrade inform
 * 
 * @param[in] fw Firmware info, see FW_UG_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef GW_RESET_TYPE_E;

typedef enum {
   GW_LOCAL_RESET_FACTORY = 0,
   GW_REMOTE_UNACTIVE,
   GW_LOCAL_UNACTIVE,
   GW_REMOTE_RESET_FACTORY,
   GW_RESET_DATA_FACTORY, //need clear local data when active
}GW_RESET_TYPE_E;
/* tuya sdk gateway reset type */

Typedef GW_RESET_IFM_CB

typedef VOID (*GW_RESET_IFM_CB)(GW_RESET_TYPE_E type);
/**
 * @brief Handler to process gateway reset
 * 
 * @param[in] type Reset type, see DEV_RESET_TYPE_E
 */

Typedef DEV_UG_INFORM_CB

typedef int (*DEV_UG_INFORM_CB)(IN CONST CHAR_T *dev_id,IN CONST FW_UG_S *fw);
/**
 * @brief Handler to process sub-device upgrade inform
 * 
 * @param[in] dev_id Device ID, NULL indicates gateway
 * @param[in] fw Firmware info, see FW_UG_S
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef DEV_RESET_TYPE_E;

typedef enum {
   DEV_REMOTE_RESET_FACTORY,
   DEV_RESET_DATA_FACTORY, //need clear local data when bind
}DEV_RESET_TYPE_E;


      

Typedef DEV_RESET_IFM_CB

typedef VOID (*DEV_RESET_IFM_CB)(IN CONST CHAR_T *dev_id,IN DEV_RESET_TYPE_E type);
/**
 * @brief Handler to process reset
 * 
 * @param[in] dev_id Device ID, NULL indicates gateway
 * @param[in] type Reset type, see DEV_RESET_TYPE_E
 */

Typedef OPE_HTTPC_GET_CHCODE_CB

typedef OPERATE_RET (*OPE_HTTPC_GET_CHCODE_CB)(IN CONST BOOL_T is_gw, IN CONST CHAR_T *devid, INOUT CH_CODE_ST *ch_code);
/**
 * @brief Handler to get operator code
 * 
 * @param[in] is_gw Whether gateway or not
 * @param[in] devid Device ID, NULL indicates gateway
 * @param[out] ch_code Operator code, see CH_CODE_ST
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef GET_FILE_DATA_CB

typedef OPERATE_RET (*GET_FILE_DATA_CB)(IN CONST FW_UG_S *fw, IN CONST UINT_T total_len,IN CONST UINT_T offset,
                                               IN CONST BYTE_T *data,IN CONST UINT_T len,OUT UINT_T *remain_len, IN PVOID_T pri_data);
/**
 * @brief Handler to process firmware download content
 * 
 * @param[in] fw Firmware info, see FW_UG_S
 * @param[in] total_len Total length of firmware
 * @param[in] offset Current offset
 * @param[in] data File data buffer
 * @param[in] len Length of buffer
 * @param[in] remain_len Length not handled
 * @param[in] pri_data Private data
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef ACTIVE_SHORTURL_CB

typedef VOID (*ACTIVE_SHORTURL_CB)(OUT CONST CHAR_T *shorturl);
/**
 * @brief Handler to process device active short url
 * 
 * @param[out] shorturl Short url to active
 */

Typedef UPGRADE_NOTIFY_CB

typedef VOID (*UPGRADE_NOTIFY_CB)(IN CONST FW_UG_S *fw, IN CONST INT_T download_result, IN PVOID_T pri_data);
/**
 * @brief Handler to process download result
 * 
 * @param[in] fw Firmware info, see FW_UG_S
 * @param[in] download_result download result, 0 indicates success
 * @param[in] pri_data Private data
 */

Typedef TY_IOT_CBS_S;

typedef struct {
   /** status update */
   GW_STATUS_CHANGED_CB gw_status_cb;
   /** gateway upgrade */
   GW_UG_INFORM_CB gw_ug_cb;
   /** gateway reset */
   GW_RESET_IFM_CB gw_reset_cb;
   /** structured DP info */
   DEV_OBJ_DP_CMD_CB dev_obj_dp_cb;
   /** raw DP info */
   DEV_RAW_DP_CMD_CB dev_raw_dp_cb;
   /** DP query */
   DEV_DP_QUERY_CB dev_dp_query_cb;
   /** sub-device upgrade */
   DEV_UG_INFORM_CB dev_ug_cb;
   /** sub-device reset */
   DEV_RESET_IFM_CB dev_reset_cb;
#if defined(TUYA_GW_OPERATOR) && (TUYA_GW_OPERATOR==1)
   /** opoerator code */
   OPE_HTTPC_GET_CHCODE_CB ope_get_chcode_cb;
#endif

#if defined(QRCODE_ACTIVE_MODE) && (QRCODE_ACTIVE_MODE==1)
   /** active short url */
   ACTIVE_SHORTURL_CB active_shorturl;
#endif
   /** gateway upgrade pre-condition */
   GW_UG_INFORM_CB pre_gw_ug_cb;
   /** sub-device upgrade pre-condition */
   DEV_UG_INFORM_CB pre_dev_ug_cb;
}TY_IOT_CBS_S;
/**
 * @brief Definition of gateway callback funtions
 */

Typedef GW_CLOUD_STREAM_MQTT_CB

typedef OPERATE_RET (*GW_CLOUD_STREAM_MQTT_CB)(IN struct ty_cJSON *root_json);


      

Typedef TRAN_STEP_T

typedef BYTE_T TRAN_STEP_T;
#define TS_START 0
#define TS_TRANSFER 1
#define TS_END 2

// mqtt media data interface

Typedef CLEAR_TYPE_T

typedef BYTE_T CLEAR_TYPE_T;
#define CLEAR_CONTINUE_ADD 0
#define CLEAR_REMOVE_MAP  1



      

Typedef DATA_TYPE_T

typedef BYTE_T DATA_TYPE_T;
#define DATA_INCREMENT_MAP 0
#define DATA_COMPLETE_MAP 1 



      

Typedef FLOW_BODY_ST;

typedef struct {
   USHORT_T id;
   UINT_T posix;
   TRAN_STEP_T step;
   UINT_T offset;
   USHORT_T len;
   BYTE_T data[0];
}FLOW_BODY_ST;


      

Typedef FLOW_BODY_V2_ST;

typedef struct {
   USHORT_T id;
 BYTE_T map_id;
 BYTE_T clear_type;
 BYTE_T data_type;	
   UINT_T posix;
   UINT_T offset;
   USHORT_T len;
   BYTE_T data[0];
}FLOW_BODY_V2_ST;


      

Typedef TY_IOT_REGION_INFO_S;

typedef struct {
   /** region info */
   CHAR_T region[REGION_LEN + 1];
   /** timezone info */
   CHAR_T time_zone[TIME_ZONE_LEN+1];
}TY_IOT_REGION_INFO_S;
/**
 * @brief Definition of region info
 */

Typedef TY_CUSTOM_CFG_E;

typedef enum {
   /** device cfg */
   CFG_DEVICE = 1,
   /** product cfg */
   CFG_PRODUCT = 2,
   CFG_INVALID,
}TY_CUSTOM_CFG_E;
/**
 * Definition of customer config type
 */

Typedef TY_LOCATION_INFO_S;

typedef struct {
   /** country code */
   CHAR_T country_code[COUNTRY_CODE_LEN + 1];
   /** ip addr. */
   CHAR_T ip[IPV4_LEN + 1];
}TY_LOCATION_INFO_S;
/**
 * @brief Definition of location info
 */

Typedef GW_APP_LOG_PATH_CB

typedef VOID (*GW_APP_LOG_PATH_CB)(OUT CHAR_T *path, IN CONST INT_T len);
/**
 * @brief Handler for log upload
 * 
 * @param path Log upload path
 * @param len Length of path
 */

Typedef TY_IOT_APP_CBS_S;

typedef struct {
   /** path for log upload */
   GW_APP_LOG_PATH_CB gw_app_log_path_cb;
}TY_IOT_APP_CBS_S;
/**
 * @brief Definition of IoT callbacks used by APP
 */

Typedef GW_WF_CFG_MTHD_SEL

typedef BYTE_T GW_WF_CFG_MTHD_SEL; // wifi config method select
#define GWCM_OLD               0  // do not have low power mode
#define GWCM_LOW_POWER         1  // with low power mode
#define GWCM_SPCL_MODE         2  // special with low power mode
#define GWCM_OLD_PROD          3  // GWCM_OLD mode with product
#define GWCM_LOW_POWER_AUTOCFG 4  // with low power mode && auto cfg
#define GWCM_SPCL_AUTOCFG      5  // special with low power mode && auto cfg

/* tuya sdk definition of wifi work mode */

Typedef GW_WF_START_MODE

typedef BYTE_T GW_WF_START_MODE;
#define WF_START_AP_ONLY       0  // only have ap-cfg mode
#define WF_START_SMART_ONLY    1  // only have smart-cfg mode
#define WF_START_AP_FIRST      2  // have both ap-cfg and smart-cfg. default is ap-cfg mode
#define WF_START_SMART_FIRST   3  // have both ap-cfg and smart-cfg. default is smart-cfg mode
#define WF_START_SMART_AP_CONCURRENT   4  //  ap-cfg and smart-cfg is concurrent
#define WF_START_MODE_NULL     15  //  no wifi start mode

/* tuya sdk definition of wifi start mode */

Typedef GW_WF_NWC_STAT_T

typedef BYTE_T GW_WF_NWC_STAT_T;
#define GWNS_LOWPOWER          0  // current in low power mode
#define GWNS_UNCFG_SMC         1  // current in smart-cfg mode
#define GWNS_UNCFG_AP          2  // current in ap-cfg mode
#define GWNS_TY_SMARTCFG       3  // already get ssid && passwd from smart-cfg mode
#define GWNS_TY_AP             4  // already get ssid && passwd from ap-cfg mode
#define GWNS_WECHAT_AK         5  // already get ssid && passwd from wechat mode
#define GWNS_OTHER_CFG         6  // already get ssid && passwd from other mode.for example:uart、bluetooth、qrcode and so on
#define GWNS_NO_NEED_CFG       7  // no need config wifi
#define GWNS_TY_SMART_AP_CFG 9 //already get ssid && passwd from smart-cfg and ap-cfg concurrent mode
#define GWNS_UNCFG_SMC_AP	10	//current in smart-cfg and ap-cfg concurrent mode
#define GWNS_BT_ACTIVED 		11	// bt actived
#define GWNS_BT_CONFIG_WF	12	//in bt actived,has configed wifi

/* tuya sdk definition of wifi-config status */

Typedef GW_WF_NWC_FAST_STAT_T

typedef BYTE_T GW_WF_NWC_FAST_STAT_T;
#define GWNS_FAST_LOWPOWER          0  // current in low power mode
#define GWNS_FAST_UNCFG_SMC         1  // current in smart-cfg mode
#define GWNS_FAST_UNCFG_AP          2  // current in ap-cfg mode
#define GWNS_FAST_UNCFG_NORMAL      3  // current in normal mode

/* tuya sdk definition of wifi-config fast status */

Typedef GW_WIFI_NW_STAT_E

typedef BYTE_T GW_WIFI_NW_STAT_E;
#define STAT_LOW_POWER         0  // idle status,use to external config network
#define STAT_UNPROVISION       1  // smart config status
#define STAT_AP_STA_UNCFG      2  // ap WIFI config status
#define STAT_AP_STA_DISC       3  // ap WIFI already config,station disconnect
#define STAT_AP_STA_CONN       4  // ap station mode,station connect
#define STAT_STA_DISC          5  // only station mode,disconnect
#define STAT_STA_CONN          6  // station mode connect
#define STAT_CLOUD_CONN        7  // cloud connect
#define STAT_AP_CLOUD_CONN     8  // cloud connect and ap start
#define STAT_REG_FAIL          9  // register fail
#define STAT_OFFLINE           10  // offline
#define STAT_MQTT_ONLINE       11
#define STAT_MQTT_OFFLINE      12
#define STAT_UNPROVISION_AP_STA_UNCFG	13 //smart-cfg and ap-cfg concurrent config status
#define STAT_BT_ACTIVED        14

/* tuya sdk definition of wifi-net status */

Typedef NW_CFG_ERR_CODE_E

typedef BYTE_T NW_CFG_ERR_CODE_E;
#define NW_CFG_INIT 				0  // initial state
#define NW_CFG_ACTIVE_FAILED		1  // active failed
#define NW_CFG_AP_NOT_FOUND		2  // ap not found
#define NW_CFG_ERR_PASSWD			3  // password error
#define NW_CFG_CANT_CONN_AP		4  // can not connect to ap
#define NW_CFG_DHCP_FAILED			5  // dhcp failed
#define NW_CFG_SUCC 				100 // succeed



      

Typedef WF_RESET_TP_T

typedef BYTE_T WF_RESET_TP_T;
#define WRT_SMT_CFG            0
#define WRT_AP                 1
#define WRT_AUTO               2
#define WRT_SMT_AP_CFG		3

/* tuya sdk definition of wifi-reset type */

Typedef WF_GW_PROD_INFO_S;

typedef struct {
   CHAR_T *uuid;      // strlen(uuid) <= 16,must not be null
   CHAR_T *auth_key;  // strlen(auth_key) <= 32,must not be null
   CHAR_T *ap_ssid;   // strlen(ap_ssid) <= 16,if ap_ssid is null ,then the default ssid is Smartlife_xxxx
   CHAR_T *ap_passwd; // strlen(ap_passwd) <= 16,default null
}WF_GW_PROD_INFO_S;
/**
 * Definition of Wi-Fi product info
 */

Typedef DEBUG_GW_PROD_INFO_S;

typedef struct {
   BOOL_T has_auth;	// authFlag
   CHAR_T *ap_ssid;	// strlen(ap_ssid) <= 16,if ap_ssid is null ,then the default ssid is Smartlife_xxxx
   CHAR_T *ap_passwd;	// strlen(ap_passwd) <= 16,default null
}DEBUG_GW_PROD_INFO_S;
/**
 * @brief Definition of product info (for debug)
 */

Typedef GET_WF_NW_STAT_CB

typedef VOID (*GET_WF_NW_STAT_CB)(IN CONST GW_WIFI_NW_STAT_E stat);
/**
 * @brief Handler when network connection error happens
 *
 * @param[in] stat State code, see GW_WIFI_NW_STAT_E
 */

Typedef WF_NW_CFG_ERR_CODE_CB

typedef VOID (*WF_NW_CFG_ERR_CODE_CB)(IN CONST NW_CFG_ERR_CODE_E err_code);
/**
 * @brief Handler when network configuration error happens
 *
 * @param[in] err_code Error code, see NW_CFG_ERR_CODE_E
 */

Typedef ty_devos_udf_active_t;

typedef struct {
   /** support udf active or not */
   BOOL_T is_udf_active_url;
   /** udf active api name */
   CHAR_T *p_active_api;
   /** udf active api version */
   CHAR_T *p_active_ver;
}ty_devos_udf_active_t;
/**
 * @brief Definition of customized active info
 */

Typedef ty_devos_udf_cfg_t;

typedef struct {
   /** ignore dp or not when in upgrade state */
   BOOL_T is_ignore_upgrade;
   /** customized active info */
   ty_devos_udf_active_t udf_active;
}ty_devos_udf_cfg_t;
/**
 * @brief Definition of user defined features(udf)
 */

Typedef ty_devos_t;

typedef struct {
   /** user defined params, see ty_devos_udf_cfg_t */
   ty_devos_udf_cfg_t udf_cfg;
}ty_devos_t;
/**
 * @brief Definitioin of cfg params
 */

Typedef tuya_activate_t;

typedef struct {
   UINT_T resved;
}tuya_activate_t;


      

Typedef tuya_dev_init_t;

typedef struct {
   /** The key of firmware, assigned by TUYA */
   CHAR_T *firmware_key;
   /** The key of product, assigned by TUYA */
   CHAR_T *product_key;
   /** The version of firmware, format is "x.y.z" */
   CHAR_T *sw_ver;
 
   /** The count of attach modules */
   UINT_T attr_num;
   /** The attributes of attach modules */
   GW_ATTACH_ATTR_T *attrs;
}tuya_dev_init_t;
/**
 * @brief Init param of IoT device
 */

Typedef tuya_netcfg_t;

typedef struct {
   UINT_T resved;
}tuya_netcfg_t;


      
      
typedef struct {
   UINT_T resved;
}tuya_netlink_t;


      

Typedef tuya_reset_t;

typedef struct {
   UINT_T resved;
}tuya_reset_t;


      

Typedef SF_GW_DEV_CMD_S;

typedef struct {
   DP_CMD_TYPE_E tp; //command source
   ty_cJSON *cmd_js; //command content
}SF_GW_DEV_CMD_S;
/**
 * @brief info of dp command
 */

Typedef MSG_DATA_S;

typedef struct msg_data_s{
   UINT_T serno; //serial number
   UINT_T len;   //message data lenth
   BYTE_T data[0];//message data
}MSG_DATA_S;
/**
 * @brief info of dp message data
 */

Typedef sf_special_dp_cb

typedef OPERATE_RET (*sf_special_dp_cb)(IN CONST UINT16_T dpid, IN CONST ty_cJSON *dp_obj);
//special dp callback function

Typedef sf_trans_type_cb

typedef OPERATE_RET (*sf_trans_type_cb)(IN CONST UINT16_T dpid, IN CONST ty_cJSON *data_js);
//callback function by different kind of transport type

Typedef subdev_dev_cntl_cb

typedef OPERATE_RET (*subdev_dev_cntl_cb)(IN DEV_CNTL_N_S *subdev_cntl, VOID *param);
//callback function for subdevice

Typedef sf_subdev_dev_cntl_traversal_cb

typedef OPERATE_RET (*sf_subdev_dev_cntl_traversal_cb)(subdev_dev_cntl_cb, VOID *param);
//callback function for traversal subdevice

Typedef sf_subdev_reliable_transfer_check_cb

typedef BOOL_T (*sf_subdev_reliable_transfer_check_cb)(IN CHAR_T *id);
//callback function for checking whether the subdevice needs to execute the reliable trasmission

Typedef sf_subdev_reliable_transfer_time_get_cb

typedef UINT_T (*sf_subdev_reliable_transfer_time_get_cb)(IN CHAR_T *id);
//callback function for getting the time of subdevice's reliable trasmission

Typedef sf_subdev_report_check_cb

typedef BOOL_T (*sf_subdev_report_check_cb)(IN CHAR_T *id);
//callback function for checking whether the subdevice nedds report

Typedef SF_SUBDEV_HANDLE_CB_S;

typedef struct{
   /** callback function for traversal subdevice */
   sf_subdev_dev_cntl_traversal_cb traversal_cb;
   /** callback function for checking whether the subdevice needs to execute the reliable trasmission */
   sf_subdev_reliable_transfer_check_cb rt_check_cb;
   /** callback function for getting the time of subdevice's reliable trasmission */
   sf_subdev_reliable_transfer_time_get_cb rt_time_get_cb;
   /** callback function for checking whether the subdevice nedds report */
   sf_subdev_report_check_cb rpt_check_cb;
} SF_SUBDEV_HANDLE_CB_S;
/**
 * @brief callback function of subdevice handle
 */

Typedef TY_OBJ_DP_DATA_S;

typedef struct {
   CHAR_T*     dev_id;       // device id
   TY_OBJ_DP_S* data;         // dp data
   UINT_T      cnt;          // dp count
}TY_OBJ_DP_DATA_S;
/**
 * @brief dp data information
 */

Typedef TY_OBJ_DP_REPT_S;

typedef struct {
   TY_OBJ_DP_DATA_S obj_dp;     // dp data information
   BOOL_T          force_send; // if report dp forcely or not
}TY_OBJ_DP_REPT_S;
/**
 * @brief dp data report information for object type
 */

Typedef TY_STAT_DP_REPT_S;

typedef struct {
   TY_OBJ_DP_DATA_S obj_dp;        // dp data information
   UINT_T          timeout;       // report timeout
   BOOL_T          auto_retrans;  // if re-report or not
}TY_STAT_DP_REPT_S;
/**
 * @brief dp data report information for statistic type
 */

Typedef TY_RAW_DP_REPT_S;

typedef struct{
   CHAR_T*     dev_id;       // device id
   BYTE_T      dpid;         // dp id
   BYTE_T*     data;         // dp data
   UINT_T      len;          // dp data lenth
   CHAR_T*     time_str;     // dp report time
   UINT_T      timeout;      // report timeout
   BOOL_T      auto_retrans; // if re-report or not
}TY_RAW_DP_REPT_S;
/**
 * @brief dp data report information for raw type
 */

Typedef HTTP_GW_GET_FILE_DATA_CB

typedef OPERATE_RET (*HTTP_GW_GET_FILE_DATA_CB)(IN PVOID_T priv_data, IN CONST UINT_T total_len,IN CONST UINT_T offset,\
                                           IN CONST BYTE_T *data,IN CONST UINT_T len,OUT UINT_T *remain_len);


      

Typedef HTTP_DYNAMIC_CFG_TYPE;

typedef enum {
   /** all configs */
   HTTP_DYNAMIC_CFG_ALL,
   /** time zone */
   HTTP_DYNAMIC_CFG_TZ,
   /** rate rule for dp */
   HTTP_DYNAMIC_CFG_RATERULE,
} HTTP_DYNAMIC_CFG_TYPE;
/**
 * @brief Definition of dynamic config
 */

Typedef DEV_SYNC_STATUS_E;

typedef enum {
   /** Unknown status */
   DEV_STATUS_UNKNOWN,
   /** Device need reset */
   DEV_STATUS_RESET,
   /** Device need refactory */
   DEV_STATUS_RESET_FACTORY,
   /** Device is normal */
   DEV_STATUS_ENABLE,
} DEV_SYNC_STATUS_E;
/**
 * @brief Definition of status to check
 */

Typedef RAW_HTTP_S

typedef PVOID_T RAW_HTTP_S;


      

Typedef DNS_QUERY_S;

typedef struct
{
   /** Host name*/
   CHAR_T *host;
   /** Host port */
   INT_T port;
   /** is certs required */
   BOOL_T need_ca;
   /** is ip required */
   BOOL_T need_ip;
} DNS_QUERY_S;
/**
 * @brief Definition of domain's IP and cert structure
 */

Typedef TY_IR_INIT_TYPE

typedef    CHAR_T     TY_IR_INIT_TYPE;
#define   TY_IR_INIT_NO_TYPE          0
#define   TY_IR_INIT_CODE_TYPE        1
#define   TY_IR_INIT_CODE_FASTLZ      2
#define   TY_IR_INIT_CODE_KK          3

/**
 * @brief define infrared init type
 */

Typedef TY_IR_STUDY_CTL_E

typedef    CHAR_T     TY_IR_STUDY_CTL_E;
#define   TY_IR_STUDY_START           0
#define   TY_IR_STUDY_EXIT            1

/**
 * @brief define infrared study state type
 */

Typedef IR_FAST_LZ;

typedef struct
{
   TY_IR_INIT_TYPE ir_init_type;
   TM_MSG_S *ir_type_sync;
}IR_FAST_LZ;
/**
 * @brief define IR_FAST_LZ
 */

Typedef TY_IR_CODE_S;

typedef struct
{
   USHORT_T   *code;
   USHORT_T   code_len;
   BYTE_T     send_count;    //repeat send count, don't need delay
   UINT_T     feq;
   USHORT_T   delay;         //ms
}TY_IR_CODE_S;
/**
 * @brief define TY_IR_CODE_S
 */

Typedef TY_IR_STUDY_CTL_CB

typedef VOID (*TY_IR_STUDY_CTL_CB)(TY_IR_STUDY_CTL_E mode);


      

Typedef TY_IR_SEND_CB

typedef VOID (*TY_IR_SEND_CB)(TY_IR_CODE_S *ir_code, UCHAR_T code_num_type);


      

Typedef TY_IR_CONTROL_CBS_S;

typedef struct
{
   TY_IR_STUDY_CTL_CB study_ctl_cb;
   TY_IR_SEND_CB      send_cb;
}TY_IR_CONTROL_CBS_S;
/**
 * @brief define TY_IR_CONTROL_CBS_S
 */

Typedef TY_IR_GW_ID_S;

typedef struct
{
   CHAR_T *devid;
   CHAR_T *vir_devid;
}TY_IR_GW_ID_S;
/**
 * @brief define TY_IR_GW_ID_S
 */

Typedef TY_IR_GW_KEY_S;

typedef struct
{
   UINT_T key_id;
   CHAR_T *key;
}TY_IR_GW_KEY_S;
/**
 * @brief define TY_IR_GW_KEY_S
 */

Typedef TY_IR_CODE_HK_S;

typedef struct
{
   CHAR_T     *ir_head;
   CHAR_T     *ir_key;
}TY_IR_CODE_HK_S;
/**
 * @brief define TY_IR_CODE_HK_S
 */

Typedef TY_IR_CODE_FZ_S;

typedef struct
{
   CHAR_T     *ir_fzcode;
   USHORT_T   ir_fzcode_len;
   USHORT_T   feq;
   UCHAR_T    send_cnt;
   
}TY_IR_CODE_FZ_S;
/**
 * @brief define TY_IR_CODE_FZ_S
 */

Typedef TY_IR_CODE_HKORFZ_U;

typedef union
{
   TY_IR_CODE_HK_S    ir_hk_info;
   TY_IR_CODE_FZ_S    ir_fz_info;
}TY_IR_CODE_HKORFZ_U;
/**
 * @brief define TY_IR_CODE_HKORFZ_U
 */

Typedef TY_IR_CODE_V20_S;

typedef struct
{
   TY_IR_CODE_HKORFZ_U ir_code_info;
   CHAR_T     is_fz_code;
   USHORT_T   delay;         //ms
   CHAR_T     relearn;
   TY_IR_GW_KEY_S ir_gw_info_s;
}TY_IR_CODE_V20_S;
/**
 * @brief define TY_IR_CODE_V20_S
 */

Typedef TY_IR_STUDY_CTL_CB_V20

typedef VOID (*TY_IR_STUDY_CTL_CB_V20)(TY_IR_STUDY_CTL_E mode,TY_IR_GW_ID_S *gwid_info);


      

Typedef TY_IR_SEND_CB_V20

typedef VOID (*TY_IR_SEND_CB_V20)(TY_IR_CODE_V20_S *ir_code, UCHAR_T code_num,TY_IR_GW_ID_S *gwid_info);


      

Typedef TY_IR_COMPRESS_CONTROL_CBS_S;

typedef struct
{
   TY_IR_STUDY_CTL_CB_V20          study_ctl_cb;
   TY_IR_SEND_CB_V20               send_cb;
}TY_IR_COMPRESS_CONTROL_CBS_S;
/**
 * @brief define TY_IR_COMPRESS_CONTROL_CBS_S
 */

Typedef TY_RF_STUDY_CTL_E

typedef UCHAR_T TY_RF_STUDY_CTL_E;
#define   TY_RF_STUDY_START   0
#define   TY_RF_STUDY_EXIT    1

/**
 * @brief define TY_RF_STUDY_CTL_E
 */

Typedef TY_RF_SEND_CTL_E

typedef UCHAR_T TY_RF_SEND_CTL_E;
#define   TY_RF_SEND_CONFIG_PKG       0
#define   TY_RF_SEND_PAIR_PKG         1
#define   TY_RF_SEND_CMD_PKG          2
#define   TY_RF_SEND_STUDYCODE_PKG    3

/**
 * @brief define TY_RF_SEND_CTL_E
 */

Typedef TY_RF_STUDY_STATE_CB

typedef VOID (*TY_RF_STUDY_STATE_CB)(TY_RF_STUDY_CTL_E mode);


      

Typedef TY_RF_SEND_CB

typedef VOID (*TY_RF_SEND_CB)(UCHAR_T *rf_data,UCHAR_T rf_data_len,TY_RF_SEND_CTL_E type);


      

Typedef TY_RF_CONTROL_CBS_S;

typedef struct
{
   TY_RF_STUDY_STATE_CB   rf_study_state_cb;   //A callback is sent in the RF learning state
   TY_RF_SEND_CB          rf_lib_send_cb;      //A callback is sent in the RF data
}TY_RF_CONTROL_CBS_S;
/**
 * @brief define TY_RF_CONTROL_CBS_S
 */

Typedef Lan_Cfg_e;

typedef enum {
   CFG_UDP_DISCOVERY_FORCE,   // send upd discovery even if clients exceed(BOOL_T)
   CFG_UDP_EXT_CONTENT,       // deprecated(reserved for gw/ipc)
   CFG_UDP_EXT_UPDATE,        // add/update new key/value(ty_cJSON)
   CFG_UDP_EXT_DELETE,        // delete key/value(ty_cJSON)
   CFG_SET_CLT_NUM,           // set clinet number(UINT_T)
   CFG_UDP_DISCOVERY_INTERVAL, // set udp discovery interval(UINT_T, unit:s, default:5)
   CFG_REV_BUF_SIZE,          // receive buffer size(UINT, default:512)
   CFG_DEFAULT_LINKAGE,       // default lan linkage (netmgr_linkage_t)
   CFG_MAX
} Lan_Cfg_e;


      

Typedef lan_cmd_handler_cb

typedef OPERATE_RET(*lan_cmd_handler_cb)(IN CONST BYTE_T *data, OUT BYTE_T **out);
/**
 * @brief lan cmd extersion, caller will free out
 *
 * @param[in] data data
 * @param[out] out buf
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef lan_ext_protocol_handler_cb

typedef OPERATE_RET(*lan_ext_protocol_handler_cb)(IN ty_cJSON *root_json);
/**
 * @brief Callback to handle lan protocol data
 *
 * @param[in] root_json Json encoded protocol data
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef AP_CFG_ERR_CODE

typedef int AP_CFG_ERR_CODE;
#define AP_CFG_SUCC 0
#define AP_CFG_ERR_PCK 1
#define AP_CFG_AP_NOT_FOUND 2
#define AP_CFG_ERR_PASSWD 3
#define AP_CFG_CANT_CONN_AP 4
#define AP_CFG_DHCP_FAILED 5
#define AP_CFG_CONN_CLOUD_FAILED 6
#define AP_CFG_GET_URL_FAILED 7
#define AP_CFG_GW_ACTIVE_FAILED 8
#define AP_CFG_GW_ACTIVE_SUCCESS 9



      

Typedef LAN_PRO_HEAD_APP_S;

typedef struct
{
   UINT_T head; // 0x55aa
   UINT_T fr_num;
   UINT_T fr_type;
   UINT_T len;
   BYTE_T data[0];
}LAN_PRO_HEAD_APP_S;
/**
 * @brief lan protocol app head
 */

Typedef LAN_PRO_TAIL_S;

typedef struct {
   UINT_T crc;
   UINT_T tail; // 0xaa55
}LAN_PRO_TAIL_S;


      

Typedef LAN_PRO_TAIL_V34_S;

typedef struct {
   BYTE_T hmac[32];
   UINT_T tail; // 0xaa55
}LAN_PRO_TAIL_V34_S;


      

Typedef LAN_PRO_HEAD_GW_S; #pragma pack()

typedef struct
{
   UINT_T head; // 0x55aa
   UINT_T fr_num;
   UINT_T fr_type;
   UINT_T len;
   UINT_T ret_code;
   BYTE_T data[0];
}LAN_PRO_HEAD_GW_S;
#pragma pack()

/**
 * @brief lan protocol gateway head
 */

Typedef NODE_CLS_ST_T

typedef BYTE_T NODE_CLS_ST_T;
#define CLS_ST_INVALID     	0 // 没有加到集群
#define CLS_ST_MASTER    		1 // 我是master
#define CLS_ST_NORMAL_NODE   	2 // 我是普通节点

//集群对外感知的状态

Typedef NODE_ST_T

typedef BYTE_T NODE_ST_T;
#define ST_MASTER_WAIT     0 // master等待状态
#define ST_MASTER_OK    	1 // master
#define ST_NORMAL_WAIT  	2 // 普通节点等待
#define ST_NORMAL  		3 // 普通节点
#define ST_MAX_NUM  		4 

//集群内部处理感知的状态,每个节点自己感知到自己的状态

Typedef NODE_CHANGE_ST_T

typedef BYTE_T NODE_CHANGE_ST_T;
#define NODE_ST_JOINING	 	0 // 节点发现
#define NODE_ST_JOINED    		1 // 节点加入集群
#define NODE_ST_LEAVE  		2 // 节点离开
#define NODE_ST_FAST_REJOIN  	3 // 离开后快速加入
#define NODE_ST_FORBIDDEN  	4 // 发现非法节点

//master感知到的单个节点的状态变化

Typedef LAN_NODE_S;

typedef struct {
   CHAR_T id[GW_ID_LEN+1]; // virtual id
 UINT_T ip;
 INT_T seqno;
 USHORT_T cap; 
}LAN_NODE_S;
//节点基本信息

Typedef LAN_NODE_REPORT_S;

typedef struct {
   CHAR_T id[GW_ID_LEN+1]; // virtual id
}LAN_NODE_REPORT_S;
//用于节点上报的信息

Typedef LAN_NODE_ACK_S;

typedef struct {
   CHAR_T id[GW_ID_LEN+1]; // virtual id    
   CHAR_T local_key[LOCAL_KEY_LEN+1]; // local key
 BOOL_T allow; 
}LAN_NODE_ACK_S;
//用于反馈节点上报结果的信息

Typedef STATE_CHANGE_CALLBACK

typedef VOID(*STATE_CHANGE_CALLBACK)(NODE_CLS_ST_T new_state, IN CONST LAN_NODE_S *master_node);
//自己的集群状态切换回调

Typedef CLS_NODE_CHANGE_CALLBACK

typedef VOID(*CLS_NODE_CHANGE_CALLBACK)(IN CONST LAN_NODE_REPORT_S *node, UINT_T num);
//集群中节点变化回调,全量上报

Typedef CLS_NODE_CHANGE_SINGLE_CALLBACK

typedef VOID(*CLS_NODE_CHANGE_SINGLE_CALLBACK)(IN CONST LAN_NODE_REPORT_S *node, NODE_CHANGE_ST_T st);
//集群中节点变化回调,单个节点上报

Typedef LAN_CLUSTER_INIT

typedef OPERATE_RET (*LAN_CLUSTER_INIT)(IN CONST   LAN_NODE_S* node);
//不同集群角色,初始化函数类型

Typedef STATE_CHANGE_CALLBACK_REG

typedef OPERATE_RET (*STATE_CHANGE_CALLBACK_REG)(STATE_CHANGE_CALLBACK cb);
//不同集群角色,注册自己集群状态切换回调的函数类型

Typedef NODE_CHANGE_CALLBACK_REG

typedef OPERATE_RET (*NODE_CHANGE_CALLBACK_REG)(CLS_NODE_CHANGE_CALLBACK cb);
//不同集群角色,注册集群节点变化回调的函数类型

Typedef NODE_ACK

typedef OPERATE_RET (*NODE_ACK)(IN CONST LAN_NODE_ACK_S *node_array, UINT_T node_num);
//不同集群角色,注册反馈节点上报结果的函数类型

Typedef LAN_MSG_MERGE_INFO;

typedef struct {
 CHAR_T *send_buf[MAX_MERGE_NUM_IN_MSG]; // 数量的
 BYTE_T merge_cnt;						// send_buf的实际个数
 CHAR_T *send_buf_out;					// 合并后的send_buf
} LAN_MSG_MERGE_INFO;


      

Typedef LAN_SEND_MSG2JSON

typedef OPERATE_RET (*LAN_SEND_MSG2JSON)(IN CONST CHAR_T *send_buf, IN INT_T seq, IN VOID *param, OUT JRPC_MSG_S *requset);


      

Typedef LAN_SEND_MSG_MERGE

typedef VOID (*LAN_SEND_MSG_MERGE)(IN OUT LAN_MSG_MERGE_INFO *merge_info, IN VOID *param);


      

Typedef LAN_SEND_MSG_RET

typedef VOID (*LAN_SEND_MSG_RET)(IN OPERATE_RET op_ret, IN CONST CHAR_T *id, IN CONST CHAR_T *send_buf, IN VOID *param);
//注意:如果允许合并信息,param字段会是合并前的第一个消息的参数

Typedef LAN_SEND_BUF_FREE

typedef VOID (*LAN_SEND_BUF_FREE)(IN CONST CHAR_T *send_buf, IN VOID *cb_param);


      

Typedef LAN_PEER_NODE_ALLOW

typedef VOID (*LAN_PEER_NODE_ALLOW)(IN CONST CHAR_T *id, IN BOOL_T allow);


      

Typedef LAN_MSG_MOD_INIT_PARAM;

typedef struct {
 USHORT_T init_peer_cnt; 		//初始化对端节点的个数
 USHORT_T max_retry_cnt;		//每个消息的最大的重试次数,如果超过,就开始丢弃该消息
 USHORT_T max_total_retry_cnt; //最大的连续重试次数,如果超过,就开始丢消息drop_msg_cnt个
 USHORT_T drop_msg_cnt;		//一次丢消息的个数
 USHORT_T cache_msg_max_cnt_per_peer; //每个对端存储的最大的消息个数,一旦超过。视为消息堆积,快速丢弃一半的新报文
} LAN_MSG_MOD_INIT_PARAM;


      

Typedef LAN_MSG_RELI_TYPE_PARAM;

typedef struct {
 LAN_SEND_MSG2JSON func_msg2Json;	//消息转为json-RPC接口,必须
 VOID *func_msg2Json_param;

 LAN_SEND_MSG_MERGE func_msgMerge;	//多条消息合并接口,非必须
 VOID *func_msgMerge_param;

 LAN_SEND_MSG_RET func_msgRet;		//消息发送结果回调,非必须, TODO,是否所有场景都回调?当前只保证正常发送后回调,异常时不一定
 //VOID *func_msgRet_param;			//发送结果回调的参数在调用发送接口处传入

 LAN_SEND_BUF_FREE func_buf_free;	//内存释放接口,非必须,空时内部使用Free释放.
									//如果有merge函数,发生merge时内部使用Malloc Free
 
} LAN_MSG_RELI_TYPE_PARAM;
//为不同类型的消息,提供差异的部分

Typedef LAN_MSG_RELI_TYPE

typedef VOID* LAN_MSG_RELI_TYPE;


      

Typedef LAN_PUB_SUB_MQ_SVC_HANDLE

typedef VOID* LAN_PUB_SUB_MQ_SVC_HANDLE;


      

Typedef LAN_PUB_SUB_MQ_SVC_FROM_REMOTE_CB

typedef OPERATE_RET (*LAN_PUB_SUB_MQ_SVC_FROM_REMOTE_CB)(IN CONST VOID * pub_content, VOID *cb_param);
//收到其他设备的发布消息,回调

Typedef LAN_PUB_SUB_MQ_SVC_MSG_SERIAL

typedef OPERATE_RET (*LAN_PUB_SUB_MQ_SVC_MSG_SERIAL)(IN CONST VOID * pub_content, OUT CHAR_T **pub_msg);
//消息序列化, msg_json在消息发送后,由模块内部Free释放

Typedef LAN_PUB_SUB_MQ_SVC_MSG_UNSERIAL

typedef OPERATE_RET (*LAN_PUB_SUB_MQ_SVC_MSG_UNSERIAL)(IN CONST CHAR_T *pub_msg, OUT VOID **pub_content);
//消息反序列化, pub_content在回调后,由模块内部调用Free释放

Typedef LAN_PUB_SUB_MQ_SVC_PARAM_S;

typedef struct {
 CHAR_T topic_name[LAN_TOPIC_NAME_LEN_MAX + 1];
 LAN_PUB_SUB_MQ_SVC_FROM_REMOTE_CB func_from_remote; //收到推送后的回调,必须字段
 VOID *cb_param;									//回调的参数
 BOOL_T omit_self;								//自己发布的消息,是否回调
 LAN_PUB_SUB_MQ_SVC_MSG_SERIAL func_serail;		//必须字段
 LAN_PUB_SUB_MQ_SVC_MSG_UNSERIAL func_unserail;	//必须字段
} LAN_PUB_SUB_MQ_SVC_PARAM_S;


      

Typedef LAN_SMP_MQ_MSG_DRCT

typedef BYTE_T LAN_SMP_MQ_MSG_DRCT;
#define LAN_SMP_MQ_MSG_DRCT_NORMAL_TO_MASTER    1 // 消息从普通节点发给master
#define LAN_SMP_MQ_MSG_DRCT_MASTER_TO_NORMAL    2 // 消息从master发给  普通节点

//消息方向,确定源和目的

Typedef LAN_SIMPLE_MQ_SEND_HANDLE

typedef VOID* LAN_SIMPLE_MQ_SEND_HANDLE;


      

Typedef LAN_SIMPLE_MQ_RECV_CB

typedef OPERATE_RET (*LAN_SIMPLE_MQ_RECV_CB)(IN CONST CHAR_T *peer_id, IN CONST CHAR_T *content, VOID *recv_cb_param);


      

Typedef LAN_SMP_MQ_SEND_SVC_PARAM_S;

typedef struct {
 CHAR_T svc_name[LAN_SVC_NAME_MAX + 1];
 LAN_SEND_MSG_MERGE func_msgMerge; //多条消息合并接口,非必须
 VOID *func_msgMerge_param;
 
 LAN_SEND_MSG_RET func_msgRet;		//消息发送结果回调,非必须, TODO,是否所有场景都回调?当前只保证正常发送后回调,异常时不一定
 //VOID *func_msgRet_param;	
 
 LAN_SEND_BUF_FREE func_buf_free;	//内存释放接口,非必须,空时内部使用Free释放.
 LAN_SMP_MQ_MSG_DRCT drct;		//必须字段
} LAN_SMP_MQ_SEND_SVC_PARAM_S;


      

Typedef LAN_SMP_MQ_RECV_SVC_PARAM_S;

typedef struct {
 CHAR_T svc_name[LAN_SVC_NAME_MAX]; //必须字段
 LAN_SMP_MQ_MSG_DRCT drct;		//必须字段
 LAN_SIMPLE_MQ_RECV_CB recv_cb;	//必须字段
 VOID *recv_cb_param;
} LAN_SMP_MQ_RECV_SVC_PARAM_S;


      

Typedef ACTION_TP_T

typedef BYTE_T ACTION_TP_T;
#define AT_DP      1 // dp issue
#define AT_RULE    2 // rule trigger
#define AT_DELAY   3 // delay event
#define AT_MULTI   4 // multi event
#define AT_TOGGLE  5 // toggle event
#define AT_SECURE_MODE 6 //secure mode 
#define AT_DP_STEP 7 // dp step event
#define AT_GROUP   8  //group 



      

Typedef AT_DP_SID_GID_S;

typedef struct {
   CHAR_T *gid;
   CHAR_T *sid;
}AT_DP_SID_GID_S;


      

Typedef AT_DP_ISSUE_S;

typedef struct {
   CHAR_T *mlk_dp_cmd; // {"cid":"xxx",dps:{"1":true,"2":100}}
#if defined(LOCAL_SCENE) && (LOCAL_SCENE==1)
   BOOL_T is_gs;//gid ,sid
   AT_DP_SID_GID_S gs_id;
#endif
}AT_DP_ISSUE_S;
// dp issue

Typedef AT_RULE_TRIGGER_S;

typedef struct {
   CHAR_T id[RULE_ID_LEN+1]; //后续改成指针,外部复制
}AT_RULE_TRIGGER_S;
// rule trigger

Typedef AT_DELAY_S;

typedef struct {
   UINT_T msecond;
}AT_DELAY_S;
// delay event

Typedef ACTION_VAL_U;

typedef union {
   BOOL_T bl;
   INT_T val; // notice:bitmap dp maxlen <= 31
   CHAR_T *str;
}ACTION_VAL_U;


      

Typedef AT_MULTI_S;

typedef struct {
   CHAR_T cid[DEV_ID_LEN+1];
   CHAR_T dp_id;
   ACTION_VAL_U dp_val;
   INT_T type;
   CHAR_T flag;// first
}AT_MULTI_S;
// multi event

Typedef AT_TOGGLE_S;

typedef struct {
   CHAR_T cid[DEV_ID_LEN+1]; // device id
   BYTE_T dp_id;
}AT_TOGGLE_S;
// toggle event

Typedef AT_SECURE_MODE_S;

typedef struct {
   //CHAR_T cid[DEV_ID_LEN+1]; // device id
   INT_T mode;
}AT_SECURE_MODE_S;


      

Typedef DP_STEP_TYPE_E;

typedef enum {
 DP_STEP_TYPE_LOW,
 DP_STEP_TYPE_HIGH,
}DP_STEP_TYPE_E;


      

Typedef AT_DPSTEP_S;

typedef struct {
 CHAR_T cid[DEV_ID_LEN+1];
 BYTE_T dp_id;
 INT_T min;
 INT_T max;
 INT_T step;
 DP_STEP_TYPE_E type;
}AT_DPSTEP_S;


      

Typedef AT_GROUP_S;

typedef struct {
   CHAR_T *mlk_dp_cmd; // {"cid":"000d6ffffe6d7101","ctype":2,"dps":{"3":false},"mbid":"10020"}
}AT_GROUP_S;


      

Typedef ACTION_U;

typedef union {
   AT_DP_ISSUE_S dp_isu;
   AT_RULE_TRIGGER_S rule_trig;
   AT_DELAY_S delay;
   AT_MULTI_S multi;
   AT_TOGGLE_S dp_toggle;
   AT_SECURE_MODE_S secure_mode;
   AT_GROUP_S group;
   AT_DPSTEP_S dp_step;
}ACTION_U;


      

Typedef ACTION_S;

typedef struct {
   ACTION_TP_T ac_tp;
   ACTION_U ac;
   BOOL_T is_check;   //检查状态是否跟设置的一样,双控环路检查
#if defined(ENABLE_LAN_LINKAGE_MASTER) && (ENABLE_LAN_LINKAGE_MASTER==1) 
 CHAR_T *gw_id;			//当局域网联动时不为空,Malloc出来,记录网关ID或WIFI设备的虚拟ID
 DP_PROP_TP_E dp_tp; 		//多控关联时,需要记录dp点的类型
   DP_PROP_ENUM_S prop_enum;	//类型是枚举时,枚举值
#endif   
}ACTION_S;


      

Typedef ACTION_SET_S;

typedef struct s_action {
   INT_T ruleType;
   USHORT_T num;
   ACTION_S action[0];
}ACTION_SET_S;
// action set 

Typedef DELAY_ACTION_SET_S;

typedef struct{
   INT_T ruleType;
   UINT_T index;
   //ACTION_SET_S *action_set;
   CHAR_T rule_id[RULE_ID_LEN+1];
   BYTE_T ruleTypeLocal; //LINKAGE_RULE_LOCAL or LINKAGE_RULE_LAN
 USHORT_T seq_no;	//rule seqno
}DELAY_ACTION_SET_S;


      

Typedef ACTION_CHECK_GW_ID_FUNC

typedef OPERATE_RET (*ACTION_CHECK_GW_ID_FUNC)(IN CONST CHAR_T *gw_id);


      

Typedef LINKAGE_RULE_TYPE_T

typedef BYTE_T LINKAGE_RULE_TYPE_T;
/***********************************************************
*************************micro define***********************
***********************************************************/

Typedef LAN_ACTION_SET_EXECUTE

typedef OPERATE_RET (*LAN_ACTION_SET_EXECUTE)(IN CONST CHAR_T *gw_id, IN CONST CHAR_T *dp_cmd, IN BOOL_T check, OUT BOOL_T *is_local);


      

Typedef LAN_TOGGLE_ACTION_EXECUTE

typedef OPERATE_RET (*LAN_TOGGLE_ACTION_EXECUTE)(IN CONST ACTION_S *action, OUT BOOL_T *is_local);


      

Typedef LAN_SCENE_EXECUTE

typedef OPERATE_RET (*LAN_SCENE_EXECUTE)(IN CONST ACTION_S *action, OUT BOOL_T *is_local);


      

Typedef LAN_LOCAL_SCENE_EXECUTE

typedef OPERATE_RET (*LAN_LOCAL_SCENE_EXECUTE)(IN CONST ACTION_S *action, OUT BOOL_T *is_local);


      

Typedef LAN_DPSTEP_ACTION_EXECUTE

typedef OPERATE_RET (*LAN_DPSTEP_ACTION_EXECUTE)(IN CONST ACTION_S *action, OUT BOOL_T *is_local);


      

Typedef LAN_GROUP_ACTION_EXECUTE

typedef OPERATE_RET (*LAN_GROUP_ACTION_EXECUTE)(IN CONST ACTION_S *action, OUT BOOL_T *is_local);


      

Typedef SCENE_LINKAGE_ON_EXE_COND_S;

typedef struct {
 CHAR_T *cid;
 BYTE_T dp_id;
}SCENE_LINKAGE_ON_EXE_COND_S;
//如果条件或动作是网关本身的,cid为网关的虚拟ID,否则为子设备node_id。调用者需要拷贝内容

Typedef SCENE_LINKAGE_ON_EXE_ACT_DP_ISSUE_S;

typedef struct {
 CHAR_T *cid;
 BYTE_T dp_id;
}SCENE_LINKAGE_ON_EXE_ACT_DP_ISSUE_S;


      

Typedef SCENE_LINKAGE_ON_EXE_DP_ISSUE

typedef VOID (*SCENE_LINKAGE_ON_EXE_DP_ISSUE)(IN CONST SCENE_LINKAGE_ON_EXE_COND_S *cond, IN CONST SCENE_LINKAGE_ON_EXE_ACT_DP_ISSUE_S *act_dp);
//动作如果有多个,会回调多次

Typedef CTRL_GROUP;

typedef struct
{
   INT_T  ionum;
   tuya_pin_name_t iopin[8];
} CTRL_GROUP;
/**
 * @brief Definition group of control
 */

Typedef GPIO_TEST_TABLE;

typedef struct {
   INT_T group_num;
   CTRL_GROUP group[20];
} GPIO_TEST_TABLE;
#else
typedef struct {
   INT_T group_num;
   CTRL_GROUP *group;
} GPIO_TEST_TABLE;


      

Typedef MF_UART_INIT_CB

typedef VOID (*MF_UART_INIT_CB)(UINT_T baud,UINT_T bufsz);
/**
 * @brief callback for URAT init function
 * 
 * @param[in] baud data bits:8bit,parity:none,stop bits:1
 * @param[in] bufsz Size of buff
 * 
 */

Typedef MF_UART_SEND_CB

typedef VOID (*MF_UART_SEND_CB)(IN BYTE_T *data,IN CONST UINT_T len);
/**
 * @brief callback for URAT send function
 * 
 * @param[in] data Send data buf
 * @param[in] len Send data buf len
 * 
 */

Typedef MF_UART_RECV_CB

typedef UINT_T (*MF_UART_RECV_CB)(OUT BYTE_T *buf,IN CONST UINT_T len);
/**
 * @brief callback for URAT receive function
 * 
 * @param[in] len buf len
 * @param[out] buf Received data buf
 * 
 * @return read data len
 */

Typedef MF_GPIO_TEST_CB

typedef BOOL_T (*MF_GPIO_TEST_CB)(IN CONST CHAR_T *in, OUT CHAR_T *out);
#else
typedef BOOL_T (*MF_GPIO_TEST_CB)(VOID);


      

Typedef MF_PRE_GPIO_TEST_CB

typedef BOOL_T (*MF_PRE_GPIO_TEST_CB)(VOID);
/**
 * @brief callback for preposed GPIO test
 *
 * @return TRUE/FALSE
 */

Typedef MF_USER_PRODUCT_TEST_CB

typedef OPERATE_RET (*MF_USER_PRODUCT_TEST_CB)(USHORT_T cmd,UCHAR_T *data, UINT_T len, OUT UCHAR_T **ret_data,OUT USHORT_T *ret_len);
/**
 * @brief callback for user product test
 * 
 * @param[in] cmd Test command
 * @param[in] data Test data
 * @param[in] len Test data len
 * @param[out] ret_data Test return data
 * @param[out] ret_len Test return data len
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef MF_UART_FREE_CB

typedef VOID (*MF_UART_FREE_CB)(VOID);
/**
 * @brief callback for UART free function
 *
 */

Typedef MF_USER_CALLBACK

typedef VOID (*MF_USER_CALLBACK)(VOID);
/**
 * @brief callback for user
 *
 */

Typedef MF_IMPORT_INTF_S;

typedef struct {
   MF_UART_INIT_CB uart_init;
   MF_UART_FREE_CB uart_free;
   MF_UART_SEND_CB uart_send;
   MF_UART_RECV_CB uart_recv;
   MF_GPIO_TEST_CB gpio_test;
   MF_USER_PRODUCT_TEST_CB mf_user_product_test; 
   MF_USER_CALLBACK user_callback;
   MF_USER_CALLBACK user_enter_mf_callback;
   MF_PRE_GPIO_TEST_CB user_pre_gpio_test;
}MF_IMPORT_INTF_S;
/**
 * @brief Definition of mf test init configure
 */

Typedef MF_USER_PARAM_CB

typedef OPERATE_RET (*MF_USER_PARAM_CB)(IN CONST BYTE_T *data, IN CONST UINT_T len);
/**
 * @brief callback after write user param finish
 * 
 * @param[in] data The data user in
 * @param[in] len Data len
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef VOID_T

typedef VOID_T (*APP_PROD_CB)(BOOL_T flag, SCHAR_T rssi);
/**
 * @brief callback for app product test
 * 
 * @param[in] flag 
 * @param[in] rssi
 *
 */

Typedef prodtest_ssid_info_t;

typedef struct {
   char       ssid[32 + 1];
   signed char rssi;
} prodtest_ssid_info_t;
/*============================ TYPES =========================================*/

Typedef prodtest_app_cb_t

typedef OPERATE_RET (*prodtest_app_cb_t)(int flag, prodtest_ssid_info_t *info, uint8_t info_count);


      

Typedef prodtest_app_cfg_t;

typedef struct {
   GW_WF_CFG_MTHD_SEL             gwcm_mode;
   uint8_t                        ssid_count;
   const char                   **ssid_list;
   prodtest_app_cb_t              app_cb;
   MF_USER_PRODUCT_TEST_CB        product_cb; 
   char                          *file_name;
   char                          *file_ver;
} prodtest_app_cfg_t;


      

Typedef autotest_prod_cfg_t;

typedef struct {
   MF_USER_PRODUCT_TEST_CB        product_cb; 
   char                          *file_name;
   char                          *file_ver;
} autotest_prod_cfg_t;


      

Typedef mqc_protocol_handler_cb

typedef OPERATE_RET (*mqc_protocol_handler_cb)(IN ty_cJSON *root_json);
/**
 * @brief Callback to handle protocol data
 * 
 * @param[in] root_json Json encoded protocol data
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef mqc_con_permit_cb

typedef BOOL_T (*mqc_con_permit_cb)(VOID);
/**
 * @brief MQTT client is permited or not to connect to broker
 *
 * @return TRUE on permited, FALSE on denied
 */

Typedef *P_AP_NETCFG_ARGS;

typedef struct{
 int enable_station_ap;
 WF_AP_CFG_IF_S *pDevApCfg;
}AP_NETCFG_ARGS, *P_AP_NETCFG_ARGS;


      

Typedef *PTR_SSID_PASSWORD_TOKEN;

typedef struct{
   /** ssid array */
   uint8_t ssid[WIFI_SSID_LEN+1];   
   /** length of ssid array */
   uint8_t s_len;   
   /** password array */
   uint8_t passwd[WIFI_PASSWD_LEN+1];      
   /** length of password array */
   uint8_t p_len; 
   /** token array */
   uint8_t token[WL_TOKEN_LEN+1]; 
   /** length of token array */
   uint8_t t_len;
}SSID_PASSWORD_TOKEN, *PTR_SSID_PASSWORD_TOKEN;


      

Typedef *ptrApSsidPasswd;

typedef struct apSsidPasswd_s{
   /** ssid */
 uint8_t* pSsid;   
   /** password */
 uint8_t* pPasswd;
}ApSsidPasswd_t, *ptrApSsidPasswd;
/**
 * @brief ssid and password info
 */

Typedef FN_NETCFG_CB

typedef int (* FN_NETCFG_CB)( PTR_SSID_PASSWORD_TOKEN info, int type);


      

Typedef FN_NETCFG_START

typedef int (* FN_NETCFG_START)(FN_NETCFG_CB cb, void * args, int type);


      

Typedef FN_NETCFG_STOP

typedef int (* FN_NETCFG_STOP)(int type);


      

Typedef *PTR_NETCFG_HANDLER;

typedef struct{
   /** node for list */
 LIST_HEAD			node;   
   /** netcfg type */
   int			 	type;   
   /** netcfg start function */
   FN_NETCFG_START	start;   
   /** netcfg stop function */
   FN_NETCFG_STOP		stop;   
   /** netcfg finished function */
   FN_NETCFG_CB       netcfg_finish_cb;     
   /** args for netcfg_finish_cb */
   void *				args;   
   /** netcfg is started or not */
 bool				isStarted; 
}NETCFG_HANDLER, *PTR_NETCFG_HANDLER;


      

Typedef fnSnifferUserCallback_t

typedef int (*fnSnifferUserCallback_t)(void *ptrArgs,uint8_t *buf, uint16_t len, const SCHAR_T rssi);
/*
	角色定义:
	Sniffer:是提供嗅探服务的组件
	SnifferUser:使用Sniffer组件的嗅探服务的用户组件

*/

Typedef *ptrSnifferUserParameters_t;

typedef struct SnifferUserParameters_s{
 fnSnifferUserCallback_t cb; 
 void* ptrArgs;
}SnifferUserParameters_t, *ptrSnifferUserParameters_t;


      

Typedef fnSnifferUserRegister

typedef int (*fnSnifferUserRegister)(int netcfg_type, ptrSnifferUserParameters_t pParam);
/*Sniffer组件内部的生命周期:
	全局:				Init->						 stop -> uninit	
	SnifferUser:			register ->	start ->unregister
*/

Typedef fnSnifferUserUnregister

typedef int (*fnSnifferUserUnregister)(int netcfg_type);


      

Typedef fnSnifferUserStart

typedef int (*fnSnifferUserStart)(int netcfg_type);


      

Typedef fnSnifferUserStop

typedef int (*fnSnifferUserStop)(bool isInternalCall);


      

Typedef fnSnifferUserStopAllOtherNetcfg

typedef int (*fnSnifferUserStopAllOtherNetcfg)(int netcfg_type, bool isInternalCall);
/*
    关闭除netcfg_type之外,其他配网的sniffer收包
    在共存配网时,当探测到netcfg_type的配网意图时,关闭其他配网的收包
*/

Typedef fnSnifferUserStartAllOtherNetcfg

typedef int (*fnSnifferUserStartAllOtherNetcfg)(int netcfg_type, bool isInternalCall);
/*
    打开除netcfg_type之外,其他配网的sniffer收包
    在共存配网时,当netcfg_type超时退出时,重新打开其他配网的收包,继续执行共存配网
*/

Typedef *ptrWifiNetcfgFrameSniffer_t;

typedef struct WifiNetcfgFrameSniffer_s{
   bool isSnifferStart;
   fnSnifferUserRegister            registerSnifferUserFn;
   fnSnifferUserStart	            startSnifferUserFn;
   fnSnifferUserStop	            stopSnifferUserFn;
   fnSnifferUserUnregister            unregisterSnifferUserFn;
   fnSnifferUserStartAllOtherNetcfg   startAllOtherUserFn;
   fnSnifferUserStopAllOtherNetcfg    stopAllOtherUserFn;
}WifiNetcfgFrameSniffer_t, *ptrWifiNetcfgFrameSniffer_t;


      

Typedef fnProbeRequestTransportCallBack_t

typedef int (*fnProbeRequestTransportCallBack_t)(void* ptrArgs, BYTE_T channel);


      

Typedef fnAuthTransportCallBack_t

typedef int (*fnAuthTransportCallBack_t)(void* ptrArgs, BYTE_T channel);


      

Typedef fnBeaconTransportCallBack_t

typedef int (*fnBeaconTransportCallBack_t)(void* ptrArgs, BYTE_T channel);


      

Typedef TransporteeParameters_t,*ptrTransporteeParameters_t;

typedef struct TransporteeParameters_s{
 fnProbeRequestTransportCallBack_t fnProbeRequestTransport;
 fnAuthTransportCallBack_t fnAuthTransport;
 fnBeaconTransportCallBack_t fnBeaconTransport;
 void* ptrArgs;
}TransporteeParameters_t,*ptrTransporteeParameters_t;


      

Typedef fnRegister

typedef int (*fnRegister)(int netcfg_type, ptrTransporteeParameters_t pParam);
/*
	transportee: 
		register->start->ungister
		isRun
	transporter:
		transporter is inited and started in WifiNetcfgFrameTransporterSessionInit
		and will be:
		lock->stop 
		getApInfo
		in transportee.
*/

Typedef fnStart

typedef int (*fnStart)(int netcfg_type);


      

Typedef bool

typedef bool (*fnIsRun)(int netcfg_type);


      

Typedef fnUnregister

typedef int (*fnUnregister)(int netcfg_type);


      

Typedef fnLock

typedef int (*fnLock)(bool lockState);


      

Typedef fnStartTransporter

typedef int (*fnStartTransporter)();


      

Typedef fnStopTransporter

typedef int (*fnStopTransporter)();


      

Typedef fnGetApInfo

typedef int (*fnGetApInfo)(AP_IF_S **ppApArray, uint32_t * pApNum);


      

Typedef *ptrWifiNetcfgFrameTransporter_t;

typedef struct WifiNetcfgFrameTransporter_s{
 fnRegister		registerTransporteeFn;
 fnStart		startTransporteeFn;
 fnIsRun		isRunTransporteeFn;
 fnUnregister unregisterTransporteeFn;
 
 fnLock		lockTransporterChannelFn;
   fnStartTransporter        startTransporterFn;
 fnStopTransporter		stopTransporterFn;
 fnGetApInfo	getApInfoFn;
}WifiNetcfgFrameTransporter_t, *ptrWifiNetcfgFrameTransporter_t;


      

Typedef pegasus_mode_t;

typedef enum {
   PEGASUS_CLIENT_MODE_FIRST,             
   PEGASUS_CLIENT_MODE_SECOND, 
   PEGASUS_SERVER_MODE_FIRST,             
   PEGASUS_SERVER_MODE_SECOND, 
} pegasus_mode_t;
/*============================ TYPES =========================================*/

Typedef pegasus_stat_t;

typedef enum {
   PEGASUS_IDLE,//0
   PEGASUS_SEND_REQ,//1
   PEGASUS_RECV_REQ,  //2
   PEGASUS_SEND_ACK,     //3
   PEGASUS_RECV_ACK, //4
   PEGASUS_CALC_KEY,//5
   PEGASUS_CHECKING,//6
   PEGASUS_SEND_MQTT,//7
   PEGASUS_RECV_MQTT,//8
   PEGASUS_SEND_CHECK, //9
   PEGASUS_RECV_CHECK,//10
   PEGASUS_SEND_CFG,     //11
   PEGASUS_RECV_CFG,         //12
   PEGASUS_CONNECT,//13
} pegasus_stat_t;


      

Typedef pegasus_info_t;

typedef struct {
   bool               ack;
   int                count;
   uint8_t            dev_mac[6];   
   uint8_t            ap_mac[6];
   char               pid[PRODUCT_KEY_LEN + 1];
   char               uuid[GW_UUID_LEN + 1];
   uint8_t            ra_uuid_hmac[TY_DEV_SHA256_DIGEST_SIZE];  
   uint8_t            ra_aes [TY_DEV_RANDOM_AES_LEN];          
   uint8_t            ra_hmac[TY_DEV_SHA256_DIGEST_SIZE];      
   uint8_t            rb_aes[TY_DEV_RANDOM_AES_LEN];           
   uint8_t            rb_hmac[TY_DEV_SHA256_DIGEST_SIZE];        
   uint8_t            uuid_hmac[TY_DEV_SHA256_DIGEST_SIZE];      
   uint8_t            key[TY_DEV_SESSION_KEY_LEN];
   pegasus_stat_t     stat;
   pegasus_mode_t     mode;
} pegasus_info_t;


      

Typedef fnLockChanCb

typedef void (*fnLockChanCb)(void);


      

Typedef pegasus_second_connect_cb

typedef int (*pegasus_second_connect_cb)(char *ssid, char *passwd);


      

Typedef BRC_HAND_T

typedef VOID * BRC_HAND_T;


      

Typedef BRC_SEND_FUNC

typedef INT_T (*BRC_SEND_FUNC)(IN CONST BRC_HAND_T hand,IN CONST CHAR_T *com_key,IN BYTE_T *data,IN CONST UINT_T len);
/**
 * @brief server send callback
 * 
 * @param[in] hand refer to BRC_HAND_T
 * @param[in] com_key key
 * @param[in] data send data
 * @param[in] len send length
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef RPC_RECV_CB

typedef VOID (*RPC_RECV_CB)(IN BRC_HAND_T hand, IN CONST CHAR_T *com_key, IN CONST VOID *input, IN CONST UINT_T len, IN CONST USHORT_T snd_seqno, IN BYTE_T *enc_key, IN CONST BOOL_T rsp);
/**
 * @brief server received callback
 * 
 * @param[in] hand refer to BRC_HAND_T
 * @param[in] com_key key
 * @param[in] input input data
 * @param[in] len data length
 * @param[in] snd_seqno sequence
 * @param[in] enc_key key
 * @param[in] rsp resonsible
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef RPC_TRANSFER_CB

typedef VOID (*RPC_TRANSFER_CB)(IN OPERATE_RET op_ret,OUT VOID *output,OUT UINT_T out_len,IN VOID *prv_data, IN BYTE_T *enc_key);
/**
 * @brief clinet result callback
 * 
 * @param[in] op_ret refer to OPERATE_RET
 * @param[out] output result
 * @param[out] out_len length
 * @param[in] prv_data data
 * @param[in] enc_key key
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef tlv_type_t;

typedef enum {
 TLV_TYPE_INT8  = 7,
 TLV_TYPE_UINT8 = 8,
 TLV_TYPE_INT16 = 9,
 TLV_TYPE_UINT16 = 10,
 TLV_TYPE_INT32 = 11,
 TLV_TYPE_UINT32 = 12,
 TLV_TYPE_BYTES = 13,
   TLV_TYPE_MSG   = 14, //Compound nested structure
} tlv_type_t;


      

Typedef tlv_t;

typedef struct {
   UINT16_T id;
   UINT16_T type;
   UINT16_T length;
   UINT8_T * value;
} PACKED tlv_t;
/* tlv/msg structures */

Typedef message_t;

typedef struct {
   UINT_T magic;
   UINT_T nitems;
   UINT_T capacity;
   tlv_t tlvs[0];
} PACKED message_t;


      

Typedef JRPC_TYPE_E;

typedef enum {
   JRPC_REQUEST       = 0,
   JRPC_RESPONSE,
   JRPC_NOTIFICATION,
   JRPC_ERROR,
   JRPC_WRONG_OBJECT
} JRPC_TYPE_E;


      

Typedef JRPC_NODE_TYPE_E;

typedef enum {
   JRPC_PARAMS        = 0,
   JRPC_RESULT
} JRPC_NODE_TYPE_E;


      

Typedef JRPC_MSG_S;

typedef struct {
   cJSON          *json;
   UINT8_T        *binary;
   JRPC_TYPE_E    type;
} JRPC_MSG_S;


      

Typedef LAN_RPC_TYPE;

typedef enum {
   LAN_RPC_SLAVER,
   LAN_RPC_MASTER,
} LAN_RPC_TYPE;


      

Typedef LAN_RPC_NODE_S;

typedef struct {
   UINT_T             ip;
   INT_T              seqno;
   USHORT_T           cap;
   UINT8_T            id[LAN_RPC_ID_LEN + 1];
   UINT8_T            key[LAN_RPC_KEY_LEN + 1]; //key是非字符串的
} LAN_RPC_NODE_S;


      

Typedef LAN_RPC_MASTER_S;

typedef struct {
   UINT8_T            owner;
   UINT8_T            stat;
   LAN_RPC_NODE_S     node;
} LAN_RPC_MASTER_S;


      

Typedef LAN_RPC_MASTER_GET_CB

typedef OPERATE_RET (*LAN_RPC_MASTER_GET_CB)(LAN_RPC_MASTER_S *master);


      

Typedef LAN_RPC_NODE_STAT_CB

typedef OPERATE_RET (*LAN_RPC_NODE_STAT_CB)(UINT8_T stat, LAN_RPC_NODE_S *node);


      

Typedef LAN_RPC_NODE_OUTPUT_CB

typedef VOID (*LAN_RPC_NODE_OUTPUT_CB)(LAN_RPC_NODE_S *node, UINT16_T num, VOID *arg);


      

Typedef LAN_RPC_CFG_S;

typedef struct {
   UINT8_T                type;
   LAN_RPC_NODE_STAT_CB   node_stat_cb;
   LAN_RPC_MASTER_GET_CB  master_get_cb;
} LAN_RPC_CFG_S;


      

Typedef RPC_TYPE_E;

typedef enum {
   RPC_CLIENT,
   RPC_SERVER,
   RPC_LOOPIF,
   RPC_CUSTOM,
} RPC_TYPE_E;


      

Typedef RPC_CMD_E;

typedef enum {
   RPC_BUFSIZE_SET_CMD,
   RPC_CUSTOM_HOST_CMD,
   RPC_KEY_ENABLE_CMD,
   RPC_KEY_SET_CMD,
   RPC_METHOD_UNREGISTER_CMD,
   RPC_EXIT_CMD,
   RPC_CALL_RETRY_CMD,
} RPC_CMD_E;


      

Typedef TUYA_RPC_S;

typedef struct {
   INT_T          udp_fd;
   UINT_T         flag;
   THRD_HANDLE    thread;
   RPC_TYPE_E     type;
   BRC_HAND_T     brchd;
   MUTEX_HANDLE   mutex;
   UINT_T         ipaddr;
   UINT_T         port;
   UINT8_T        key[16];
   map_t          method_list;
   UINT16_T       buffer_size;
   UINT8_T        *buffer;
   UINT8_T        default_buffer[RPC_DEFAULT_BUFSIZE];
} TUYA_RPC_S;


      

Typedef RPC_METHOD_CB

typedef VOID (*RPC_METHOD_CB)(IN JRPC_MSG_S *request, IN VOID *arg, IN UNW_IP_ADDR_T peer_ip, OUT JRPC_MSG_S *reply);
/**
 * @brief callback of rpc method
 * 
 * @param[in] request refer to JRPC_MSG_S
 * @param[in] arg callback argument
 * @param[in] peer_ip refer to UNW_IP_ADDR_T
 * @param[out] reply refer to JRPC_MSG_S 
 *
 */

Typedef RPC_RET_CB

typedef VOID (*RPC_RET_CB)(IN OPERATE_RET op_ret, IN JRPC_MSG_S *result, IN VOID *prv_data);
/**
 * @brief callback of rpc return
 * 
 * @param[in] op_ret return code,refer to tuya_error_code.h
 * @param[in] result reference to JRPC_MSG_S
 * @param[in] prv_data
 *
 */

Typedef TY_CUCC_STAT_E;

typedef enum {
   /** INIT */
   TY_CUCC_STAT_INIT = 0,
   /** HTTP error */  
   TY_CUCC_STAT_HTTP_ERR = 1,
   /** HTTP ok */
   TY_CUCC_STAT_HTTP_OK = 2
} TY_CUCC_STAT_E;
/**
 * @brief Definition of CUCC state
 */

Typedef TY_CUCC_STAT_INFO_S;

typedef struct {
   /** see TY_CUCC_STAT_E */
   TY_CUCC_STAT_E stat;
   /** serial code */
   CHAR_T         cuei[20];
   /** report result */
   UINT_T         report_result;
   /** is unicom network */
   UINT_T         is_unicom_network;
   /** is home location */
   UINT_T         is_telephone_home_location;
}TY_CUCC_STAT_INFO_S;
/**
 * @brief Definition of CUCC state info
 */

Typedef TY_OPERATOR_INFO_S;

typedef struct {             /*   CTCC     CMCC    CUCC  */
   CHAR_T *fwver;           /*    Y                Y    */ //
   CHAR_T *device_info;     /*             Y            */ //备用(不上报)
   CHAR_T *app_info;        /*             Y            */ //应用信息(App集合,每条日志用\r\n分隔,每条日志包含 App名称、包名、App使用时长(毫秒)、App打开次数 并由’|’分隔 )
   CHAR_T *rom;             /*             Y            */ //rom信息
   CHAR_T *ram;             /*             Y            */ //ram信息
   CHAR_T *cpu;             /*             Y            */ //cpu信息
   CHAR_T *sys_ver;         /*             Y            */ //操作系统版本号
   CHAR_T *soft_ver;        /*             Y            */ //固件版本号
   CHAR_T *soft_name;       /*             Y            */ //固件名称
   CHAR_T *volte;           /*             Y            */ //volte开关状态
   CHAR_T *nettype;         /*             Y            */ //当前网络类型
   CHAR_T *account;         /*             Y            */ //宽带账号
   CHAR_T *p_num;           /*             Y            */ //本机号码
   CHAR_T *location;        /*             Y            */ //位置信息(包含经度,维度,定位模式,以逗号‘,’分隔)
   BYTE_T mac[6];           /*    Y                Y    */ //设备mac地址
   BOOL_T initial;           /*   Y                     */ //是否开机后首次上报,子设备使用
   CHAR_T *devid;           /*    Y                     */ //子设备ID/MAC
}TY_OPERATOR_INFO_S;
/**
 * @brief Definition of operator info
 */

Typedef TY_OPERATOR_TYPE_E;

typedef enum operat_ctei_type {
   /** TUYA */
   OPERATOR_TUYA = 1,
   /** China Telecom */
   OPERATOR_CTCC,
   /** China Mobile */
   OPERATOR_CMCC,
   /** China Unicom */
   OPERATOR_CUCC,
} TY_OPERATOR_TYPE_E;
/**
 * @brief Definition of operator type
 */

Typedef Action_e;

typedef enum tagAction_e {
   /** this action will redo */
   ACTION_CONTINUE,
   /** switch to next action */
   ACTION_NEXT,
   /** action list is complete */
   ACTION_COMPLETE,
   ACTION_MAX
}Action_e;
/**
 * @brief Definition of schema upgrade action
 */

Typedef Action_e

typedef Action_e (*ACTION_CB)(OUT VOID *data);
/**
 * @brief Schema upgrade action
 * 
 * @param[in] data ID of sub-device, or NULL for GW
 * 
 * @return see Action_e
 */

Typedef TI_UPGRD_STAT_S

typedef BYTE_T TI_UPGRD_STAT_S;
#define TUS_RD 1 // ready
#define TUS_UPGRDING 2 // upgrading
#define TUS_UPGRD_FINI 3 // finish
#define TUS_UPGRD_EXEC 4 // error



      

Typedef tuya_upgrade_detect_t;

typedef struct {
   /*
    * @param[out] dev_id device id for gw or nodeId for subdev
    * @return OPERATE_RET OPRT_OK indicates a valid device need detect
    */
   OPERATE_RET (*upgrade_get_dev)(OUT CHAR_T dev_id[DEV_ID_LEN+1]);
   /*
    * @param[in] is_err TRUE indicates error happen, detect process is over
    * @param[in] is_exe valid when !is_err
                    TRUE indicates upgrade is got and notified
                    FALSE indicates upgrade is got but execute time not arrival
    * @param[in] detect_interval valid when !is_err && !is_exe
                             upgrade should be detected again after detect_interval(s)
    */
   VOID (*upgrade_detect_result)(IN BOOL_T is_err, IN BOOL_T is_exe, IN UINT_T detect_interval);
}tuya_upgrade_detect_t;
/**
 * @brief Definition of firmware upgrade workload
 */

Typedef dev_upgrade_inform_cb

typedef int (*dev_upgrade_inform_cb)(const FW_UG_S *fw);
/**
 * @brief Handler of GW upgrade inform
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef dev_upgrade_pre_inform_cb

typedef VOID (*dev_upgrade_pre_inform_cb)(BOOL_T *handled, const FW_UG_S *fw);
/**
 * @brief Handler of pre-process inform
 */

Typedef subdev_upgrade_inform_cb

typedef int (*subdev_upgrade_inform_cb)(const char *dev_id, const FW_UG_S *fw);
/**
 * @brief Handler of sub-device upgrade inform
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef dev_upgrade_mq15_inform_cb

typedef int (*dev_upgrade_mq15_inform_cb)(ty_cJSON *root_json);
/**
 * @brief Handler of process inform for some upgrade type
 * 
 * @return OPRT_OK on had handled. Others should process by svc_upgrade
 */

Typedef *tuya_upgrade_param_p;

typedef struct {
   /** Handler of gw upgrade inform */
   dev_upgrade_inform_cb dev_upgrade_cb;
   /** Handler of sub-device upgrade inform */
   subdev_upgrade_inform_cb subdev_upgrade_cb;
   /** Handler of gw upgrade pre-precess */
   dev_upgrade_inform_cb pre_dev_upgrade_cb;
   /** Handler of sub-device pre-precess */
   subdev_upgrade_inform_cb pre_subdev_upgrade_cb;
}tuya_upgrade_param_t, *tuya_upgrade_param_p;
/**
 * @brief Definition of firmware upgrade handler
 */

Typedef ffc_cb_state_t;

typedef enum {
   FFC_INIT_STATE = 0,
   FFC_CONTROL_STATE,
   FFC_BINDING_BEGIN_STATE,
   FFC_BINDING_SUCCESS_STATE,
   FFC_BINDING_FINSH_STATE,
} ffc_cb_state_t;


      

Typedef ffc_status_cb

typedef int (*ffc_status_cb)(ffc_cb_state_t state);


      

Typedef ffc_recv_cb

typedef int (*ffc_recv_cb)(uint8_t *data_cmd, uint16_t data_len);


      

Typedef ffc_master_type_t;

typedef enum {
   FFC_MASTER_TYPE_LOCAL   = 0,
   FFC_MASTER_TYPE_FITTINGS = 1,
   FFC_MASTER_TYPE_DEVICE  = 2,
   FFC_MASTER_TYPE_ONLINE  = FFC_MASTER_TYPE_DEVICE,
   FFC_MASTER_TYPE_MAX,
} ffc_master_type_t;
//! FFC_MASTER_TYPE_LOCAL -> FFC_MASTER_TYPE_FITTINGS

Typedef ffc_fittings_event_t;

typedef enum {
   FFC_FITTINGS_SYNC_EVENT,
   FFC_FITTINGS_ACTIVE_EVENT,
} ffc_fittings_event_t;


      

Typedef ffc_fittings_msg_t;

typedef struct {
   ffc_fittings_event_t   event;
   ffc_master_type_t      type;
   uint8_t                mac[6];
   uint8_t                key[16];
   uint16_t               seq;
   uint8_t                uuid[25 + 1];
   uint8_t                pid[20 + 1];
} ffc_fittings_msg_t;


      

Typedef ffc_fittings_cb

typedef int (*ffc_fittings_cb)(ffc_fittings_msg_t *msg);


      

Typedef ffc_group_t;

typedef enum {
   FFC_GROUP_0 = 0,
   FFC_GROUP_1,
   FFC_GROUP_2,
   FFC_GROUP_3,
   FFC_GROUP_MAX,
} ffc_group_t;


      

Typedef ffc_flag_t;

typedef enum {
   FFC_CHANNEL_SCAN_FLAG  = 1,
   FFC_MASTER_GROUP_SET_FLAG,
   FFC_MASTER_TYPE_SET_FLAG,
} ffc_flag_t;


      

Typedef ffc_cfg_t;

typedef struct {
   /** uuid,assigned by TUYA */
   uint8_t    uuid[25 + 1];
   /** pid,assigned by TUYA */
   uint8_t    pid[20 + 1];
   /** auzkey,assigned by TUYA */
   uint8_t    auzkey[32 + 1];
   /** mac address */
   uint8_t    mac[6];
   /** wifi channel */
   uint8_t    channel[13];
   /** channel count */
   uint8_t    channel_count;
   /** flag */
   uint32_t   flag;
} ffc_cfg_t;
/**
 * @brief ffc configure struct
 */

Typedef ffc_ops_t;

typedef struct {
   /** new channel set */
   int (*channel_set)(uint8_t new_channel);
   /** one channel get */
   uint8_t (*channel_get)(void);
   /** set frame */
   int (*send_frame)(uint8_t *frame, uint16_t frame_len, uint8_t src_mac[6], uint8_t dst_mac[6]);
} ffc_ops_t;
/**
 * @brief ffc operation struct
 */

Typedef ffc_cb_t;

typedef struct {
   /** user status call back */
   ffc_status_cb  status_cb;
   /** user received callback */
   ffc_recv_cb    recv_cb;
   /** ffc active cb */
   ffc_fittings_cb fittings_cb;
} ffc_cb_t;
/**
 * @brief callback define when ffc init
 */

Typedef coap_address_t;

typedef struct coap_address_t {
 uint16_t port;
 ip_addr_t addr;
} coap_address_t;


      

Typedef coap_address_t;

typedef struct coap_address_t {
 uip_ipaddr_t addr;
 uint16_t port;
} coap_address_t;


      

Typedef addr;

typedef struct coap_address_t {
 struct {
   UNW_IP_ADDR_T addr;
 } addr;


      

Typedef addr;

typedef struct coap_address_t {
 socklen_t size;          /**< size of addr */
 union {
   struct sockaddr        sa;
   struct sockaddr_in     sin;
   struct sockaddr_in6    sin6;
 } addr;
/** multi-purpose address abstraction */

Typedef coap_async_state_t;

typedef struct coap_async_state_t {
 unsigned char flags; /**< holds the flags to control behaviour */

 /**
   * Holds the internal time when the object was registered with a
   * resource. This field will be updated whenever
   * coap_register_async() is called for a specific resource.
   */
 coap_tick_t created;

 /**
   * This field can be used to register opaque application data with the
   * asynchronous state object.
   */
 void *appdata;
 uint16_t message_id;      /**< id of last message seen */
 coap_session_t *session;        /**< transaction session */
 coap_tid_t id;                  /**< transaction id */
 struct coap_async_state_t *next; /**< internally used for linking */
 size_t tokenlen;                /**< length of the token */
 uint8_t token[8];               /**< the token to use in a response */
} coap_async_state_t;
/**
 * @defgroup coap_async Asynchronous Messaging
 * @{
 * Structure for managing asynchronous state of CoAP resources. A
 * coap_resource_t object holds a list of coap_async_state_t objects that can be
 * used to generate a separate response in case a result of an operation cannot
 * be delivered in time, or the resource has been explicitly subscribed to with
 * the option @c observe.
 */

Typedef coap_block_t;

typedef struct {
 unsigned int num;      /**< block number */
 unsigned int m:1;      /**< 1 if more blocks follow, 0 otherwise */
 unsigned int szx:3;    /**< block size */
} coap_block_t;
/**
 * Structure of Block options.
 */

Typedef coap_log_t;

typedef short coap_log_t;
#else
/** Pre-defined log levels akin to what is used in \b syslog. */
typedef enum {
 LOG_EMERG=0, /**< Emergency */
 LOG_ALERT,  /**< Alert */
 LOG_CRIT,   /**< Critical */
 LOG_ERR,    /**< Error */
 LOG_WARNING, /**< Warning */
 LOG_NOTICE, /**< Notice */
 LOG_INFO,   /**< Information */
 LOG_DEBUG   /**< Debug */
} coap_log_t;
/**
 * Logging type.  One of LOG_* from @b syslog.
 */

Typedef coap_log_handler_t

typedef void (*coap_log_handler_t) (coap_log_t level, const char *message);
/**
 * Logging call-back handler definition.
 *
 * @param level One of the LOG_* values.
 * @param message Zero-terminated string message to log.
 */

Typedef coap_tls_version_t;

typedef struct coap_tls_version_t {
 uint64_t version; /**< (D)TLS runtime Library Version */
 int type; /**< Library type. One of COAP_TLS_LIBRARY_* */
 uint64_t built_version; /**< (D)TLS Built against Library Version */
} coap_tls_version_t;
/**
 * The structure used for returning the underlying (D)TLS library
 * information.
 */

Typedef coap_dtls_security_setup_t

typedef int (*coap_dtls_security_setup_t)(void* tls_session,
                                       struct coap_dtls_pki_t *setup_data);
/**
 * Additional Security setup handler that can be set up by
 * coap_context_set_pki().
 * Invoked when libcoap has done the validation checks at the TLS level,
 * but the application needs to do some additional checks/changes/updates.
 *
 * @param tls_session The security session definition - e.g. SSL * for OpenSSL.
 *                    NULL if server call-back.
 *                    This will be dependent on the underlying TLS library -
 *                    see coap_get_tls_library_version()
 * @param setup_data A structure containing setup data originally passed into
 *                   coap_context_set_pki() or coap_new_client_session_pki().
 *
 * @return @c 1 if successful, else @c 0.
 */

Typedef coap_dtls_cn_callback_t

typedef int (*coap_dtls_cn_callback_t)(const char *cn,
            const uint8_t *asn1_public_cert,
            size_t asn1_length,
            coap_session_t *coap_session,
            unsigned depth,
            int validated,
            void *arg);
/**
 * CN Validation call-back that can be set up by coap_context_set_pki().
 * Invoked when libcoap has done the validation checks at the TLS level,
 * but the application needs to check that the CN is allowed.
 * CN is the SubjectAltName in the cert, if not present, then the leftmost
 * Common Name (CN) component of the subject name.
 *
 * @param cn  The determined CN from the certificate
 * @param asn1_public_cert  The ASN.1 DER encoded X.509 certificate
 * @param asn1_length  The ASN.1 length
 * @param coap_session  The CoAP session associated with the certificate update
 * @param depth  Depth in cert chain.  If 0, then client cert, else a CA
 * @param validated  TLS layer can find no issues if 1
 * @param arg  The same as was passed into coap_context_set_pki()
 *             in setup_data->cn_call_back_arg
 *
 * @return @c 1 if accepted, else @c 0 if to be rejected.
 */

Typedef coap_asn1_privatekey_type_t;

typedef enum coap_asn1_privatekey_type_t {
 COAP_ASN1_PKEY_NONE,    /**< NONE */
 COAP_ASN1_PKEY_RSA,     /**< RSA type */
 COAP_ASN1_PKEY_RSA2,    /**< RSA2 type */
 COAP_ASN1_PKEY_DSA,     /**< DSA type */
 COAP_ASN1_PKEY_DSA1,    /**< DSA1 type */
 COAP_ASN1_PKEY_DSA2,    /**< DSA2 type */
 COAP_ASN1_PKEY_DSA3,    /**< DSA3 type */
 COAP_ASN1_PKEY_DSA4,    /**< DSA4 type */
 COAP_ASN1_PKEY_DH,      /**< DH type */
 COAP_ASN1_PKEY_DHX,     /**< DHX type */
 COAP_ASN1_PKEY_EC,      /**< EC type */
 COAP_ASN1_PKEY_HMAC,    /**< HMAC type */
 COAP_ASN1_PKEY_CMAC,    /**< CMAC type */
 COAP_ASN1_PKEY_TLS1_PRF, /**< TLS1_PRF type */
 COAP_ASN1_PKEY_HKDF     /**< HKDF type */
} coap_asn1_privatekey_type_t;
/**
 * The enum used for determining the provided PKI ASN.1 (DER) Private Key
 * formats.
 */

Typedef coap_pki_key_t;

typedef enum coap_pki_key_t {
 COAP_PKI_KEY_PEM = 0,  /**< The PKI key type is PEM */
 COAP_PKI_KEY_ASN1,     /**< The PKI key type is ASN.1 (DER) */
} coap_pki_key_t;
/**
 * The enum used for determining the PKI key formats.
 */

Typedef coap_pki_key_pem_t;

typedef struct coap_pki_key_pem_t {
 const char *ca_file;      /**< File location of Common CA in PEM format */
 const char *public_cert;  /**< File location of Public Cert in PEM format */
 const char *private_key;  /**< File location of Private Key in PEM format */
} coap_pki_key_pem_t;
/**
 * The structure that holds the PKI PEM definitions.
 */

Typedef coap_pki_key_asn1_t;

typedef struct coap_pki_key_asn1_t {
 const uint8_t *ca_cert;    /**< ASN1 (DER) Common CA Cert */
 const uint8_t *public_cert; /**< ASN1 (DER) Public Cert */
 const uint8_t *private_key; /**< ASN1 (DER) Private Key */
 size_t ca_cert_len;        /**< ASN1 CA Cert length */
 size_t public_cert_len;    /**< ASN1 Public Cert length */
 size_t private_key_len;    /**< ASN1 Private Key length */
 coap_asn1_privatekey_type_t private_key_type; /**< Private Key Type */
} coap_pki_key_asn1_t;
/**
 * The structure that holds the PKI ASN.1 (DER) definitions.
 */

Typedef key;

typedef struct coap_dtls_key_t {
 coap_pki_key_t key_type;         /**< key format type */
 union {
   coap_pki_key_pem_t pem;        /**< for PEM keys */
   coap_pki_key_asn1_t asn1;      /**< for ASN.1 (DER) keys */
 } key;
/**
 * The structure that holds the PKI key information.
 */

Typedef coap_dtls_key_t

typedef coap_dtls_key_t *(*coap_dtls_sni_callback_t)(const char *sni,
            void* arg);
/**
 * Server Name Indication (SNI) Validation call-back that can be set up by
 * coap_context_set_pki().
 * Invoked if the SNI is not previously seen and prior to sending a certificate
 * set back to the client so that the appropriate certificate set can be used
 * based on the requesting SNI.
 *
 * @param sni  The requested SNI
 * @param arg  The same as was passed into coap_context_set_pki()
 *             in setup_data->sni_call_back_arg
 *
 * @return New set of certificates to use, or @c NULL if SNI is to be rejected.
 */

Typedef coap_dtls_pki_t;

typedef struct coap_dtls_pki_t {
 uint8_t version; /** Set to 1 to support this version of the struct */

 /* Options to enable different TLS functionality in libcoap */
 uint8_t verify_peer_cert;       /**< 1 if peer cert is to be verified */
 uint8_t require_peer_cert;      /**< 1 if peer cert is required */
 uint8_t allow_self_signed;      /**< 1 if self signed certs are allowed */
 uint8_t allow_expired_certs;    /**< 1 if expired certs are allowed */
 uint8_t cert_chain_validation;  /**< 1 if to check cert_chain_verify_depth */
 uint8_t cert_chain_verify_depth; /**< recommended depth is 3 */
 uint8_t check_cert_revocation;  /**< 1 if revocation checks wanted */
 uint8_t allow_no_crl;           /**< 1 ignore if CRL not there */
 uint8_t allow_expired_crl;      /**< 1 if expired crl is allowed */
 uint8_t reserved[6];            /**< Reserved - must be set to 0 for
                                        future compatibility */
                                  /* Size of 6 chosen to align to next
                                    * parameter, so if newly defined option
                                    * it can use one of the reserverd slot so
                                    * no need to change
                                    * COAP_DTLS_PKI_SETUP_VERSION and just
                                    * decrement the reserved[] count.
                                    */

 /** CN check call-back function.
   * If not NULL, is called when the TLS connection has passed the configured
   * TLS options above for the application to verify if the CN is valid.
   */
 coap_dtls_cn_callback_t validate_cn_call_back;
 void *cn_call_back_arg; /**< Passed in to the CN call-back function */

 /** SNI check call-back function.
   * If not @p NULL, called if the SNI is not previously seen and prior to
   * sending a certificate set back to the client so that the appropriate
   * certificate set can be used based on the requesting SNI.
   */
 coap_dtls_sni_callback_t validate_sni_call_back;
 void *sni_call_back_arg; /**< Passed in to the sni call-back function */

 /** Additional Security call-back handler that is invoked when libcoap has
   * done the standerd, defined validation checks at the TLS level,
   * If not @p NULL, called from within the TLS Client Hello connection
   * setup.
   */
 coap_dtls_security_setup_t additional_tls_setup_call_back;

 char* client_sni;   /**<  If not NULL, SNI to use in client TLS setup.
                             Owned by the client app and must remain valid
                             during the call to coap_new_client_session_pki() */

 coap_dtls_key_t pki_key; /**< PKI key definition */
} coap_dtls_pki_t;
/**
 * The structure used for defining the PKI setup data to be used.
 */

Typedef coap_dtls_role_t;

typedef enum coap_dtls_role_t {
 COAP_DTLS_ROLE_CLIENT, /**< Internal function invoked for client */
 COAP_DTLS_ROLE_SERVER /**< Internal function invoked for server */
} coap_dtls_role_t;


      

Typedef coap_event_t

typedef unsigned int coap_event_t;
/**
 * Scalar type to represent different events, e.g. DTLS events or
 * retransmission timeouts.
 */

Typedef coap_event_handler_t

typedef int (*coap_event_handler_t)(struct coap_context_t *,
                                   coap_event_t event,
                                   struct coap_session_t *session);
/**
 * Type for event handler functions that can be registered with a CoAP
 * context using the unction coap_set_event_handler(). When called by
 * the library, the first argument will be the coap_context_t object
 * where the handler function has been registered. The second argument
 * is the event type that may be complemented by event-specific data
 * passed as the third argument.
 */

Typedef coap_key_t[4]

typedef unsigned char coap_key_t[4];


      

Typedef SOCKET

typedef SOCKET coap_fd_t;
#define coap_closesocket closesocket
#define COAP_SOCKET_ERROR SOCKET_ERROR
#define COAP_INVALID_SOCKET INVALID_SOCKET
#else
typedef int coap_fd_t;
#define coap_closesocket tuya_hal_net_close
#define COAP_SOCKET_ERROR (-1)
#define COAP_INVALID_SOCKET (-1)


      

Typedef coap_socket_flags_t

typedef uint16_t coap_socket_flags_t;


      

Typedef coap_socket_t;

typedef struct coap_socket_t {
#if defined(WITH_LWIP)
 struct udp_pcb *pcb;
#elif defined(WITH_CONTIKI)
 void *conn;
#else
 coap_fd_t fd;
#endif /* WITH_LWIP */
 coap_socket_flags_t flags;
} coap_socket_t;


      

Typedef coap_packet_t

typedef struct coap_packet_t coap_packet_t;


      

Typedef coap_nack_reason_t;

typedef enum {
 COAP_NACK_TOO_MANY_RETRIES,
 COAP_NACK_NOT_DELIVERABLE,
 COAP_NACK_RST,
 COAP_NACK_TLS_FAILED
} coap_nack_reason_t;


      

Typedef coap_memory_tag_t;

typedef enum {
 COAP_STRING,
 COAP_ATTRIBUTE_NAME,
 COAP_ATTRIBUTE_VALUE,
 COAP_PACKET,
 COAP_NODE,
 COAP_CONTEXT,
 COAP_ENDPOINT,
 COAP_PDU,
 COAP_PDU_BUF,
 COAP_RESOURCE,
 COAP_RESOURCEATTR,
#ifdef HAVE_LIBTINYDTLS
 COAP_DTLS_SESSION,
#endif
 COAP_SESSION,
 COAP_OPTLIST,
} coap_memory_tag_t;
/**
 * Type specifiers for coap_malloc_type(). Memory objects can be typed to
 * facilitate arrays of type objects to be used instead of dynamic memory
 * management on constrained devices.
 */

Typedef coap_queue_t;

typedef struct coap_queue_t {
 struct coap_queue_t *next;
 coap_tick_t t;               /**< when to send PDU for the next time */
 unsigned char retransmit_cnt; /**< retransmission counter, will be removed
                                 *    when zero */
 unsigned int timeout;        /**< the randomized timeout value */
 coap_session_t *session;     /**< the CoAP session */
 coap_tid_t id;               /**< CoAP transaction id */
 coap_pdu_t *pdu;             /**< the CoAP PDU to send */
} coap_queue_t;
/**
 * Queue entry
 */

Typedef coap_response_handler_t

typedef void (*coap_response_handler_t)(struct coap_context_t *context,
                                       coap_session_t *session,
                                       coap_pdu_t *sent,
                                       coap_pdu_t *received,
                                       const coap_tid_t id);
/**
 * Response handler that is used as call-back in coap_context_t.
 *
 * @param context CoAP session.
 * @param session CoAP session.
 * @param sent The PDU that was transmitted.
 * @param received The PDU that was received.
 * @param id CoAP transaction ID.
 */

Typedef coap_nack_handler_t

typedef void (*coap_nack_handler_t)(struct coap_context_t *context,
                                   coap_session_t *session,
                                   coap_pdu_t *sent,
                                   coap_nack_reason_t reason,
                                   const coap_tid_t id);
/**
 * Negative Acknowedge handler that is used as call-back in coap_context_t.
 *
 * @param context CoAP session.
 * @param session CoAP session.
 * @param sent The PDU that was transmitted.
 * @param reason The reason for the NACK.
 * @param id CoAP transaction ID.
 */

Typedef coap_ping_handler_t

typedef void (*coap_ping_handler_t)(struct coap_context_t *context,
                                   coap_session_t *session,
                                   coap_pdu_t *received,
                                   const coap_tid_t id);
/**
 * Recieved Ping handler that is used as call-back in coap_context_t.
 *
 * @param context CoAP session.
 * @param session CoAP session.
 * @param received The PDU that was received.
 * @param id CoAP transaction ID.
 */

Typedef coap_pong_handler_t

typedef void (*coap_pong_handler_t)(struct coap_context_t *context,
                                   coap_session_t *session,
                                   coap_pdu_t *received,
                                   const coap_tid_t id);
/**
 * Recieved Pong handler that is used as call-back in coap_context_t.
 *
 * @param context CoAP session.
 * @param session CoAP session.
 * @param received The PDU that was received.
 * @param id CoAP transaction ID.
 */

Typedef coap_context_t;

typedef struct coap_context_t {
 coap_opt_filter_t known_options;
 struct coap_resource_t *resources; /**< hash table or list of known
                                          resources */
 struct coap_resource_t *unknown_resource; /**< can be used for handling
                                                 unknown resources */

#ifndef WITHOUT_ASYNC
 /**
   * list of asynchronous transactions */
 struct coap_async_state_t *async_state;
#endif /* WITHOUT_ASYNC */

 /**
   * The time stamp in the first element of the sendqeue is relative
   * to sendqueue_basetime. */
 coap_tick_t sendqueue_basetime;
 coap_queue_t *sendqueue;
 coap_endpoint_t *endpoint;     /**< the endpoints used for listening  */
 coap_session_t *sessions;      /**< client sessions */

#ifdef WITH_CONTIKI
 struct uip_udp_conn *conn;     /**< uIP connection object */
 struct etimer retransmit_timer; /**< fires when the next packet must be sent */
 struct etimer notify_timer;    /**< used to check resources periodically */
#endif /* WITH_CONTIKI */

#ifdef WITH_LWIP
 uint8_t timer_configured;      /**< Set to 1 when a retransmission is
                                   *   scheduled using lwIP timers for this
                                   *   context, otherwise 0. */
#endif /* WITH_LWIP */

 /**
   * The last message id that was used is stored in this field. The initial
   * value is set by coap_new_context() and is usually a random value. A new
   * message id can be created with coap_new_message_id().
   */
 uint16_t message_id;

 coap_response_handler_t response_handler;
 coap_nack_handler_t nack_handler;
 coap_ping_handler_t ping_handler;
 coap_pong_handler_t pong_handler;

 /**
   * Callback function that is used to signal events to the
   * application.  This field is set by coap_set_event_handler().
   */
 coap_event_handler_t handle_event;

 ssize_t (*network_send)(coap_socket_t *sock, const coap_session_t *session, const uint8_t *data, size_t datalen);

 ssize_t (*network_read)(coap_socket_t *sock, struct coap_packet_t *packet);

 size_t(*get_client_psk)(const coap_session_t *session, const uint8_t *hint, size_t hint_len, uint8_t *identity, size_t *identity_len, size_t max_identity_len, uint8_t *psk, size_t max_psk_len);
 size_t(*get_server_psk)(const coap_session_t *session, const uint8_t *identity, size_t identity_len, uint8_t *psk, size_t max_psk_len);
 size_t(*get_server_hint)(const coap_session_t *session, uint8_t *hint, size_t max_hint_len);

 void *dtls_context;
 uint8_t *psk_hint;
 size_t psk_hint_len;
 uint8_t *psk_key;
 size_t psk_key_len;

 unsigned int session_timeout;   /**< Number of seconds of inactivity after which an unused session will be closed. 0 means use default. */
 unsigned int max_idle_sessions; /**< Maximum number of simultaneous unused sessions per endpoint. 0 means no maximum. */
 unsigned int max_handshake_sessions; /**< Maximum number of simultaneous negotating sessions per endpoint. 0 means use default. */
 unsigned int ping_timeout;          /**< Minimum inactivity time before sending a ping message. 0 means disabled. */
 unsigned int csm_timeout;          /**< Timeout for waiting for a CSM from the remote side. 0 means disabled. */

 void *app;                      /**< application-specific data */
} coap_context_t;
/**
 * The CoAP stack's global state is stored in a coap_context_t object.
 */

Typedef coap_fixed_point_t;

typedef struct coap_fixed_point_t {
 uint16_t integer_part;   /**< Integer part of fixed point variable */
 uint16_t fractional_part; /**< Fractional part of fixed point variable
                                1/1000 (3 points) precision */
} coap_fixed_point_t;
/**
* Abstraction of a fixed point number that can be used where necessary instead
* of a float.  1,000 fractional bits equals one integer
*/

Typedef coap_session_type_t

typedef uint8_t coap_session_type_t;


      

Typedef coap_session_state_t

typedef uint8_t coap_session_state_t;


      

Typedef coap_session_t;

typedef struct coap_session_t {
 struct coap_session_t *next;
 coap_proto_t proto;              /**< protocol used */
 coap_session_type_t type;        /**< client or server side socket */
 coap_session_state_t state;      /**< current state of relationaship with peer */
 unsigned ref;                    /**< reference count from queues */
 unsigned tls_overhead;           /**< overhead of TLS layer */
 unsigned mtu;                    /**< path or CSM mtu */
 coap_address_t local_if;         /**< optional local interface address */
 coap_address_t remote_addr;      /**< remote address and port */
 coap_address_t local_addr;       /**< local address and port */
 int ifindex;                     /**< interface index */
 coap_socket_t sock;              /**< socket object for the session, if any */
 struct coap_endpoint_t *endpoint; /**< session's endpoint */
 struct coap_context_t *context;  /**< session's context */
 void *tls;                       /**< security parameters */
 uint16_t tx_mid;                 /**< the last message id that was used in this session */
 uint8_t con_active;              /**< Active CON request sent */
 struct coap_queue_t *delayqueue; /**< list of delayed messages waiting to be sent */
 size_t partial_write;            /**< if > 0 indicates number of bytes already written from the pdu at the head of sendqueue */
 uint8_t read_header[8];          /**< storage space for header of incoming message header */
 size_t partial_read;             /**< if > 0 indicates number of bytes already read for an incoming message */
 coap_pdu_t *partial_pdu;         /**< incomplete incoming pdu */
 coap_tick_t last_rx_tx;
 coap_tick_t last_tx_rst;
 coap_tick_t last_ping;
 coap_tick_t last_pong;
 coap_tick_t csm_tx;
 uint8_t *psk_identity;
 size_t psk_identity_len;
 uint8_t *psk_key;
 size_t psk_key_len;
 void *app;                       /**< application-specific data */
 unsigned int max_retransmit;     /**< maximum re-transmit count (default 4) */
 coap_fixed_point_t ack_timeout;  /**< timeout waiting for ack (default 2 secs) */
 coap_fixed_point_t ack_random_factor; /**< ack random factor backoff (default 1.5) */
 unsigned int dtls_timeout_count;     /**< dtls setup retry counter */
 int dtls_event;                      /**< Tracking any (D)TLS events on this sesison */
} coap_session_t;


      

Typedef coap_endpoint_t;

typedef struct coap_endpoint_t {
 struct coap_endpoint_t *next;
 struct coap_context_t *context; /**< endpoint's context */
 coap_proto_t proto;            /**< protocol used on this interface */
 uint16_t default_mtu;          /**< default mtu for this interface */
 coap_socket_t sock;            /**< socket object for the interface, if any */
 coap_address_t bind_addr;      /**< local interface address */
 coap_session_t *sessions;      /**< list of active sessions */
 coap_session_t hello;          /**< special session of DTLS hello messages */
} coap_endpoint_t;
/**
* Abstraction of virtual endpoint that can be attached to coap_context_t. The
* tuple (handle, addr) must uniquely identify this endpoint.
*/

Typedef coap_tick_t

typedef uint32_t coap_tick_t;


      

Typedef coap_time_t

typedef uint32_t coap_time_t;


      

Typedef coap_tick_diff_t

typedef int32_t coap_tick_diff_t;


      

Typedef coap_tick_t

typedef clock_time_t coap_tick_t;


      

Typedef coap_time_t

typedef clock_time_t coap_time_t;


      

Typedef coap_tick_diff_t

typedef int coap_tick_diff_t;
/**
 * This data type is used to represent the difference between two clock_tick_t
 * values. This data type must have the same size in memory as coap_tick_t to
 * allow wrapping.
 */

Typedef coap_tick_t

typedef uint64_t coap_tick_t;
/**
 * This data type represents internal timer ticks with COAP_TICKS_PER_SECOND
 * resolution.
 */

Typedef coap_time_t

typedef uint32_t coap_time_t;
/**
 * CoAP time in seconds since epoch.
 */

Typedef coap_tick_diff_t

typedef int64_t coap_tick_diff_t;
/**
 * This data type is used to represent the difference between two clock_tick_t
 * values. This data type must have the same size in memory as coap_tick_t to
 * allow wrapping.
 */

Typedef ssize_t

typedef SSIZE_T ssize_t;


      

Typedef USHORT

typedef USHORT in_port_t;
#elif !defined (CONTIKI)



      

Typedef uint8_t

typedef uint8_t coap_opt_t;
#define PCHAR(p) ((coap_opt_t *)(p))

/**
 * Use byte-oriented access methods here because sliding a complex struct
 * coap_opt_t over the data buffer may cause bus error on certain platforms.
 */

Typedef coap_option_t;

typedef struct {
 uint16_t delta;
 size_t length;
 const uint8_t *value;
} coap_option_t;
/**
 * Representation of CoAP options.
 */

Typedef coap_opt_filter_t[COAP_OPT_FILTER_SIZE]

typedef uint16_t coap_opt_filter_t[COAP_OPT_FILTER_SIZE];
/**
 * Fixed-size vector we use for option filtering. It is large enough
 * to hold COAP_OPT_FILTER_SHORT entries with an option number between
 * 0 and 255, and COAP_OPT_FILTER_LONG entries with an option number
 * between 256 and 65535. Its internal structure is
 *
 * @code
struct {
  uint16_t mask;
  uint16_t long_opts[COAP_OPT_FILTER_LONG];
  uint8_t short_opts[COAP_OPT_FILTER_SHORT];
}
 * @endcode
 *
 * The first element contains a bit vector that indicates which fields
 * in the remaining array are used. The first COAP_OPT_FILTER_LONG
 * bits correspond to the long option types that are stored in the
 * elements from index 1 to COAP_OPT_FILTER_LONG. The next
 * COAP_OPT_FILTER_SHORT bits correspond to the short option types
 * that are stored in the elements from index COAP_OPT_FILTER_LONG + 1
 * to COAP_OPT_FILTER_LONG + COAP_OPT_FILTER_SHORT. The latter
 * elements are treated as bytes.
 */

Typedef coap_opt_iterator_t;

typedef struct {
 size_t length;               /**< remaining length of PDU */
 uint16_t type;               /**< decoded option type */
 unsigned int bad:1;          /**< iterator object is ok if not set */
 unsigned int filtered:1;     /**< denotes whether or not filter is used */
 coap_opt_t *next_option;     /**< pointer to the unparsed next option */
 coap_opt_filter_t filter;    /**< option filter */
} coap_opt_iterator_t;
/**
 * Iterator to run through PDU options. This object must be
 * initialized with coap_option_iterator_init(). Call
 * coap_option_next() to walk through the list of options until
 * coap_option_next() returns @c NULL.
 *
 * @code
 * coap_opt_t *option;
 * coap_opt_iterator_t opt_iter;
 * coap_option_iterator_init(pdu, &opt_iter, COAP_OPT_ALL);
 *
 * while ((option = coap_option_next(&opt_iter))) {
 *   ... do something with option ...
 * }
 * @endcode
 */

Typedef coap_optlist_t;

typedef struct coap_optlist_t {
 struct coap_optlist_t *next; /**< next entry in the optlist chain */
 uint16_t number;             /**< the option number (no delta coding) */
 size_t length;               /**< the option value length */
 uint8_t *data;               /**< the option data */
} coap_optlist_t;
/**
 * Representation of chained list of CoAP options to install.
 *
 * @code
 * coap_optlist_t *optlist_chain = NULL;
 * coap_pdu_t *pdu = coap_new_pdu(session);
 *
 * ... other set up code ...
 * coap_insert_optlist(&optlist_chain, coap_new_optlist(COAP_OPTION_OBSERVE,
 *                    COAP_OBSERVE_ESTABLISH, NULL));
 *
 * coap_add_optlist_pdu(pdu, &optlist_chain);
 * ... other code ...
 * coap_delete_optlist(optlist_chain);
 * @endcode
 */

Typedef coap_tid_t

typedef int coap_tid_t;
/**
 * coap_tid_t is used to store CoAP transaction id, i.e. a hash value
 * built from the remote transport address and the message id of a
 * CoAP PDU.  Valid transaction ids are greater or equal zero.
 */

Typedef coap_pdu_t;

typedef struct coap_pdu_t {
 uint8_t type;            /**< message type */
 uint8_t code;            /**< request method (value 1--10) or response code (value 40-255) */
 uint8_t max_hdr_size;    /**< space reserved for protocol-specific header */
 uint8_t hdr_size;        /**< actaul size used for protocol-specific header */
 uint8_t token_length;    /**< length of Token */
 uint16_t tid;            /**< transaction id, if any, in regular host byte order */
 uint16_t max_delta;      /**< highest option number */
 size_t alloc_size;       /**< allocated storage for token, options and payload */
 size_t used_size;        /**< used bytes of storage for token, options and payload */
 size_t max_size;         /**< maximum size for token, options and payload, or zero for variable size pdu */
 uint8_t *token;          /**< first byte of token, if any, or options */
 uint8_t *data;           /**< first byte of payload, if any */
#ifdef WITH_LWIP
 struct pbuf *pbuf;       /**< lwIP PBUF. The package data will always reside
                             *   inside the pbuf's payload, but this pointer
                             *   has to be kept because no exact offset can be
                             *   given. This field must not be accessed from
                             *   outside, because the pbuf's reference count
                             *   is checked to be 1 when the pbuf is assigned
                             *   to the pdu, and the pbuf stays exclusive to
                             *   this pdu. */
#endif
} coap_pdu_t;


      

Typedef coap_proto_t

typedef uint8_t coap_proto_t;


      

Typedef coap_method_handler_t

typedef void (*coap_method_handler_t)
 (coap_context_t *,
  struct coap_resource_t *,
  coap_session_t *,
  coap_pdu_t *,
  coap_binary_t * /* token */,
  coap_string_t * /* query string */,
  coap_pdu_t * /* response */);
/**
 * Definition of message handler function (@sa coap_resource_t).
 */

Typedef coap_attr_t;

typedef struct coap_attr_t {
 struct coap_attr_t *next;
 coap_str_const_t *name;
 coap_str_const_t *value;
 int flags;
} coap_attr_t;


      

Typedef coap_resource_t;

typedef struct coap_resource_t {
 unsigned int dirty:1;         /**< set to 1 if resource has changed */
 unsigned int partiallydirty:1; /**< set to 1 if some subscribers have not yet
                                  *   been notified of the last change */
 unsigned int observable:1;    /**< can be observed */
 unsigned int cacheable:1;     /**< can be cached */
 unsigned int is_unknown:1;    /**< resource created for unknown handler */

 /**
   * Used to store handlers for the seven coap methods @c GET, @c POST, @c PUT,
   * @c DELETE, @c FETCH, @c PATCH and @c IPATCH.
   * coap_dispatch() will pass incoming requests to the handler
   * that corresponds to its request method or generate a 4.05 response if no
   * handler is available.
   */
 coap_method_handler_t handler[7];

 UT_hash_handle hh;

 coap_attr_t *link_attr; /**< attributes to be included with the link format */
 coap_subscription_t *subscribers; /**< list of observers for this resource */

 /**
   * Request URI Path for this resource. This field will point into static
   * or allocated memory which must remain there for the duration of the
   * resource.
   */
 coap_str_const_t *uri_path; /**< the key used for hash lookup for this resource */
 int flags;

 /**
  * The next value for the Observe option. This field must be increased each
  * time the resource changes. Only the lower 24 bits are sent.
  */
 unsigned int observe;

 /**
   * This pointer is under user control. It can be used to store context for
   * the coap handler.
   */
 void *user_data;

} coap_resource_t;


      

Typedef coap_print_status_t

typedef unsigned int coap_print_status_t;
/**
 * Status word to encode the result of conditional print or copy operations such
 * as coap_print_link(). The lower 28 bits of coap_print_status_t are used to
 * encode the number of characters that has actually been printed, bits 28 to 31
 * encode the status.  When COAP_PRINT_STATUS_ERROR is set, an error occurred
 * during output. In this case, the other bits are undefined.
 * COAP_PRINT_STATUS_TRUNC indicates that the output is truncated, i.e. the
 * printing would have exceeded the current buffer.
 */

Typedef coap_string_t;

typedef struct coap_string_t {
 size_t length;   /**< length of string */
 uint8_t *s;      /**< string data */
} coap_string_t;
/**
 * Coap string data definition
 */

Typedef coap_str_const_t;

typedef struct coap_str_const_t {
 size_t length;   /**< length of string */
 const uint8_t *s; /**< string data */
} coap_str_const_t;
/**
 * Coap string data definition with const data
 */

Typedef coap_binary_t;

typedef struct coap_binary_t {
 size_t length;   /**< length of binary data */
 uint8_t *s;      /**< binary data */
} coap_binary_t;
/**
 * Coap binary data definition
 */

Typedef coap_subscription_t;

typedef struct coap_subscription_t {
 struct coap_subscription_t *next; /**< next element in linked list */
 coap_session_t *session;         /**< subscriber session */

 unsigned int non_cnt:4; /**< up to 15 non-confirmable notifies allowed */
 unsigned int fail_cnt:2; /**< up to 3 confirmable notifies can fail */
 unsigned int dirty:1;   /**< set if the notification temporarily could not be
                            *   sent (in that case, the resource's partially
                            *   dirty flag is set too) */
 unsigned int has_block2:1; /**< GET request had Block2 definition */
 coap_block_t block2;    /**< GET request Block2 definition */
 size_t token_length;    /**< actual length of token */
 unsigned char token[8]; /**< token used for subscription */
 coap_string_t *query;   /**< query string used for subscription, if any */
} coap_subscription_t;
/** Subscriber information */

Typedef coap_uri_t;

typedef struct {
 coap_str_const_t host; /**< host part of the URI */
 uint16_t port;         /**< The port in host byte order */
 coap_str_const_t path; /**< Beginning of the first path segment.
                           Use coap_split_path() to create Uri-Path options */
 coap_str_const_t query; /**<  The query part if present */

 /** The parsed scheme specifier. */
 enum coap_uri_scheme_t scheme;
} coap_uri_t;
/**
 * Representation of parsed URI. Components may be filled from a string with
 * coap_split_uri() and can be used as input for option-creation functions.
 */

Typedef uint32_t

typedef unsigned int uint32_t;


      

Typedef uint8_t

typedef unsigned char uint8_t;


      

Typedef uint32_t

typedef unsigned int uint32_t;


      

Typedef uint8_t

typedef unsigned char uint8_t;


      

Typedef UT_hash_bucket;

typedef struct UT_hash_bucket {
  struct UT_hash_handle *hh_head;
  unsigned count;

  /* expand_mult is normally set to 0. In this situation, the max chain length
    * threshold is enforced at its default value, HASH_BKT_CAPACITY_THRESH. (If
    * the bucket's chain exceeds this length, bucket expansion is triggered).
    * However, setting expand_mult to a non-zero value delays bucket expansion
    * (that would be triggered by additions to this particular bucket)
    * until its chain length reaches a *multiple* of HASH_BKT_CAPACITY_THRESH.
    * (The multiplier is simply expand_mult+1). The whole idea of this
    * multiplier is to reduce bucket expansions, since they are expensive, in
    * situations where we know that a particular bucket tends to be overused.
    * It is better to let its chain length grow to a longer yet-still-bounded
    * value, than to do an O(n) bucket expansion too often.
    */
  unsigned expand_mult;

} UT_hash_bucket;


      

Typedef UT_hash_table;

typedef struct UT_hash_table {
  UT_hash_bucket *buckets;
  unsigned num_buckets, log2_num_buckets;
  unsigned num_items;
  struct UT_hash_handle *tail; /* tail hh in app order, for fast append    */
  ptrdiff_t hho; /* hash handle offset (byte pos of hash handle in element */

  /* in an ideal situation (all buckets used equally), no bucket would have
    * more than ceil(#items/#buckets) items. that's the ideal chain length. */
  unsigned ideal_chain_maxlen;

  /* nonideal_items is the number of items in the hash whose chain position
    * exceeds the ideal chain maxlen. these items pay the penalty for an uneven
    * hash distribution; reaching them in a chain traversal takes >ideal steps */
  unsigned nonideal_items;

  /* ineffective expands occur when a bucket doubling was performed, but
    * afterward, more than half the items in the hash had nonideal chain
    * positions. If this happens on two consecutive expansions we inhibit any
    * further expansion, as it's not helping; this happens when the hash
    * function isn't a good fit for the key domain. When expansion is inhibited
    * the hash will still work, albeit no longer in constant time. */
  unsigned ineff_expands, noexpand;

  uint32_t signature; /* used only to find hash tables in external analysis */
#ifdef HASH_BLOOM
  uint32_t bloom_sig; /* used only to test bloom exists in external analysis */
  uint8_t *bloom_bv;
  uint8_t bloom_nbits;
#endif

} UT_hash_table;


      

Typedef UT_hash_handle;

typedef struct UT_hash_handle {
  struct UT_hash_table *tbl;
  void *prev;                      /* prev element in app order      */
  void *next;                      /* next element in app order      */
  struct UT_hash_handle *hh_prev;  /* previous hh in bucket order    */
  struct UT_hash_handle *hh_next;  /* next hh in bucket order        */
  const void *key;                 /* ptr to enclosing struct's key  */
  unsigned keylen;                 /* enclosing struct's key len     */
  unsigned hashv;                  /* result of hash-fcn(key)        */
} UT_hash_handle;


      

Typedef TY_COAP_SERVER_HANLDER

typedef PVOID_T TY_COAP_SERVER_HANLDER;


      

Typedef ty_coap_init_resource_cb

typedef OPERATE_RET (*ty_coap_init_resource_cb)(IN TY_COAP_SERVER_HANLDER handler);


      

Typedef TY_COAP_OPTION_S;

typedef struct
{
   /** option type */
   SHORT_T type;
   /** option length */
   UINT_T length;
   /** option data */
   CHAR_T *p_data;
}TY_COAP_OPTION_S;
/**
 * @brief Definition of COAP option
 */

Typedef HTTP_DATA_RECV

typedef INT_T (*HTTP_DATA_RECV)(PVOID_T hand,PVOID_T buf,UINT_T len);
/**
 * @brief This API is used to handle HTTP response content
 * 
 * @param[in] hand http_session_t
 * @param[in] buf Buffer of HTTP response content
 * @param[in] len length of buf
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef HTTP_INF_H_S;

typedef struct {
   /** chunk is enabled or not */
   BOOL_T chunked;
   /** if(chunked == FALSE) then valid */
   UINT_T content_len;
   /** http_session_t */
   PVOID_T hand;
   /** system auto fill */
   HTTP_DATA_RECV recv;
   /** private data */
   PVOID_T *pri_data;
   /** status code of HTTP response */
   INT_T status_code;
   /** decode key of HTTP response content */
   CHAR_T *p_decode_key;
}HTTP_INF_H_S;
/**
 * @brief Definition of HTTP request/response structure
 */

Typedef HTTP_INF_CB

typedef OPERATE_RET (*HTTP_INF_CB)(HTTP_INF_H_S *hand);
/**
 * @brief This API is used to handle customized HTTP response
 * 
 * @param[in] hand Pointer to HTTP_INF_H_S
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef HTTP_PARAM_H_S;

typedef struct {
   /** max count of URL params */
   BYTE_T total;
   /** used count of URL params */
   BYTE_T cnt;
   /** pointer to URL param */
   CHAR_T *pos[0];
}HTTP_PARAM_H_S;
/**
 * @brief Definition of HTTP URL param structure
 */

Typedef HTTP_URL_H_S;

typedef struct {
   /** param handle */
   HTTP_PARAM_H_S *param_h;
   /** param insert pos */
   CHAR_T *param_in;
   /** head_size == "url?" or "url" */
   USHORT_T head_size;
   /** bufer len */
   USHORT_T buf_len;
   /** "url?key=value" + "kev=value statistics" */
   CHAR_T buf[0];
}HTTP_URL_H_S;
/**
 * @brief Definition of HTTP URL structure
 */

Typedef E_HTTP_SESSION_STATE;

typedef enum
{
   HTTP_FREE = 0,  // session is free
   HTTP_DISCONNECT, // session is disconnected
   HTTP_CONNECTING, // session is connecting
   HTTP_CONNECTED, // session is connected and ready to send/recv
   HTTP_UPLOADING, // session has sent data and is ready to recv
}E_HTTP_SESSION_STATE;
/**
 * @brief Definition of HTTP session state
 */

Typedef S_HTTP_SESSION;

typedef struct
{
   /** internal HTTP session */
   http_session_t s;

   /** persistent or not */
   BOOL_T is_persistent;

   /** hdr field flags */
   http_hdr_field_sel_t flags;

   /** url content */
   CHAR_T url[MAX_HTTP_URL_LEN];

   /** http request */
   http_req_t req;

   /** session state, please refer to enum E_HTTP_SESSION_STATE */
   E_HTTP_SESSION_STATE state;
}S_HTTP_SESSION;
/**
 * @brief The HTTP session's Request structure
 */

Typedef SESSION_ID

typedef S_HTTP_SESSION* SESSION_ID;


      

Typedef FUNC_HTTP_SESSION_CREATE

typedef SESSION_ID (*FUNC_HTTP_SESSION_CREATE)(IN CONST CHAR_T *url,BOOL_T is_persistent);
/**
 * @brief This API is used to create HTTP session
 * 
 * @param[in] url URL of HTTP session, max len of URL is 256
 * @param[in] is_persistent Session is persistent or not
 * 
 * @return SESSION_ID on success, NULL on error
 */

Typedef FUNC_HTTP_SESSION_SEND

typedef OPERATE_RET (*FUNC_HTTP_SESSION_SEND)(IN CONST SESSION_ID session,IN CONST http_req_t *req,http_hdr_field_sel_t field_flags);
/**
 * @brief This API is used to send HTTP session request
 * 
 * @param[in] session Session returned from the call to FUNC_HTTP_SESSION_CREATE
 * @param[in] req The http_req_t structure filled up with appropriate parameters
 * @param[in] field_flags The http_hdr_field_sel_t, OR of zero or more flags
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef FUNC_HTTP_SESSION_RECEIVE

typedef OPERATE_RET (*FUNC_HTTP_SESSION_RECEIVE)(SESSION_ID session, http_resp_t **resp);
/**
 * @brief This API is used to recv response header from HTTP session
 * 
 * @param[in] session Session returned from the call to FUNC_HTTP_SESSION_CREATE
 * @param[in,out] resp Pointer to a pointer of type http_resp_t .The
 * structure will be allocated by the callee. Note that the caller does
 * not need to free the structure allocated and returned from this
 * API. The allocation and free is done by the callee automatically
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef FUNC_HTTP_SESSION_DESTORY

typedef OPERATE_RET (*FUNC_HTTP_SESSION_DESTORY)(SESSION_ID session);
/**
 * @brief This API is used to destroy HTTP session
 * 
 * @param[in] session Session returned from the call to FUNC_HTTP_SESSION_CREATE
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef FUNC_HTTP_SESSION_RECEIVE_DATA

typedef OPERATE_RET (*FUNC_HTTP_SESSION_RECEIVE_DATA)(SESSION_ID session, http_resp_t *pResp, BYTE_T** pDataOut);
/**
 * @brief This API is used to recv response content from HTTP session.
 * 
 * @param[in] session Session returned from the call to FUNC_HTTP_SESSION_CREATE
 * @param[in] pResp The http_resp_t structure returned from the call to FUNC_HTTP_SESSION_RECEIVE
 * @param[in, out] pDataOut Caller allocated buffer
 * 
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef S_HTTP_MANAGER;

typedef struct
{
   /** session resources */
   S_HTTP_SESSION *session[MAX_HTTP_SESSION_NUM];
   /** exclusive access to session resources*/
   MUTEX_HANDLE mutex;

   /** session manager inited or not */
   BOOL_T inited;

   /** handler to create HTTP session */
   FUNC_HTTP_SESSION_CREATE create_http_session;
   /** handler to send HTTP session request */
   FUNC_HTTP_SESSION_SEND send_http_request;
   /** handler to recv response header from HTTP session */
   FUNC_HTTP_SESSION_RECEIVE receive_http_response;
   /** handler to destroy HTTP session */
   FUNC_HTTP_SESSION_DESTORY destory_http_session;
   /** handler to recv response content from HTTP session */
   FUNC_HTTP_SESSION_RECEIVE_DATA receive_http_data;
}S_HTTP_MANAGER;
/**
 * @brief The HTTP session manager structure.
 */

Typedef http_session_t

typedef void * http_session_t;


      

Typedef http_method_t;

typedef enum {
   HTTP_OPTIONS,	/* request to server for communication  options */
   HTTP_GET,	/* retrieve information */
   HTTP_HEAD,	/* get meta-info */
   HTTP_POST,	/* request to accept new sub-ordinate of resource */
   HTTP_PUT,	/* modify or create new resource referred to by URI */
   HTTP_DELETE,	/* delete the resource */
   HTTP_TRACE,	/* echo */
   HTTP_CONNECT,	/* do we need this  ? */
} http_method_t;
/* Request methods */

Typedef http_ver_t;

typedef enum {
   HTTP_VER_1_0,
   HTTP_VER_1_1,
} http_ver_t;


      

Typedef http_hdr_field_sel_t;

typedef enum {
   HDR_ADD_DEFAULT_USER_AGENT = 1,
   /* Note: This flag is not necessary to set up persistent
     * connections in HTTP 1.1. However, if you want the server to
     * respond with persistent connection timeout values you may need
     * to add this flag. These timeout values are used to find out how
     * long a persistent connection will be kept alive by the
     * server. */
   HDR_ADD_CONN_KEEP_ALIVE	= 2,
   HDR_ADD_CONN_CLOSE	= 4,
   HDR_ADD_TYPE_CHUNKED           = 8,

   // add content type
   HDR_ADD_CONTENT_TYPE_JSON      = 16,
   HDR_ADD_CONTENT_TYPE_FORM_URLENCODE = 32, // add by nzy 20150608
   HRD_ADD_DOWNLOAD_RANGE = 64, /* add downlaod offset */
   HRD_ADD_HTTP_RAW = 128, /* add downlaod offset */

} http_hdr_field_sel_t;
/**
 * The OR of zero or more flags below is passed to the API
 * http_prepare_req(). If the a flag is passed the corresponding HTTP
 * header field is added to the HTTP header. The values added will be
 * default ones.
 */

Typedef HTTP_HEAD_ADD_CB

typedef void (*HTTP_HEAD_ADD_CB)(http_session_t session, VOID* data);
// user http head add callback

Typedef HTTP_CUSTOM_GET_CONTENT_LEN_CB

typedef unsigned int (*HTTP_CUSTOM_GET_CONTENT_LEN_CB)(VOID *pri_data);


      

Typedef HTTP_CUSTOM_BEFORE_READ_CONTENT_CB

typedef int (*HTTP_CUSTOM_BEFORE_READ_CONTENT_CB)(VOID *pri_data, unsigned int *p_malloc_buffer_size);


      

Typedef HTTP_CUSTOM_READ_CONTENT_CB

typedef int (*HTTP_CUSTOM_READ_CONTENT_CB)(unsigned char *p_buffer, int buf_size, VOID *pri_data);


      

Typedef HTTP_CUSTOM_AFTER_READ_CONTENT_CB

typedef int (*HTTP_CUSTOM_AFTER_READ_CONTENT_CB)(VOID *pri_data);


      

Typedef http_custom_content_ctx_s;

typedef struct {
   HTTP_CUSTOM_GET_CONTENT_LEN_CB get_content_len_cb;
   HTTP_CUSTOM_BEFORE_READ_CONTENT_CB before_read_cb;
   HTTP_CUSTOM_READ_CONTENT_CB read_content_cb;
   HTTP_CUSTOM_AFTER_READ_CONTENT_CB after_read_cb;
   VOID *pri_data;
}http_custom_content_ctx_s;


      

Typedef http_req_t;

typedef struct {
   /** The Type of HTTP Request */
   http_method_t type;
   /** The target resource for the HTTP Request. A complete URL is also
     * accepted.
     */
   const char *resource;
   /** initialzied redirect count, default is zero */
   unsigned char redirect_cnt;
   /** The HTTP Protocol Version */
   http_ver_t version;
   /** Pointer to data buffer. NULL if GET request */
   const char *content;
   /** The length of the data pointed to by \a content above. This is
     * don't-care if the content is set to NULL
     */
   int content_len;
   HTTP_HEAD_ADD_CB add_head_cb;
   VOID *add_head_data;
   unsigned int download_offset;
   unsigned int download_size;

   http_custom_content_ctx_s *p_custom_content_ctx;
} http_req_t;
/** The HTTP Client's Request structure
 *
 * \par
 * The application should fill up this structure and pass it to the
 * http_prepare_req() API while making an HTTP request.
 * For HTTP POST, the fields content and content_len of this structure
 * have to be set as well.
 * More name-value fields can be added to HTTP header using http_add_header().
 */

Typedef http_resp_t;

typedef struct {
   /** The value of the protocol field in the first line of the HTTP
        header response. e.g. "HTTP". */
   const char *protocol;
   /** HTTP version */
   http_ver_t version;
   /** The status code returned as a part of the first line of the
        HTTP response e.g. 200 if success
    */
   int status_code;
   /** The ASCII string present in the first line of HTTP response. It
        is the verbose representation of status code. e.g. "OK" if
        status_code is 200
    */
   const char *reason_phrase;
   /** HTTP "Location" header field value */
   const char *location;
   /** HTTP "Server" header field value */
   const char *server;
   /** Accept-Ranges */
   const char *p_accept_ranges;
   /** Last-Modified header field value in POSIX time format */
   time_t modify_time;
   /** The value of "Content-Type" header field. e.g. "text/html" */
   const char *content_type;
   /** The value of "Content-Encoding" header field e.g. "gzip" */
   const char *content_encoding;
   /** If "Keep-Alive" field is present or if the value of
        "Connection" field is "Keep-Alive" then this member is set to
        'true'. It is set to 'false' in other cases
    */
   bool_t keep_alive_ack;
   /** If "Keep-Alive" field is present in the response, this member
        contains the value of the "timeout" sub-field of this
        field. This is the time the server will allow an idle
        connection to remain open before it is closed.
    */
   int keep_alive_timeout;
   /** If "Keep-Alive" field is present in the response, this member
        contains the value of the "max" sub-field of this field. The
        max parameter indicates the maximum number of requests that a
        client will make, or that a server will allow to be made on the
        persistent connection.
    */
   int keep_alive_max;
   /** This will be 'true' if "Transfer-Encoding" field is set to
        "chunked". Note that this is only for information and the API
        http_read_content() transparently handles chunked reads.
    */
   bool_t chunked;
   /** Value of the "Content-Length" field. If "Transfer-Encoding" is
        set to chunked then this value will be zero.
    */
   unsigned int content_length;
} http_resp_t;
/**
 * Structure used to give back http header response fields to the caller.
 */

Typedef http_header_pair_t;

typedef struct {
   char *name;
   char *value;
} http_header_pair_t;


      

Typedef parsed_url_t;

typedef struct {
   const char *scheme;
   const char *hostname;
   unsigned portno;
   const char *resource;
} parsed_url_t;


      

Typedef http_open_flags_t;

typedef enum {
   /** Pass this flag when you want the connection to be SSL based */
   TLS_ENABLE = 1,
} http_open_flags_t;
/**
 * If the given URL has a scheme field, and it is https then the http
 * client will auto-switch to SSL mode, irrespective of the TLS_ENABLE
 * flag below.
 */

Typedef MQ_HANDLE

typedef PVOID_T MQ_HANDLE; //Definition of MQTT client handler


      

Typedef MQ_DATA_RECV_CB

typedef VOID (*MQ_DATA_RECV_CB)(IN BYTE_T *data,IN UINT_T len);
/**
 * @brief  MQTT msg is recved from broker
 * 
 * @param[in] data Buffer of msg
 * @param[in] len Length os msg
 */

Typedef MQ_CLIENT_IF_S;

typedef struct {
   /** default topic subscribed from MQTT broker */
   CHAR_T *subcribe_topic;
   /** client id */
   CHAR_T *client_id;
   /** user name */
   CHAR_T *user_name;
   /** password */
   CHAR_T *passwd;
}MQ_CLIENT_IF_S;
/**
 * @brief Definition of MQTT client's credentials
 */

Typedef MQ_CONNED_CB

typedef VOID (*MQ_CONNED_CB)(VOID);
/**
 * @brief MQTT client is connected to broker
 */

Typedef MQ_DISCONN_CB

typedef VOID (*MQ_DISCONN_CB)(VOID);
/**
 * @brief MQTT client is disconnected to broker
 */

Typedef MQ_CONN_DENY_CB

typedef VOID (*MQ_CONN_DENY_CB)(IN BYTE_T deny_times);
/**
 * @brief MQTT client is not permited to connect to broker
 * 
 * @param[in] deny_times How many times this MQTT client is denied by broker
 */

Typedef MQ_UPDATE_AUTH_CB

typedef VOID (*MQ_UPDATE_AUTH_CB)(VOID);
/**
 * @brief Update authentication of MQTT client
 */

Typedef MQ_PERMIT_CONN_CB

typedef INT_T (*MQ_PERMIT_CONN_CB)(VOID);
/**
 * @brief Check permission when connect to broker
 * 
 * @return 1: permit to connect mqtt
 * 0: not permit to connect mqtt, and reconnect after a random delay
 * -1: not permit to connect mqtt, and reconnect after a short delay
 */

Typedef MQ_PUB_ASYNC_IFM_CB

typedef VOID (*MQ_PUB_ASYNC_IFM_CB)(IN CONST OPERATE_RET op_ret,IN CONST VOID *prv_data);
/**
 * @brief  Async callback that indicates mqtt_publish_async success or not.
 * 
 * @param[in] op_ret OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 * @param[in] prv_data Private data
 */

Typedef MQ_MSG_RECV_CB

typedef VOID (*MQ_MSG_RECV_CB)(IN CONST CHAR_T *topic, IN BYTE_T *data,IN UINT_T len);
/**
 * @brief Callback when specific MQTT msg recv
 * 
 * @param[in] topic Topic that msg is recved from
 * @param[in] data Buffer of msg content
 * @param[in] len Length of msg content
 *
 * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */

Typedef mbedtls_aes_context;

typedef struct mbedtls_aes_context
{
   int nr;                    /*!< The number of rounds. */
   uint32_t *rk;              /*!< AES round keys. */
   uint32_t buf[68];          /*!< Unaligned data buffer. This buffer can
                                     hold 32 extra Bytes, which can be used for
                                     one of the following purposes:
                                     
  • Alignment if VIA padlock is used.
  • Simplifying key expansion in the 256-bit case by generating an extra round key.
*/ } mbedtls_aes_context;
/**
 * \brief The AES context-type definition.
 */

Typedef mbedtls_aes_xts_context;

typedef struct mbedtls_aes_xts_context
{
   mbedtls_aes_context crypt; /*!< The AES context to use for AES block
                                        encryption or decryption. */
   mbedtls_aes_context tweak; /*!< The AES context used for tweak
                                        computation. */
} mbedtls_aes_xts_context;
/**
 * \brief The AES XTS context-type definition.
 */

Typedef mbedtls_aes_context;

typedef struct
{
   uint8_t aes_key[16];
}
mbedtls_aes_context;


      

Typedef mbedtls_arc4_context;

typedef struct mbedtls_arc4_context
{
   int x;                     /*!< permutation index */
   int y;                     /*!< permutation index */
   unsigned char m[256];      /*!< permutation table */
}
mbedtls_arc4_context;
/**
 * \brief     ARC4 context structure
 *
 * \warning   ARC4 is considered a weak cipher and its use constitutes a
 *            security risk. We recommend considering stronger ciphers instead.
 *
 */

Typedef mbedtls_aria_context;

typedef struct mbedtls_aria_context
{
   unsigned char nr;          /*!< The number of rounds (12, 14 or 16) */
   /*! The ARIA round keys. */
   uint32_t rk[MBEDTLS_ARIA_MAX_ROUNDS + 1][MBEDTLS_ARIA_BLOCKSIZE / 4];
}
mbedtls_aria_context;
/**
 * \brief The ARIA context-type definition.
 */

Typedef mbedtls_asn1_buf;

typedef struct mbedtls_asn1_buf
{
   int tag;               /**< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */
   size_t len;            /**< ASN1 length, in octets. */
   unsigned char *p;      /**< ASN1 data, e.g. in ASCII. */
}
mbedtls_asn1_buf;
/**
 * Type-length-value structure that allows for ASN1 using DER.
 */

Typedef mbedtls_asn1_bitstring;

typedef struct mbedtls_asn1_bitstring
{
   size_t len;                /**< ASN1 length, in octets. */
   unsigned char unused_bits; /**< Number of unused bits at the end of the string */
   unsigned char *p;          /**< Raw ASN1 data for the bit string */
}
mbedtls_asn1_bitstring;
/**
 * Container for ASN1 bit strings.
 */

Typedef mbedtls_asn1_sequence;

typedef struct mbedtls_asn1_sequence
{
   mbedtls_asn1_buf buf;                  /**< Buffer containing the given ASN.1 item. */
   struct mbedtls_asn1_sequence *next;   /**< The next entry in the sequence. */
}
mbedtls_asn1_sequence;
/**
 * Container for a sequence of ASN.1 items
 */

Typedef mbedtls_asn1_named_data;

typedef struct mbedtls_asn1_named_data
{
   mbedtls_asn1_buf oid;                  /**< The object identifier. */
   mbedtls_asn1_buf val;                  /**< The named value. */
   struct mbedtls_asn1_named_data *next; /**< The next entry in the sequence. */
   unsigned char next_merged;     /**< Merge next item into the current one? */
}
mbedtls_asn1_named_data;
/**
 * Container for a sequence or list of 'named' ASN.1 data items
 */

Typedef mbedtls_mpi_sint

typedef int64_t mbedtls_mpi_sint;


      

Typedef mbedtls_mpi_uint

typedef uint64_t mbedtls_mpi_uint;


      

Typedef mbedtls_mpi_sint

typedef int64_t mbedtls_mpi_sint;


      

Typedef mbedtls_mpi_uint

typedef uint64_t mbedtls_mpi_uint;


      

Typedef mbedtls_t_udbl

typedef unsigned int mbedtls_t_udbl __attribute__((mode(TI)));
/* mbedtls_t_udbl defined as 128-bit unsigned int */

Typedef mbedtls_mpi_sint

typedef int64_t mbedtls_mpi_sint;


      

Typedef mbedtls_mpi_uint

typedef uint64_t mbedtls_mpi_uint;


      

Typedef mbedtls_t_udbl

typedef __uint128_t mbedtls_t_udbl;
/* mbedtls_t_udbl defined as 128-bit unsigned int */

Typedef mbedtls_mpi_sint

typedef int64_t mbedtls_mpi_sint;
/* Force 64-bit integers with unknown compiler */

Typedef mbedtls_mpi_uint

typedef uint64_t mbedtls_mpi_uint;


      

Typedef mbedtls_mpi_sint

typedef int32_t mbedtls_mpi_sint;


      

Typedef mbedtls_mpi_uint

typedef uint32_t mbedtls_mpi_uint;


      

Typedef mbedtls_t_udbl

typedef uint64_t mbedtls_t_udbl;


      

Typedef mbedtls_mpi;

typedef struct mbedtls_mpi
{
   int s;             /*!<  integer sign      */
   size_t n;          /*!<  total # of limbs  */
   mbedtls_mpi_uint *p;         /*!<  pointer to limbs  */
}
mbedtls_mpi;
/**
 * \brief          MPI structure
 */

Typedef mbedtls_mpi_gen_prime_flag_t;

typedef enum {
   MBEDTLS_MPI_GEN_PRIME_FLAG_DH =     1, /**< (X-1)/2 is prime too */
   MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR = 2, /**< lower error rate from 2-80 to 2-128 */
} mbedtls_mpi_gen_prime_flag_t;
/**
 * \brief Flags for mbedtls_mpi_gen_prime()
 *
 * Each of these flags is a constraint on the result X returned by
 * mbedtls_mpi_gen_prime().
 */

Typedef mbedtls_blowfish_context;

typedef struct mbedtls_blowfish_context
{
   uint32_t P[MBEDTLS_BLOWFISH_ROUNDS + 2];   /*!<  Blowfish round keys    */
   uint32_t S[4][256];                /*!<  key dependent S-boxes  */
}
mbedtls_blowfish_context;
/**
 * \brief          Blowfish context structure
 */

Typedef mbedtls_camellia_context;

typedef struct mbedtls_camellia_context
{
   int nr;                    /*!<  number of rounds  */
   uint32_t rk[68];           /*!<  CAMELLIA round keys    */
}
mbedtls_camellia_context;
/**
 * \brief          CAMELLIA context structure
 */

Typedef mbedtls_ccm_context;

typedef struct mbedtls_ccm_context
{
   mbedtls_cipher_context_t cipher_ctx;   /*!< The cipher context used. */
}
mbedtls_ccm_context;
/**
 * \brief    The CCM context-type definition. The CCM context is passed
 *           to the APIs called.
 */

Typedef mbedtls_chacha20_context;

typedef struct mbedtls_chacha20_context
{
   uint32_t state[16];         /*! The state (before round operations). */
   uint8_t keystream8[64];    /*! Leftover keystream bytes. */
   size_t keystream_bytes_used; /*! Number of keystream bytes already used. */
}
mbedtls_chacha20_context;


      

Typedef mbedtls_chachapoly_mode_t;

typedef enum
{
   MBEDTLS_CHACHAPOLY_ENCRYPT,    /**< The mode value for performing encryption. */
   MBEDTLS_CHACHAPOLY_DECRYPT     /**< The mode value for performing decryption. */
}
mbedtls_chachapoly_mode_t;


      

Typedef mbedtls_chachapoly_context;

typedef struct mbedtls_chachapoly_context
{
   mbedtls_chacha20_context chacha20_ctx; /**< The ChaCha20 context. */
   mbedtls_poly1305_context poly1305_ctx; /**< The Poly1305 context. */
   uint64_t aad_len;                      /**< The length (bytes) of the Additional Authenticated Data. */
   uint64_t ciphertext_len;               /**< The length (bytes) of the ciphertext. */
   int state;                             /**< The current state of the context. */
   mbedtls_chachapoly_mode_t mode;        /**< Cipher mode (encrypt or decrypt). */
}
mbedtls_chachapoly_context;


      

Typedef mbedtls_iso_c_forbids_empty_translation_units

typedef int mbedtls_iso_c_forbids_empty_translation_units;
/*
 * Avoid warning from -pedantic. This is a convenient place for this
 * workaround since this is included by every single file before the
 * #if defined(MBEDTLS_xxx_C) that results in emtpy translation units.
 */

Typedef mbedtls_cipher_id_t;

typedef enum {
   MBEDTLS_CIPHER_ID_NONE = 0, /**< Placeholder to mark the end of cipher ID lists. */
   MBEDTLS_CIPHER_ID_NULL,     /**< The identity cipher, treated as a stream cipher. */
   MBEDTLS_CIPHER_ID_AES,      /**< The AES cipher. */
   MBEDTLS_CIPHER_ID_DES,      /**< The DES cipher. */
   MBEDTLS_CIPHER_ID_3DES,     /**< The Triple DES cipher. */
   MBEDTLS_CIPHER_ID_CAMELLIA, /**< The Camellia cipher. */
   MBEDTLS_CIPHER_ID_BLOWFISH, /**< The Blowfish cipher. */
   MBEDTLS_CIPHER_ID_ARC4,     /**< The RC4 cipher. */
   MBEDTLS_CIPHER_ID_ARIA,     /**< The Aria cipher. */
   MBEDTLS_CIPHER_ID_CHACHA20, /**< The ChaCha20 cipher. */
} mbedtls_cipher_id_t;
/**
 * \brief     Supported cipher types.
 *
 * \warning   RC4 and DES are considered weak ciphers and their use
 *            constitutes a security risk. Arm recommends considering stronger
 *            ciphers instead.
 */

Typedef mbedtls_cipher_type_t;

typedef enum {
   MBEDTLS_CIPHER_NONE = 0,            /**< Placeholder to mark the end of cipher-pair lists. */
   MBEDTLS_CIPHER_NULL,                /**< The identity stream cipher. */
   MBEDTLS_CIPHER_AES_128_ECB,         /**< AES cipher with 128-bit ECB mode. */
   MBEDTLS_CIPHER_AES_192_ECB,         /**< AES cipher with 192-bit ECB mode. */
   MBEDTLS_CIPHER_AES_256_ECB,         /**< AES cipher with 256-bit ECB mode. */
   MBEDTLS_CIPHER_AES_128_CBC,         /**< AES cipher with 128-bit CBC mode. */
   MBEDTLS_CIPHER_AES_192_CBC,         /**< AES cipher with 192-bit CBC mode. */
   MBEDTLS_CIPHER_AES_256_CBC,         /**< AES cipher with 256-bit CBC mode. */
   MBEDTLS_CIPHER_AES_128_CFB128,      /**< AES cipher with 128-bit CFB128 mode. */
   MBEDTLS_CIPHER_AES_192_CFB128,      /**< AES cipher with 192-bit CFB128 mode. */
   MBEDTLS_CIPHER_AES_256_CFB128,      /**< AES cipher with 256-bit CFB128 mode. */
   MBEDTLS_CIPHER_AES_128_CTR,         /**< AES cipher with 128-bit CTR mode. */
   MBEDTLS_CIPHER_AES_192_CTR,         /**< AES cipher with 192-bit CTR mode. */
   MBEDTLS_CIPHER_AES_256_CTR,         /**< AES cipher with 256-bit CTR mode. */
   MBEDTLS_CIPHER_AES_128_GCM,         /**< AES cipher with 128-bit GCM mode. */
   MBEDTLS_CIPHER_AES_192_GCM,         /**< AES cipher with 192-bit GCM mode. */
   MBEDTLS_CIPHER_AES_256_GCM,         /**< AES cipher with 256-bit GCM mode. */
   MBEDTLS_CIPHER_CAMELLIA_128_ECB,    /**< Camellia cipher with 128-bit ECB mode. */
   MBEDTLS_CIPHER_CAMELLIA_192_ECB,    /**< Camellia cipher with 192-bit ECB mode. */
   MBEDTLS_CIPHER_CAMELLIA_256_ECB,    /**< Camellia cipher with 256-bit ECB mode. */
   MBEDTLS_CIPHER_CAMELLIA_128_CBC,    /**< Camellia cipher with 128-bit CBC mode. */
   MBEDTLS_CIPHER_CAMELLIA_192_CBC,    /**< Camellia cipher with 192-bit CBC mode. */
   MBEDTLS_CIPHER_CAMELLIA_256_CBC,    /**< Camellia cipher with 256-bit CBC mode. */
   MBEDTLS_CIPHER_CAMELLIA_128_CFB128, /**< Camellia cipher with 128-bit CFB128 mode. */
   MBEDTLS_CIPHER_CAMELLIA_192_CFB128, /**< Camellia cipher with 192-bit CFB128 mode. */
   MBEDTLS_CIPHER_CAMELLIA_256_CFB128, /**< Camellia cipher with 256-bit CFB128 mode. */
   MBEDTLS_CIPHER_CAMELLIA_128_CTR,    /**< Camellia cipher with 128-bit CTR mode. */
   MBEDTLS_CIPHER_CAMELLIA_192_CTR,    /**< Camellia cipher with 192-bit CTR mode. */
   MBEDTLS_CIPHER_CAMELLIA_256_CTR,    /**< Camellia cipher with 256-bit CTR mode. */
   MBEDTLS_CIPHER_CAMELLIA_128_GCM,    /**< Camellia cipher with 128-bit GCM mode. */
   MBEDTLS_CIPHER_CAMELLIA_192_GCM,    /**< Camellia cipher with 192-bit GCM mode. */
   MBEDTLS_CIPHER_CAMELLIA_256_GCM,    /**< Camellia cipher with 256-bit GCM mode. */
   MBEDTLS_CIPHER_DES_ECB,             /**< DES cipher with ECB mode. */
   MBEDTLS_CIPHER_DES_CBC,             /**< DES cipher with CBC mode. */
   MBEDTLS_CIPHER_DES_EDE_ECB,         /**< DES cipher with EDE ECB mode. */
   MBEDTLS_CIPHER_DES_EDE_CBC,         /**< DES cipher with EDE CBC mode. */
   MBEDTLS_CIPHER_DES_EDE3_ECB,        /**< DES cipher with EDE3 ECB mode. */
   MBEDTLS_CIPHER_DES_EDE3_CBC,        /**< DES cipher with EDE3 CBC mode. */
   MBEDTLS_CIPHER_BLOWFISH_ECB,        /**< Blowfish cipher with ECB mode. */
   MBEDTLS_CIPHER_BLOWFISH_CBC,        /**< Blowfish cipher with CBC mode. */
   MBEDTLS_CIPHER_BLOWFISH_CFB64,      /**< Blowfish cipher with CFB64 mode. */
   MBEDTLS_CIPHER_BLOWFISH_CTR,        /**< Blowfish cipher with CTR mode. */
   MBEDTLS_CIPHER_ARC4_128,            /**< RC4 cipher with 128-bit mode. */
   MBEDTLS_CIPHER_AES_128_CCM,         /**< AES cipher with 128-bit CCM mode. */
   MBEDTLS_CIPHER_AES_192_CCM,         /**< AES cipher with 192-bit CCM mode. */
   MBEDTLS_CIPHER_AES_256_CCM,         /**< AES cipher with 256-bit CCM mode. */
   MBEDTLS_CIPHER_CAMELLIA_128_CCM,    /**< Camellia cipher with 128-bit CCM mode. */
   MBEDTLS_CIPHER_CAMELLIA_192_CCM,    /**< Camellia cipher with 192-bit CCM mode. */
   MBEDTLS_CIPHER_CAMELLIA_256_CCM,    /**< Camellia cipher with 256-bit CCM mode. */
   MBEDTLS_CIPHER_ARIA_128_ECB,        /**< Aria cipher with 128-bit key and ECB mode. */
   MBEDTLS_CIPHER_ARIA_192_ECB,        /**< Aria cipher with 192-bit key and ECB mode. */
   MBEDTLS_CIPHER_ARIA_256_ECB,        /**< Aria cipher with 256-bit key and ECB mode. */
   MBEDTLS_CIPHER_ARIA_128_CBC,        /**< Aria cipher with 128-bit key and CBC mode. */
   MBEDTLS_CIPHER_ARIA_192_CBC,        /**< Aria cipher with 192-bit key and CBC mode. */
   MBEDTLS_CIPHER_ARIA_256_CBC,        /**< Aria cipher with 256-bit key and CBC mode. */
   MBEDTLS_CIPHER_ARIA_128_CFB128,     /**< Aria cipher with 128-bit key and CFB-128 mode. */
   MBEDTLS_CIPHER_ARIA_192_CFB128,     /**< Aria cipher with 192-bit key and CFB-128 mode. */
   MBEDTLS_CIPHER_ARIA_256_CFB128,     /**< Aria cipher with 256-bit key and CFB-128 mode. */
   MBEDTLS_CIPHER_ARIA_128_CTR,        /**< Aria cipher with 128-bit key and CTR mode. */
   MBEDTLS_CIPHER_ARIA_192_CTR,        /**< Aria cipher with 192-bit key and CTR mode. */
   MBEDTLS_CIPHER_ARIA_256_CTR,        /**< Aria cipher with 256-bit key and CTR mode. */
   MBEDTLS_CIPHER_ARIA_128_GCM,        /**< Aria cipher with 128-bit key and GCM mode. */
   MBEDTLS_CIPHER_ARIA_192_GCM,        /**< Aria cipher with 192-bit key and GCM mode. */
   MBEDTLS_CIPHER_ARIA_256_GCM,        /**< Aria cipher with 256-bit key and GCM mode. */
   MBEDTLS_CIPHER_ARIA_128_CCM,        /**< Aria cipher with 128-bit key and CCM mode. */
   MBEDTLS_CIPHER_ARIA_192_CCM,        /**< Aria cipher with 192-bit key and CCM mode. */
   MBEDTLS_CIPHER_ARIA_256_CCM,        /**< Aria cipher with 256-bit key and CCM mode. */
   MBEDTLS_CIPHER_AES_128_OFB,         /**< AES 128-bit cipher in OFB mode. */
   MBEDTLS_CIPHER_AES_192_OFB,         /**< AES 192-bit cipher in OFB mode. */
   MBEDTLS_CIPHER_AES_256_OFB,         /**< AES 256-bit cipher in OFB mode. */
   MBEDTLS_CIPHER_AES_128_XTS,         /**< AES 128-bit cipher in XTS block mode. */
   MBEDTLS_CIPHER_AES_256_XTS,         /**< AES 256-bit cipher in XTS block mode. */
   MBEDTLS_CIPHER_CHACHA20,            /**< ChaCha20 stream cipher. */
   MBEDTLS_CIPHER_CHACHA20_POLY1305,   /**< ChaCha20-Poly1305 AEAD cipher. */
} mbedtls_cipher_type_t;
/**
 * \brief     Supported {cipher type, cipher mode} pairs.
 *
 * \warning   RC4 and DES are considered weak ciphers and their use
 *            constitutes a security risk. Arm recommends considering stronger
 *            ciphers instead.
 */

Typedef mbedtls_cipher_mode_t;

typedef enum {
   MBEDTLS_MODE_NONE = 0,              /**< None. */
   MBEDTLS_MODE_ECB,                   /**< The ECB cipher mode. */
   MBEDTLS_MODE_CBC,                   /**< The CBC cipher mode. */
   MBEDTLS_MODE_CFB,                   /**< The CFB cipher mode. */
   MBEDTLS_MODE_OFB,                   /**< The OFB cipher mode. */
   MBEDTLS_MODE_CTR,                   /**< The CTR cipher mode. */
   MBEDTLS_MODE_GCM,                   /**< The GCM cipher mode. */
   MBEDTLS_MODE_STREAM,                /**< The stream cipher mode. */
   MBEDTLS_MODE_CCM,                   /**< The CCM cipher mode. */
   MBEDTLS_MODE_XTS,                   /**< The XTS cipher mode. */
   MBEDTLS_MODE_CHACHAPOLY,            /**< The ChaCha-Poly cipher mode. */
} mbedtls_cipher_mode_t;
/** Supported cipher modes. */

Typedef mbedtls_cipher_padding_t;

typedef enum {
   MBEDTLS_PADDING_PKCS7 = 0,    /**< PKCS7 padding (default).        */
   MBEDTLS_PADDING_ONE_AND_ZEROS, /**< ISO/IEC 7816-4 padding.         */
   MBEDTLS_PADDING_ZEROS_AND_LEN, /**< ANSI X.923 padding.             */
   MBEDTLS_PADDING_ZEROS,        /**< Zero padding (not reversible). */
   MBEDTLS_PADDING_NONE,         /**< Never pad (full blocks only).   */
} mbedtls_cipher_padding_t;
/** Supported cipher padding types. */

Typedef mbedtls_operation_t;

typedef enum {
   MBEDTLS_OPERATION_NONE = -1,
   MBEDTLS_DECRYPT = 0,
   MBEDTLS_ENCRYPT,
} mbedtls_operation_t;
/** Type of operation. */

Typedef mbedtls_cipher_base_t

typedef struct mbedtls_cipher_base_t mbedtls_cipher_base_t;
/**
 * Base cipher information (opaque struct).
 */

Typedef mbedtls_cmac_context_t

typedef struct mbedtls_cmac_context_t mbedtls_cmac_context_t;
/**
 * CMAC context (opaque struct).
 */

Typedef mbedtls_cipher_info_t;

typedef struct mbedtls_cipher_info_t
{
   /** Full cipher identifier. For example,
     * MBEDTLS_CIPHER_AES_256_CBC.
     */
   mbedtls_cipher_type_t type;

   /** The cipher mode. For example, MBEDTLS_MODE_CBC. */
   mbedtls_cipher_mode_t mode;

   /** The cipher key length, in bits. This is the
     * default length for variable sized ciphers.
     * Includes parity bits for ciphers like DES.
     */
   unsigned int key_bitlen;

   /** Name of the cipher. */
   const char * name;

   /** IV or nonce size, in Bytes.
     * For ciphers that accept variable IV sizes,
     * this is the recommended size.
     */
   unsigned int iv_size;

   /** Bitflag comprised of MBEDTLS_CIPHER_VARIABLE_IV_LEN and
     *  MBEDTLS_CIPHER_VARIABLE_KEY_LEN indicating whether the
     *  cipher supports variable IV or variable key sizes, respectively.
     */
   int flags;

   /** The block size, in Bytes. */
   unsigned int block_size;

   /** Struct for base cipher information and functions. */
   const mbedtls_cipher_base_t *base;

} mbedtls_cipher_info_t;
/**
 * Cipher information. Allows calling cipher functions
 * in a generic way.
 */

Typedef mbedtls_cipher_context_t;

typedef struct mbedtls_cipher_context_t
{
   /** Information about the associated cipher. */
   const mbedtls_cipher_info_t *cipher_info;

   /** Key length to use. */
   int key_bitlen;

   /** Operation that the key of the context has been
     * initialized for.
     */
   mbedtls_operation_t operation;

#if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING)
   /** Padding functions to use, if relevant for
     * the specific cipher mode.
     */
   void (*add_padding)( unsigned char *output, size_t olen, size_t data_len );
   int (*get_padding)( unsigned char *input, size_t ilen, size_t *data_len );
#endif

   /** Buffer for input that has not been processed yet. */
   unsigned char unprocessed_data[MBEDTLS_MAX_BLOCK_LENGTH];

   /** Number of Bytes that have not been processed yet. */
   size_t unprocessed_len;

   /** Current IV or NONCE_COUNTER for CTR-mode, data unit (or sector) number
     * for XTS-mode. */
   unsigned char iv[MBEDTLS_MAX_IV_LENGTH];

   /** IV size in Bytes, for ciphers with variable-length IVs. */
   size_t iv_size;

   /** The cipher-specific context. */
   void *cipher_ctx;

#if defined(MBEDTLS_CMAC_C)
   /** CMAC-specific context. */
   mbedtls_cmac_context_t *cmac_ctx;
#endif
} mbedtls_cipher_context_t;
/**
 * Generic cipher context.
 */

Typedef mbedtls_cipher_definition_t;

typedef struct
{
   mbedtls_cipher_type_t type;
   const mbedtls_cipher_info_t *info;
} mbedtls_cipher_definition_t;


      

Typedef mbedtls_ctr_drbg_context;

typedef struct mbedtls_ctr_drbg_context
{
   unsigned char counter[16]; /*!< The counter (V). */
   int reseed_counter;        /*!< The reseed counter. */
   int prediction_resistance; /*!< This determines whether prediction
                                     resistance is enabled, that is
                                     whether to systematically reseed before
                                     each random generation. */
   size_t entropy_len;        /*!< The amount of entropy grabbed on each
                                     seed or reseed operation. */
   int reseed_interval;       /*!< The reseed interval. */

   mbedtls_aes_context aes_ctx;       /*!< The AES context. */

   /*
     * Callbacks (Entropy)
     */
   int (*f_entropy)(void *, unsigned char *, size_t);
                               /*!< The entropy callback function. */

   void *p_entropy;           /*!< The context for the entropy function. */

#if defined(MBEDTLS_THREADING_C)
   mbedtls_threading_mutex_t mutex;
#endif
}
mbedtls_ctr_drbg_context;
/**
 * \brief          The CTR_DRBG context structure.
 */

Typedef mbedtls_debug_ecdh_attr;

typedef enum
{
   MBEDTLS_DEBUG_ECDH_Q,
   MBEDTLS_DEBUG_ECDH_QP,
   MBEDTLS_DEBUG_ECDH_Z,
} mbedtls_debug_ecdh_attr;


      

Typedef mbedtls_des_context;

typedef struct mbedtls_des_context
{
   uint32_t sk[32];           /*!<  DES subkeys       */
}
mbedtls_des_context;
/**
 * \brief          DES context structure
 *
 * \warning        DES is considered a weak cipher and its use constitutes a
 *                 security risk. We recommend considering stronger ciphers
 *                 instead.
 */

Typedef mbedtls_des3_context;

typedef struct mbedtls_des3_context
{
   uint32_t sk[96];           /*!<  3DES subkeys      */
}
mbedtls_des3_context;
/**
 * \brief          Triple-DES context structure
 */

Typedef mbedtls_dhm_context;

typedef struct mbedtls_dhm_context
{
   size_t len;        /*!<  The size of \p P in Bytes. */
   mbedtls_mpi P;     /*!<  The prime modulus. */
   mbedtls_mpi G;     /*!<  The generator. */
   mbedtls_mpi X;     /*!<  Our secret value. */
   mbedtls_mpi GX;    /*!<  Our public key = \c G^X mod \c P. */
   mbedtls_mpi GY;    /*!<  The public key of the peer = \c G^Y mod \c P. */
   mbedtls_mpi K;     /*!<  The shared secret = \c G^(XY) mod \c P. */
   mbedtls_mpi RP;    /*!<  The cached value = \c R^2 mod \c P. */
   mbedtls_mpi Vi;    /*!<  The blinding value. */
   mbedtls_mpi Vf;    /*!<  The unblinding value. */
   mbedtls_mpi pX;    /*!<  The previous \c X. */
}
mbedtls_dhm_context;
/**
 * \brief          The DHM context structure.
 */

Typedef mbedtls_ecdh_side;

typedef enum
{
   MBEDTLS_ECDH_OURS,  /**< Our key. */
   MBEDTLS_ECDH_THEIRS, /**< The key of the peer. */
} mbedtls_ecdh_side;
/**
 * Defines the source of the imported EC key.
 */

Typedef mbedtls_ecdh_variant;

typedef enum
{
   MBEDTLS_ECDH_VARIANT_NONE = 0,  /*!< Implementation not defined. */
   MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0,/*!< The default Mbed TLS implementation */
} mbedtls_ecdh_variant;
/**
 * Defines the ECDH implementation used.
 *
 * Later versions of the library may add new variants, therefore users should
 * not make any assumptions about them.
 */

Typedef mbedtls_ecdh_context_mbed;

typedef struct mbedtls_ecdh_context_mbed
{
   mbedtls_ecp_group grp;  /*!< The elliptic curve used. */
   mbedtls_mpi d;          /*!< The private key. */
   mbedtls_ecp_point Q;    /*!< The public key. */
   mbedtls_ecp_point Qp;   /*!< The value of the public key of the peer. */
   mbedtls_mpi z;          /*!< The shared secret. */
#if defined(MBEDTLS_ECP_RESTARTABLE)
   mbedtls_ecp_restart_ctx rs; /*!< The restart context for EC computations. */
#endif
} mbedtls_ecdh_context_mbed;
/**
 * The context used by the default ECDH implementation.
 *
 * Later versions might change the structure of this context, therefore users
 * should not make any assumptions about the structure of
 * mbedtls_ecdh_context_mbed.
 */

Typedef mbedtls_ecdh_context;

typedef struct mbedtls_ecdh_context
{
#if defined(MBEDTLS_ECDH_LEGACY_CONTEXT)
   mbedtls_ecp_group grp;  /*!< The elliptic curve used. */
   mbedtls_mpi d;          /*!< The private key. */
   mbedtls_ecp_point Q;    /*!< The public key. */
   mbedtls_ecp_point Qp;   /*!< The value of the public key of the peer. */
   mbedtls_mpi z;          /*!< The shared secret. */
   int point_format;       /*!< The format of point export in TLS messages. */
   mbedtls_ecp_point Vi;   /*!< The blinding value. */
   mbedtls_ecp_point Vf;   /*!< The unblinding value. */
   mbedtls_mpi _d;         /*!< The previous \p d. */
#if defined(MBEDTLS_ECP_RESTARTABLE)
   int restart_enabled;       /*!< The flag for restartable mode. */
   mbedtls_ecp_restart_ctx rs; /*!< The restart context for EC computations. */
#endif /* MBEDTLS_ECP_RESTARTABLE */
#else
   uint8_t point_format;      /*!< The format of point export in TLS messages
                                  as defined in RFC 4492. */
   mbedtls_ecp_group_id grp_id;/*!< The elliptic curve used. */
   mbedtls_ecdh_variant var;  /*!< The ECDH implementation/structure used. */
   union
   {
       mbedtls_ecdh_context_mbed  mbed_ecdh;
   } ctx;                                          /*!< Implementation-specific context. The
                                  context in use is specified by the \c var
                                  field. */
#if defined(MBEDTLS_ECP_RESTARTABLE)
   uint8_t restart_enabled;      /*!< The flag for restartable mode. Functions of
                                  an alternative implementation not supporting
                                  restartable mode must return
                                  MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED error
                                  if this flag is set. */
#endif /* MBEDTLS_ECP_RESTARTABLE */
#endif /* MBEDTLS_ECDH_LEGACY_CONTEXT */
}
mbedtls_ecdh_context;
/**
 *
 * \warning         Performing multiple operations concurrently on the same
 *                  ECDSA context is not supported; objects of this type
 *                  should not be shared between multiple threads.
 * \brief           The ECDH context structure.
 */

Typedef mbedtls_ecdsa_context

typedef mbedtls_ecp_keypair mbedtls_ecdsa_context;
/**
 * \brief           The ECDSA context structure.
 *
 * \warning         Performing multiple operations concurrently on the same
 *                  ECDSA context is not supported; objects of this type
 *                  should not be shared between multiple threads.
 */

Typedef mbedtls_ecdsa_restart_ver_ctx

typedef struct mbedtls_ecdsa_restart_ver mbedtls_ecdsa_restart_ver_ctx;
/**
 * \brief           Internal restart context for ecdsa_verify()
 *
 * \note            Opaque struct, defined in ecdsa.c
 */

Typedef mbedtls_ecdsa_restart_sig_ctx

typedef struct mbedtls_ecdsa_restart_sig mbedtls_ecdsa_restart_sig_ctx;
/**
 * \brief           Internal restart context for ecdsa_sign()
 *
 * \note            Opaque struct, defined in ecdsa.c
 */

Typedef mbedtls_ecdsa_restart_det_ctx

typedef struct mbedtls_ecdsa_restart_det mbedtls_ecdsa_restart_det_ctx;
/**
 * \brief           Internal restart context for ecdsa_sign_det()
 *
 * \note            Opaque struct, defined in ecdsa.c
 */

Typedef mbedtls_ecdsa_restart_ctx;

typedef struct
{
   mbedtls_ecp_restart_ctx ecp;       /*!<  base context for ECP restart and
                                              shared administrative info    */
   mbedtls_ecdsa_restart_ver_ctx *ver; /*!<  ecdsa_verify() sub-context    */
   mbedtls_ecdsa_restart_sig_ctx *sig; /*!<  ecdsa_sign() sub-context      */
#if defined(MBEDTLS_ECDSA_DETERMINISTIC)
   mbedtls_ecdsa_restart_det_ctx *det; /*!<  ecdsa_sign_det() sub-context  */
#endif
} mbedtls_ecdsa_restart_ctx;
/**
 * \brief           General context for resuming ECDSA operations
 */

Typedef mbedtls_ecdsa_restart_ctx

typedef void mbedtls_ecdsa_restart_ctx;
/* Now we can declare functions that take a pointer to that */

Typedef mbedtls_ecjpake_role;

typedef enum {
   MBEDTLS_ECJPAKE_CLIENT = 0,        /**< Client                         */
   MBEDTLS_ECJPAKE_SERVER,            /**< Server                         */
} mbedtls_ecjpake_role;
/**
 * Roles in the EC J-PAKE exchange
 */

Typedef mbedtls_ecjpake_context;

typedef struct mbedtls_ecjpake_context
{
   const mbedtls_md_info_t *md_info;  /**< Hash to use                    */
   mbedtls_ecp_group grp;             /**< Elliptic curve                 */
   mbedtls_ecjpake_role role;         /**< Are we client or server?       */
   int point_format;                  /**< Format for point export        */

   mbedtls_ecp_point Xm1;             /**< My public key 1   C: X1, S: X3 */
   mbedtls_ecp_point Xm2;             /**< My public key 2   C: X2, S: X4 */
   mbedtls_ecp_point Xp1;             /**< Peer public key 1 C: X3, S: X1 */
   mbedtls_ecp_point Xp2;             /**< Peer public key 2 C: X4, S: X2 */
   mbedtls_ecp_point Xp;              /**< Peer public key   C: Xs, S: Xc */

   mbedtls_mpi xm1;                   /**< My private key 1  C: x1, S: x3 */
   mbedtls_mpi xm2;                   /**< My private key 2  C: x2, S: x4 */

   mbedtls_mpi s;                     /**< Pre-shared secret (passphrase) */
} mbedtls_ecjpake_context;
/**
 * EC J-PAKE context structure.
 *
 * J-PAKE is a symmetric protocol, except for the identifiers used in
 * Zero-Knowledge Proofs, and the serialization of the second message
 * (KeyExchange) as defined by the Thread spec.
 *
 * In order to benefit from this symmetry, we choose a different naming
 * convetion from the Thread v1.0 spec. Correspondance is indicated in the
 * description as a pair C: client name, S: server name
 */

Typedef mbedtls_ecp_group_id;

typedef enum
{
   MBEDTLS_ECP_DP_NONE = 0,      /*!< Curve not defined. */
   MBEDTLS_ECP_DP_SECP192R1,     /*!< Domain parameters for the 192-bit curve defined by FIPS 186-4 and SEC1. */
   MBEDTLS_ECP_DP_SECP224R1,     /*!< Domain parameters for the 224-bit curve defined by FIPS 186-4 and SEC1. */
   MBEDTLS_ECP_DP_SECP256R1,     /*!< Domain parameters for the 256-bit curve defined by FIPS 186-4 and SEC1. */
   MBEDTLS_ECP_DP_SECP384R1,     /*!< Domain parameters for the 384-bit curve defined by FIPS 186-4 and SEC1. */
   MBEDTLS_ECP_DP_SECP521R1,     /*!< Domain parameters for the 521-bit curve defined by FIPS 186-4 and SEC1. */
   MBEDTLS_ECP_DP_BP256R1,       /*!< Domain parameters for 256-bit Brainpool curve. */
   MBEDTLS_ECP_DP_BP384R1,       /*!< Domain parameters for 384-bit Brainpool curve. */
   MBEDTLS_ECP_DP_BP512R1,       /*!< Domain parameters for 512-bit Brainpool curve. */
   MBEDTLS_ECP_DP_CURVE25519,    /*!< Domain parameters for Curve25519. */
   MBEDTLS_ECP_DP_SECP192K1,     /*!< Domain parameters for 192-bit "Koblitz" curve. */
   MBEDTLS_ECP_DP_SECP224K1,     /*!< Domain parameters for 224-bit "Koblitz" curve. */
   MBEDTLS_ECP_DP_SECP256K1,     /*!< Domain parameters for 256-bit "Koblitz" curve. */
   MBEDTLS_ECP_DP_CURVE448,      /*!< Domain parameters for Curve448. */
} mbedtls_ecp_group_id;
/**
 * Domain-parameter identifiers: curve, subgroup, and generator.
 *
 * \note Only curves over prime fields are supported.
 *
 * \warning This library does not support validation of arbitrary domain
 * parameters. Therefore, only standardized domain parameters from trusted
 * sources should be used. See mbedtls_ecp_group_load().
 */

Typedef mbedtls_ecp_curve_info;

typedef struct mbedtls_ecp_curve_info
{
   mbedtls_ecp_group_id grp_id;   /*!< An internal identifier. */
   uint16_t tls_id;               /*!< The TLS NamedCurve identifier. */
   uint16_t bit_size;             /*!< The curve size in bits. */
   const char *name;              /*!< A human-friendly name. */
} mbedtls_ecp_curve_info;
/**
 * Curve information, for use by other modules.
 */

Typedef mbedtls_ecp_point;

typedef struct mbedtls_ecp_point
{
   mbedtls_mpi X;         /*!< The X coordinate of the ECP point. */
   mbedtls_mpi Y;         /*!< The Y coordinate of the ECP point. */
   mbedtls_mpi Z;         /*!< The Z coordinate of the ECP point. */
}
mbedtls_ecp_point;
/**
 * \brief           The ECP point structure, in Jacobian coordinates.
 *
 * \note            All functions expect and return points satisfying
 *                  the following condition: Z == 0 or
 *                  Z == 1. Other values of \p Z are
 *                  used only by internal functions.
 *                  The point is zero, or "at infinity", if Z == 0.
 *                  Otherwise, \p X and \p Y are its standard (affine)
 *                  coordinates.
 */

Typedef mbedtls_ecp_group;

typedef struct mbedtls_ecp_group
{
   mbedtls_ecp_group_id id;   /*!< An internal group identifier. */
   mbedtls_mpi P;             /*!< The prime modulus of the base field. */
   mbedtls_mpi A;             /*!< For Short Weierstrass: \p A in the equation. For
                                     Montgomery curves: (A + 2) / 4. */
   mbedtls_mpi B;             /*!< For Short Weierstrass: \p B in the equation.
                                     For Montgomery curves: unused. */
   mbedtls_ecp_point G;       /*!< The generator of the subgroup used. */
   mbedtls_mpi N;             /*!< The order of \p G. */
   size_t pbits;              /*!< The number of bits in \p P.*/
   size_t nbits;              /*!< For Short Weierstrass: The number of bits in \p P.
                                     For Montgomery curves: the number of bits in the
                                     private keys. */
   unsigned int h;            /*!< \internal 1 if the constants are static. */
   int (*modp)(mbedtls_mpi *); /*!< The function for fast pseudo-reduction
                                     mod \p P (see above).*/
   int (*t_pre)(mbedtls_ecp_point *, void *); /*!< Unused. */
   int (*t_post)(mbedtls_ecp_point *, void *); /*!< Unused. */
   void *t_data;              /*!< Unused. */
   mbedtls_ecp_point *T;      /*!< Pre-computed points for ecp_mul_comb(). */
   size_t T_size;             /*!< The number of pre-computed points. */
}
mbedtls_ecp_group;
/**
 * \brief           The ECP group structure.
 *
 * We consider two types of curve equations:
 * 
  • Short Weierstrass: y^2 = x^3 + A x + B mod P * (SEC1 + RFC-4492)
  • *
  • Montgomery: y^2 = x^3 + A x^2 + x mod P (Curve25519, * Curve448)
* In both cases, the generator (\p G) for a prime-order subgroup is fixed. * * For Short Weierstrass, this subgroup is the whole curve, and its * cardinality is denoted by \p N. Our code requires that \p N is an * odd prime as mbedtls_ecp_mul() requires an odd number, and * mbedtls_ecdsa_sign() requires that it is prime for blinding purposes. * * For Montgomery curves, we do not store \p A, but (A + 2) / 4, * which is the quantity used in the formulas. Additionally, \p nbits is * not the size of \p N but the required size for private keys. * * If \p modp is NULL, reduction modulo \p P is done using a generic algorithm. * Otherwise, \p modp must point to a function that takes an \p mbedtls_mpi in the * range of 0..2^(2*pbits)-1, and transforms it in-place to an integer * which is congruent mod \p P to the given MPI, and is close enough to \p pbits * in size, so that it may be efficiently brought in the 0..P-1 range by a few * additions or subtractions. Therefore, it is only an approximative modular * reduction. It must return 0 on success and non-zero on failure. * * \note Alternative implementations must keep the group IDs distinct. If * two group structures have the same ID, then they must be * identical. * */

Typedef mbedtls_ecp_restart_mul_ctx

typedef struct mbedtls_ecp_restart_mul mbedtls_ecp_restart_mul_ctx;
/**
 * \brief           Internal restart context for multiplication
 *
 * \note            Opaque struct
 */

Typedef mbedtls_ecp_restart_muladd_ctx

typedef struct mbedtls_ecp_restart_muladd mbedtls_ecp_restart_muladd_ctx;
/**
 * \brief           Internal restart context for ecp_muladd()
 *
 * \note            Opaque struct
 */

Typedef mbedtls_ecp_restart_ctx;

typedef struct
{
   unsigned ops_done;                 /*!<  current ops count             */
   unsigned depth;                    /*!<  call depth (0 = top-level)    */
   mbedtls_ecp_restart_mul_ctx *rsm;  /*!<  ecp_mul_comb() sub-context    */
   mbedtls_ecp_restart_muladd_ctx *ma; /*!<  ecp_muladd() sub-context      */
} mbedtls_ecp_restart_ctx;
/**
 * \brief           General context for resuming ECC operations
 */

Typedef mbedtls_ecp_restart_ctx

typedef void mbedtls_ecp_restart_ctx;
/* We want to declare restartable versions of existing functions anyway */

Typedef mbedtls_ecp_keypair;

typedef struct mbedtls_ecp_keypair
{
   mbedtls_ecp_group grp;     /*!<  Elliptic curve and base point     */
   mbedtls_mpi d;             /*!<  our secret value                  */
   mbedtls_ecp_point Q;       /*!<  our public value                  */
}
mbedtls_ecp_keypair;
/**
 * \brief    The ECP key-pair structure.
 *
 * A generic key-pair that may be used for ECDSA and fixed ECDH, for example.
 *
 * \note    Members are deliberately in the same order as in the
 *          ::mbedtls_ecdsa_context structure.
 */

Typedef mbedtls_entropy_f_source_ptr

typedef int (*mbedtls_entropy_f_source_ptr)(void *data, unsigned char *output, size_t len,
                           size_t *olen);
/**
 * \brief           Entropy poll callback pointer
 *
 * \param data      Callback-specific data pointer
 * \param output    Data to fill
 * \param len       Maximum size to provide
 * \param olen      The actual amount of bytes put into the buffer (Can be 0)
 *
 * \return          0 if no critical failures occurred,
 *                  MBEDTLS_ERR_ENTROPY_SOURCE_FAILED otherwise
 */

Typedef mbedtls_entropy_source_state;

typedef struct mbedtls_entropy_source_state
{
   mbedtls_entropy_f_source_ptr   f_source;  /**< The entropy source callback */
   void *         p_source;  /**< The callback data pointer */
   size_t         size;      /**< Amount received in bytes */
   size_t         threshold; /**< Minimum bytes required before release */
   int            strong;    /**< Is the source strong? */
}
mbedtls_entropy_source_state;
/**
 * \brief           Entropy source state
 */

Typedef mbedtls_entropy_context;

typedef struct mbedtls_entropy_context
{
   int accumulator_started;
#if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR)
   mbedtls_sha512_context accumulator;
#else
   mbedtls_sha256_context accumulator;
#endif
   int            source_count;
   mbedtls_entropy_source_state   source[MBEDTLS_ENTROPY_MAX_SOURCES];
#if defined(MBEDTLS_HAVEGE_C)
   mbedtls_havege_state   havege_data;
#endif
#if defined(MBEDTLS_THREADING_C)
   mbedtls_threading_mutex_t mutex;   /*!< mutex                  */
#endif
#if defined(MBEDTLS_ENTROPY_NV_SEED)
   int initial_entropy_run;
#endif
}
mbedtls_entropy_context;
/**
 * \brief           Entropy context structure
 */

Typedef mbedtls_gcm_context;

typedef struct mbedtls_gcm_context
{
   mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */
   uint64_t HL[16];                     /*!< Precalculated HTable low. */
   uint64_t HH[16];                     /*!< Precalculated HTable high. */
   uint64_t len;                        /*!< The total length of the encrypted data. */
   uint64_t add_len;                    /*!< The total length of the additional data. */
   unsigned char base_ectr[16];         /*!< The first ECTR for tag. */
   unsigned char y[16];                 /*!< The Y working value. */
   unsigned char buf[16];               /*!< The buf working value. */
   int mode;                            /*!< The operation to perform:
                                               #MBEDTLS_GCM_ENCRYPT or
                                               #MBEDTLS_GCM_DECRYPT. */
}
mbedtls_gcm_context;
/**
 * \brief          The GCM context structure.
 */

Typedef mbedtls_havege_state;

typedef struct mbedtls_havege_state
{
   int PT1, PT2, offset[2];
   int pool[MBEDTLS_HAVEGE_COLLECT_SIZE];
   int WALK[8192];
}
mbedtls_havege_state;
/**
 * \brief          HAVEGE state structure
 */

Typedef mbedtls_hmac_drbg_context;

typedef struct mbedtls_hmac_drbg_context
{
   /* Working state: the key K is not stored explicitely,
     * but is implied by the HMAC context */
   mbedtls_md_context_t md_ctx;                   /*!< HMAC context (inc. K)  */
   unsigned char V[MBEDTLS_MD_MAX_SIZE]; /*!< V in the spec          */
   int reseed_counter;                    /*!< reseed counter         */

   /* Administrative state */
   size_t entropy_len;        /*!< entropy bytes grabbed on each (re)seed */
   int prediction_resistance; /*!< enable prediction resistance (Automatic
                                     reseed before every random generation) */
   int reseed_interval;       /*!< reseed interval   */

   /* Callbacks */
   int (*f_entropy)(void *, unsigned char *, size_t); /*!< entropy function */
   void *p_entropy;           /*!< context for the entropy function        */

#if defined(MBEDTLS_THREADING_C)
   mbedtls_threading_mutex_t mutex;
#endif
} mbedtls_hmac_drbg_context;
/**
 * HMAC_DRBG context.
 */

Typedef mbedtls_md_type_t;

typedef enum {
   MBEDTLS_MD_NONE=0,   /**< None. */
   MBEDTLS_MD_MD2,      /**< The MD2 message digest. */
   MBEDTLS_MD_MD4,      /**< The MD4 message digest. */
   MBEDTLS_MD_MD5,      /**< The MD5 message digest. */
   MBEDTLS_MD_SHA1,     /**< The SHA-1 message digest. */
   MBEDTLS_MD_SHA224,   /**< The SHA-224 message digest. */
   MBEDTLS_MD_SHA256,   /**< The SHA-256 message digest. */
   MBEDTLS_MD_SHA384,   /**< The SHA-384 message digest. */
   MBEDTLS_MD_SHA512,   /**< The SHA-512 message digest. */
   MBEDTLS_MD_RIPEMD160, /**< The RIPEMD-160 message digest. */
} mbedtls_md_type_t;
/**
 * \brief     Supported message digests.
 *
 * \warning   MD2, MD4, MD5 and SHA-1 are considered weak message digests and
 *            their use constitutes a security risk. We recommend considering
 *            stronger message digests instead.
 *
 */

Typedef mbedtls_md_info_t

typedef struct mbedtls_md_info_t mbedtls_md_info_t;
/**
 * Opaque struct defined in md_internal.h.
 */

Typedef mbedtls_md_context_t;

typedef struct mbedtls_md_context_t
{
   /** Information about the associated message digest. */
   const mbedtls_md_info_t *md_info;

   /** The digest-specific context. */
   void *md_ctx;

   /** The HMAC part of the context. */
   void *hmac_ctx;
} mbedtls_md_context_t;
/**
 * The generic message-digest context.
 */

Typedef mbedtls_md2_context;

typedef struct mbedtls_md2_context
{
   unsigned char cksum[16];   /*!< checksum of the data block */
   unsigned char state[48];   /*!< intermediate digest state  */
   unsigned char buffer[16];  /*!< data block being processed */
   size_t left;               /*!< amount of data in buffer   */
}
mbedtls_md2_context;
/**
 * \brief          MD2 context structure
 *
 * \warning        MD2 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Typedef mbedtls_md4_context;

typedef struct mbedtls_md4_context
{
   uint32_t total[2];         /*!< number of bytes processed  */
   uint32_t state[4];         /*!< intermediate digest state  */
   unsigned char buffer[64];  /*!< data block being processed */
}
mbedtls_md4_context;
/**
 * \brief          MD4 context structure
 *
 * \warning        MD4 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Typedef mbedtls_md5_context;

typedef struct mbedtls_md5_context
{
   uint32_t total[2];         /*!< number of bytes processed  */
   uint32_t state[4];         /*!< intermediate digest state  */
   unsigned char buffer[64];  /*!< data block being processed */
}
mbedtls_md5_context;
/**
 * \brief          MD5 context structure
 *
 * \warning        MD5 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Typedef mbedtls_net_context;

typedef struct mbedtls_net_context
{
   int fd;            /**< The underlying file descriptor                 */
}
mbedtls_net_context;
/**
 * Wrapper type for sockets.
 *
 * Currently backed by just a file descriptor, but might be more in the future
 * (eg two file descriptors for combined IPv4 + IPv6 support, or additional
 * structures for hand-made UDP demultiplexing).
 */

Typedef mbedtls_nist_kw_mode_t;

typedef enum
{
   MBEDTLS_KW_MODE_KW = 0,
   MBEDTLS_KW_MODE_KWP = 1
} mbedtls_nist_kw_mode_t;


      

Typedef mbedtls_nist_kw_context;

typedef struct {
   mbedtls_cipher_context_t cipher_ctx;   /*!< The cipher context used. */
} mbedtls_nist_kw_context;
/**
 * \brief    The key wrapping context-type definition. The key wrapping context is passed
 *           to the APIs called.
 *
 * \note     The definition of this type may change in future library versions.
 *           Don't make any assumptions on this context!
 */

Typedef mbedtls_oid_descriptor_t;

typedef struct mbedtls_oid_descriptor_t
{
   const char *asn1;              /*!< OID ASN.1 representation       */
   size_t asn1_len;               /*!< length of asn1                 */
   const char *name;              /*!< official name (e.g. from RFC)  */
   const char *description;       /*!< human friendly description     */
} mbedtls_oid_descriptor_t;
/**
 * \brief Base OID descriptor structure
 */

Typedef mbedtls_pem_context;

typedef struct mbedtls_pem_context
{
   unsigned char *buf;    /*!< buffer for decoded data             */
   size_t buflen;         /*!< length of the buffer                */
   unsigned char *info;   /*!< buffer for extra header information */
}
mbedtls_pem_context;
/**
 * \brief       PEM context structure
 */

Typedef mbedtls_pk_type_t;

typedef enum {
   MBEDTLS_PK_NONE=0,
   MBEDTLS_PK_RSA,
   MBEDTLS_PK_ECKEY,
   MBEDTLS_PK_ECKEY_DH,
   MBEDTLS_PK_ECDSA,
   MBEDTLS_PK_RSA_ALT,
   MBEDTLS_PK_RSASSA_PSS,
} mbedtls_pk_type_t;
/**
 * \brief          Public key types
 */

Typedef mbedtls_pk_rsassa_pss_options;

typedef struct mbedtls_pk_rsassa_pss_options
{
   mbedtls_md_type_t mgf1_hash_id;
   int expected_salt_len;

} mbedtls_pk_rsassa_pss_options;
/**
 * \brief           Options for RSASSA-PSS signature verification.
 *                  See \c mbedtls_rsa_rsassa_pss_verify_ext()
 */

Typedef mbedtls_pk_debug_type;

typedef enum
{
   MBEDTLS_PK_DEBUG_NONE = 0,
   MBEDTLS_PK_DEBUG_MPI,
   MBEDTLS_PK_DEBUG_ECP,
} mbedtls_pk_debug_type;
/**
 * \brief           Types for interfacing with the debug module
 */

Typedef mbedtls_pk_debug_item;

typedef struct mbedtls_pk_debug_item
{
   mbedtls_pk_debug_type type;
   const char *name;
   void *value;
} mbedtls_pk_debug_item;
/**
 * \brief           Item to send to the debug module
 */

Typedef mbedtls_pk_info_t

typedef struct mbedtls_pk_info_t mbedtls_pk_info_t;
/**
 * \brief           Public key information and operations
 */

Typedef mbedtls_pk_context;

typedef struct mbedtls_pk_context
{
   const mbedtls_pk_info_t *  pk_info; /**< Public key information         */
   void *                     pk_ctx; /**< Underlying public key context  */
} mbedtls_pk_context;
/**
 * \brief           Public key container
 */

Typedef mbedtls_pk_restart_ctx;

typedef struct
{
   const mbedtls_pk_info_t *  pk_info; /**< Public key information         */
   void *                     rs_ctx; /**< Underlying restart context     */
} mbedtls_pk_restart_ctx;
#else /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */
/* Now we can declare functions that take a pointer to that */
typedef void mbedtls_pk_restart_ctx;
/**
 * \brief           Context for resuming operations
 */

Typedef mbedtls_pk_rsa_alt_decrypt_func

typedef int (*mbedtls_pk_rsa_alt_decrypt_func)( void *ctx, int mode, size_t *olen,
                   const unsigned char *input, unsigned char *output,
                   size_t output_max_len );
/**
 * \brief           Types for RSA-alt abstraction
 */

Typedef mbedtls_pk_rsa_alt_sign_func

typedef int (*mbedtls_pk_rsa_alt_sign_func)( void *ctx,
                   int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
                   int mode, mbedtls_md_type_t md_alg, unsigned int hashlen,
                   const unsigned char *hash, unsigned char *sig );


      

Typedef size_t

typedef size_t (*mbedtls_pk_rsa_alt_key_len_func)( void *ctx );


      

Typedef mbedtls_rsa_alt_context;

typedef struct
{
   void *key;
   mbedtls_pk_rsa_alt_decrypt_func decrypt_func;
   mbedtls_pk_rsa_alt_sign_func sign_func;
   mbedtls_pk_rsa_alt_key_len_func key_len_func;
} mbedtls_rsa_alt_context;
/* Container for RSA-alt */

Typedef mbedtls_pkcs11_context;

typedef struct mbedtls_pkcs11_context
{
       pkcs11h_certificate_t pkcs11h_cert;
       int len;
} mbedtls_pkcs11_context;
/**
 * Context for PKCS #11 private keys.
 */

Typedef mbedtls_platform_context;

typedef struct mbedtls_platform_context
{
   char dummy; /**< A placeholder member, as empty structs are not portable. */
}
mbedtls_platform_context;
/**
 * \brief   The platform context structure.
 *
 * \note    This structure may be used to assist platform-specific
 *          setup or teardown operations.
 */

Typedef mbedtls_time_t

typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t;
#else
/* For time_t */
#include 
typedef time_t mbedtls_time_t;


      

Typedef mbedtls_poly1305_context;

typedef struct mbedtls_poly1305_context
{
   uint32_t r[4];     /** The value for 'r' (low 128 bits of the key). */
   uint32_t s[4];     /** The value for 's' (high 128 bits of the key). */
   uint32_t acc[5];   /** The accumulator number. */
   uint8_t queue[16]; /** The current partial block of data. */
   size_t queue_len;  /** The number of bytes stored in 'queue'. */
}
mbedtls_poly1305_context;


      

Typedef mbedtls_ripemd160_context;

typedef struct mbedtls_ripemd160_context
{
   uint32_t total[2];         /*!< number of bytes processed  */
   uint32_t state[5];         /*!< intermediate digest state  */
   unsigned char buffer[64];  /*!< data block being processed */
}
mbedtls_ripemd160_context;
/**
 * \brief          RIPEMD-160 context structure
 */

Typedef mbedtls_rsa_context;

typedef struct mbedtls_rsa_context
{
   int ver;                   /*!<  Always 0.*/
   size_t len;                /*!<  The size of \p N in Bytes. */

   mbedtls_mpi N;             /*!<  The public modulus. */
   mbedtls_mpi E;             /*!<  The public exponent. */

   mbedtls_mpi D;             /*!<  The private exponent. */
   mbedtls_mpi P;             /*!<  The first prime factor. */
   mbedtls_mpi Q;             /*!<  The second prime factor. */

   mbedtls_mpi DP;            /*!<  D % (P - 1). */
   mbedtls_mpi DQ;            /*!<  D % (Q - 1). */
   mbedtls_mpi QP;            /*!<  1 / (Q % P). */

   mbedtls_mpi RN;            /*!<  cached R^2 mod N. */

   mbedtls_mpi RP;            /*!<  cached R^2 mod P. */
   mbedtls_mpi RQ;            /*!<  cached R^2 mod Q. */

   mbedtls_mpi Vi;            /*!<  The cached blinding value. */
   mbedtls_mpi Vf;            /*!<  The cached un-blinding value. */

   int padding;               /*!< Selects padding mode:
                                     #MBEDTLS_RSA_PKCS_V15 for 1.5 padding and
                                     #MBEDTLS_RSA_PKCS_V21 for OAEP or PSS. */
   int hash_id;               /*!< Hash identifier of mbedtls_md_type_t type,
                                     as specified in md.h for use in the MGF
                                     mask generating function used in the
                                     EME-OAEP and EMSA-PSS encodings. */
#if defined(MBEDTLS_THREADING_C)
   mbedtls_threading_mutex_t mutex;   /*!<  Thread-safety mutex. */
#endif
}
mbedtls_rsa_context;
/**
 * \brief   The RSA context structure.
 *
 * \note    Direct manipulation of the members of this structure
 *          is deprecated. All manipulation should instead be done through
 *          the public interface functions.
 */

Typedef mbedtls_sha1_context;

typedef struct mbedtls_sha1_context
{
   uint32_t total[2];         /*!< The number of Bytes processed.  */
   uint32_t state[5];         /*!< The intermediate digest state.  */
   unsigned char buffer[64];  /*!< The data block being processed. */
}
mbedtls_sha1_context;
/**
 * \brief          The SHA-1 context structure.
 *
 * \warning        SHA-1 is considered a weak message digest and its use
 *                 constitutes a security risk. We recommend considering
 *                 stronger message digests instead.
 *
 */

Typedef mbedtls_sha256_context;

typedef struct mbedtls_sha256_context
{
   uint32_t total[2];         /*!< The number of Bytes processed.  */
   uint32_t state[8];         /*!< The intermediate digest state.  */
   unsigned char buffer[64];  /*!< The data block being processed. */
   int is224;                 /*!< Determines which function to use:
                                     0: Use SHA-256, or 1: Use SHA-224. */
}
mbedtls_sha256_context;
/**
 * \brief          The SHA-256 context structure.
 *
 *                 The structure is used both for SHA-256 and for SHA-224
 *                 checksum calculations. The choice between these two is
 *                 made in the call to mbedtls_sha256_starts_ret().
 */

Typedef mbedtls_sha512_context;

typedef struct mbedtls_sha512_context
{
   uint64_t total[2];         /*!< The number of Bytes processed. */
   uint64_t state[8];         /*!< The intermediate digest state. */
   unsigned char buffer[128]; /*!< The data block being processed. */
   int is384;                 /*!< Determines which function to use:
                                     0: Use SHA-512, or 1: Use SHA-384. */
}
mbedtls_sha512_context;
/**
 * \brief          The SHA-512 context structure.
 *
 *                 The structure is used both for SHA-384 and for SHA-512
 *                 checksum calculations. The choice between these two is
 *                 made in the call to mbedtls_sha512_starts_ret().
 */

Typedef mbedtls_ssl_states;

typedef enum
{
   MBEDTLS_SSL_HELLO_REQUEST,
   MBEDTLS_SSL_CLIENT_HELLO,
   MBEDTLS_SSL_SERVER_HELLO,
   MBEDTLS_SSL_SERVER_CERTIFICATE,
   MBEDTLS_SSL_SERVER_KEY_EXCHANGE,
   MBEDTLS_SSL_CERTIFICATE_REQUEST,
   MBEDTLS_SSL_SERVER_HELLO_DONE,
   MBEDTLS_SSL_CLIENT_CERTIFICATE,
   MBEDTLS_SSL_CLIENT_KEY_EXCHANGE,
   MBEDTLS_SSL_CERTIFICATE_VERIFY,
   MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC,
   MBEDTLS_SSL_CLIENT_FINISHED,
   MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC,
   MBEDTLS_SSL_SERVER_FINISHED,
   MBEDTLS_SSL_FLUSH_BUFFERS,
   MBEDTLS_SSL_HANDSHAKE_WRAPUP,
   MBEDTLS_SSL_HANDSHAKE_OVER,
   MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET,
   MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT,
}
mbedtls_ssl_states;
/*
 * SSL state machine
 */

Typedef mbedtls_ssl_send_t

typedef int mbedtls_ssl_send_t( void *ctx,
                               const unsigned char *buf,
                               size_t len );
/**
 * \brief          Callback type: send data on the network.
 *
 * \note           That callback may be either blocking or non-blocking.
 *
 * \param ctx      Context for the send callback (typically a file descriptor)
 * \param buf      Buffer holding the data to send
 * \param len      Length of the data to send
 *
 * \return         The callback must return the number of bytes sent if any,
 *                 or a non-zero error code.
 *                 If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_WRITE
 *                 must be returned when the operation would block.
 *
 * \note           The callback is allowed to send fewer bytes than requested.
 *                 It must always return the number of bytes actually sent.
 */

Typedef mbedtls_ssl_recv_t

typedef int mbedtls_ssl_recv_t( void *ctx,
                               unsigned char *buf,
                               size_t len );
/**
 * \brief          Callback type: receive data from the network.
 *
 * \note           That callback may be either blocking or non-blocking.
 *
 * \param ctx      Context for the receive callback (typically a file
 *                 descriptor)
 * \param buf      Buffer to write the received data to
 * \param len      Length of the receive buffer
 *
 * \return         The callback must return the number of bytes received,
 *                 or a non-zero error code.
 *                 If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_READ
 *                 must be returned when the operation would block.
 *
 * \note           The callback may receive fewer bytes than the length of the
 *                 buffer. It must always return the number of bytes actually
 *                 received and written to the buffer.
 */

Typedef mbedtls_ssl_recv_timeout_t

typedef int mbedtls_ssl_recv_timeout_t( void *ctx,
                                       unsigned char *buf,
                                       size_t len,
                                       uint32_t timeout );
/**
 * \brief          Callback type: receive data from the network, with timeout
 *
 * \note           That callback must block until data is received, or the
 *                 timeout delay expires, or the operation is interrupted by a
 *                 signal.
 *
 * \param ctx      Context for the receive callback (typically a file descriptor)
 * \param buf      Buffer to write the received data to
 * \param len      Length of the receive buffer
 * \param timeout  Maximum nomber of millisecondes to wait for data
 *                 0 means no timeout (potentially waiting forever)
 *
 * \return         The callback must return the number of bytes received,
 *                 or a non-zero error code:
 *                 \c MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out,
 *                 \c MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal.
 *
 * \note           The callback may receive fewer bytes than the length of the
 *                 buffer. It must always return the number of bytes actually
 *                 received and written to the buffer.
 */

Typedef mbedtls_ssl_set_timer_t

typedef void mbedtls_ssl_set_timer_t( void * ctx,
                                     uint32_t int_ms,
                                     uint32_t fin_ms );
/**
 * \brief          Callback type: set a pair of timers/delays to watch
 *
 * \param ctx      Context pointer
 * \param int_ms   Intermediate delay in milliseconds
 * \param fin_ms   Final delay in milliseconds
 *                 0 cancels the current timer.
 *
 * \note           This callback must at least store the necessary information
 *                 for the associated \c mbedtls_ssl_get_timer_t callback to
 *                 return correct information.
 *
 * \note           If using a event-driven style of programming, an event must
 *                 be generated when the final delay is passed. The event must
 *                 cause a call to \c mbedtls_ssl_handshake() with the proper
 *                 SSL context to be scheduled. Care must be taken to ensure
 *                 that at most one such call happens at a time.
 *
 * \note           Only one timer at a time must be running. Calling this
 *                 function while a timer is running must cancel it. Cancelled
 *                 timers must not generate any event.
 */

Typedef mbedtls_ssl_get_timer_t

typedef int mbedtls_ssl_get_timer_t( void * ctx );
/**
 * \brief          Callback type: get status of timers/delays
 *
 * \param ctx      Context pointer
 *
 * \return         This callback must return:
 *                 -1 if cancelled (fin_ms == 0),
 *                  0 if none of the delays have passed,
 *                  1 if only the intermediate delay has passed,
 *                  2 if the final delay has passed.
 */

Typedef mbedtls_ssl_session

typedef struct mbedtls_ssl_session mbedtls_ssl_session;
/* Defined below */

Typedef mbedtls_ssl_context

typedef struct mbedtls_ssl_context mbedtls_ssl_context;


      

Typedef mbedtls_ssl_config

typedef struct mbedtls_ssl_config mbedtls_ssl_config;


      

Typedef mbedtls_ssl_transform

typedef struct mbedtls_ssl_transform mbedtls_ssl_transform;
/* Defined in ssl_internal.h */

Typedef mbedtls_ssl_handshake_params

typedef struct mbedtls_ssl_handshake_params mbedtls_ssl_handshake_params;


      

Typedef mbedtls_ssl_sig_hash_set_t

typedef struct mbedtls_ssl_sig_hash_set_t mbedtls_ssl_sig_hash_set_t;
#if defined(MBEDTLS_X509_CRT_PARSE_C)
typedef struct mbedtls_ssl_key_cert mbedtls_ssl_key_cert;


      

Typedef mbedtls_ssl_flight_item

typedef struct mbedtls_ssl_flight_item mbedtls_ssl_flight_item;


      

Typedef mbedtls_ssl_async_sign_t

typedef int mbedtls_ssl_async_sign_t( mbedtls_ssl_context *ssl,
                                     mbedtls_x509_crt *cert,
                                     mbedtls_md_type_t md_alg,
                                     const unsigned char *hash,
                                     size_t hash_len );
/**
 * \brief           Callback type: start fal signature operation.
 *
 *                  This callback is called during an SSL handshake to start
 *                  a signature decryption operation using an
 *                  external processor. The parameter \p cert contains
 *                  the public key; it is up to the callback function to
 *                  determine how to access the associated private key.
 *
 *                  This function typically sends or enqueues a request, and
 *                  does not wait for the operation to complete. This allows
 *                  the handshake step to be non-blocking.
 *
 *                  The parameters \p ssl and \p cert are guaranteed to remain
 *                  valid throughout the handshake. On the other hand, this
 *                  function must save the contents of \p hash if the value
 *                  is needed for later processing, because the \p hash buffer
 *                  is no longer valid after this function returns.
 *
 *                  This function may call mbedtls_ssl_set_async_operation_data()
 *                  to store an operation context for later retrieval
 *                  by the resume or cancel callback.
 *
 * \note            For RSA signatures, this function must produce output
 *                  that is consistent with PKCS#1 v1.5 in the same way as
 *                  mbedtls_rsa_pkcs1_sign(). Before the private key operation,
 *                  apply the padding steps described in RFC 8017, section 9.2
 *                  "EMSA-PKCS1-v1_5" as follows.
 *                  - If \p md_alg is #MBEDTLS_MD_NONE, apply the PKCS#1 v1.5
 *                    encoding, treating \p hash as the DigestInfo to be
 *                    padded. In other words, apply EMSA-PKCS1-v1_5 starting
 *                    from step 3, with `T = hash` and `tLen = hash_len`.
 *                  - If `md_alg != MBEDTLS_MD_NONE`, apply the PKCS#1 v1.5
 *                    encoding, treating \p hash as the hash to be encoded and
 *                    padded. In other words, apply EMSA-PKCS1-v1_5 starting
 *                    from step 2, with `digestAlgorithm` obtained by calling
 *                    mbedtls_oid_get_oid_by_md() on \p md_alg.
 *
 * \note            For ECDSA signatures, the output format is the DER encoding
 *                  `Ecdsa-Sig-Value` defined in
 *                  [RFC 4492 section 5.4](https://tools.ietf.org/html/rfc4492#section-5.4).
 *
 * \param ssl             The SSL connection instance. It should not be
 *                        modified other than via
 *                        mbedtls_ssl_set_async_operation_data().
 * \param cert            Certificate containing the public key.
 *                        In simple cases, this is one of the pointers passed to
 *                        mbedtls_ssl_conf_own_cert() when configuring the SSL
 *                        connection. However, if other callbacks are used, this
 *                        property may not hold. For example, if an SNI callback
 *                        is registered with mbedtls_ssl_conf_sni(), then
 *                        this callback determines what certificate is used.
 * \param md_alg          Hash algorithm.
 * \param hash            Buffer containing the hash. This buffer is
 *                        no longer valid when the function returns.
 * \param hash_len        Size of the \c hash buffer in bytes.
 *
 * \return          0 if the operation was started successfully and the SSL
 *                  stack should call the resume callback immediately.
 * \return          #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation
 *                  was started successfully and the SSL stack should return
 *                  immediately without calling the resume callback yet.
 * \return          #MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external
 *                  processor does not support this key. The SSL stack will
 *                  use the private key object instead.
 * \return          Any other error indicates a fatal failure and is
 *                  propagated up the call chain. The callback should
 *                  use \c MBEDTLS_ERR_PK_xxx error codes, and must not
 *                  use \c MBEDTLS_ERR_SSL_xxx error codes except as
 *                  directed in the documentation of this callback.
 */

Typedef mbedtls_ssl_async_decrypt_t

typedef int mbedtls_ssl_async_decrypt_t( mbedtls_ssl_context *ssl,
                                        mbedtls_x509_crt *cert,
                                        const unsigned char *input,
                                        size_t input_len );
/**
 * \brief           Callback type: start external decryption operation.
 *
 *                  This callback is called during an SSL handshake to start
 *                  an RSA decryption operation using an
 *                  external processor. The parameter \p cert contains
 *                  the public key; it is up to the callback function to
 *                  determine how to access the associated private key.
 *
 *                  This function typically sends or enqueues a request, and
 *                  does not wait for the operation to complete. This allows
 *                  the handshake step to be non-blocking.
 *
 *                  The parameters \p ssl and \p cert are guaranteed to remain
 *                  valid throughout the handshake. On the other hand, this
 *                  function must save the contents of \p input if the value
 *                  is needed for later processing, because the \p input buffer
 *                  is no longer valid after this function returns.
 *
 *                  This function may call mbedtls_ssl_set_async_operation_data()
 *                  to store an operation context for later retrieval
 *                  by the resume or cancel callback.
 *
 * \warning         RSA decryption as used in TLS is subject to a potential
 *                  timing side channel attack first discovered by Bleichenbacher
 *                  in 1998. This attack can be remotely exploitable
 *                  in practice. To avoid this attack, you must ensure that
 *                  if the callback performs an RSA decryption, the time it
 *                  takes to execute and return the result does not depend
 *                  on whether the RSA decryption succeeded or reported
 *                  invalid padding.
 *
 * \param ssl             The SSL connection instance. It should not be
 *                        modified other than via
 *                        mbedtls_ssl_set_async_operation_data().
 * \param cert            Certificate containing the public key.
 *                        In simple cases, this is one of the pointers passed to
 *                        mbedtls_ssl_conf_own_cert() when configuring the SSL
 *                        connection. However, if other callbacks are used, this
 *                        property may not hold. For example, if an SNI callback
 *                        is registered with mbedtls_ssl_conf_sni(), then
 *                        this callback determines what certificate is used.
 * \param input           Buffer containing the input ciphertext. This buffer
 *                        is no longer valid when the function returns.
 * \param input_len       Size of the \p input buffer in bytes.
 *
 * \return          0 if the operation was started successfully and the SSL
 *                  stack should call the resume callback immediately.
 * \return          #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation
 *                  was started successfully and the SSL stack should return
 *                  immediately without calling the resume callback yet.
 * \return          #MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external
 *                  processor does not support this key. The SSL stack will
 *                  use the private key object instead.
 * \return          Any other error indicates a fatal failure and is
 *                  propagated up the call chain. The callback should
 *                  use \c MBEDTLS_ERR_PK_xxx error codes, and must not
 *                  use \c MBEDTLS_ERR_SSL_xxx error codes except as
 *                  directed in the documentation of this callback.
 */

Typedef mbedtls_ssl_async_resume_t

typedef int mbedtls_ssl_async_resume_t( mbedtls_ssl_context *ssl,
                                       unsigned char *output,
                                       size_t *output_len,
                                       size_t output_size );
/**
 * \brief           Callback type: resume external operation.
 *
 *                  This callback is called during an SSL handshake to resume
 *                  an external operation started by the
 *                  ::mbedtls_ssl_async_sign_t or
 *                  ::mbedtls_ssl_async_decrypt_t callback.
 *
 *                  This function typically checks the status of a pending
 *                  request or causes the request queue to make progress, and
 *                  does not wait for the operation to complete. This allows
 *                  the handshake step to be non-blocking.
 *
 *                  This function may call mbedtls_ssl_get_async_operation_data()
 *                  to retrieve an operation context set by the start callback.
 *                  It may call mbedtls_ssl_set_async_operation_data() to modify
 *                  this context.
 *
 *                  Note that when this function returns a status other than
 *                  #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS, it must free any
 *                  resources associated with the operation.
 *
 * \param ssl             The SSL connection instance. It should not be
 *                        modified other than via
 *                        mbedtls_ssl_set_async_operation_data().
 * \param output          Buffer containing the output (signature or decrypted
 *                        data) on success.
 * \param output_len      On success, number of bytes written to \p output.
 * \param output_size     Size of the \p output buffer in bytes.
 *
 * \return          0 if output of the operation is available in the
 *                  \p output buffer.
 * \return          #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation
 *                  is still in progress. Subsequent requests for progress
 *                  on the SSL connection will call the resume callback
 *                  again.
 * \return          Any other error means that the operation is aborted.
 *                  The SSL handshake is aborted. The callback should
 *                  use \c MBEDTLS_ERR_PK_xxx error codes, and must not
 *                  use \c MBEDTLS_ERR_SSL_xxx error codes except as
 *                  directed in the documentation of this callback.
 */

Typedef mbedtls_ssl_async_cancel_t

typedef void mbedtls_ssl_async_cancel_t( mbedtls_ssl_context *ssl );
/**
 * \brief           Callback type: cancel external operation.
 *
 *                  This callback is called if an SSL connection is closed
 *                  while an asynchronous operation is in progress. Note that
 *                  this callback is not called if the
 *                  ::mbedtls_ssl_async_resume_t callback has run and has
 *                  returned a value other than
 *                  #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS, since in that case
 *                  the asynchronous operation has already completed.
 *
 *                  This function may call mbedtls_ssl_get_async_operation_data()
 *                  to retrieve an operation context set by the start callback.
 *
 * \param ssl             The SSL connection instance. It should not be
 *                        modified.
 */

Typedef mbedtls_ssl_srtp_profile;

typedef enum
{
   MBEDTLS_SRTP_UNSET_PROFILE,
   MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_80,
   MBEDTLS_SRTP_AES128_CM_HMAC_SHA1_32,
   MBEDTLS_SRTP_NULL_HMAC_SHA1_80,
   MBEDTLS_SRTP_NULL_HMAC_SHA1_32,
}
mbedtls_ssl_srtp_profile;
/*
 * List of SRTP profiles for DTLS-SRTP
 */

Typedef mbedtls_ssl_srtp_profile_info;

typedef struct
{
   const mbedtls_ssl_srtp_profile  profile;
   const char                     *name;
}
mbedtls_ssl_srtp_profile_info;


      

Typedef mbedtls_dtls_srtp_info;

typedef struct mbedtls_dtls_srtp_info_t
{
   mbedtls_ssl_srtp_profile chosen_dtls_srtp_profile; /*!< negotiated SRTP profile */
   unsigned char dtls_srtp_keys[MBEDTLS_DTLS_SRTP_MAX_KEY_MATERIAL_LENGTH]; /*!< master keys and master salt for SRTP generated during handshake */
   size_t dtls_srtp_keys_len; /*!< length in bytes of master keys and master salt for SRTP generated during handshake */
   unsigned char mki_value[MBEDTLS_DTLS_SRTP_MAX_MKI_LENGTH]; /* opaque srtp_mki<0..255> */
   size_t                mki_len;
}
mbedtls_dtls_srtp_info;


      

Typedef psk_func_cb

typedef void (*psk_func_cb)(void *ctx);


      

Typedef mbedtls_ssl_ticket_write_t

typedef int mbedtls_ssl_ticket_write_t( void *p_ticket,
                                       const mbedtls_ssl_session *session,
                                       unsigned char *start,
                                       const unsigned char *end,
                                       size_t *tlen,
                                       uint32_t *lifetime );
/**
 * \brief           Callback type: generate and write session ticket
 *
 * \note            This describes what a callback implementation should do.
 *                  This callback should generate an encrypted and
 *                  authenticated ticket for the session and write it to the
 *                  output buffer. Here, ticket means the opaque ticket part
 *                  of the NewSessionTicket structure of RFC 5077.
 *
 * \param p_ticket  Context for the callback
 * \param session   SSL session to be written in the ticket
 * \param start     Start of the output buffer
 * \param end       End of the output buffer
 * \param tlen      On exit, holds the length written
 * \param lifetime  On exit, holds the lifetime of the ticket in seconds
 *
 * \return          0 if successful, or
 *                  a specific MBEDTLS_ERR_XXX code.
 */

Typedef mbedtls_ssl_export_keys_t

typedef int mbedtls_ssl_export_keys_t( void *p_expkey,
                               const unsigned char *ms,
                               const unsigned char *kb,
                               size_t maclen,
                               size_t keylen,
                               size_t ivlen );
/**
 * \brief           Callback type: Export key block and master secret
 *
 * \note            This is required for certain uses of TLS, e.g. EAP-TLS
 *                  (RFC 5216) and Thread. The key pointers are ephemeral and
 *                  therefore must not be stored. The master secret and keys
 *                  should not be used directly except as an input to a key
 *                  derivation function.
 *
 * \param p_expkey  Context for the callback
 * \param ms        Pointer to master secret (fixed length: 48 bytes)
 * \param kb        Pointer to key block, see RFC 5246 section 6.3
 *                  (variable length: 2 * maclen + 2 * keylen + 2 * ivlen).
 * \param maclen    MAC length
 * \param keylen    Key length
 * \param ivlen     IV length
 *
 * \return          0 if successful, or
 *                  a specific MBEDTLS_ERR_XXX code.
 */

Typedef mbedtls_ssl_ticket_parse_t

typedef int mbedtls_ssl_ticket_parse_t( void *p_ticket,
                                       mbedtls_ssl_session *session,
                                       unsigned char *buf,
                                       size_t len );
/**
 * \brief           Callback type: parse and load session ticket
 *
 * \note            This describes what a callback implementation should do.
 *                  This callback should parse a session ticket as generated
 *                  by the corresponding mbedtls_ssl_ticket_write_t function,
 *                  and, if the ticket is authentic and valid, load the
 *                  session.
 *
 * \note            The implementation is allowed to modify the first len
 *                  bytes of the input buffer, eg to use it as a temporary
 *                  area for the decrypted ticket contents.
 *
 * \param p_ticket  Context for the callback
 * \param session   SSL session to be loaded
 * \param buf       Start of the buffer containing the ticket
 * \param len       Length of the ticket.
 *
 * \return          0 if successful, or
 *                  MBEDTLS_ERR_SSL_INVALID_MAC if not authentic, or
 *                  MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED if expired, or
 *                  any other non-zero code for other failures.
 */
typedef int mbedtls_ssl_cookie_write_t( void *ctx,
                               unsigned char **p, unsigned char *end,
                               const unsigned char *info, size_t ilen );
/**
 * \brief          Callback type: generate a cookie
 *
 * \param ctx      Context for the callback
 * \param p        Buffer to write to,
 *                 must be updated to point right after the cookie
 * \param end      Pointer to one past the end of the output buffer
 * \param info     Client ID info that was passed to
 *                 \c mbedtls_ssl_set_client_transport_id()
 * \param ilen     Length of info in bytes
 *
 * \return         The callback must return 0 on success,
 *                 or a negative error code.
 */
typedef int mbedtls_ssl_cookie_check_t( void *ctx,
                               const unsigned char *cookie, size_t clen,
                               const unsigned char *info, size_t ilen );
/**
 * \brief          Callback type: verify a cookie
 *
 * \param ctx      Context for the callback
 * \param cookie   Cookie to verify
 * \param clen     Length of cookie
 * \param info     Client ID info that was passed to
 *                 \c mbedtls_ssl_set_client_transport_id()
 * \param ilen     Length of info in bytes
 *
 * \return         The callback must return 0 if cookie is valid,
 *                 or a negative error code.
 */

Typedef mbedtls_ssl_cache_context

typedef struct mbedtls_ssl_cache_context mbedtls_ssl_cache_context;


      

Typedef mbedtls_ssl_cache_entry

typedef struct mbedtls_ssl_cache_entry mbedtls_ssl_cache_entry;


      

Typedef mbedtls_key_exchange_type_t;

typedef enum {
   MBEDTLS_KEY_EXCHANGE_NONE = 0,
   MBEDTLS_KEY_EXCHANGE_RSA,
   MBEDTLS_KEY_EXCHANGE_DHE_RSA,
   MBEDTLS_KEY_EXCHANGE_ECDHE_RSA,
   MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA,
   MBEDTLS_KEY_EXCHANGE_PSK,
   MBEDTLS_KEY_EXCHANGE_DHE_PSK,
   MBEDTLS_KEY_EXCHANGE_RSA_PSK,
   MBEDTLS_KEY_EXCHANGE_ECDHE_PSK,
   MBEDTLS_KEY_EXCHANGE_ECDH_RSA,
   MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA,
   MBEDTLS_KEY_EXCHANGE_ECJPAKE,
} mbedtls_key_exchange_type_t;
/* Reminder: update mbedtls_ssl_premaster_secret when adding a new key exchange.
 * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below
 */

Typedef mbedtls_ssl_ciphersuite_t

typedef struct mbedtls_ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t;


      
      
typedef struct mbedtls_ssl_cookie_ctx
{
   mbedtls_md_context_t   hmac_ctx;  /*!< context for the HMAC portion   */
#if !defined(MBEDTLS_HAVE_TIME)
   unsigned long  serial;    /*!< serial number for expiration   */
#endif
   unsigned long  timeout;   /*!< timeout delay, in seconds if HAVE_TIME,
                                     or in number of tickets issued */

#if defined(MBEDTLS_THREADING_C)
   mbedtls_threading_mutex_t mutex;
#endif
} mbedtls_ssl_cookie_ctx;
/**
 * \brief          Context for the default cookie functions.
 */

Typedef mbedtls_ssl_hs_buffer

typedef struct mbedtls_ssl_hs_buffer mbedtls_ssl_hs_buffer;


      

Typedef mbedtls_ssl_ticket_key;

typedef struct mbedtls_ssl_ticket_key
{
   unsigned char name[4];         /*!< random key identifier              */
   uint32_t generation_time;      /*!< key generation timestamp (seconds) */
   mbedtls_cipher_context_t ctx;  /*!< context for auth enc/decryption    */
}
mbedtls_ssl_ticket_key;
/**
 * \brief   Information for session ticket protection
 */

Typedef mbedtls_ssl_ticket_context;

typedef struct mbedtls_ssl_ticket_context
{
   mbedtls_ssl_ticket_key keys[2]; /*!< ticket protection keys             */
   unsigned char active;          /*!< index of the currently active key  */

   uint32_t ticket_lifetime;      /*!< lifetime of tickets in seconds     */

   /** Callback for getting (pseudo-)random numbers                        */
   int (*f_rng)(void *, unsigned char *, size_t);
   void *p_rng;                   /*!< context for the RNG function       */

#if defined(MBEDTLS_THREADING_C)
   mbedtls_threading_mutex_t mutex;
#endif
}
mbedtls_ssl_ticket_context;
/**
 * \brief   Context for session ticket handling functions
 */

Typedef mbedtls_threading_mutex_t;

typedef struct mbedtls_threading_mutex_t
{
   pthread_mutex_t mutex;
   char is_valid;
} mbedtls_threading_mutex_t;


      

Typedef mbedtls_timing_delay_context;

typedef struct mbedtls_timing_delay_context
{
   struct mbedtls_timing_hr_time  timer;
   uint32_t                       int_ms;
   uint32_t                       fin_ms;
} mbedtls_timing_delay_context;
/**
 * \brief          Context for mbedtls_timing_set/get_delay()
 */

Typedef mbedtls_x509_buf

typedef mbedtls_asn1_buf mbedtls_x509_buf;
/**
 * Type-length-value structure that allows for ASN1 using DER.
 */

Typedef mbedtls_x509_bitstring

typedef mbedtls_asn1_bitstring mbedtls_x509_bitstring;
/**
 * Container for ASN1 bit strings.
 */

Typedef mbedtls_x509_name

typedef mbedtls_asn1_named_data mbedtls_x509_name;
/**
 * Container for ASN1 named information objects.
 * It allows for Relative Distinguished Names (e.g. cn=localhost,ou=code,etc.).
 */

Typedef mbedtls_x509_sequence

typedef mbedtls_asn1_sequence mbedtls_x509_sequence;
/**
 * Container for a sequence of ASN.1 items
 */

Typedef mbedtls_x509_time;

typedef struct mbedtls_x509_time
{
   int year, mon, day;        /**< Date. */
   int hour, min, sec;        /**< Time. */
}
mbedtls_x509_time;
/** Container for date and time (precision in seconds). */

Typedef mbedtls_x509_crl_entry;

typedef struct mbedtls_x509_crl_entry
{
   mbedtls_x509_buf raw;

   mbedtls_x509_buf serial;

   mbedtls_x509_time revocation_date;

   mbedtls_x509_buf entry_ext;

   struct mbedtls_x509_crl_entry *next;
}
mbedtls_x509_crl_entry;
/**
 * Certificate revocation list entry.
 * Contains the CA-specific serial numbers and revocation dates.
 */

Typedef mbedtls_x509_crl;

typedef struct mbedtls_x509_crl
{
   mbedtls_x509_buf raw;          /**< The raw certificate data (DER). */
   mbedtls_x509_buf tbs;          /**< The raw certificate body (DER). The part that is To Be Signed. */

   int version;           /**< CRL version (1=v1, 2=v2) */
   mbedtls_x509_buf sig_oid;      /**< CRL signature type identifier */

   mbedtls_x509_buf issuer_raw;   /**< The raw issuer data (DER). */

   mbedtls_x509_name issuer;      /**< The parsed issuer data (named information object). */

   mbedtls_x509_time this_update;
   mbedtls_x509_time next_update;

   mbedtls_x509_crl_entry entry;  /**< The CRL entries containing the certificate revocation times for this CA. */

   mbedtls_x509_buf crl_ext;

   mbedtls_x509_buf sig_oid2;
   mbedtls_x509_buf sig;
   mbedtls_md_type_t sig_md;          /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */
   mbedtls_pk_type_t sig_pk;          /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */
   void *sig_opts;            /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */

   struct mbedtls_x509_crl *next;
}
mbedtls_x509_crl;
/**
 * Certificate revocation list structure.
 * Every CRL may have multiple entries.
 */

Typedef mbedtls_x509_crt;

typedef struct mbedtls_x509_crt
{
   mbedtls_x509_buf raw;              /**< The raw certificate data (DER). */
   mbedtls_x509_buf tbs;              /**< The raw certificate body (DER). The part that is To Be Signed. */

   int version;               /**< The X.509 version. (1=v1, 2=v2, 3=v3) */
   mbedtls_x509_buf serial;           /**< Unique id for certificate issued by a specific CA. */
   mbedtls_x509_buf sig_oid;          /**< Signature algorithm, e.g. sha1RSA */

   mbedtls_x509_buf issuer_raw;       /**< The raw issuer data (DER). Used for quick comparison. */
   mbedtls_x509_buf subject_raw;      /**< The raw subject data (DER). Used for quick comparison. */

   mbedtls_x509_name issuer;          /**< The parsed issuer data (named information object). */
   mbedtls_x509_name subject;         /**< The parsed subject data (named information object). */

   mbedtls_x509_time valid_from;      /**< Start time of certificate validity. */
   mbedtls_x509_time valid_to;        /**< End time of certificate validity. */

   mbedtls_pk_context pk;             /**< Container for the public key context. */

   mbedtls_x509_buf issuer_id;        /**< Optional X.509 v2/v3 issuer unique identifier. */
   mbedtls_x509_buf subject_id;       /**< Optional X.509 v2/v3 subject unique identifier. */
   mbedtls_x509_buf v3_ext;           /**< Optional X.509 v3 extensions.  */
   mbedtls_x509_sequence subject_alt_names;   /**< Optional list of Subject Alternative Names (Only dNSName supported). */

   int ext_types;             /**< Bit string containing detected and parsed extensions */
   int ca_istrue;             /**< Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise. */
   int max_pathlen;           /**< Optional Basic Constraint extension value: The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+ */

   unsigned int key_usage;    /**< Optional key usage extension value: See the values in x509.h */

   mbedtls_x509_sequence ext_key_usage; /**< Optional list of extended key usage OIDs. */

   unsigned char ns_cert_type; /**< Optional Netscape certificate type extension value: See the values in x509.h */

   mbedtls_x509_buf sig;              /**< Signature: hash of the tbs part signed with the private key. */
   mbedtls_md_type_t sig_md;          /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */
   mbedtls_pk_type_t sig_pk;          /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */
   void *sig_opts;            /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */

   struct mbedtls_x509_crt *next;    /**< Next certificate in the CA-chain. */
}
mbedtls_x509_crt;
/**
 * Container for an X.509 certificate. The certificate may be chained.
 */

Typedef mbedtls_x509_crt_profile;

typedef struct mbedtls_x509_crt_profile
{
   uint32_t allowed_mds;      /**< MDs for signatures         */
   uint32_t allowed_pks;      /**< PK algs for signatures     */
   uint32_t allowed_curves;   /**< Elliptic curves for ECDSA  */
   uint32_t rsa_min_bitlen;   /**< Minimum size for RSA keys  */
}
mbedtls_x509_crt_profile;
/**
 * Security profile for certificate verification.
 *
 * All lists are bitfields, built by ORing flags from MBEDTLS_X509_ID_FLAG().
 */

Typedef mbedtls_x509write_cert;

typedef struct mbedtls_x509write_cert
{
   int version;
   mbedtls_mpi serial;
   mbedtls_pk_context *subject_key;
   mbedtls_pk_context *issuer_key;
   mbedtls_asn1_named_data *subject;
   mbedtls_asn1_named_data *issuer;
   mbedtls_md_type_t md_alg;
   char not_before[MBEDTLS_X509_RFC5280_UTC_TIME_LEN + 1];
   char not_after[MBEDTLS_X509_RFC5280_UTC_TIME_LEN + 1];
   mbedtls_asn1_named_data *extensions;
}
mbedtls_x509write_cert;
/**
 * Container for writing a certificate (CRT)
 */

Typedef mbedtls_x509_crt_verify_chain_item;

typedef struct {
   mbedtls_x509_crt *crt;
   uint32_t flags;
} mbedtls_x509_crt_verify_chain_item;
/**
 * Item in a verification chain: cert and flags for it
 */

Typedef mbedtls_x509_crt_verify_chain;

typedef struct
{
   mbedtls_x509_crt_verify_chain_item items[MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE];
   unsigned len;
} mbedtls_x509_crt_verify_chain;
/**
 * Verification chain as built by \c mbedtls_crt_verify_chain()
 */

Typedef self_cnt;

typedef struct
{
   /* for check_signature() */
   mbedtls_pk_restart_ctx pk;

   /* for find_parent_in() */
   mbedtls_x509_crt *parent; /* non-null iff parent_in in progress */
   mbedtls_x509_crt *fallback_parent;
   int fallback_signature_is_good;

   /* for find_parent() */
   int parent_is_trusted; /* -1 if find_parent is not in progress */

   /* for verify_chain() */
   enum {
       x509_crt_rs_none,
       x509_crt_rs_find_parent,
   } in_progress;  /* none if no operation is in progress */
   int self_cnt;
/**
 * \brief       Context for resuming X.509 verify operations
 */

Typedef mbedtls_x509_crt_restart_ctx

typedef void mbedtls_x509_crt_restart_ctx;
/* Now we can declare functions that take a pointer to that */

Typedef mbedtls_x509_csr;

typedef struct mbedtls_x509_csr
{
   mbedtls_x509_buf raw;          /**< The raw CSR data (DER). */
   mbedtls_x509_buf cri;          /**< The raw CertificateRequestInfo body (DER). */

   int version;           /**< CSR version (1=v1). */

   mbedtls_x509_buf subject_raw; /**< The raw subject data (DER). */
   mbedtls_x509_name subject;     /**< The parsed subject data (named information object). */

   mbedtls_pk_context pk;         /**< Container for the public key context. */

   mbedtls_x509_buf sig_oid;
   mbedtls_x509_buf sig;
   mbedtls_md_type_t sig_md;      /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */
   mbedtls_pk_type_t sig_pk;      /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */
   void *sig_opts;        /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */
}
mbedtls_x509_csr;
/**
 * Certificate Signing Request (CSR) structure.
 */

Typedef mbedtls_x509write_csr;

typedef struct mbedtls_x509write_csr
{
   mbedtls_pk_context *key;
   mbedtls_asn1_named_data *subject;
   mbedtls_md_type_t md_alg;
   mbedtls_asn1_named_data *extensions;
}
mbedtls_x509write_csr;
/**
 * Container for writing a CSR
 */

Typedef mbedtls_xtea_context;

typedef struct mbedtls_xtea_context
{
   uint32_t k[4];      /*!< key */
}
mbedtls_xtea_context;
/**
 * \brief          XTEA context structure
 */

Typedef tuya_tls_cert_perm_t;

typedef struct {
   CONST UINT8_T *pub_perm;
   CONST UINT8_T *pri_perm;
   UINT16_T pub_perm_len;
   UINT16_T pri_perm_len;
}tuya_tls_cert_perm_t;


      

Typedef tuya_tls_hander

typedef PVOID_T tuya_tls_hander;


      

Typedef tuya_tls_send_cb

typedef INT_T (*tuya_tls_send_cb)( VOID *p_custom_net_ctx, CONST BYTE_T *buf, SIZE_T len);


      

Typedef tuya_tls_recv_cb

typedef INT_T (*tuya_tls_recv_cb)( VOID *p_custom_net_ctx, BYTE_T *buf, SIZE_T len);


      

Typedef TY_TLS_EVENT_E;

typedef enum
{
   TY_TLS_CERT_EXPIRED,
}TY_TLS_EVENT_E;


      

Typedef tuya_tls_event_cb

typedef VOID (*tuya_tls_event_cb)(TY_TLS_EVENT_E event, VOID *p_args);


      

Typedef cli_cmd_func_cb_t

typedef void (*cli_cmd_func_cb_t)(int argc, char *argv[]);
/**
 * @brief callback for one cli command
 * 
 * @param[in] argc The number of argumnet
 * @param[in] argv The point date of argument
 * 
 */

Typedef cli_cmd_t;

typedef struct {
   /** cli command name */
   char               *name;
   /** cli command help */
   char               *help;
   /** the callback of one command */
   cli_cmd_func_cb_t   func;
} cli_cmd_t;


      

Typedef VAR_TP_T

typedef BYTE_T VAR_TP_T;
#define VT_CHAR 0      // char, same as int, need 11+6 byte
#define VT_BYTE 1      // byte, same as int, need 11+6 byte
#define VT_SHORT 2     // short, same as int, need 11+6 byte
#define VT_USHORT 3    // unsigned short, same as int, need 11+6 byte
#define VT_INT 4       // int, need 11+6 byte when serialize to json format
#define VT_BOOL 5      // bool, need 6+6 byte when serialize to json format
#define VT_STRING 6    // string, need len+6 byte when serialize to json format
#define VT_RAW 7       // raw, need len/3*4+len%3?4:0+6 (base64 encode) when serialize to json format

/**
 * @brief tuya key-value database property define, used for serialize/deserialize data to json format
 * 
 */

Typedef TY_DB_RW_S;

typedef struct {
   CHAR_T *key;   // property name
   VAR_TP_T vt;   // property type
   VOID *val;     // property value
   USHORT_T len;  // property length
}TY_DB_RW_S;
/**
 * @brief tuya key-value database property, used for serialize/deserialize data to json format
 * 
 */

Typedef SUBSCRIBE_TYPE_E

typedef BYTE_T SUBSCRIBE_TYPE_E;
#define SUBSCRIBE_TYPE_NORMAL   0 // normal type, dispatch by the subscribe order, remove when unsubscribe
#define SUBSCRIBE_TYPE_EMERGENCY 1 // emergency type, dispatch first, remove when unsubscribe
#define SUBSCRIBE_TYPE_ONETIME  2 // one time type, dispatch by the subscribe order, remove after first time dispath

/**
 * @brief subscriber type
 * 
 */

Typedef event_raw_data_t;

typedef struct {
   int type;          // the data type
   int len;           // the data length
   char value[0];     // the data content
}event_raw_data_t;
/**
 * @brief the event dispatch raw data
 * 
 */

Typedef event_subscribe_cb

typedef int (*event_subscribe_cb)(void *data);
/**
 * @brief event subscribe callback function type
 * 
 */

Typedef subscribe_node_t;

typedef struct {
   char name[EVENT_NAME_MAX_LEN+1];   // name, used to record the the event info
   char desc[EVENT_DESC_MAX_LEN+1];   // description, used to record the subscribe info
   SUBSCRIBE_TYPE_E type;             // the subscribe type
   event_subscribe_cb cb;             // the subscribe callback function
   struct tuya_list_head node;        // list node, used to attch to the event node
}subscribe_node_t;
/**
 * @brief the subscirbe node
 * 
 */

Typedef event_node_t;

typedef struct {
   MUTEX_HANDLE mutex;                        // mutex, protection the event publish and subscribe	

   char name[EVENT_NAME_MAX_LEN+1];           // name, the event name  
   struct tuya_list_head node;                // list node, used to attach to the event manage module
   struct tuya_list_head subscribe_root;      // subscibe root, used to manage the subscriber    
}event_node_t;
/**
 * @brief the event node
 * 
 */

Typedef event_manage_t;

typedef struct {
   int inited;
   MUTEX_HANDLE mutex;                            // mutex, used to protection event manage node
   int event_cnt;                                 // current event number
   struct tuya_list_head event_root;              // event root, used to manage the event
   struct tuya_list_head free_subscribe_root;     // free subscriber list, used to manage the subscribe which not found the event
}event_manage_t;
/**
 * @brief the event manage node
 * 
 */

Typedef LS_DATA_TP_T

typedef BYTE_T LS_DATA_TP_T; // log sequence data type
#define LDT_NULL 0
#define LDT_DEC 1
#define LDT_HEX 2
#define LDT_TIMESTAMP 3
#define LDT_STRING 4



      

Typedef LOG_DA_TP_U;

typedef union {
   INT_T  dec_data;
   UINT_T hex_data;
   TIME_T tm_data;
   CHAR_T *str_data;
}LOG_DA_TP_U;
/**
 * @brief data storage structure of log sequence
 */

Typedef LS_DATA_S;

typedef struct {
   /** log id */
   BYTE_T         id;
   /** log type */
   LS_DATA_TP_T   type;
   /** log data */
   LOG_DA_TP_U    data;
   /** log list node */
   struct tuya_list_head node;
}LS_DATA_S;
/**
 * @brief data structure of log sequence
 */

Typedef LS_STAT_T

typedef BYTE_T LS_STAT_T;
#define LSS_INIT 0
#define LSS_RECORDING 1
#define LSS_LOCKED 2 // LOG_SEQ_T set locked status when record the error log sequence



      

Typedef LOG_SEQ_UPLOAD_CB

typedef int (*LOG_SEQ_UPLOAD_CB)(const char *p_log); 
// Calling when record the error log sequence

Typedef HTTP_LOG_SEQ_E;

typedef enum {
   // generic
   LOGSEQ_HTTP_TIME               = 0,   // type:string, value:system time, location:NULL
   LOGSEQ_HTTP_TOKEN              = 1,   // typeLstring, value:device Token, location:NULL

   // URL config
   LOGSEQ_HTTP_URL_CFG            = 11,  // type: error code, value: URL from URL config api, location:http_iot_dns_get_cloud_url

   // request
   LOGSEQ_HTTP_API                = 20,  // type:string, value:API name, location:__iot_common_post
   LOGSEQ_HTTP_URL                = 21,  // type:string, value:API name, location:__iot_common_post
   LOGSEQ_HTTP_DATA               = 22,  // type:string, value:API name, location:__iot_common_post
   LOGSEQ_HTTP_OPEN_SESSION       = 23,  // type:error code, value:fail on connect http session, locaiton:__http_inf_com_hanle->http_open_session
   LOGSEQ_HTTP_PREPARE_REQ        = 24,  // type:error code, value:fail on prepare http request data, location:__http_inf_com_hanle->http_prepare_req
   LOGSEQ_HTTP_SEND_REQUEST       = 25,  // type:error code, value:fail on http send request, location:__http_inf_com_hanle->http_send_request

   // response
   LOGSEQ_HTTP_GET_RESP_HEAD      = 30,  // type:error code, value:get head of http responsed data fail, location:http_get_response_hdr
   LOGSEQ_HTTP_CHK_RESP_RET       = 31,  // type:error code, value:return value of http response error, location:NULL
   LOGSEQ_HTTP_RECV_RESP          = 32,  // type:error code, value:http failed to accept response data, location:__httpc_return_json_cb和__httpc_gw_common_cb
   LOGSEQ_HTTP_RECV_BODY_CJSON    = 33,  // type:error code, value:http received response data decode failed,location:__httpc_return_json_cb和__httpc_gw_common_cb
   LOGSEQ_HTTP_RECV_DECODE        = 34,  // type:error code, value:http decryption failed, location:__httpc_gw_common_cb
   LOGSEQ_HTTP_RECV_CONTENT       = 35,  // type:error code, value:http content error, location:NULL
   LOGSEQ_HTTP_RECV_DATA          = 36,  // type:error code, value:http data error, location:NULL

   LOGSEQ_HTTP_DB_RECOVERY        = 100, // 类型:错误码,值:KV被破坏并恢复,位置:NULL
}HTTP_LOG_SEQ_E;
/**
 * @brief define http detail log sequence information 
 *        user can easy know bug location from this sequence, which include type, value, location
 */

Typedef MQTT_LOG_SEQ_E;

typedef enum {
   // generic
   LOGSEQ_MQTT_TIME           = 0,   // type:string, value:system time, location:NULL
   LOGSEQ_MQTT_RSSI           = 9,   // type:string, value:RSSI signal strength, location:__mqtt_log_seq_err

   // DNS
   LOGSEQ_MQTT_DNS_RESV       = 10,  // type:error code, value:DNS parse, location:__mq_ctrl_task

   // connect
   LOGSEQ_MQTT_SOCK_CONN      = 20,  // type:error code, value:soket connect, location:__mq_ctrl_task
   LOGSEQ_MQTT_CONN           = 21,  // type:system error code, value:mqtt connect, location:__mq_ctrl_task
   LOGSEQ_MQTT_CONN_ACK       = 22,  // type:system error code, value:mqtt conect acknowleage, location:mqtt_connect

   // subscirbe
   LOGSEQ_MQTT_SUB            = 30,  // type:system error code, value:mqtt subscription, location:__mq_ctrl_task
   LOGSEQ_MQTT_SUB_ACK        = 31,  // type:system error code, value:mqtt subscription acknowleage, location:mqtt_subscribe

   // publish
   LOGSEQ_MQTT_PUB            = 40,  // type:system error code, value:mqtt publish, location:mqtt_publish_async
   LOGSEQ_MQTT_PUB_ACK        = 41,  // type:system error code, value:mqtt publish acknowleage, location:mqtt_publish
   LOGSEQ_MQTT_PUB_ACK_CLOSE  = 42,  // type:string, value:mqtt failed to publish acknowleage 3 times then closed, location:LOGSEQ_MQTT_PUB_ACK_CLOSE

   // process logic
   LOGSEQ_MQTT_RECV           = 50,  // type:system error code, value:receive mqtt, location:__mq_ctrl_task
   LOGSEQ_MQTT_LOGIC_PROC     = 51,  // type:error code, value:mqtt logic process, location:__mq_ctrl_task
   LOGSEQ_MQTT_CONN_RECV      = 52,  // type:error code, value:mqtt connect receive, location:__mq_ctrl_task

   // ping
   LOGSEQ_MQTT_PING           = 60,  // type:system error code, value:mqtt ping failed, location:__alive_tm_msg_cb
   LOGSEQ_MQTT_PING_TIMEOUT   = 61,  // type:string, value:time of recorde,location:__resp_tm_cb
}MQTT_LOG_SEQ_E;
/**
 * @brief define mqtt detail log sequence information 
 *        user can easy know bug location from this sequence, which include type, value, location
 */

Typedef NETCFG_LOG_SEQ_E;

typedef enum {
   // generic
   LOGSEQ_NETCFG_TIME             = 0,   // type:string, value:system time, location:NULL
   LOGSEQ_NETCFG_TOKEN            = 1,   // type:string, value:device Token, location:NULL
   LOGSEQ_NETCFG_TYPE             = 9,   // type:string, value:network configure type, location:NULL

   // netcfg 
   LOGSEQ_NETCFG_FAIL             = 10,  // type:error code, value:reasons for network configuration failure, location:NULL

   // route
   LOGSEQ_NETCFG_LAST_STATUS      = 20,  // type: decimal number, value:previous network status, location:get_wf_gw_nw_status
   LOGSEQ_NETCFG_NEW_STATUS       = 21,  // type: decimal number, value: new network status, location:get_wf_gw_nw_status
   LOGSEQ_NETCFG_OTHERS_START     = 22,  // type: decimal number, value: exit type, location:__gw_net_conn_cb
}NETCFG_LOG_SEQ_E;
/**
 * @brief define network configuration detail log sequence information 
 *        user can easy know bug location from this sequence, which include type, value, location
 */

Typedef TIMER_TASK_LOG_SEQ_E;

typedef enum {
   // run timer task
   LOGSEQ_TIMER_TASK_EXECUTE             = 0,   // type:string, value:timer id and execute result, location:NULL
   
   // generic
   LOGSEQ_TIMER_TASK_TIME                = 1,   // type:string, value:system time, location:NULL
   LOGSEQ_TIMER_TASK_TOKEN               = 2,   // type:string, value:device Token, location:NULL

   // load from disk
   LOGSEQ_TIMER_TASK_LOAD                = 10,   // type:error code, value:failed to load timing task from flash, location:__load_timer_task_from_disk
   LOGSEQ_TIMER_TASK_LOAD_DPS_FAILD      = 11,   // type: decimal number, value:failed to request memory for dps, location:__load_timer_task_from_disk
   LOGSEQ_TIMER_TASK_LOAD_TIMER_ID_FAILD = 12,   // type: decimal number, value:failed to request memory for timer id, location:__load_timer_task_from_disk

   // save to disk
   LOGSEQ_TIMER_TASK_SAVE                = 20,   // type:error code, value:failed to save timing task to flash, location:__save_time_task_to_disk

   // update from cloud
   LOGSEQ_TIMER_TASK_UPDATE              = 30,   // type:error code, value:failed to update timing task, location:__update_time_task_from_cloud
   LOGSEQ_TIMER_TASK_UPDATE_GET          = 31,   // type:error code, value:failed to update timing content, location:__update_time_task_from_cloud
   LOGSEQ_TIMER_TASK_UPDATE_GET_ITEM     = 32,   // type: decimal number, value:get timer index of the error, location:__update_time_task_from_cloud
   LOGSEQ_TIMER_TASK_UPDATE_INCREASE     = 33,   // type: decimal number, value:total timer number, location__increase_arr_size
   LOGSEQ_TIMER_TASK_UPDATE_ADD          = 34,   // type: decimal number, value:add timer index of the error, location:__add_task_to_arr
}TIMER_TASK_LOG_SEQ_E;
/**
 * @brief define timer task detail log sequence information 
 *        user can easy know bug location from this sequence, which include type, value, location
 */

Typedef LOG_LEVEL

typedef INT_T LOG_LEVEL;


      

Typedef LOG_OUTPUT

typedef VOID (*LOG_OUTPUT)(IN CONST     CHAR_T *str);
// prototype of log output function

Typedef MODULE_HANDLE

typedef PVOID_T MODULE_HANDLE;
//the handle of the module

Typedef MSG_QUE_HANDLE

typedef PVOID_T MSG_QUE_HANDLE; // message queue handle


      

Typedef MSG_ID

typedef USHORT_T MSG_ID;         // message id


      

Typedef P_MSG_DATA

typedef PVOID_T P_MSG_DATA;      // message data


      

Typedef MSG_DATA_LEN

typedef UINT_T MSG_DATA_LEN;     // message data lenth


      

Typedef MSG_TYPE

typedef UINT_T MSG_TYPE; 
#define INSTANCY_MESSAGE 0 // instant message type
#define NORMAL_MESSAGE 1   // normal message type

/**
 * @brief Definition of message type
 */

Typedef MESSAGE,*P_MESSAGE;

typedef struct
{
   MSG_ID msgID;           // message id
   P_MSG_DATA pMsgData;    // message data
   MSG_DATA_LEN msgDataLen; // message data len
}MESSAGE,*P_MESSAGE;
/**
 * @brief Init param of message
 */

Typedef MSG_LIST,*P_MSG_LIST;

typedef struct
{
   LIST_HEAD listHead; // list head
   MESSAGE msg;        // message info
}MSG_LIST,*P_MSG_LIST;
/**
 * @brief message list
 */

Typedef MSG_CALLBACK

typedef VOID(*MSG_CALLBACK)(MESSAGE *msg);
// message processing callback

Typedef TM_MSG_CB

typedef VOID(* TM_MSG_CB)(struct s_tm_msg *tm_msg); // timer message callback


      

Typedef TM_MSG_S;

typedef struct s_tm_msg {
   TIMER_ID timer;             // timer id
   MSG_QUE_HANDLE msgQueHandle; // timer queue handle
   TM_MSG_CB cb;               // timer callback function
   MSG_ID msgID;               // message id
   VOID *data;                 // message data
}TM_MSG_S;
/**
 * @brief timer message definition
 */

Typedef MSG_ENTRY_S;

typedef struct {
   MSG_ID *mid;        // message id
   MSG_CALLBACK msg_cb; // message callback
}MSG_ENTRY_S;
/**
 * @brief message entry definition
 */

Typedef TM_MSG_ENTRY_S;

typedef struct {
   TM_MSG_S **tm_msg;   //timer message info
   TM_MSG_CB tmm_msg_cb; //timer message callback
}TM_MSG_ENTRY_S;
/**
 * @brief timer message entry definition
 */

Typedef INTF_TYPE_ENUM;

typedef enum {
   INTF_MEMORY,
   INTF_MUTEX,
   INTF_SEMAPHORE,
   INTF_THREAD,
   INTF_FILE_SYSTEM,
   INTF_NETWORK,
   INTF_OUTPUT,
   INTF_SYSTEM,
   INTF_INTERRUPT,
   INTF_QUEUE,
   INTF_WIFI,
   INTF_BT,
   INTF_BLE_MESH_PROV,
   INTF_STORAGE,
   INTF_OTA,
   INTF_WIRED,
   INTF_CELLULAR,
   ALL_INTF_NUMS
} INTF_TYPE_ENUM;
/***********************************************************
*************************micro define***********************
***********************************************************/

Typedef TUYA_DIR

typedef void* TUYA_DIR;


      

Typedef TUYA_FILEINFO

typedef void* TUYA_FILEINFO;


      

Typedef TUYA_FILE

typedef void* TUYA_FILE;


      

Typedef TUYA_OS_FS_INTF;

typedef struct {
   OPERATE_RET  (*fs_mkdir)     (CONST CHAR_T* path);
   OPERATE_RET  (*fs_remove)    (CONST CHAR_T* path);
   OPERATE_RET  (*fs_mode)      (CONST CHAR_T* path, UINT_T* mode);
   OPERATE_RET  (*fs_is_exist)  (CONST CHAR_T* path, BOOL_T* is_exist);
   OPERATE_RET  (*fs_rename)    (CONST CHAR_T* path_old, CONST CHAR_T* path_new);
   OPERATE_RET  (*dir_open)     (CONST CHAR_T* path, TUYA_DIR* dir);
   OPERATE_RET  (*dir_close)    (TUYA_DIR dir);
   OPERATE_RET  (*dir_read)     (TUYA_DIR dir, TUYA_FILEINFO* info);
   OPERATE_RET  (*dir_name)     (TUYA_FILEINFO info, CONST CHAR_T** name);
   OPERATE_RET  (*dir_is_dir)   (TUYA_FILEINFO info, BOOL_T* is_dir);
   OPERATE_RET  (*dir_is_regular)(TUYA_FILEINFO info, BOOL_T* is_regular);
   TUYA_FILE    (*fopen)        (CONST CHAR_T* path, CONST CHAR_T* mode);
   OPERATE_RET  (*fclose)       (TUYA_FILE file);
   OPERATE_RET  (*fread)        (VOID_T* buf, INT_T bytes, TUYA_FILE file);
   OPERATE_RET  (*fwrite)       (VOID_T* buf, INT_T bytes, TUYA_FILE file);
   OPERATE_RET  (*fsync)        (TUYA_FILE file);
   CHAR_T*      (*fgets)        (CHAR_T* buf, INT_T len, TUYA_FILE file);
   OPERATE_RET  (*feof)         (TUYA_FILE file);
   OPERATE_RET  (*fseek)        (TUYA_FILE file, INT64_T offs, INT_T whence);
   INT64_T      (*ftell)        (TUYA_FILE file);
} TUYA_OS_FS_INTF;


      

Typedef TUYA_OS_MEMORY_INTF;

typedef struct {
   VOID_T* (*malloc)   (CONST size_t size);
   VOID_T  (*free)     (VOID_T* ptr);
   VOID_T* (*calloc)   (size_t nitems, size_t size);
   VOID_T* (*realloc)  (VOID_T* ptr, size_t size);
} TUYA_OS_MEMORY_INTF;
/********************************************************************************
 *********************************tuya_os_memory_intf****************************
 ********************************************************************************/

Typedef MUTEX_HANDLE

typedef void* MUTEX_HANDLE;
/********************************************************************************
 *********************************tuya_os_mutex_intf*****************************
 ********************************************************************************/

Typedef TUYA_OS_MUTEX_INTF;

typedef struct {
   OPERATE_RET  (*init)     (MUTEX_HANDLE *pMutexHandle);
   OPERATE_RET  (*lock)     (const MUTEX_HANDLE mutexHandle);
   OPERATE_RET  (*unlock)   (const MUTEX_HANDLE mutexHandle);
   OPERATE_RET  (*release)  (const MUTEX_HANDLE mutexHandle);
} TUYA_OS_MUTEX_INTF;


      

Typedef UNW_PROTOCOL_TYPE;

typedef enum {
   PROTOCOL_TCP = 0,
   PROTOCOL_UDP = 1,
   PROTOCOL_RAW = 2,
}UNW_PROTOCOL_TYPE;
/* tuya sdk definition of socket protocol */

Typedef UNW_TRANS_TYPE_E;

typedef enum {
   TRANS_RECV = 0,
   TRANS_SEND = 1,
}UNW_TRANS_TYPE_E;
/* tuya sdk definition of transfer type */

Typedef UNW_IP_ADDR_T

typedef UINT_T UNW_IP_ADDR_T;
/* tuya sdk definition of IP addr */

Typedef NW_IP_S;

typedef struct
{
   char ip[16];   /* ip addr:  xxx.xxx.xxx.xxx  */
   char mask[16]; /* net mask: xxx.xxx.xxx.xxx  */
   char gw[16];   /* gateway:  xxx.xxx.xxx.xxx  */
}NW_IP_S;
/* tuya sdk definition of IP info */

Typedef NW_MAC_S;

typedef struct
{
   uint8_t mac[TY_MAC_ADDR_LEN]; /* mac address */
}NW_MAC_S;
/* tuya sdk definition of MAC info */

Typedef nw_in_addr_t

typedef uint32_t nw_in_addr_t;


      

Typedef TUYA_OS_NETWORK_INTF;

typedef struct {
   int          (*get_errno)    (void);
   int          (*fd_set1)      (int fd, UNW_FD_SET_T* fds);
   int          (*fd_clear)     (int fd, UNW_FD_SET_T* fds);
   int          (*fd_isset)     (int fd, UNW_FD_SET_T* fds);
   int          (*fd_zero)      (UNW_FD_SET_T* fds);
   int          (*select)       (const int maxfd, UNW_FD_SET_T *readfds, UNW_FD_SET_T *writefds, UNW_FD_SET_T *errorfds, const UINT_T ms_timeout);
   int          (*get_nonblock) (const int fd);
   int          (*set_block)    (const int fd, const BOOL_T block);
   int          (*close)        (const int fd);
   int          (*shutdown)     (const int fd, const int how);
   int          (*socket_create) (const UNW_PROTOCOL_TYPE type);
   int          (*connect)      (const int fd, const UNW_IP_ADDR_T addr, const UINT16_T port);
   int          (*connect_raw)  (const int fd, void *p_socket, const int len);
   int          (*bind)         (const int fd, const UNW_IP_ADDR_T addr, const UINT16_T port);
   int          (*listen)       (const int fd, const int backlog);
   int          (*send)         (const int fd, const void *buf, const UINT_T nbytes);
   int          (*send_to)      (const int fd, const void *buf, const UINT_T nbytes, const UNW_IP_ADDR_T addr, const UINT16_T port);
   int          (*recv)         (const int fd, void *buf, const UINT_T nbytes);
   int          (*recvfrom)     (const int fd, void *buf, const UINT_T nbytes, UNW_IP_ADDR_T *addr, UINT16_T *port);
   int          (*set_timeout)  (const int fd, const int ms_timeout, const UNW_TRANS_TYPE_E type);
   int          (*set_bufsize)  (const int fd, const int buf_size, const UNW_TRANS_TYPE_E type);
   int          (*set_reuse)    (const int fd);
   int          (*disable_nagle) (const int fd);
   int          (*set_boardcast) (const int fd);
   int          (*gethostbyname) (const char *domain, UNW_IP_ADDR_T *addr);
   int          (*accept)       (const int fd, UNW_IP_ADDR_T *addr, UINT16_T *port);
   int          (*recv_nd_size) (const int fd, void *buf, const UINT_T buf_size, const UINT_T nd_size);
   UNW_IP_ADDR_T (*str2addr)     (const char *ip_str);
   char*        (*addr2str)     (UNW_IP_ADDR_T ipaddr);
   int          (*set_keepalive) (int fd, const bool_t alive, const UINT_T idle, const UINT_T intr, const UINT_T cnt);
   int          (*socket_bind)  (int fd, const char *ip);
   int          (*set_cloexec)  (const int fd);
   int          (*get_socket_ip) (int fd, UNW_IP_ADDR_T *addr);
   UNW_IP_ADDR_T (*addr)         (const char *cp);
   int (*setsockopt)(int fd, int level, int optname, void *optval, int optlen);
}TUYA_OS_NETWORK_INTF;
/* add begin: by sunkz, interface regist */

Typedef TUYA_OS_OUTPUT_INTF;

typedef struct {
   VOID_T       (*output_log) (CONST CHAR_T *str);
   OPERATE_RET  (*log_close)  (VOID_T);
   OPERATE_RET  (*log_open)   (VOID_T);
} TUYA_OS_OUTPUT_INTF;
/********************************************************************************
 *********************************tuya_os_output_intf****************************
 ********************************************************************************/

Typedef SEM_HANDLE

typedef void* SEM_HANDLE;
#define TUYA_OS_ADAPT_SEM_FOREVER 4294967295

/********************************************************************************
 *********************************tuya_os_semaphore_intf*************************
 ********************************************************************************/

Typedef TUYA_OS_SEMAPHORE_INTF;

typedef struct {
   OPERATE_RET  (*init)      (SEM_HANDLE *pHandle, CONST UINT_T semCnt, CONST UINT_T sem_max);
   OPERATE_RET  (*wait)      (CONST SEM_HANDLE semHandle);
   OPERATE_RET  (*waittimeout)(CONST SEM_HANDLE semHandle, unsigned int timeout);
   OPERATE_RET  (*post)      (CONST SEM_HANDLE semHandle);
   OPERATE_RET  (*release)   (CONST SEM_HANDLE semHandle);
} TUYA_OS_SEMAPHORE_INTF;


      

Typedef SYS_TICK_T

typedef UINT64_T SYS_TICK_T;
#else
typedef UINT_T SYS_TICK_T;


      

Typedef TY_RST_REASON_E;

typedef enum {
 TY_RST_POWER_OFF = 0,
 TY_RST_HARDWARE_WATCHDOG,
 TY_RST_FATAL_EXCEPTION,
 TY_RST_SOFTWARE_WATCHDOG,
 TY_RST_SOFTWARE,
 TY_RST_DEEPSLEEP,
 TY_RST_HARDWARE,
 TY_RST_OTHER = 0xAA,
 TY_RST_UNSUPPORT = 255,
} TY_RST_REASON_E;


      

Typedef TY_CPU_SLEEP_MODE_E;

typedef enum {
 TY_CPU_SLEEP,
 TY_CPU_DEEP_SLEEP,
} TY_CPU_SLEEP_MODE_E;


      

Typedef TUYA_OS_SYSTEM_INTF;

typedef struct {
   SYS_TICK_T     (*get_systemtickcount)   (void);
   UINT_T         (*get_tickratems)        (void);
   void           (*system_sleep)          (const unsigned long msTime);
   void           (*system_reset)          (void);
   unsigned int   (*watchdog_init_start)   (const unsigned int timeval);
   void           (*watchdog_refresh)      (void);
   void           (*watchdog_stop)         (void);
   int            (*system_getheapsize)    (void);
   TY_RST_REASON_E (*system_get_rst_info)   (void);
   OPERATE_RET    (*system_get_rst_ext_info)(CHAR_T** ext_info);
   int            (*get_random_data)       (const unsigned int range);
   int            (*set_cpu_lp_mode)       (const bool_t en, const TY_CPU_SLEEP_MODE_E mode);
} TUYA_OS_SYSTEM_INTF;


      

Typedef THREAD_HANDLE

typedef void* THREAD_HANDLE;
/********************************************************************************
 *********************************tuya_os_thread_intf****************************
 ********************************************************************************/

Typedef THREAD_FUNC_T

typedef void (*THREAD_FUNC_T)(void*);


      

Typedef TUYA_OS_THREAD_INTF;

typedef struct {
   OPERATE_RET  (*create)        (THREAD_HANDLE* thread, CONST char* name, UINT_T stack_size, UINT_T priority, THREAD_FUNC_T func, VOID_T* CONST arg);
   OPERATE_RET  (*release)       (THREAD_HANDLE thread);
   OPERATE_RET  (*is_self)       (THREAD_HANDLE thread, BOOL_T* is_self);
   OPERATE_RET  (*set_self_name) (CONST CHAR_T* name);
   OPERATE_RET  (*watermark)     (THREAD_HANDLE thread, UINT_T* watermark);
} TUYA_OS_THREAD_INTF;


      

Typedef TUYA_OS_QUEUE_INTF;

typedef struct {
   OPERATE_RET  (*init)  (QUEUE_HANDLE *queue, int msgsize,int msgcount);
   VOID_T       (*free)  (QUEUE_HANDLE queue);
   OPERATE_RET  (*post)  (QUEUE_HANDLE queue, void *data, unsigned int timeout);
   OPERATE_RET  (*fetch) (QUEUE_HANDLE queue, void *msg, unsigned int timeout);
} TUYA_OS_QUEUE_INTF;


      

Typedef BT_ABILITY

typedef INT_T BT_ABILITY;
#define BT_ABI_NEED_RESET_STACK  (1<<0)
//#define BT_ABI_OTHER   (1<<1)



      

Typedef ty_bt_scan_type_t;

typedef enum {
   TY_BT_SCAN_BY_NAME = 1,
   TY_BT_SCAN_BY_MAC = 2,
   TY_BT_SCAN_BY_ADV = 3, //接收蓝牙广播
}ty_bt_scan_type_t;


      

Typedef ty_bt_cb_event_t;

typedef enum {
   TY_BT_EVENT_DISCONNECTED,  /* APP断开连接 */
   TY_BT_EVENT_CONNECTED,     /* APP连接上设备 */
   TY_BT_EVENT_RX_DATA,       /* 接收到APP数据*/
   TY_BT_EVENT_ADV_READY,     /* start adv. */
}ty_bt_cb_event_t;


      

Typedef ty_bt_mode_t;

typedef enum {
   TY_BT_MODE_PERIPHERAL = BIT(0),
   TY_BT_MODE_CENTRAL = BIT(1),
   TY_BT_MODE_MESH_PROVISIONER = BIT(2),
   TY_BT_MODE_MESH_DEVICE = BIT(3),
}ty_bt_mode_t;


      

Typedef tuya_ble_data_buf_t;

typedef struct{
 unsigned int len;
 unsigned char *data;
}tuya_ble_data_buf_t;


      

Typedef ty_bt_mesh_prov_cb_event_t;

typedef enum {
   TY_BT_MESH_PROV_EVENT_STACK_STATE,
   TY_BT_MESH_PROV_EVENT_ADD_DEV,
   TY_BT_MESH_PROV_EVENT_DEL_DEV,
   TY_BT_MESH_PROV_EVENT_RECV_DATA,
   TY_BT_MESH_PROV_EVENT_RECV_UNPROV_ADV,
   TY_BT_MESH_PROV_EVENT_MAX,
} ty_bt_mesh_prov_cb_event_t;


      

Typedef ty_bt_mesh_prov_init_state_t;

typedef enum {
   TY_BT_MESH_PROV_STACK_INIT_STATE_IDLE,
   TY_BT_MESH_PROV_STACK_INIT_STATE_INITING,
   TY_BT_MESH_PROV_STACK_INIT_STATE_READY,
   TY_BT_MESH_PROV_STACK_INIT_STATE_DEINITING,
} ty_bt_mesh_prov_init_state_t;


      

Typedef ty_bt_mesh_prov_cb_param_t;

typedef union {
   struct ble_mesh_prov_stack_state_param {
       INT_T err_code; /*!< Indicate the result of BLE Mesh initialization */
       ty_bt_mesh_prov_init_state_t init_state; /*!< Mesh stack init state */
   } prov_stack_state;  /*!< Event parameter of TY_BT_MESH_PROV_EVENT_STACK_STATE */
   struct ble_mesh_prov_add_comp_param {
       INT_T err_code; /*!< Indicate the result of BLE Mesh initialization */
       UINT16_T unicast_addr; /*!< Primary address of the provisioned device */
       UINT8_T dev_uuid[16]; /*!< Device UUID of the unprovisioned device */
       UINT8_T mac[6]; /*!< Device address of the unprovisioned device */
       UINT8_T dev_key[16];
       UINT8_T* composite_data;
       UINT16_T composite_data_len;
   } prov_add_comp;  /*!< Event parameter of TY_BT_MESH_PROV_EVENT_ADD_DEV */

   struct ble_mesh_prov_del_comp_param {
       INT_T err_code; /*!< Indicate the result of BLE Mesh initialization */
       UINT16_T unicast_addr; /*!< Primary address of the provisioned device */
   } prov_del_comp;  /*!< Event parameter of TY_BT_MESH_PROV_EVENT_DEL_DEV */

   struct ble_mesh_prov_recv_data_param {
       INT_T err_code; /*!< Indicate the result of BLE Mesh initialization */
       UINT16_T unicast_addr; /*!< Primary address of the provisioned device */
       UINT8_T *data;
       UINT_T len;
   } prov_recv_data;  /*!< Event parameter of TY_BT_MESH_PROV_EVENT_RECV_DATA */

   struct ble_mesh_prov_recv_unprov_adv_pkt_param {
       UINT8_T dev_uuid[16]; /*!< Device UUID of the unprovisioned device */
       UINT8_T mac[6]; /*!< Device address of the unprovisioned device */
       UINT8_T addr_type; /*!< Device address type */
       UINT16_T oob_info; /*!< OOB Info of the unprovisioned device */
       UINT8_T adv_type; /*!< Avertising type of the unprovisioned device */
       INT8_T rssi; /*!< RSSI of the received advertising packet */
   } prov_recv_unprov_adv_pkt;  /*!< Event parameter of TY_BT_MESH_PROV_EVENT_RECV_UNPROV_ADV */

} ty_bt_mesh_prov_cb_param_t;


      

Typedef ty_ble_central_init_state_t;

typedef enum {
   TY_BLE_CENTRAL_STACK_INIT_STATE_IDLE,
   TY_BLE_CENTRAL_STACK_INIT_STATE_INITING,
   TY_BLE_CENTRAL_STACK_INIT_STATE_READY,
   TY_BLE_CENTRAL_STACK_INIT_STATE_DEINITING,
} ty_ble_central_init_state_t;


      

Typedef ty_ble_gap_adv_type_t;

typedef enum {
   TY_BLE_GAP_ADV_EVT_TYPE_UNDIRECTED = 0,   /**<  Connectable  undirected advertising. */
   TY_BLE_GAP_ADV_EVT_TYPE_DIRECTED  = 1,   /**<  Connectable directed advertising. */
   TY_BLE_GAP_ADV_EVT_TYPE_SCANNABLE = 2,   /**<  Scanable undirected advertising. */
   TY_BLE_GAP_ADV_EVT_TYPE_NON_CONNECTABLE,  /**<  Nonconnectable undirected advertising. */
   TY_BLE_GAP_ADV_EVT_TYPE_SCAN_RSP          /**<  scan response. */
} ty_ble_gap_adv_type_t;


      

Typedef ty_bt_uuid_t;

typedef struct {
#define TY_BT_UUID_LEN_16    2
#define TY_BT_UUID_LEN_32    4
#define TY_BT_UUID_LEN_128   16
   UINT16_T len;						/*!< UUID length, 16bit, 32bit or 128bit */
   union {
       UINT16_T   uuid16;                /*!< 16bit UUID */
       UINT_T   uuid32;                /*!< 32bit UUID */
       UINT8_T    uuid128[TY_BT_UUID_LEN_128]; /*!< 128bit UUID */
   } uuid;																/*!< UUID */
} __attribute__((packed)) ty_bt_uuid_t;


      

Typedef ty_ble_addr_type_t;

typedef enum {
   TUYA_BLE_ADDR_RANDOM = 1,
   TUYA_BLE_ADDR_PUBLIC = 2,
} ty_ble_addr_type_t;


      

Typedef ty_ble_central_cb_event_t;

typedef enum {
   TY_BLE_CENTRAL_EVENT_STACK_STATE,
   TY_BLE_CENTRAL_EVENT_GAP_RECV_SCAN_INFO,
   TY_BLE_CENTRAL_EVENT_GAP_CONN_EVT,
   TY_BLE_CENTRAL_EVENT_GAP_DISCONN_EVT,
   TY_BLE_CENTRAL_EVENT_GATTC_RECV_DATA,
   TY_BLE_CENTRAL_EVENT_GATTC_CFG_MTU_EVT,
   TY_BLE_CENTRAL_EVENT_GATTC_DIS_SRVC_CMPL_EVT,   /*!< When the ble discover service complete, the event comes */
   TY_BLE_CENTRAL_EVENT_MAX,
} ty_ble_central_cb_event_t;


      

Typedef ty_ble_central_cb_param_t;

typedef union {
   struct ble_cent_stack_state_param {
       INT_T err_code; /*!< Indicate the result of BLE Central initialization */
       ty_ble_central_init_state_t init_state; /*!< BLE Central stack init state */
   } ble_cent_stack_state;  /*!< Event parameter of TY_BLE_CENTRAL_EVENT_STACK_STATE */
   struct ble_gap_scan_info_param {
       UINT8_T mac[6]; /**< Bluetooth address of remote device. */
       ty_ble_addr_type_t remote_addr_type; /**< Address type of remote device. */
       ty_ble_gap_adv_type_t adv_type; /**< Advertising event type. */
       INT8_T rssi; /**< RSSI. */
       UINT8_T data_len;
       UINT8_T data[31];
   } gap_scan_info;  /*!< Event parameter of TY_BLE_CENTRAL_EVENT_GAP_RECV_SCAN_INFO */
   struct ble_gap_conn_evt_param {
       UINT8_T mac[6]; /**< Bluetooth address of remote device. */
   } gap_conn_evt;  /*!< Event parameter of TY_BLE_CENTRAL_EVENT_GAP_CONN_EVT */
   struct ble_gap_disconn_evt_param {
       INT_T err_code; /*!< Indicate the result of BLE Central initialization */
       BOOL_T discovery_success;
       UINT8_T mac[6]; /**< Bluetooth address of remote device. */
   } gap_disconn_evt;  /*!< Event parameter of TY_BLE_CENTRAL_EVENT_GAP_DISCONN_EVT */
   struct ble_gattc_cfg_mtu_evt_param {
       UINT8_T mac[6]; /**< Bluetooth address of remote device. */
       UINT16_T conn_id;              /*!< Connection id */
       UINT16_T mtu;                  /*!< MTU size */
   } gattc_cfg_mtu;  /*!< Event parameter of TY_BLE_CENTRAL_EVENT_GATTC_CFG_MTU_EVT */
   struct gattc_dis_srvc_cmpl_evt_param {
       INT_T err_code; /*!< Indicate the result of BLE Central initialization */
       UINT8_T mac[6]; /**< Bluetooth address of remote device. */
       ty_ble_addr_type_t remote_addr_type; /**< Address type of remote device. */
       UINT16_T conn_id;             /*!< Connection id */
   } gattc_dis_srvc_cmpl;  /*!< Event parameter of TY_BLE_CENTRAL_EVENT_GATTC_DIS_SRVC_CMPL_EVT */
   struct ble_gattc_recv_data_param {
       UINT8_T mac[6]; /**< Bluetooth address of remote device. */
       UINT_T data_len;
       UINT8_T *data;
   } gattc_recv_data;  /*!< Event parameter of TY_BLE_CENTRAL_EVENT_GATTC_RECV_DATA */
} ty_ble_central_cb_param_t;


      

Typedef TY_BT_MSG_CB

typedef VOID (*TY_BT_MSG_CB)(INT_T id, ty_bt_cb_event_t e, tuya_ble_data_buf_t *buf);


      

Typedef TY_BT_MESH_PROV_MSG_CB

typedef VOID (*TY_BT_MESH_PROV_MSG_CB)(ty_bt_mesh_prov_cb_event_t event, ty_bt_mesh_prov_cb_param_t *params);


      

Typedef TY_BLE_CENTRAL_MSG_CB

typedef VOID (*TY_BLE_CENTRAL_MSG_CB)(ty_ble_central_cb_event_t event, ty_ble_central_cb_param_t *params);


      

Typedef ty_bt_param_t;

typedef struct {
   CHAR_T name[DEVICE_NAME_LEN];
   ty_bt_mode_t mode;
   UCHAR_T link_num;
   TY_BT_MSG_CB cb;
   tuya_ble_data_buf_t adv;
   tuya_ble_data_buf_t scan_rsp;
}ty_bt_param_t;


      

Typedef TY_BT_SCAN_ADV_CB

typedef VOID (*TY_BT_SCAN_ADV_CB)(CHAR_T *data, UINT_T len, UCHAR_T* mac, UINT8_T type);


      

Typedef ty_bt_scan_info_t;

typedef struct {
   CHAR_T scan_type; /* ref ty_bt_scan_type_t. */
   CHAR_T name[DEVICE_NAME_LEN];
   CHAR_T bd_addr[6];
   SCHAR_T rssi;
   UCHAR_T channel;
   UCHAR_T timeout_s; /* second. */
   TY_BT_SCAN_ADV_CB scan_adv_cb;
}ty_bt_scan_info_t;


      

Typedef ty_ble_mesh_info_t;

typedef struct{
   UINT8_T netkey[TY_BT_MESH_NET_KEY_LEN];
   UINT8_T appkey[TY_BT_MESH_APP_KEY_LEN];
   UINT16_T local_addr;
}ty_ble_mesh_info_t;


      

Typedef ty_ble_gap_conn_params_t;

typedef struct {
   /** Scan interval in 0.625ms units */
   UINT16_T scan_itvl;

   /** Scan window in 0.625ms units */
   UINT16_T scan_window;

   /** Minimum value for connection interval in 1.25ms units */
   UINT16_T itvl_min;

   /** Maximum value for connection interval in 1.25ms units */
   UINT16_T itvl_max;

   /** Connection latency */
   UINT16_T latency;

   /** Supervision timeout in 10ms units */
   UINT16_T supervision_timeout;

   /** Minimum length of connection event in 0.625ms units */
   UINT16_T min_ce_len;

   /** Maximum length of connection event in 0.625ms units */
   UINT16_T max_ce_len;
} ty_ble_gap_conn_params_t;


      

Typedef ty_ble_central_param_t;

typedef struct {
   TY_BLE_CENTRAL_MSG_CB ble_central_cb;
}ty_ble_central_param_t;


      

Typedef TUYA_OS_BT_INTF;

typedef struct {
   OPERATE_RET (*port_init)(ty_bt_param_t *p);
   OPERATE_RET (*port_deinit)(VOID_T);
   OPERATE_RET (*gap_disconnect)(VOID_T);
   OPERATE_RET (*send)(BYTE_T *data, UINT8_T len);
   OPERATE_RET (*reset_adv)(tuya_ble_data_buf_t *adv, tuya_ble_data_buf_t *scan_resp);
   OPERATE_RET (*get_rssi)(SCHAR_T *rssi);
   OPERATE_RET (*start_adv)(VOID_T);
   OPERATE_RET (*stop_adv)(VOID_T);
   OPERATE_RET (*assign_scan)(INOUT ty_bt_scan_info_t *info);
   OPERATE_RET (*scan_init)(IN TY_BT_SCAN_ADV_CB scan_adv_cb);
   OPERATE_RET (*start_scan)(VOID_T);
   OPERATE_RET (*stop_scan)(VOID_T);
   OPERATE_RET (*get_ability)(VOID_T);
   OPERATE_RET (*set_mac)(CONST NW_MAC_S *mac);
   OPERATE_RET (*get_mac)(NW_MAC_S *mac);
   OPERATE_RET (*send_beacon)(tuya_ble_data_buf_t *adv, tuya_ble_data_buf_t *scan_resp, UINT16_T interval, UINT16_T timeout);

   OPERATE_RET (*central_init)(ty_ble_central_param_t *p);
   OPERATE_RET (*central_deinit)(VOID_T);
   OPERATE_RET (*master_connect)(UINT8_T mac[6], ty_ble_addr_type_t type, UINT_T timeout_ms, ty_ble_gap_conn_params_t *params);
   OPERATE_RET (*master_disconnect)(UINT8_T mac[6], ty_ble_addr_type_t type);
   OPERATE_RET (*master_scan)(BOOL_T enable);
   OPERATE_RET (*master_get_max_slave_num)(UINT16_T *num);
   OPERATE_RET (*gattc_send_data)(UINT8_T mac[6], UINT8_T *data, UINT_T length);
   OPERATE_RET (*gattc_start_discovery)(UINT8_T mac[6], ty_bt_uuid_t *uuid);
} TUYA_OS_BT_INTF;


      

Typedef ty_ble_mesh_prov_param_t;

typedef struct {
   TY_BT_MESH_PROV_MSG_CB mesh_prov_cb;
}ty_ble_mesh_prov_param_t;


      

Typedef TUYA_OS_BLE_MESH_RPOV_INTF;

typedef struct {
   OPERATE_RET (*mesh_prov_init)(ty_ble_mesh_prov_param_t *p);
   OPERATE_RET (*mesh_prov_deinit)(VOID_T);
   OPERATE_RET (*mesh_prov_set_info)(ty_ble_mesh_info_t *info);
   OPERATE_RET (*mesh_prov_set_addr)(UINT16_T mesh_addr);
   OPERATE_RET (*mesh_prov_scan)(BOOL_T enable);
   OPERATE_RET (*mesh_prov_add_dev)(UINT8_T uuid[16], UINT8_T mac[6], UINT16_T mesh_addr);
   OPERATE_RET (*mesh_prov_del_dev_with_addr)(UINT16_T mesh_addr, UINT8_T dev_key[16]);
   OPERATE_RET (*mesh_prov_send_data)(UINT_T opcode, UINT16_T mesh_addr, UINT8_T *data, UINT_T length, UINT8_T dev_key[16]);
   OPERATE_RET (*mesh_prov_node_reset)(VOID_T);
} TUYA_OS_BLE_MESH_RPOV_INTF;


      

Typedef AP_IF_S;

typedef struct
{
   unsigned char channel;                ///< AP channel
   signed char rssi;                            ///< AP rssi
   unsigned char bssid[6];               ///< AP bssid
   unsigned char ssid[WIFI_SSID_LEN+1];  ///< AP ssid array
   unsigned char s_len;                  ///< AP ssid len
   unsigned char security;          //refer to WF_AP_AUTH_MODE_E
   unsigned char resv1;
 uint8_t data_len;
   uint8_t data[0];
}AP_IF_S;


      

Typedef COUNTRY_CODE_E;

typedef enum {
   COUNTRY_CODE_CN,
   COUNTRY_CODE_US,
   COUNTRY_CODE_JP,
   COUNTRY_CODE_EU
} COUNTRY_CODE_E;


      

Typedef MIMO_TYPE_E;

typedef enum
{
   MIMO_TYPE_NORMAL = 0,
   MIMO_TYPE_HT40,
   MIMO_TYPE_2X2,
   MIMO_TYPE_LDPC,

   MIMO_TYPE_NUM,
}MIMO_TYPE_E;
/**
 * @brief WIFI芯片探测本地AP信息结构体
 * @struct MIMO_IF_S
 */

Typedef MIMO_IF_S;

typedef struct
{
   signed char rssi;               /*!< MIMO包信号 */
   MIMO_TYPE_E type;          /*!< MIMO包类型 */
   unsigned short len;              /*!< MIMO包长度 */
   unsigned char channel;           /*!< MIMO包信道 */
   unsigned char mcs;
} MIMO_IF_S;


      

Typedef WLAN_FRM_TP_E;

typedef enum {
   WFT_PROBE_REQ  = 64,    ///< Probe request
   WFT_PROBE_RSP  = 80,    ///< Probe response
   WFT_AUTH       = 0xB0,        //auth
   WFT_BEACON     = 128,    ///< Beacon
   WFT_DATA       = 8,    ///< Data
   WFT_QOS_DATA   = 136,    ///< QOS Data
   WFT_MIMO_DATA  = 255,    ///< MIMO Data
}WLAN_FRM_TP_E;


      

Typedef WLAN_MANAGEMENT_S;

typedef struct {
   //802.11 management
   unsigned char id;
   unsigned char len;
   char data[0];  ///< data
} WLAN_MANAGEMENT_S;


      

Typedef WLAN_PROBE_REQ_IF_S;

typedef struct {
   unsigned char frame_type;           ///< WLAN Frame type
   unsigned char frame_ctrl_flags;     ///< Frame Control flags
   unsigned short duration;             ///< Duration
   unsigned char dest[6];              ///< Destination MAC Address
   unsigned char src[6];               ///< Source MAC Address
   unsigned char bssid[6];             ///< BSSID MAC Address
   unsigned short seq_frag_num;         ///< Sequence and Fragmentation number
} WLAN_PROBE_REQ_IF_S;


      

Typedef WLAN_BEACON_IF_S;

typedef struct {
   unsigned char    frame_ctrl_flags;  ///< Frame Control flags
   unsigned short   duration;          ///< Duration
   unsigned char    dest[6];           ///< Destination MAC Address
   unsigned char    src[6];            ///< Source MAC Address
   unsigned char    bssid[6];          ///< BSSID MAC Address
   unsigned short   seq_frag_num;      ///< Sequence and Fragmentation number
   unsigned char    timestamp[8];      ///< Time stamp
   unsigned short   beacon_interval;   ///< Beacon Interval
   unsigned short   cap_info;          ///< Capability Information
   unsigned char    ssid_element_id;   ///< SSID Element ID
   unsigned char    ssid_len;          ///< SSID Length
   char       ssid[0];           ///< SSID
}WLAN_BEACON_IF_S;


      

Typedef BC_DA_CHAN_T

typedef unsigned char BC_DA_CHAN_T;
#define BC_TO_AP 0
#define BC_FROM_AP 1
#define BC_CHAN_NUM 2



      

Typedef WLAN_COM_ADDR_S;

typedef struct {
   unsigned char addr1[6];
   unsigned char addr2[6];
   unsigned char addr3[6];
}WLAN_COM_ADDR_S;


      

Typedef WLAN_TO_AP_ADDR_S;

typedef struct {
   unsigned char bssid[6];
   unsigned char src[6];
   unsigned char dst[6];
}WLAN_TO_AP_ADDR_S;


      

Typedef WLAN_FROM_AP_ADDR_S;

typedef struct {
   unsigned char dst[6];
   unsigned char bssid[6];
   unsigned char src[6];
}WLAN_FROM_AP_ADDR_S;


      

Typedef WLAN_ADDR_U;

typedef union {
   WLAN_COM_ADDR_S com;
   WLAN_TO_AP_ADDR_S to_ap;
   WLAN_FROM_AP_ADDR_S from_ap;
}WLAN_ADDR_U;


      

Typedef WLAN_DATA_IF_S;

typedef struct {
   unsigned char frame_ctrl_flags;  ///< Frame Control flags
   unsigned short duration;         ///< Duration
   WLAN_ADDR_U addr;                ///< address
   unsigned short seq_frag_num;     ///< Sequence and Fragmentation number
   unsigned short qos_ctrl;         ///< QoS Control bits
}WLAN_DATA_IF_S;


      

Typedef frame_data;

typedef struct {
   unsigned char frame_type;                ///< WLAN Frame type
   union {
       WLAN_BEACON_IF_S beacon_info;  ///< WLAN Beacon info
       WLAN_DATA_IF_S  data_info;    ///< WLAN Data info
       MIMO_IF_S       mimo_info;    ///< mimo info
   } frame_data;
/*!
\brief WLAN Frame info
\struct WLAN_FRAME_S
*/

Typedef PROBE_REQUEST_PACKAGE_HEAD_S;

typedef struct
{
   unsigned short type_and_subtype;
   unsigned short duration_id;
   unsigned char addr1[6];
   unsigned char addr2[6];
   unsigned char addr3[6];
   unsigned short seq_ctrl;
} PROBE_REQUEST_PACKAGE_HEAD_S;


      

Typedef PROBE_RESPONSE_PACKAGE_HEAD_S;

typedef struct
{
   uint16_t type_and_subtype;
   uint16_t duration_id;
   uint8_t addr1[6];
   uint8_t addr2[6];
   uint8_t addr3[6];
   uint16_t seq_ctrl;
   uint8_t timestamp[8]; // Time stamp
   uint16_t beacon_interval; // Beacon Interval
   uint16_t cap_info; // Capability Information
} PROBE_RESPONSE_PACKAGE_HEAD_S;


      

Typedef BEACON_TAG_DATA_UNIT_S; #pragma pack()

typedef struct
{
   unsigned char index;
   unsigned char len;
   unsigned char ptr[0];
} BEACON_TAG_DATA_UNIT_S;
#pragma pack()



      

Typedef PROBE_REQUEST_FIX_S;

typedef struct
{
   PROBE_REQUEST_PACKAGE_HEAD_S pack_head;
   BEACON_TAG_DATA_UNIT_S tag_ssid;
} PROBE_REQUEST_FIX_S;


      

Typedef WF_IF_E;

typedef enum
{
   WF_STATION = 0,    ///< station type
   WF_AP,             ///< ap type
}WF_IF_E;
/* tuya sdk definition of wifi function type */

Typedef WF_WK_MD_E;

typedef enum
{
   WWM_LOWPOWER = 0,  ///< wifi work in lowpower mode
   WWM_SNIFFER,       ///< wifi work in sniffer mode
   WWM_STATION,       ///< wifi work in station mode
   WWM_SOFTAP,        ///< wifi work in ap mode
   WWM_STATIONAP,     ///< wifi work in station+ap mode
   WWM_UNKNOWN,       ///< wifi work in unknown mode
}WF_WK_MD_E;
/* tuya sdk definition of wifi work mode */

Typedef WF_AP_AUTH_MODE_E;

typedef enum
{
   WAAM_OPEN = 0,     ///< open
   WAAM_WEP,          ///< WEP
   WAAM_WPA_PSK,      ///< WPA—PSK
   WAAM_WPA2_PSK,     ///< WPA2—PSK
   WAAM_WPA_WPA2_PSK, ///< WPA/WPA2
   WAAM_UNKNOWN,      //unknown
}WF_AP_AUTH_MODE_E;
/* tuya sdk definition of wifi encryption type */

Typedef WF_AP_CFG_IF_S;

typedef struct {
   unsigned char ssid[WIFI_SSID_LEN+1];      ///< ssid
   unsigned char s_len;                      ///< len of ssid
   unsigned char passwd[WIFI_PASSWD_LEN+1];  ///< passwd
   unsigned char p_len;                      ///< len of passwd
   unsigned char chan;                       ///< channel. default:6
   WF_AP_AUTH_MODE_E md;                     ///< encryption type
   unsigned char ssid_hidden;                ///< ssid hidden  default:0
   unsigned char max_conn;                   ///< max sta connect nums default:3
   unsigned short ms_interval;               ///< broadcast interval default:100
   NW_IP_S ip;                               ///< ip info for ap mode
}WF_AP_CFG_IF_S; 
/* tuya sdk definition of ap config info */

Typedef WF_STATION_STAT_E;

typedef enum {
   WSS_IDLE = 0,                      ///< not connected
   WSS_CONNECTING,                    ///< connecting wifi
   WSS_PASSWD_WRONG,                  ///< passwd not match
   WSS_NO_AP_FOUND,                   ///< ap is not found
   WSS_CONN_FAIL,                     ///< connect fail
   WSS_CONN_SUCCESS,                  ///< connect wifi success
   WSS_GOT_IP,                        ///< get ip success
}WF_STATION_STAT_E;
/* tuya sdk definition of wifi station work status */

Typedef FAST_WF_CONNECTED_AP_INFO_V2_S;

typedef struct {
   unsigned int len;                                                   ///< data len
   unsigned char data[0];                                               ///< data buff
}FAST_WF_CONNECTED_AP_INFO_V2_S;
/* for fast connect*/

Typedef SNIFFER_CALLBACK

typedef void (*SNIFFER_CALLBACK)(CONST UINT8_T *buf, CONST UINT16_T len, CONST SCHAR_T rssi);
/**
 * @brief callback function: SNIFFER_CALLBACK
 *        when wifi sniffers package from air, notify tuya-sdk
 *        with this callback. the package should include
 * @param[in]       buf         the buf wifi recv
 * @param[in]       len         the len of buf
 */

Typedef WIFI_REV_MGNT_CB

typedef void (*WIFI_REV_MGNT_CB)(UCHAR_T *buf, UINT_T len);
/**
 * @brief receive wifi management callback
 * 
 */

Typedef TUYA_OS_WIFI_INTF;

typedef struct {
   OPERATE_RET (*all_ap_scan)(AP_IF_S **ap_ary, UINT_T *num);
   OPERATE_RET (*assign_ap_scan)(CONST SCHAR_T *ssid, AP_IF_S **ap);
   OPERATE_RET (*release_ap)(AP_IF_S *ap);
   OPERATE_RET (*set_cur_channel)(CONST UCHAR_T chan);
   OPERATE_RET (*get_cur_channel)(UCHAR_T *chan);
   OPERATE_RET (*sniffer_set)(CONST BOOL_T en, CONST SNIFFER_CALLBACK cb);
   OPERATE_RET (*get_ip)(CONST WF_IF_E wf, NW_IP_S *ip);
   OPERATE_RET (*set_mac)(CONST WF_IF_E wf, CONST NW_MAC_S *mac);
   OPERATE_RET (*get_mac)(CONST WF_IF_E wf, NW_MAC_S *mac);
   OPERATE_RET (*set_work_mode)(CONST WF_WK_MD_E mode);
   OPERATE_RET (*get_work_mode)(WF_WK_MD_E *mode);
   OPERATE_RET (*ap_start)(CONST WF_AP_CFG_IF_S *cfg);
   OPERATE_RET (*ap_stop)(VOID_T);
   OPERATE_RET (*get_connected_ap_info_v2)(FAST_WF_CONNECTED_AP_INFO_V2_S **fast_ap_info);
   OPERATE_RET (*fast_station_connect_v2)(CONST FAST_WF_CONNECTED_AP_INFO_V2_S *fast_ap_info);
   OPERATE_RET (*station_connect)(CONST SCHAR_T *ssid, CONST SCHAR_T *passwd);
   OPERATE_RET (*station_disconnect)(VOID_T);
   OPERATE_RET (*station_get_conn_ap_rssi)(SCHAR_T *rssi);
   OPERATE_RET (*get_bssid)(UCHAR_T *mac);
   OPERATE_RET (*station_get_status)(WF_STATION_STAT_E *stat);
   OPERATE_RET (*set_country_code)(CONST COUNTRY_CODE_E ccode);
   OPERATE_RET (*send_mgnt)(CONST UCHAR_T *buf, CONST UINT_T len);
   OPERATE_RET (*register_recv_mgnt_callback)(CONST BOOL_T enable, CONST WIFI_REV_MGNT_CB recv_cb);
   OPERATE_RET (*set_lp_mode)(CONST BOOL_T en, CONST UCHAR_T dtim);
   BOOL_T     (*rf_calibrated)(VOID_T);
   OPERATE_RET (*send_beacon)(uint8_t channel, uint8_t *ssid, uint8_t ssid_len);
} TUYA_OS_WIFI_INTF;


      

Typedef UNI_STORAGE_DESC_S;

typedef struct {
   unsigned int start_addr;   ///< user physical flash start address 
   unsigned int flash_sz;     ///< user flash size
   unsigned int block_sz;     ///< flash block/sector size

   // For data backup and power down protection data recovery
   unsigned int swap_start_addr;  ///< swap flash start address
   unsigned int swap_flash_sz;    ///< swap flash size    

   /// for restore factor of flash encryption key 
   unsigned int key_restore_addr;

   // for protected data
   unsigned int protected_addr;
   unsigned int flash_physical_block_sz;
} UNI_STORAGE_DESC_S;
/**
 * @brief storage description
 * 
 */

Typedef UF_PARTITION;

typedef struct {
   unsigned int uf_partition_start_addr;
   unsigned int uf_partiton_flash_sz;
} UF_PARTITION;
/**
 * @brief UF partition
 * 
 */

Typedef UF_PARTITION_TABLE_S;

typedef struct {
   unsigned int sector_size;
   unsigned int uf_partition_num;
   UF_PARTITION uf_partition[PARTATION_NUM_MAX];
} UF_PARTITION_TABLE_S;
/**
 * @brief UF description
 * 
 */

Typedef PARTITION_TABLE_S

typedef UF_PARTITION_TABLE_S PARTITION_TABLE_S;


      

Typedef TUYA_OS_STORAGE_INTF;

typedef struct {
   OPERATE_RET            (*read)            (CONST UINT_T addr, UCHAR_T *dst, CONST UINT_T size);
   OPERATE_RET            (*write)           (CONST UINT_T addr, CONST UCHAR_T *src, CONST UINT_T size);
   OPERATE_RET            (*erase)           (CONST UINT_T addr, CONST UINT_T size);
   UNI_STORAGE_DESC_S*    (*get_storage_desc) (void);
   UF_PARTITION_TABLE_S*  (*get_uf_desc)     (void);
   PARTITION_TABLE_S*     (*get_rcd_desc)     (void);
   OPERATE_RET            (*get_legacy_swap_desc)(UINT_T *addr, UINT_T *size);
} TUYA_OS_STORAGE_INTF;


      

Typedef OTA_TYPE;

typedef enum {
   AIR_OTA_TYPE,
   UART_OTA_TYPE,
} OTA_TYPE;
/********************************************************************************
 *********************************tuya_os_ota_intf*****************************
 ********************************************************************************/

Typedef TUYA_OS_OTA_INTF;

typedef struct {
   OPERATE_RET (*start)   (UINT_T file_size, OTA_TYPE type);
   OPERATE_RET (*process) (CONST UINT_T total_len, CONST UINT_T offset, CONST UCHAR_T* data, CONST UINT_T len, UINT_T* remain_len, void* pri_data);
   OPERATE_RET (*end)     (BOOL_T reset);
} TUYA_OS_OTA_INTF;


      

Typedef GW_BASE_NW_STAT_T

typedef uint8_t GW_BASE_NW_STAT_T;
/********************************************************************************
 *********************************tuya_os_wired_intf*****************************
 ********************************************************************************/

Typedef TUYA_OS_WIRED_INTF;

typedef struct {
   OPERATE_RET (*get_ip)                  (NW_IP_S *ip);
   OPERATE_RET (*get_mac)                 (NW_MAC_S *mac);
   OPERATE_RET (*set_mac)                 (CONST NW_MAC_S *mac);
   OPERATE_RET (*set_station_connect)     (CONST CHAR_T *ssid, CONST CHAR_T *passwd);
   OPERATE_RET (*station_get_conn_ap_rssi) (SCHAR_T *rssi);
   OPERATE_RET (*get_nw_stat)             (GW_BASE_NW_STAT_T *stat);
   OPERATE_RET (*if_connect_internet)     (BOOL_T *status);
   BOOL_T     (*need_cfg)                (VOID);
   BOOL_T     (*station_conn)            (VOID);
} TUYA_OS_WIRED_INTF;


      

Typedef CELLULAR_TEST_INTF;

typedef struct {
   BOOL_T     (*sim_card_test)           (VOID);
   BOOL_T     (*tf_card_test)            (VOID);
   BOOL_T     (*sound_loopback_test)     (INT_T rate);
   BOOL_T     (*uart_loopback_test)      (VOID);
   unsigned int (*adc_self_test)          (VOID);
} CELLULAR_TEST_INTF;
/********************************************************************************
 *********************************tuya_cat1_intf*****************************
 ********************************************************************************/

Typedef CELLULAR_CMD_E;

typedef enum {
   CELLULAR_GET_TEST_INTF_CMD = 0,
   CELLULAR_GET_CELLSITE_INFO_CMD = 1,
   CELLULAR_RECOVER_SYS_CONFIG = 2,
} CELLULAR_CMD_E;


      

Typedef CELL_SITE_INFO;

typedef struct {
   unsigned char oper_id[6];  //运营商ID
   unsigned char area_code[2]; //小区编码
   unsigned char cell_id[4];  //基站编码
} CELL_SITE_INFO;


      

Typedef TUYA_OS_CELLULAR_INTF;

typedef struct {
   OPERATE_RET (*set_imei)                (CONST CHAR_T imei[15 + 1]);
   OPERATE_RET (*get_imei)                (CHAR_T imei[15 + 1]);
   OPERATE_RET (*get_iccid)               (CHAR_T iccid[20 + 1]);
   OPERATE_RET (*get_ip)                  (NW_IP_S *ip);
   OPERATE_RET (*get_simcard_state)       (uint8_t *state);
   OPERATE_RET (*get_network_state)       (BOOL_T *state);
   OPERATE_RET (*get_rssi)                (SCHAR_T *rssi);
   OPERATE_RET (*control)                 (uint8_t cmd, void *arg);
   BOOL_T     (*rf_calibrated)           (VOID_T);
} TUYA_OS_CELLULAR_INTF;


      

Typedef UNW_ERRNO_T

typedef int UNW_ERRNO_T;
#define UNW_SUCCESS      0
#define UNW_FAIL         -1
#define UNW_EINTR        -2
#define UNW_EBADF        -3
#define UNW_EAGAIN       -4
#define UNW_EFAULT       -5
#define UNW_EBUSY        -6
#define UNW_EINVAL       -7
#define UNW_ENFILE       -8
#define UNW_EMFILE       -9
#define UNW_ENOSPC       -10
#define UNW_EPIPE        -11
#define UNW_EWOULDBLOCK  -12
#define UNW_ENOTSOCK     -13
#define UNW_ENOPROTOOPT  -14
#define UNW_EADDRINUSE   -15
#define UNW_EADDRNOTAVAIL -16
#define UNW_ENETDOWN     -17
#define UNW_ENETUNREACH  -18
#define UNW_ENETRESET    -19
#define UNW_ECONNRESET   -20
#define UNW_ENOBUFS      -21
#define UNW_EISCONN      -22
#define UNW_ENOTCONN     -23
#define UNW_ETIMEDOUT    -24
#define UNW_ECONNREFUSED -25
#define UNW_EHOSTDOWN    -26
#define UNW_EHOSTUNREACH -27
#define UNW_ENOMEM       -28
#define UNW_EMSGSIZE     -29

/**
 * @brief tuya sdk definition of socket errno
 */

Typedef AES128_ECB_ENC_BUF

typedef VOID (*AES128_ECB_ENC_BUF)(IN CONST BYTE_T *input, IN CONST UINT_T length, IN CONST BYTE_T *key,OUT BYTE_T *output);


      

Typedef AES128_ECB_DEC_BUF

typedef VOID (*AES128_ECB_DEC_BUF)(IN CONST BYTE_T *input, IN CONST UINT_T length, IN CONST BYTE_T *key,OUT BYTE_T *output);


      

Typedef AES128_CBC_ENC_BUF

typedef VOID (*AES128_CBC_ENC_BUF)(IN CONST BYTE_T *input, IN CONST UINT_T length, IN CONST BYTE_T *key, IN BYTE_T *iv, OUT BYTE_T *output);


      

Typedef AES128_CBC_DEC_BUF

typedef VOID (*AES128_CBC_DEC_BUF)(IN CONST BYTE_T *input, IN CONST UINT_T length, IN CONST BYTE_T *key, IN BYTE_T *iv, OUT BYTE_T *output);


      

Typedef AES_METHOD_REG_S;

typedef struct {
   AES128_ECB_ENC_BUF ecb_enc_128;
   AES128_ECB_DEC_BUF ecb_dec_128;
   AES128_CBC_ENC_BUF cbc_enc_128;
   AES128_CBC_DEC_BUF cbc_dec_128;
}AES_METHOD_REG_S;


      

Typedef TUYA_HW_AES_MODE_E;

typedef enum TUYA_HW_AES_MODE_ {
   TUYA_HW_AES_MODE_ENCRYPT,
   TUYA_HW_AES_MODE_DECRYPT,
} TUYA_HW_AES_MODE_E;


      

Typedef TUYA_HW_AES_CRYPT_MODE_E;

typedef enum TUYA_HW_AES_CRYPT_MODE_ {
   TUYA_HW_AES_CRYPT_MODE_ECB,
   TUYA_HW_AES_CRYPT_MODE_CBC,
   TUYA_HW_AES_CRYPT_MODE_CFB,
   TUYA_HW_AES_CRYPT_MODE_OFB,
} TUYA_HW_AES_CRYPT_MODE_E;


      

Typedef TUYA_HW_AES_PARAM_S;

typedef struct TUYA_HW_AES_PARAM_ {
   TUYA_HW_AES_MODE_E       method;
   TUYA_HW_AES_CRYPT_MODE_E encryptMode;
} TUYA_HW_AES_PARAM_S;


      

Typedef TUYA_HW_AES_S;

typedef struct TUYA_HW_AES_ {
   int (*aes_create)(void** pphdl, TUYA_HW_AES_PARAM_S* pparam);
   int (*aes_destroy)(void* phdl);
   int (*aes_setkey_enc)(void* phdl, const unsigned char *key, unsigned int keybits);
   int (*aes_setkey_dec)(void* phdl, const unsigned char *key, unsigned int keybits);
   int (*aes_crypt_ecb)(void* phdl, const unsigned char* input, size_t length, unsigned char* output);
   int (*aes_crypt_cbc)(void* phdl, const unsigned char* iv, unsigned int ivbits, const unsigned char *input, size_t length, unsigned char *output);
} TUYA_HW_AES_S;


      

Typedef Tuya_CBC_AES128_Init

typedef INT_T (*Tuya_CBC_AES128_Init)(VOID);


      

Typedef Tuya_CBC_AES128_Encrypt

typedef INT_T (*Tuya_CBC_AES128_Encrypt)(IN BYTE_T *pdata_in,  //data to be encrypted, should NOT be changed
                                            IN UINT_T data_len,    //date length to be encrypted
                                            IN BYTE_T *pdata_out,  //data after encrytion, memory is MALLOC inside tuya SDK already
                                            OUT UINT_T *pdata_out_len,  //data length after encrytion
                                            IN BYTE_T *pkey,    //aes key 
                                            IN BYTE_T *piv);    //aes iv for cbc mode


      

Typedef Tuya_CBC_AES128_Decrypt

typedef INT_T (*Tuya_CBC_AES128_Decrypt)(IN BYTE_T *pdata_in,  //date to be decryted, should NOT be changed
                                            IN UINT_T data_len,    //data length after decryption
                                            IN BYTE_T *pdata_out,  //data after decryption, memory is MALLOC inside tuya SDK already
                                            OUT UINT_T *pdata_out_len,  //data length after decrytion
                                            IN BYTE_T *pkey,    //aes key
                                            IN BYTE_T *piv);    //aes iv for cbc mode


      

Typedef Tuya_CBC_AES128_Destroy

typedef INT_T (*Tuya_CBC_AES128_Destroy)(VOID);


      

Typedef AES_HW_CBC_FUNC;

typedef struct
{
   Tuya_CBC_AES128_Init init;
   Tuya_CBC_AES128_Encrypt encrypt;
   Tuya_CBC_AES128_Decrypt decrypt;
   Tuya_CBC_AES128_Destroy destory;
}AES_HW_CBC_FUNC;


      

Typedef TUYA_HW_AES_HANDLE_S;

typedef struct TUYA_HW_AES_HANDLE_ {
   int            init;
   TUYA_HW_AES_S  aesFunc;
   void*          phwHdl;
} TUYA_HW_AES_HANDLE_S;


      

Typedef apr_sha1_ctx_t

typedef struct apr_sha1_ctx_t apr_sha1_ctx_t;
/** @see apr_sha1_ctx_t */

Typedef sha2_context;

typedef struct
{
   unsigned long total[2]; /*!< number of bytes processed */
   unsigned long state[8]; /*!< intermediate digest state */
   unsigned char buffer[64]; /*!< data block being processed */

   unsigned char ipad[64]; /*!< HMAC: inner padding */
   unsigned char opad[64]; /*!< HMAC: outer padding */
   int is224; /*!< 0 => SHA-256, else SHA-224 */
}
sha2_context;
/**
* @brief SHA-256 context structure
*/

Typedef UNI_MD5_CTX_S;

typedef struct 
{ 
   unsigned int count[2]; 
   unsigned int state[4]; 
   unsigned char buffer[64];    
}UNI_MD5_CTX_S; 


      

Typedef NOTIFY_HANDLE

typedef PVOID_T NOTIFY_HANDLE;
//notify handle

Typedef NOTIFY_PARAM

typedef PVOID_T NOTIFY_PARAM;
//notify param

Typedef NOTIFY_TIME_MS

typedef DWORD_T NOTIFY_TIME_MS;
//notify time(ms)

Typedef NOTIFY_TYPE_E;

typedef enum
{
   NOTIFY_FINISH = 0,
   NOTIFY_ERROR,
   NOTIFY_OVERTIME,
}NOTIFY_TYPE_E;
/**
 * @brief Definition of notify type
 */

Typedef P_NOTIFY_FUNC

typedef VOID (*P_NOTIFY_FUNC)(IN CONST NOTIFY_TYPE_E type, IN NOTIFY_PARAM param);
//notify callback function definition

Typedef NOTIFY_HANDLE_S;

typedef struct
{
   TIMER_ID timer;       //timer
   P_NOTIFY_FUNC func;   //callback function
   NOTIFY_PARAM param;   //param
   NOTIFY_TIME_MS time_ms;//time(ms)
}NOTIFY_HANDLE_S;
/**
 * @brief notify handle info
 */

Typedef TIMER_QUE_HANDLE

typedef PVOID_T TIMER_QUE_HANDLE; 
//the handle of the timer queue

Typedef TIMER_ID

typedef WORD_T TIMER_ID; // 定时器ID
//timer id

Typedef P_TIMER_FUNC

typedef VOID (* P_TIMER_FUNC)(UINT_T timerID,PVOID_T pTimerArg);
//the timer's processing function

Typedef TIMER_TYPE;

typedef enum {
   TIMER_ONCE = 0,
   TIMER_CYCLE,
}TIMER_TYPE;
/**
 * @brief the type of timer
 */

Typedef uFILE

typedef VOID uFILE;
/**
 * @brief unique file handle
 * 
 */

Typedef ufmode_t

typedef unsigned char ufmode_t;
#define UF_SEEK_SET 0  // seek from head of the file
#define UF_SEEK_CUR 1  // seek from current position
#define UF_SEEK_END 2  // seek from end of the file

/**
 * @brief unique file mode
 * 
 */

Typedef *any_t

typedef void *any_t;
/**
 * @brief any_t is a pointer.  This allows you to put arbitrary structures in
 * the hashmap.
 */

Typedef map_t

typedef any_t map_t;   
/**
 * @brief map_t is a pointer to an internally maintained data structure.
 * Clients of this package do not need to know how hashmaps are
 * represented.  They see and manipulate only map_t's.
 */

Typedef *any_t_iter

typedef any_t *any_t_iter;
/**
 * @brief any_t_iter is a iterator which used to traverse the hashmap
 * 
 */

Typedef MEM_PARTITION;

typedef struct {               // MEMORY CONTROL BLOCK                                         
   VOID  *pMemAddr;          // Pointer to beginning of memory partition    
   VOID  *pMemAddrEnd;       // Pointer to ending of memory partition
   VOID  *pMemFreeList;      // Pointer to list of free memory blocks                        
   DWORD_T memBlkSize;       // Size (in bytes) of each block of memory                      
   DWORD_T memNBlks;         // Total number of blocks in this partition                     
   DWORD_T memNFree;         // Number of memory blocks remaining in this partition          
}MEM_PARTITION;
/**
 * @brief the memory partition
 * 
 */

Typedef MEM_POOL_SETUP_TBL;

typedef struct {
   DWORD_T memBlkSize; // 块大小 >=2
   DWORD_T memNBlks; // 块数量
}MEM_POOL_SETUP_TBL;
/**
 * @brief the memory pool table
 * 
 */

Typedef HLIST_NODE;

typedef struct hlist_node {
   struct hlist_node *next,**pprev;
}HLIST_NODE;
/**
 * @brief hash list node
 * 
 */

Typedef HLIST_HEAD;

typedef struct hlist_head{
   struct hlist_node *first;
}HLIST_HEAD;
/**
 * @brief hash list head
 * 
 */

Typedef REGION_E

typedef UINT_T REGION_E;
#define E_REGION_DYNAMIC 0     // no fixed region
#define E_REGION_CN 1          // china region
#define E_REGION_EU 2          // european region
#define E_REGION_US 3          // american region
#define E_REGION_UE 4          // west american region
#define E_REGION_IN 5          // indian region
#define E_REGION_WE 6          // west european region
#define E_REGION_MAX 7         // region max

/**
 * @brief DNS region
 * 
 */

Typedef TY_DNS_PRIO_T

typedef UINT_T TY_DNS_PRIO_T;
#define DNS_PRIO_REGION 0  // default priority, use the dns server of current region
#define DNS_PRIO_RANDOM 1  // select a random dns server of the regions except current region
#define DNS_PRIO_SYSTEM 2  // use the system dns service of the router

/**
 * @brief DNS priority
 * 
 */

Typedef TY_DNS_INFO_S;

typedef struct
{
   REGION_E       region; // the region of the DNS entry
   CHAR_T         *domain;// the domain of the DNS entry
   UNW_IP_ADDR_T  ip;    // the ip address of the DNS entry
}TY_DNS_INFO_S;
/**
 * @brief DNS entry info
 * 
 */

Typedef LIST_HEAD,*P_LIST_HEAD;

typedef struct tuya_list_head 
{
   struct tuya_list_head *next, *prev;
}LIST_HEAD,*P_LIST_HEAD;
/**
 * @brief bidirection list head
 * 
 */

Typedef QUEUE_CLASS,*P_QUEUE_CLASS;

typedef struct{
   unsigned int queUnitSize;  // queue unit size 
   unsigned int queTolNum;    // queue total unit number
   unsigned int queCurNum;    // queue current unit number
   
   unsigned char *queData;    // queue buffer
   unsigned char *queIn;      // in queue position
   unsigned char *queOut;     // out queue position

   #ifdef QUEUE_SAFE_FUNC
   MUTEX_HANDLE mutex;        // safity access prevent reentry
   #endif
}QUEUE_CLASS,*P_QUEUE_CLASS;
/**
 * @brief queue data structure define
 * 
 */

Typedef RFC_DATA_S;

typedef struct {
   MUTEX_HANDLE mutex;
   BOOL_T malk;
   UINT_T rfc;
   UINT_T data_len;
   VOID *data;
}RFC_DATA_S;
/**
 * @brief the reference data
 * 
 */

Typedef SLIST_HEAD;

typedef struct slist_head {
   struct slist_head *next;
}SLIST_HEAD;
/**
 * @brief sigle list head
 * 
 */

Typedef P_THRD_FUNC

typedef VOID (*P_THRD_FUNC)(PVOID_T pArg);
/**
 * @brief thread process function
 * 
 */

Typedef THRD_HANDLE

typedef PVOID_T THRD_HANDLE;
/**
 * @brief thread handle
 * 
 */

Typedef P_CONSTRUCT_FUNC

typedef VOID(*P_CONSTRUCT_FUNC)(VOID); 
/**
 * @brief thread construct function
 * 
 */

Typedef P_EXTRACT_FUNC

typedef VOID(*P_EXTRACT_FUNC)(VOID); // thread extract
/**
 * @brief thread extract function
 * 
 */

Typedef STACK_SIZE

typedef unsigned int STACK_SIZE;
/**
 * @brief thread stack size
 * 
 */

Typedef THRD_STA

typedef INT_T THRD_STA;
#define STATE_EMPTY 0      // thread is inited
#define STATE_RUNNING 1    // thread is running
#define STATE_STOP 2       // thread is stop
#define STATE_DELETE 3     // thread delete status 

/**
 * @brief thread running status
 * 
 */

Typedef TRD_PRI

typedef unsigned int TRD_PRI;
#define TRD_PRIO_0    5   // high
#define TRD_PRIO_1    4
#define TRD_PRIO_2    3
#define TRD_PRIO_3    2
#define TRD_PRIO_4    1
#define TRD_PRIO_5    0
#define TRD_PRIO_6    0   // low

/**
 * @brief thread priority
 * 
 */

Typedef THRD_PARAM_S;

typedef struct {
   STACK_SIZE stackDepth; // stack size 
   TRD_PRI priority;     // thread priority
   CHAR_T *thrdname;     // thread name
}THRD_PARAM_S;
/**
 * @brief thread parameters
 * 
 */

Typedef POSIX_TM_S;

typedef struct {
   INT_T tm_sec;    /* seconds [0-59] */
   INT_T tm_min;    /* minutes [0-59] */
   INT_T tm_hour;   /* hours [0-23] */
   INT_T tm_mday;   /* day of the month [1-31] */
   INT_T tm_mon;    /* month [0-11] */
   INT_T tm_year;   /* year. The number of years since 1900 */
   INT_T tm_wday;   /* day of the week [0-6] 0-Sunday...6-Saturday */
}POSIX_TM_S;
/**
 * @brief posix time
 * 
 */

Typedef SUM_ZONE_S;

typedef struct {
   TIME_T posix_min;  // summer time start
   TIME_T posix_max;  // summer time end
}SUM_ZONE_S;
/**
 * @brief summer time zone
 * 
 */

Typedef SUM_ZONE_TBL_S;

typedef struct {
   UINT_T cnt; //sum zone count
   SUM_ZONE_S zone[SUM_ZONE_TAB_LMT];//zone info
}SUM_ZONE_TBL_S;
/**
 * @brief sum zone info
 * 
 */

Typedef WIFI_REV_MGNT_FILTER

typedef BOOL_T (*WIFI_REV_MGNT_FILTER)(UCHAR_T *buf, UINT_T len);
/**
 * @brief filter wifi recv mng frame cb
 *
 * @param[in] buf frame buf
 * @param[in] len frame len
 *
 * @note called to filter mng recv.
 *
 * @return TRUE for needed, FLASE for not needed
 */

Typedef TY_WK_CB

typedef VOID (*TY_WK_CB)(VOID *data);
/**
 * @brief call back prototype of work
 */

Typedef WORK_QUEUE_HANDLE

typedef PVOID_T WORK_QUEUE_HANDLE;
/**
 * @brief handle of work queue
 */

Typedef WK_CALLBACK

typedef VOID (*WK_CALLBACK)(VOID *data);
/**
 * @brief call back function of work queue
 */

Typedef AP_CFG_FINISH_CB

typedef OPERATE_RET (*AP_CFG_FINISH_CB)(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd, IN CONST CHAR_T *token);
/*
	配网完成之后的回调,在gw_intf.c中实现,用于保存配网信息到gw,同时触发绑定流程
*/

Typedef FN_FFS_NET_CFG_CB

typedef OPERATE_RET (*FN_FFS_NET_CFG_CB)(IN CONST CHAR_T *ssid,IN CONST CHAR_T *passwd, IN CONST CHAR_T *token);


      

Typedef tuya_ffs_status_e;

typedef enum {
   TUYA_FFS_STATUS_IDLE,
   TUYA_FFS_STATUS_COMPUTE_SSID_PWD,
   TUYA_FFS_STATUS_SCAN_AP,
   TUYA_FFS_STATUS_CONNECT_NETWORK,
   TUYA_FFS_STATUS_START_DSS,
   TUYA_FFS_STATUS_PRE_ACTIVE,
   TUYA_FFS_STATUS_CONNECT_TUYA_MQTT,
   TUYA_FFS_STATUS_FINISHED,
   TUYA_FFS_STATUS_STOPED,
}tuya_ffs_status_e;


      

Typedef *ptrProbeRequestTransportParam_t;

typedef struct probeRequestTransportParam_s{ 
   char ffsSsid[FFS_WIFI_SSID_LEN+1];
}ProbeRequestTransportParam_t, *ptrProbeRequestTransportParam_t;


      

Typedef tuya_ffs_info_t;

typedef struct {
   uint8_t status; // ref tuya_ffs_status_e.
   char ssid[FFS_WIFI_SSID_LEN+1];
   char passwd[FFS_WIFI_PASSWD_LEN+1];
   char nonce[FFS_CLIENT_NONCE_SIZE];
   char *session_token;
   char *gw_endpoint;
   FN_NETCFG_CB cb;
   TIMER_ID netcfg_timeout_timer;/*ffs配网超时*/

   mbedtls_pk_context cloudPublicKey;			//!< Cloud public key.
   mbedtls_pk_context devicePrivateKey;			//!< Device private key.
   BOOL_T found_ffs_ssid;
 uint32_t dss_port;/*echo:8888; simple_setup:443*/

   tuya_ffs_config_t config;

 
 ptrWifiNetcfgFrameTransporter_t ptrWifiTransporter;
 ProbeRequestTransportParam_t ProbeRequestTransportParameter;
 TransporteeParameters_t TransporteeParameter;

 
 ptrWifiNetcfgFrameSniffer_t ptrWifiSniffer;
 SnifferUserParameters_t SnifferUserParammeter;
}tuya_ffs_info_t;


      

Typedef tuya_ffs_dss_context_t;

typedef struct {
   char host[TUYA_FFS_DSS_HOST_LEN+1];
   uint32_t port;
   char *session_id; // use strdup, must free;
   char *session_token; // use strdup, must free;
   char *gw_endpoint; // use strdup, must free;
   char *salt; // use strdup, must free;
   uint32_t sequenceNumber;
   tuya_ffs_stream_t *http_body; // must free.
   const char *provisionee_state;
   bool connected_wifi;
   tuya_ffs_config_t* config;
   S_HTTP_MANAGER* httpManager;
   SESSION_ID httpSession;

}tuya_ffs_dss_context_t;


      

Typedef tuya_ffs_config_t;

typedef struct {
   char* pid;         // the length is 4, ref TEST_PRODUCT_INDEX "Q9pp"
   char* pin;
   char* sn;
   char* cert_pem;
   char* private_pem;
   char* public_pem;
 int netcfg_type;
}tuya_ffs_config_t;


      

Typedef tuya_ffs_stream_t;

typedef struct {
   CHAR_T *data;
   INT_T  data_size; /* number of byte writen */
   INT_T  max_size;  /* maximnm data size.*/
}tuya_ffs_stream_t;


      

Typedef THING_CONFIG_SOCKET_CB

typedef OPERATE_RET (*THING_CONFIG_SOCKET_CB)(IN CONST INT_T socket);


      

Typedef WL_NW_CFG_T

typedef BYTE_T WL_NW_CFG_T;
#define WNC_TEZ_MC     0
#define WNC_TLK_BC     1
#define WNC_AIRKISS_BC 2

/***********************************************************
*************************micro define***********************
***********************************************************/

Typedef WL_CFG_COM_IF_S;

typedef struct {
   BYTE_T ssid[WIFI_SSID_LEN+1];
   BYTE_T s_len;
   BYTE_T passwd[WIFI_PASSWD_LEN+1];
   BYTE_T p_len;
   BYTE_T token[WL_TOKEN_LEN+1]; // tuya link:region(2BYTE) + token(8BYTE) + key(4BYTE) useless
                               // airkiss:useless
   BYTE_T t_len;
}WL_CFG_COM_IF_S;


      

Typedef LOCK_CHAN_CALLBACK

typedef VOID (*LOCK_CHAN_CALLBACK)(IN CONST WL_NW_CFG_T wnc,IN CONST BYTE_T *src_mac,\
                                  IN CONST BYTE_T *bssid,IN CONST BYTE_T lock_chan);


      

Typedef NW_CFG_FIN_CALLBACK

typedef VOID (*NW_CFG_FIN_CALLBACK)(IN CONST WL_NW_CFG_T wnc,IN CONST WL_CFG_COM_IF_S *wl_cfg,\
                                   IN VOID *data);