libumumble/src/message.c

16 lines
288 B
C

#include <stdint.h>
#include <string.h>
#include <arpa/inet.h>
static void mumble_packet_gen_header(uint8_t *buf, uint16_t type, uint32_t len)
{
uint16_t type_be;
uint32_t len_be;
type_be = htons(type);
len_be = htonl(len);
memcpy(buf, &type_be, 2);
memcpy(buf+2, &len_be, 4);
}