aboutsummaryrefslogtreecommitdiffstats
path: root/src/scvpp/src/sc_vpp_comm.c
diff options
context:
space:
mode:
authorAndrej Kozemcak <andrej.kozemcak@pantheon.tech>2019-02-14 13:15:22 +0100
committerAndrej Kozemcak <andrej.kozemcak@pantheon.tech>2019-03-20 16:13:15 +0100
commit52002bff61ccdd95a3e69094f8e6a99eaf2c0b32 (patch)
treefe63846d48bec1e555c36f47564506ae3e662cc3 /src/scvpp/src/sc_vpp_comm.c
parent7dd61fc820323344c7479dd767a2ee0f84abd810 (diff)
Plugin - init NAT
Change-Id: I072b3bc018812d9f51cb7269bfdbb98b19db873c Signed-off-by: Andrej Kozemcak <andrej.kozemcak@pantheon.tech>
Diffstat (limited to 'src/scvpp/src/sc_vpp_comm.c')
-rw-r--r--src/scvpp/src/sc_vpp_comm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/scvpp/src/sc_vpp_comm.c b/src/scvpp/src/sc_vpp_comm.c
index 241b4ce..cd0b035 100644
--- a/src/scvpp/src/sc_vpp_comm.c
+++ b/src/scvpp/src/sc_vpp_comm.c
@@ -98,3 +98,16 @@ char* sc_ntoa(const u8 * buf)
memcpy(&addr, buf, sizeof(addr));
return inet_ntoa(addr);
}
+
+/**
+ * @brief Function converts the u8 array from network byte order to host byte order.
+ *
+ * @param[in] host IPv4 address.
+ * @return host byte order value.
+ */
+uint32_t hardntohlu32(uint8_t host[4])
+{
+ uint32_t tmp = host[3] | host[2] | host[1] | host[0];
+
+ return ntohl(tmp);
+}