Added xlat support for Packet-Authentication-Vector
authoraland <aland>
Sun, 21 Nov 2004 14:29:33 +0000 (14:29 +0000)
committeraland <aland>
Sun, 21 Nov 2004 14:29:33 +0000 (14:29 +0000)
share/dictionary
src/include/radius.h
src/main/xlat.c

index 75ea1c6..e2998ec 100644 (file)
@@ -55,6 +55,7 @@ $INCLUDE dictionary.3com
 $INCLUDE dictionary.3gpp
 $INCLUDE dictionary.3gpp2
 $INCLUDE dictionary.acc
+$INCLUDE dictionary.airespace
 $INCLUDE dictionary.alcatel
 $INCLUDE dictionary.alteon
 $INCLUDE dictionary.ascend
@@ -305,6 +306,7 @@ ATTRIBUTE   Packet-Src-IP-Address   1084    ipaddr
 ATTRIBUTE      Packet-Dst-IP-Address   1085    ipaddr
 ATTRIBUTE      Packet-Src-Port         1086    integer
 ATTRIBUTE      Packet-Dst-Port         1087    integer
+ATTRIBUTE      Packet-Authentication-Vector 1088 octets
 
 #
 #      Range:  1084-1199
index ed1a22e..5067d75 100644 (file)
 #define PW_PACKET_DST_IP_ADDRESS       1085
 #define PW_PACKET_SRC_PORT             1086
 #define PW_PACKET_DST_PORT             1087
+#define PW_PACKET_AUTHENTICATION_VECTOR        1088
 
 /*
  *     Integer Translations
index 6805312..6c23bd5 100644 (file)
@@ -233,6 +233,8 @@ static int xlat_packet(void *instance, REQUEST *request,
                if (packet) {
                        VALUE_PAIR localvp;
 
+                       localvp.strvalue[0] = 0;
+
                        switch (da->attr) {
                        case PW_PACKET_TYPE:
                        {
@@ -267,13 +269,18 @@ static int xlat_packet(void *instance, REQUEST *request,
                                localvp.attribute = da->attr;
                                localvp.lvalue = packet->dst_port;
                                break;
+                       case PW_PACKET_AUTHENTICATION_VECTOR:
+                               localvp.attribute = da->attr;
+                               memcpy(localvp.strvalue, packet->vector,
+                                      sizeof(packet->vector));
+                               localvp.length = sizeof(packet->vector);
+                               break;
                        
                        default:
                                return 0; /* not found */
                                break;
                        }
 
-                       localvp.strvalue[0] = 0;
                        localvp.type = da->type;
                        return valuepair2str(out, outlen, &localvp,
                                             da->type, func);