%include <stdint.i>
%include <cstring.i>
%include <cpointer.i>
+%include <exception.i>
%inline %{
struct nl_dump_params *alloc_dump_params(void)
%typemap(out) void *;
extern int nla_type(const struct nlattr *);
+%typemap(in) (int, const void *) {
+ $1 = Py_SIZE($input);
+ if (PyByteArray_Check($input)) {
+ $2 = ($2_ltype)PyByteArray_AsString($input);
+ } else if (PyString_Check($input)) {
+ $2 = ($2_ltype)PyString_AsString($input);
+ } else
+ SWIG_exception(SWIG_TypeError,
+ "pointer must be bytearray or string.");
+}
+extern int nla_put(struct nl_msg *, int, int, const void *);
+%typemap(in) const void *;
+
/* Integer attribute */
extern uint8_t nla_get_u8(struct nlattr *);
extern int nla_put_u8(struct nl_msg *, int, uint8_t);