PUD: make nodeIdBinary accessible
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 3 Feb 2012 13:33:13 +0000 (14:33 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 14 Feb 2012 13:32:58 +0000 (14:32 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/configuration.c
lib/pud/src/configuration.h

index 75f4b4c..d68207d 100644 (file)
@@ -252,6 +252,28 @@ unsigned char * getNodeIdWithLength(size_t *length) {
 }
 
 /**
+ Get the nodeIdBinary and its length
+
+ @param length
+ a pointer to the variable in which to store the nodeIdBinary length (allowed to be
+ NULL, in which case the length is not stored)
+
+ @return
+ The node ID in binary representation
+ */
+unsigned char * getNodeIdBinaryWithLength(size_t *length) {
+       if (!nodeIdBinarySet) {
+               setNodeId("", NULL, (set_plugin_parameter_addon) {.pc = NULL});
+       }
+
+       if (length != NULL) {
+               *length = nodeIdBinaryLength;
+       }
+
+       return (unsigned char *)&nodeIdBinary;
+}
+
+/**
  Set the node ID.
 
  @param value
index 3465446..af4eea3 100644 (file)
@@ -30,6 +30,7 @@ int setNodeIdType(const char *value, void *data,
 
 unsigned char * getNodeId(void);
 unsigned char * getNodeIdWithLength(size_t *length);
+unsigned char * getNodeIdBinaryWithLength(size_t *length);
 int setNodeId(const char *value, void *data, set_plugin_parameter_addon addon);
 
 /*