Amit Ghosh | c9ac1e5 | 2017-07-28 12:31:18 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Matteo Scandolo | cf847b8 | 2019-04-26 15:00:00 -0700 | [diff] [blame] | 16 | package org.opencord.aaa.impl; |
Amit Ghosh | c9ac1e5 | 2017-07-28 12:31:18 +0100 | [diff] [blame] | 17 | |
| 18 | import org.onlab.packet.Ethernet; |
| 19 | import org.onlab.packet.RADIUS; |
| 20 | |
| 21 | import org.onosproject.net.packet.InboundPacket; |
| 22 | |
| 23 | /** |
| 24 | * Default RADIUS Packet Customization. |
| 25 | * Does not change the packet |
| 26 | * |
| 27 | * Subclasses should implement filling of attributes depending on specifics ofsetup/RADIUS server |
| 28 | */ |
| 29 | public class PacketCustomizer { |
| 30 | |
| 31 | protected CustomizationInfo customInfo; |
| 32 | |
| 33 | public PacketCustomizer(CustomizationInfo info) { |
| 34 | this.customInfo = info; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Customize the packet as per specific Setup or RADIUS server requirements. |
| 39 | * |
| 40 | * @param inPkt RADIUS packet to be customized |
| 41 | * @param eapPacket Incoming packet containing EAP for which this the RADIUS message is being created |
| 42 | * @return Customized RADIUS packet |
| 43 | */ |
| 44 | public RADIUS customizePacket(RADIUS inPkt, InboundPacket eapPacket) { |
| 45 | return inPkt; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Customize the Ethernet header as per specific Setup or RADIUS server requirements. |
| 50 | * |
| 51 | * @param inPkt Ethernet packet to be changed |
| 52 | * @param eapPacket Incoming packet containing EAP for which this the |
| 53 | * RADIUS message is being created |
| 54 | * @return Changed Ethernet packet |
| 55 | */ |
| 56 | public Ethernet customizeEthernetIPHeaders(Ethernet inPkt, |
| 57 | InboundPacket eapPacket) { |
| 58 | return inPkt; |
| 59 | } |
| 60 | } |