refactor network packets
[carveJwlIkooP6JGAAIwe30JlM.git] / network_common.h
diff --git a/network_common.h b/network_common.h
new file mode 100644 (file)
index 0000000..404c000
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef NETWORK_COMMON_H
+#define NETWORK_COMMON_H
+
+#include "vg/vg_stdint.h"
+#include "vg/vg_platform.h"
+
+#define NETWORK_USERNAME_MAX 32
+
+#define ADDON_DEFINE_ONLY
+ #include "addon.h"
+#undef ADDON_DEFINE_ONLY
+
+static u32 network_msgstring( const char *src, 
+                              u32 m_cbSize, u32 base_size,
+                              char *buf, u32 buf_size ){
+   
+   u32 string_len = VG_MIN( m_cbSize - base_size, buf_size );
+   return vg_strncpy( src, buf, string_len, k_strncpy_always_add_null );
+}
+
+#endif /* NETWORK_COMMON_H */