]> git.sur5r.net Git - ngadmin/blobdiff - raw/src/encoding_attr.h
Start reorganization of low level library
[ngadmin] / raw / src / encoding_attr.h
diff --git a/raw/src/encoding_attr.h b/raw/src/encoding_attr.h
new file mode 100644 (file)
index 0000000..a3cb18b
--- /dev/null
@@ -0,0 +1,24 @@
+
+#ifndef DEF_ENCODING_ATTR
+#define DEF_ENCODING_ATTR
+
+
+#include <stdbool.h>
+
+#include <attr.h>
+
+
+
+struct attr_handler {
+       unsigned short attr;                                    /* attribute code */
+       unsigned int size;                                      /* expected data size */
+       bool (*encode)(struct attr *at, unsigned char ports);   /* encode function */
+       bool (*decode)(struct attr *at, unsigned char ports);   /* decode function */
+};
+
+
+const struct attr_handler* getAttrHandler (unsigned short attrcode);
+
+
+#endif
+