X-Git-Url: https://git.teslayout.com/public/public/public/?p=anna.git;a=blobdiff_plain;f=example%2Fdiameter%2Flauncher%2Fresources%2Fscripts%2Fdecode.sh;fp=example%2Fdiameter%2Flauncher%2Fresources%2Fscripts%2Fdecode.sh;h=c2ca72e52485119ec5693441496746798d8e4f02;hp=0000000000000000000000000000000000000000;hb=64cc135e716c2ef018227375fc4f15ff0670fdf7;hpb=b0fce20be4095debc4b06b4b32fc9e6a8b1fa0fa diff --git a/example/diameter/launcher/resources/scripts/decode.sh b/example/diameter/launcher/resources/scripts/decode.sh new file mode 100755 index 0000000..c2ca72e --- /dev/null +++ b/example/diameter/launcher/resources/scripts/decode.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Diameter decoder for ADML-HTTP + +[ -z "$1" ] && echo "Usage: $0 " && 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 +