wpa_supplicant AP: Add management frame RX for nl80211
[wpasupplicant] / src / utils / wpabuf.h
index 724412e..a150455 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Dynamic data buffer
- * Copyright (c) 2007, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2007-2009, Jouni Malinen <j@w1.fi>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -37,6 +37,8 @@ struct wpabuf * wpabuf_dup(const struct wpabuf *src);
 void wpabuf_free(struct wpabuf *buf);
 void * wpabuf_put(struct wpabuf *buf, size_t len);
 struct wpabuf * wpabuf_concat(struct wpabuf *a, struct wpabuf *b);
+struct wpabuf * wpabuf_zeropad(struct wpabuf *buf, size_t len);
+void wpabuf_printf(struct wpabuf *buf, char *fmt, ...) PRINTF_FORMAT(2, 3);
 
 
 /**
@@ -109,6 +111,12 @@ static inline void wpabuf_put_u8(struct wpabuf *buf, u8 data)
        *pos = data;
 }
 
+static inline void wpabuf_put_le16(struct wpabuf *buf, u16 data)
+{
+       u8 *pos = wpabuf_put(buf, 2);
+       WPA_PUT_LE16(pos, data);
+}
+
 static inline void wpabuf_put_be16(struct wpabuf *buf, u16 data)
 {
        u8 *pos = wpabuf_put(buf, 2);
@@ -146,4 +154,9 @@ static inline void wpabuf_set(struct wpabuf *buf, const void *data, size_t len)
        buf->size = buf->used = len;
 }
 
+static inline void wpabuf_put_str(struct wpabuf *dst, const char *str)
+{
+       wpabuf_put_data(dst, str, os_strlen(str));
+}
+
 #endif /* WPABUF_H */