mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-31 10:20:58 +00:00
replace bzero with memset and drop HAVE_BZERO
This commit is contained in:
parent
60b9e82fcb
commit
40d883bd01
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_TIME_MS
|
#define HAVE_TIME_MS
|
||||||
|
|
||||||
// BTstack features that can be enabled
|
// BTstack features that can be enabled
|
||||||
|
@ -132,7 +132,6 @@ echo >> btstack_config.h
|
|||||||
echo "// Port related features" >> btstack_config.h
|
echo "// Port related features" >> btstack_config.h
|
||||||
echo "#define HAVE_TIME" >> btstack_config.h
|
echo "#define HAVE_TIME" >> btstack_config.h
|
||||||
echo "#define HAVE_MALLOC" >> btstack_config.h
|
echo "#define HAVE_MALLOC" >> btstack_config.h
|
||||||
echo "#define HAVE_BZERO" >> btstack_config.h
|
|
||||||
if test "x$HAVE_SO_NOSIGPIPE" == xyes ; then
|
if test "x$HAVE_SO_NOSIGPIPE" == xyes ; then
|
||||||
echo "#define HAVE_SO_NOSIGPIPE" >> btstack_config.h
|
echo "#define HAVE_SO_NOSIGPIPE" >> btstack_config.h
|
||||||
else
|
else
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_INIT_SCRIPT
|
#define HAVE_INIT_SCRIPT
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_TICK
|
#define HAVE_TICK
|
||||||
#define HAVE_EHCILL
|
#define HAVE_EHCILL
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_MALLOC
|
#define HAVE_MALLOC
|
||||||
#define HAVE_PLATFORM_IPHONE_OS
|
#define HAVE_PLATFORM_IPHONE_OS
|
||||||
#define HAVE_POSIX_FILE_IO
|
#define HAVE_POSIX_FILE_IO
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_MALLOC
|
#define HAVE_MALLOC
|
||||||
#define HAVE_SO_NOSIGPIPE
|
#define HAVE_SO_NOSIGPIPE
|
||||||
#define HAVE_TIME
|
#define HAVE_TIME
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_EHCILL
|
#define HAVE_EHCILL
|
||||||
#define HAVE_INIT_SCRIPT
|
#define HAVE_INIT_SCRIPT
|
||||||
#define HAVE_TICK
|
#define HAVE_TICK
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_INIT_SCRIPT
|
#define HAVE_INIT_SCRIPT
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_TICK
|
#define HAVE_TICK
|
||||||
|
|
||||||
// #define HAVE_EHCILL
|
// #define HAVE_EHCILL
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_MALLOC
|
#define HAVE_MALLOC
|
||||||
#define HAVE_POSIX_FILE_IO
|
#define HAVE_POSIX_FILE_IO
|
||||||
// #define HAVE_SO_NOSIGPIPE
|
// #define HAVE_SO_NOSIGPIPE
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_EHCILL
|
#define HAVE_EHCILL
|
||||||
#define HAVE_TIME_MS
|
#define HAVE_TIME_MS
|
||||||
#define WICED_BT_UART_MANUAL_CTS_RTS
|
#define WICED_BT_UART_MANUAL_CTS_RTS
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_TICK
|
#define HAVE_TICK
|
||||||
|
|
||||||
// BTstack features that can be enabled
|
// BTstack features that can be enabled
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_MALLOC
|
#define HAVE_MALLOC
|
||||||
#define HAVE_POSIX_FILE_IO
|
#define HAVE_POSIX_FILE_IO
|
||||||
#define HAVE_SO_NOSIGPIPE
|
#define HAVE_SO_NOSIGPIPE
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_INIT_SCRIPT
|
#define HAVE_INIT_SCRIPT
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_TICK
|
#define HAVE_TICK
|
||||||
#define HAVE_EHCILL
|
#define HAVE_EHCILL
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __BTSTACK_CONFIG
|
#define __BTSTACK_CONFIG
|
||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_EHCILL
|
#define HAVE_EHCILL
|
||||||
#define HAVE_TIME_MS
|
#define HAVE_TIME_MS
|
||||||
#define WICED_BT_UART_MANUAL_CTS_RTS
|
#define WICED_BT_UART_MANUAL_CTS_RTS
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_INIT_SCRIPT
|
#define HAVE_INIT_SCRIPT
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_TIME
|
#define HAVE_TIME
|
||||||
#define HAVE_MALLOC
|
#define HAVE_MALLOC
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
// Port related features
|
// Port related features
|
||||||
#define HAVE_INIT_SCRIPT
|
#define HAVE_INIT_SCRIPT
|
||||||
#define HAVE_BZERO
|
|
||||||
#define HAVE_TIME
|
#define HAVE_TIME
|
||||||
|
|
||||||
// BTstack features that can be enabled
|
// BTstack features that can be enabled
|
||||||
|
@ -243,7 +243,7 @@ static void send_arp_probe_ipv4(void){
|
|||||||
pos += 2;
|
pos += 2;
|
||||||
bd_addr_copy(&network_buffer[pos], local_addr); // Sender Hardware Address (SHA)
|
bd_addr_copy(&network_buffer[pos], local_addr); // Sender Hardware Address (SHA)
|
||||||
pos += 6;
|
pos += 6;
|
||||||
bzero(&network_buffer[pos], 4); // Sender Protocol Adress (SPA)
|
memset(&network_buffer[pos], 0, 4); // Sender Protocol Adress (SPA)
|
||||||
pos += 4;
|
pos += 4;
|
||||||
bd_addr_copy(&network_buffer[pos], other_addr); // Target Hardware Address (THA) (ignored for requests)
|
bd_addr_copy(&network_buffer[pos], other_addr); // Target Hardware Address (THA) (ignored for requests)
|
||||||
pos += 6;
|
pos += 6;
|
||||||
@ -491,7 +491,7 @@ static void send_llmnr_request_ipv4(void){
|
|||||||
pos += sizeof(udp_header);
|
pos += sizeof(udp_header);
|
||||||
|
|
||||||
// llmnr packet
|
// llmnr packet
|
||||||
bzero(llmnr_packet, sizeof(llmnr_packet));
|
memset(llmnr_packet, 0, sizeof(llmnr_packet));
|
||||||
big_endian_store_16(llmnr_packet, 0, 0x1234); // transaction id
|
big_endian_store_16(llmnr_packet, 0, 0x1234); // transaction id
|
||||||
big_endian_store_16(llmnr_packet, 4, 1); // one query
|
big_endian_store_16(llmnr_packet, 4, 1); // one query
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ static void send_llmnr_request_ipv6(void){
|
|||||||
int payload_length = sizeof(udp_header) + sizeof(llmnr_packet) + sizeof(dns_data);
|
int payload_length = sizeof(udp_header) + sizeof(llmnr_packet) + sizeof(dns_data);
|
||||||
|
|
||||||
// llmnr header
|
// llmnr header
|
||||||
bzero(llmnr_packet, sizeof(llmnr_packet));
|
memset(llmnr_packet, 0, sizeof(llmnr_packet));
|
||||||
big_endian_store_16(llmnr_packet, 0, 0x1235); // transaction id
|
big_endian_store_16(llmnr_packet, 0, 0x1235); // transaction id
|
||||||
big_endian_store_16(llmnr_packet, 4, 1); // one query
|
big_endian_store_16(llmnr_packet, 4, 1); // one query
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ static void send_llmnr_request_ipv6(void){
|
|||||||
big_endian_store_16(ipv6_header, 4, payload_length);
|
big_endian_store_16(ipv6_header, 4, payload_length);
|
||||||
|
|
||||||
// udp header
|
// udp header
|
||||||
bzero(udp_header, sizeof(udp_header));
|
memset(udp_header, 0, sizeof(udp_header));
|
||||||
big_endian_store_16(udp_header, 0, 5355); // source port
|
big_endian_store_16(udp_header, 0, 5355); // source port
|
||||||
big_endian_store_16(udp_header, 2, 5355); // destination port
|
big_endian_store_16(udp_header, 2, 5355); // destination port
|
||||||
big_endian_store_16(udp_header, 4, payload_length);
|
big_endian_store_16(udp_header, 4, payload_length);
|
||||||
|
@ -22,8 +22,8 @@ static void hexdump2(void *data, int size){
|
|||||||
int main(void){
|
int main(void){
|
||||||
uint8_t key[16];
|
uint8_t key[16];
|
||||||
uint8_t plaintext[16];
|
uint8_t plaintext[16];
|
||||||
bzero(key, 16);
|
memset(key, 0, 16);
|
||||||
bzero(plaintext, 16);
|
memset(plaintext, 0, 16);
|
||||||
uint8_t cyphertext[16];
|
uint8_t cyphertext[16];
|
||||||
aes128_calc_cyphertext(key, plaintext, cyphertext);
|
aes128_calc_cyphertext(key, plaintext, cyphertext);
|
||||||
hexdump2(cyphertext, 16);
|
hexdump2(cyphertext, 16);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user