[Bro-Dev] #968: Add bytestring_to_uint16, uint32, uint64 functions

Bro Tracker bro at tracker.bro.org
Sun Apr 14 04:44:37 PDT 2013

#968: Add bytestring_to_uint16, uint32, uint64 functions
  Reporter:  yun    |      Owner:
      Type:  Patch  |     Status:  new
  Priority:  Low    |  Milestone:  Bro2.2
 Component:  Bro    |    Version:  git/master
Resolution:         |   Keywords:  bytestring

Comment (by yun):

 I haven't seen any commits yet for this patch. I would love to have this
 function in the next release :) So if the patch needs some re-work please
 let me know.

 I do think the current patch would be much cleaner if we had access to
 these functions:

 uint16_t htobe16(uint16_t host_16bits);
 uint16_t htole16(uint16_t host_16bits);
 uint16_t be16toh(uint16_t big_endian_16bits);
 uint16_t le16toh(uint16_t little_endian_16bits);

 uint32_t htobe32(uint32_t host_32bits);
 uint32_t htole32(uint32_t host_32bits);
 uint32_t be32toh(uint32_t big_endian_32bits);
 uint32_t le32toh(uint32_t little_endian_32bits);

 uint64_t htobe64(uint64_t host_64bits);
 uint64_t htole64(uint64_t host_64bits);
 uint64_t be64toh(uint64_t big_endian_64bits);
 uint64_t le64toh(uint64_t little_endian_64bits);

 So proposed idea: check if these functions are available on the host OS,
 and if not use our own implementation of these functions?

Ticket URL: <http://tracker.bro.org/bro/ticket/968#comment:32>
Bro Tracker <http://tracker.bro.org/bro>
Bro Issue Tracker

More information about the bro-dev mailing list