Loading system/btcore/src/counter.c +8 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,10 @@ static bool counter_foreach_cb_(hash_map_entry_t *hash_map_entry, void *context) } static bool counter_socket_open(void) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return true; // Disable using network sockets for security reasons #endif assert(listen_socket_ == NULL); assert(thread_ == NULL); assert(clients_ == NULL); Loading Loading @@ -294,6 +298,10 @@ error:; } static void counter_socket_close(void) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif socket_free(listen_socket_); thread_free(thread_); list_free(clients_); Loading system/hci/src/btsnoop_net.c +12 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,10 @@ static int listen_socket_ = -1; static int client_socket_ = -1; void btsnoop_net_open() { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif listen_thread_valid_ = (pthread_create(&listen_thread_, NULL, listen_fn_, NULL) == 0); if (!listen_thread_valid_) { LOG_ERROR("%s pthread_create failed: %s", __func__, strerror(errno)); Loading @@ -54,6 +58,10 @@ void btsnoop_net_open() { } void btsnoop_net_close() { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif if (listen_thread_valid_) { shutdown(listen_socket_, SHUT_RDWR); pthread_join(listen_thread_, NULL); Loading @@ -63,6 +71,10 @@ void btsnoop_net_close() { } void btsnoop_net_write(const void *data, size_t length) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif pthread_mutex_lock(&client_socket_lock_); if (client_socket_ != -1) { if (send(client_socket_, data, length, 0) == -1 && errno == ECONNRESET) { Loading system/hci/src/hci_inject.c +8 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ static void read_ready(socket_t *socket, void *context); static void client_free(void *ptr); bool hci_inject_open(const hci_t *hci_interface) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return true; // Disable using network sockets for security reasons #endif assert(listen_socket == NULL); assert(thread == NULL); assert(clients == NULL); Loading Loading @@ -92,6 +96,10 @@ error:; } void hci_inject_close(void) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif socket_free(listen_socket); list_free(clients); thread_free(thread); Loading Loading
system/btcore/src/counter.c +8 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,10 @@ static bool counter_foreach_cb_(hash_map_entry_t *hash_map_entry, void *context) } static bool counter_socket_open(void) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return true; // Disable using network sockets for security reasons #endif assert(listen_socket_ == NULL); assert(thread_ == NULL); assert(clients_ == NULL); Loading Loading @@ -294,6 +298,10 @@ error:; } static void counter_socket_close(void) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif socket_free(listen_socket_); thread_free(thread_); list_free(clients_); Loading
system/hci/src/btsnoop_net.c +12 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,10 @@ static int listen_socket_ = -1; static int client_socket_ = -1; void btsnoop_net_open() { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif listen_thread_valid_ = (pthread_create(&listen_thread_, NULL, listen_fn_, NULL) == 0); if (!listen_thread_valid_) { LOG_ERROR("%s pthread_create failed: %s", __func__, strerror(errno)); Loading @@ -54,6 +58,10 @@ void btsnoop_net_open() { } void btsnoop_net_close() { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif if (listen_thread_valid_) { shutdown(listen_socket_, SHUT_RDWR); pthread_join(listen_thread_, NULL); Loading @@ -63,6 +71,10 @@ void btsnoop_net_close() { } void btsnoop_net_write(const void *data, size_t length) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif pthread_mutex_lock(&client_socket_lock_); if (client_socket_ != -1) { if (send(client_socket_, data, length, 0) == -1 && errno == ECONNRESET) { Loading
system/hci/src/hci_inject.c +8 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,10 @@ static void read_ready(socket_t *socket, void *context); static void client_free(void *ptr); bool hci_inject_open(const hci_t *hci_interface) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return true; // Disable using network sockets for security reasons #endif assert(listen_socket == NULL); assert(thread == NULL); assert(clients == NULL); Loading Loading @@ -92,6 +96,10 @@ error:; } void hci_inject_close(void) { #if (!defined(BT_NET_DEBUG) || (BT_NET_DEBUG != TRUE)) return; // Disable using network sockets for security reasons #endif socket_free(listen_socket); list_free(clients); thread_free(thread); Loading