Add omec pfcp agent helm chart
Change-Id: I243f2cef484f61658156d0e8bd7bb70ef4c7358a
diff --git a/omec/omec-pfcp-agent/templates/bin/_pfcp-agent-run.sh.tpl b/omec/omec-pfcp-agent/templates/bin/_pfcp-agent-run.sh.tpl
new file mode 100644
index 0000000..b39bb56
--- /dev/null
+++ b/omec/omec-pfcp-agent/templates/bin/_pfcp-agent-run.sh.tpl
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Copyright 2019 Intel Corporation
+# Copyright 2019-present Open Networking Foundation
+#
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+set -ex
+
+{{- if .Values.config.coreDump.enabled }}
+cp /bin/ngic_dataplane /tmp/coredump/
+{{- end }}
+
+mkdir -p /opt/dp/config
+cd /opt/dp/config
+cp /etc/dp/config/{cdr.cfg,dp_config.cfg,interface.cfg} .
+
+sed -i "s/DP_ADDR/$POD_IP/g" interface.cfg
+
+source dp_config.cfg
+ngic_dataplane $EAL_ARGS -- $APP_ARGS
diff --git a/omec/omec-pfcp-agent/templates/bin/_pfcp-agent-setup-af-iface.sh.tpl b/omec/omec-pfcp-agent/templates/bin/_pfcp-agent-setup-af-iface.sh.tpl
new file mode 100644
index 0000000..bd65a23
--- /dev/null
+++ b/omec/omec-pfcp-agent/templates/bin/_pfcp-agent-setup-af-iface.sh.tpl
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# Copyright 2019 Intel Corporation
+# Copyright 2019-present Open Networking Foundation
+#
+# SPDX-License-Identifier: Apache-2.0
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+
+set -ex
+
+UL_IFACE="{{ .Values.config.pfcpAgent.s1u.device }}-veth"
+DL_IFACE="{{ .Values.config.pfcpAgent.sgi.device }}-veth"
+
+if ! ip link show $UL_IFACE; then
+ s1u_mac=$(ip addr show dev s1u-net | awk '$1=="link/ether"{print $2}')
+ ip link add $UL_IFACE type veth peer name l_$UL_IFACE
+ ip link set $UL_IFACE up
+ ip link set l_$UL_IFACE up
+ ip link set dev $UL_IFACE address $s1u_mac
+fi
+if ! ip link show $DL_IFACE; then
+ sgi_mac=$(ip addr show dev sgi-net | awk '$1=="link/ether"{print $2}')
+ ip link add $DL_IFACE type veth peer name l_$DL_IFACE
+ ip link set $DL_IFACE up
+ ip link set l_$DL_IFACE up
+ ip link set dev $DL_IFACE address $sgi_mac
+fi
+
+if ! ip addr show $UL_IFACE | grep inet; then
+ s1u_ip=$(ip addr show s1u-net | grep inet | grep -v inet6 | awk '{print $2}')
+ ip addr add $s1u_ip dev $UL_IFACE
+fi
+if ! ip addr show $DL_IFACE | grep inet; then
+ sgi_ip=$(ip addr show sgi-net | grep inet | grep -v inet6 | awk '{print $2}')
+ ip addr add $sgi_ip dev $DL_IFACE
+fi
+
+ip a