Add option to set the initial security level
@@ -187,8 +187,15 @@ void uipbuf_init(void);
/* Avoid using prefix compression on the packet (6LoWPAN) */
#define UIPBUF_ATTR_FLAGS_6LOWPAN_NO_PREFIX_COMPRESSION 0x02
-/* MAC will set the default for this packet */
+
+/* Use this initial security level if defined */
+#ifdef UIPBUF_ATTR_LLSEC_STARTUP_LEVEL
+#define UIPBUF_ATTR_LLSEC_LEVEL_MAC_DEFAULT UIPBUF_ATTR_LLSEC_STARTUP_LEVEL
+#else
+/* Else MAC will set the default for this packet */
#define UIPBUF_ATTR_LLSEC_LEVEL_MAC_DEFAULT 0xffff
+#endif
+
/**
* \brief The attributes defined for uipbuf attributes function.
