18 [[ "$V" = "must" ]] && must="$must,V"
19 [[ "$M" = "must" ]] && must="$must,M"
20 [[ "$P" = "must" ]] && must="$must,P"
21 [[ "$V" = "may" ]] && may="$may,V"
22 [[ "$M" = "may" ]] && may="$may,M"
23 [[ "$P" = "may" ]] && may="$may,P"
24 [[ "$V" = "shouldnot" ]] && shouldnot="$shouldnot,V"
25 [[ "$M" = "shouldnot" ]] && shouldnot="$shouldnot,M"
26 [[ "$P" = "shouldnot" ]] && shouldnot="$shouldnot,P"
27 [[ "$V" = "mustnot" ]] && mustnot="$mustnot,V"
28 [[ "$M" = "mustnot" ]] && mustnot="$mustnot,M"
29 [[ "$P" = "mustnot" ]] && mustnot="$mustnot,P"
30 [[ "$ENC" = "yes" ]] && enc="$enc,Y"
31 [[ "$ENC" = "no" ]] && enc="$enc,N"
33 _must=$(echo $must | cut -d',' -f2-)
34 _may=$(echo $may | cut -d',' -f2-)
35 _shouldnot=$(echo $shouldnot | cut -d',' -f2-)
36 _mustnot=$(echo $mustnot | cut -d',' -f2-)
37 _enc=$(echo $enc | cut -d',' -f2-)
39 printf "%50s %2s %10s %2s %10s %2s %10s %2s %10s %2s %10s\n" $AVP "|" $_must "|" $_may "|" $_shouldnot "|" $_mustnot "|" $_enc
43 [[ "$1" = "" ]] && _exit "Use: $0 <avps dictionary>, i.e.: $0 avps_ietf.xml"
45 BN_FILE=`basename $FILE`
46 TMP_FILE=.${BN_FILE}.tmp
48 grep "<avp name=" $FILE > $TMP_FILE
50 printf "%50s %2s %10s %2s %10s %2s %10s %2s %10s %2s %10s\n" AVP "|" Must "|" May "|" "Should Not" "|" "Must Not" "|" "May Encrypt"
51 echo "-------------------------------------------------------------------------------------------------------------------------"
55 AVP=$(echo $line | awk -F'avp name=' '{ print $2 }' | cut -d'"' -f2)
56 V=$(echo $line | awk -F'v-bit=' '{ print $2 }' | cut -d'"' -f2)
57 M=$(echo $line | awk -F'm-bit=' '{ print $2 }' | cut -d'"' -f2)
58 P=$(echo $line | awk -F'p-bit=' '{ print $2 }' | cut -d'"' -f2)
59 ENC=$(echo $line | awk -F'may-encrypt=' '{ print $2 }' | cut -d'"' -f2)