]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpabuf: Add helper functions for writing 64-bit integers
authorJouni Malinen <j@w1.fi>
Sun, 7 Mar 2021 19:31:22 +0000 (21:31 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 7 Mar 2021 19:31:41 +0000 (21:31 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
src/utils/wpabuf.h

index b2a54b22fddb76cb898f75a764731fcdfe52f4f1..eb1db80912a06b651b567ee207d33e4813c4b478 100644 (file)
@@ -133,6 +133,12 @@ static inline void wpabuf_put_le32(struct wpabuf *buf, u32 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)
 {
        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);
 }
 
+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,
                                   size_t len)
 {