Adding AT&T specific Radius packet customizer. Currently it
avoids updating the nas ip attribute previously set from netcfg.

Change-Id: Ib2af6975c807a65e294e2a73c30a58535623cc26
diff --git a/src/main/java/org/opencord/aaa/AaaManager.java b/src/main/java/org/opencord/aaa/AaaManager.java
index b527d91..b6b417d 100755
--- a/src/main/java/org/opencord/aaa/AaaManager.java
+++ b/src/main/java/org/opencord/aaa/AaaManager.java
@@ -243,6 +243,10 @@
                 pktCustomizer = new SamplePacketCustomizer(customInfo);
                 log.info("Created SamplePacketCustomizer");
                 break;
+            case "att":
+                pktCustomizer = new AttPacketCustomizer(customInfo);
+                log.info("Created AttPacketCustomizer");
+                break;
             default:
                 pktCustomizer = new PacketCustomizer(customInfo);
                 log.info("Created default PacketCustomizer");
diff --git a/src/main/java/org/opencord/aaa/AttPacketCustomizer.java b/src/main/java/org/opencord/aaa/AttPacketCustomizer.java
new file mode 100644
index 0000000..f133466
--- /dev/null
+++ b/src/main/java/org/opencord/aaa/AttPacketCustomizer.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.opencord.aaa;
+
+/**
+ * AT&T specific RADIUS packet customization.
+ *
+ */
+public class AttPacketCustomizer extends SamplePacketCustomizer {
+
+    public AttPacketCustomizer(CustomizationInfo customInfo) {
+        super(customInfo);
+    }
+
+    @Override
+    protected boolean updateNasIp() {
+        return false;
+    }
+
+}
diff --git a/src/main/java/org/opencord/aaa/SamplePacketCustomizer.java b/src/main/java/org/opencord/aaa/SamplePacketCustomizer.java
index bc8a0d4..6130073 100755
--- a/src/main/java/org/opencord/aaa/SamplePacketCustomizer.java
+++ b/src/main/java/org/opencord/aaa/SamplePacketCustomizer.java
@@ -15,23 +15,20 @@
  */
 package org.opencord.aaa;
 
-import org.onlab.packet.Ethernet;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.IPv4;
-import org.onlab.packet.RADIUS;
-import org.onlab.packet.RADIUSAttribute;
-
-
-import org.onosproject.net.AnnotationKeys;
-import org.onosproject.net.Port;
-import org.onosproject.net.packet.InboundPacket;
-
-import org.opencord.sadis.SubscriberAndDeviceInformation;
-import org.slf4j.Logger;
+import static org.slf4j.LoggerFactory.getLogger;
 
 import java.nio.ByteBuffer;
 
-import static org.slf4j.LoggerFactory.getLogger;
+import org.onlab.packet.Ethernet;
+import org.onlab.packet.IPv4;
+import org.onlab.packet.MacAddress;
+import org.onlab.packet.RADIUS;
+import org.onlab.packet.RADIUSAttribute;
+import org.onosproject.net.AnnotationKeys;
+import org.onosproject.net.Port;
+import org.onosproject.net.packet.InboundPacket;
+import org.opencord.sadis.SubscriberAndDeviceInformation;
+import org.slf4j.Logger;
 
 
 /**
@@ -47,6 +44,15 @@
     }
 
     /**
+     * Determines if NAS IP Attribute should be updated or not.
+     *
+     * @return true if updating NAS IP is desired
+     */
+    protected boolean updateNasIp() {
+        return true;
+    }
+
+    /**
      * Customize the packet as per specific Setup or RADIUS
      * server requirements.
      *
@@ -92,8 +98,10 @@
 
         log.info("Setting nasId={} nasPortId{}", nodeName, nasPortId);
 
-        inPkt.updateAttribute(RADIUSAttribute.RADIUS_ATTR_NAS_IP,
-                deviceInfo.ipAddress().toOctets());
+        if (updateNasIp()) {
+            inPkt.updateAttribute(RADIUSAttribute.RADIUS_ATTR_NAS_IP,
+                                  deviceInfo.ipAddress().toOctets());
+        }
 
         inPkt.setAttribute(RADIUSAttribute.RADIUS_ATTR_CALLING_STATION_ID,
                 srcMac.toString().getBytes());
@@ -125,6 +133,7 @@
      *                  RADIUS message is being created
      * @return Changed Ethernet packet
      */
+    @Override
     public Ethernet customizeEthernetIPHeaders(Ethernet inPkt,
                                                InboundPacket eapPacket) {