packet.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2011-2014 Intel Corporation
  7. * Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
  8. *
  9. *
  10. */
  11. #include <stdint.h>
  12. #include <stdbool.h>
  13. #include <sys/time.h>
  14. #include <sys/socket.h>
  15. #define PACKET_FILTER_SHOW_INDEX (1 << 0)
  16. #define PACKET_FILTER_SHOW_DATE (1 << 1)
  17. #define PACKET_FILTER_SHOW_TIME (1 << 2)
  18. #define PACKET_FILTER_SHOW_TIME_OFFSET (1 << 3)
  19. #define PACKET_FILTER_SHOW_ACL_DATA (1 << 4)
  20. #define PACKET_FILTER_SHOW_SCO_DATA (1 << 5)
  21. #define PACKET_FILTER_SHOW_A2DP_STREAM (1 << 6)
  22. #define PACKET_FILTER_SHOW_MGMT_SOCKET (1 << 7)
  23. bool packet_has_filter(unsigned long filter);
  24. void packet_set_filter(unsigned long filter);
  25. void packet_add_filter(unsigned long filter);
  26. void packet_del_filter(unsigned long filter);
  27. void packet_set_priority(const char *priority);
  28. void packet_select_index(uint16_t index);
  29. void packet_set_fallback_manufacturer(uint16_t manufacturer);
  30. void packet_set_msft_evt_prefix(const uint8_t *prefix, uint8_t len);
  31. void packet_hexdump(const unsigned char *buf, uint16_t len);
  32. void packet_print_error(const char *label, uint8_t error);
  33. void packet_print_version(const char *label, uint8_t version,
  34. const char *sublabel, uint16_t subversion);
  35. void packet_print_company(const char *label, uint16_t company);
  36. void packet_print_addr(const char *label, const void *data, uint8_t type);
  37. void packet_print_handle(uint16_t handle);
  38. void packet_print_rssi(const char *label, int8_t rssi);
  39. void packet_print_ad(const void *data, uint8_t size);
  40. void packet_print_features_lmp(const uint8_t *features, uint8_t page);
  41. void packet_print_features_ll(const uint8_t *features);
  42. void packet_print_features_msft(const uint8_t *features);
  43. void packet_print_channel_map_lmp(const uint8_t *map);
  44. void packet_print_channel_map_ll(const uint8_t *map);
  45. void packet_print_io_capability(uint8_t capability);
  46. void packet_print_io_authentication(uint8_t authentication);
  47. void packet_control(struct timeval *tv, struct ucred *cred,
  48. uint16_t index, uint16_t opcode,
  49. const void *data, uint16_t size);
  50. void packet_monitor(struct timeval *tv, struct ucred *cred,
  51. uint16_t index, uint16_t opcode,
  52. const void *data, uint16_t size);
  53. void packet_simulator(struct timeval *tv, uint16_t frequency,
  54. const void *data, uint16_t size);
  55. void packet_new_index(struct timeval *tv, uint16_t index, const char *label,
  56. uint8_t type, uint8_t bus, const char *name);
  57. void packet_del_index(struct timeval *tv, uint16_t index, const char *label);
  58. void packet_open_index(struct timeval *tv, uint16_t index, const char *label);
  59. void packet_close_index(struct timeval *tv, uint16_t index, const char *label);
  60. void packet_index_info(struct timeval *tv, uint16_t index, const char *label,
  61. uint16_t manufacturer);
  62. void packet_vendor_diag(struct timeval *tv, uint16_t index,
  63. uint16_t manufacturer,
  64. const void *data, uint16_t size);
  65. void packet_system_note(struct timeval *tv, struct ucred *cred,
  66. uint16_t index, const void *message);
  67. void packet_user_logging(struct timeval *tv, struct ucred *cred,
  68. uint16_t index, uint8_t priority,
  69. const char *ident, const void *data,
  70. uint16_t size);
  71. void packet_hci_command(struct timeval *tv, struct ucred *cred, uint16_t index,
  72. const void *data, uint16_t size);
  73. void packet_hci_event(struct timeval *tv, struct ucred *cred, uint16_t index,
  74. const void *data, uint16_t size);
  75. void packet_hci_acldata(struct timeval *tv, struct ucred *cred, uint16_t index,
  76. bool in, const void *data, uint16_t size);
  77. void packet_hci_scodata(struct timeval *tv, struct ucred *cred, uint16_t index,
  78. bool in, const void *data, uint16_t size);
  79. void packet_hci_isodata(struct timeval *tv, struct ucred *cred, uint16_t index,
  80. bool in, const void *data, uint16_t size);
  81. void packet_ctrl_open(struct timeval *tv, struct ucred *cred, uint16_t index,
  82. const void *data, uint16_t size);
  83. void packet_ctrl_close(struct timeval *tv, struct ucred *cred, uint16_t index,
  84. const void *data, uint16_t size);
  85. void packet_ctrl_command(struct timeval *tv, struct ucred *cred, uint16_t index,
  86. const void *data, uint16_t size);
  87. void packet_ctrl_event(struct timeval *tv, struct ucred *cred, uint16_t index,
  88. const void *data, uint16_t size);
  89. void packet_todo(void);