wpabuf: Add helper functions for writing 64-bit integers

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2021-03-07 21:31:22 +02:00
parent cf47a43335
commit edbaffc4f6

View file

@ -133,6 +133,12 @@ static inline void wpabuf_put_le32(struct wpabuf *buf, u32 data)
WPA_PUT_LE32(pos, data); WPA_PUT_LE32(pos, data);
} }
static inline void wpabuf_put_le64(struct wpabuf *buf, u64 data)
{
u8 *pos = (u8 *) wpabuf_put(buf, 8);
WPA_PUT_LE64(pos, data);
}
static inline void wpabuf_put_be16(struct wpabuf *buf, u16 data) static inline void wpabuf_put_be16(struct wpabuf *buf, u16 data)
{ {
u8 *pos = (u8 *) wpabuf_put(buf, 2); u8 *pos = (u8 *) wpabuf_put(buf, 2);
@ -151,6 +157,12 @@ static inline void wpabuf_put_be32(struct wpabuf *buf, u32 data)
WPA_PUT_BE32(pos, data); WPA_PUT_BE32(pos, data);
} }
static inline void wpabuf_put_be64(struct wpabuf *buf, u64 data)
{
u8 *pos = (u8 *) wpabuf_put(buf, 8);
WPA_PUT_BE64(pos, data);
}
static inline void wpabuf_put_data(struct wpabuf *buf, const void *data, static inline void wpabuf_put_data(struct wpabuf *buf, const void *data,
size_t len) size_t len)
{ {