--- /dev/null
+#!/bin/bash
+# Diameter decoder for ADML-HTTP
+
+[ -z "$1" ] && echo "Usage: $0 <pcap file>" && exit 1
+PCAP=$(readlink -f $1 2>/dev/null)
+[ ! -f "${PCAP}" ] && echo "Invalid or missing file '$1'" && exit 1
+PCAP_BN=$(basename ${PCAP} .pcap)
+PCAP_DN=$(dirname ${PCAP})
+
+cd $(dirname $0)
+
+./tsharkDecoder.sh ${PCAP}
+
+# Decode hex data:
+trap "rm -f .body.json" EXIT
+for hex in $(ls ${PCAP_DN}/*.hex 2>/dev/null)
+do
+ echo "{\"diameterHex\":\"$(cat ${hex})\"}" > .body.json
+ curl -s -XPOST --http2-prior-knowledge -d@./.body.json http://localhost:8074/decode | jq -r '.response' | base64 -d > ${hex}.xml
+done
+
# Add interesting stuff:
cp -r ${REPO_DIR}/example/diameter/launcher/resources/rest_api/helpers/diameterJsonHelper ${AD}
cp ${REPO_DIR}/example/diameter/pcapDecoder/tsharkDecoder.sh ${AD}
+cp ${REPO_DIR}/example/diameter/launcher/resources/scripts/decode.sh ${AD}
echo
echo "Generate docker image ..."