netbios_query.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //---------------------------------------------------------------------------
  2. // __________________ _________ _____ _____ .__ ._.
  3. // \______ \______ \ / _____/ / \ / _ \ |__| ____ | |
  4. // | | _/| | \ \_____ \ / \ / \ / /_\ \| _/ __ \ | |
  5. // | | \| ` \/ / Y \ / | | \ ___/ \|
  6. // |______ /_______ /_______ \____|__ / /\ \____|__ |__|\___ | __
  7. // \/ \/ \/ \/ )/ \/ \/ \/
  8. //
  9. // This file is part of libdsm. Copyright © 2014 VideoLabs SAS
  10. //
  11. // Author: Julien 'Lta' BALLET <contact@lta.io>
  12. //
  13. // This program is free software. It comes without any warranty, to the extent
  14. // permitted by applicable law. You can redistribute it and/or modify it under
  15. // the terms of the Do What The Fuck You Want To Public License, Version 2, as
  16. // published by Sam Hocevar. See the COPYING file for more details.
  17. //----------------------------------------------------------------------------
  18. #ifndef __BDSM_NETBIOS_QUERY_H_
  19. #define __BDSM_NETBIOS_QUERY_H_
  20. #include <stdint.h>
  21. #include <stddef.h>
  22. #include "bdsm/netbios_defs.h"
  23. typedef struct netbios_query_s
  24. {
  25. size_t payload_size;
  26. size_t cursor;
  27. netbios_query_packet *packet;
  28. } netbios_query;
  29. netbios_query *netbios_query_new(size_t payload_size, int is_query,
  30. char opcode);
  31. void netbios_query_destroy(netbios_query *q);
  32. void netbios_query_set_flag(netbios_query *q,
  33. uint16_t flag, int value);
  34. int netbios_query_append(netbios_query *q, const char *data,
  35. size_t data_size);
  36. void netbios_query_print(netbios_query *q);
  37. #endif