blob: 3dbdb710fb2797f4fafd54de065a1e4cfb027da6 [file] [log] [blame]
Simon Hunta3b61bc2017-10-30 16:46:41 -07001/*
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 */
16package org.opencord.aaa.api;
17
18import org.onlab.packet.Ethernet;
19import org.onlab.packet.RADIUS;
20import org.onosproject.net.packet.InboundPacket;
21
22/**
23 * Facilitates the customization of RADIUS packets.
24 * <p>
25 * This default implementation does no customization.
26 * <p>
27 * Subclasses should override the appropriate methods to fill in attributes
28 * according to the specifics of the RADIUS server set up.
29 */
30public class PacketCustomizer {
31
32 /**
33 * Customize the packet as per specific setup or RADIUS server requirements.
34 * <p>
35 * This default implementation returns the packet unaltered.
36 *
37 * @param inPkt RADIUS packet to be customized
38 * @param eapPacket Incoming packet containing EAP for which this RADIUS
39 * message is being created
40 * @return customized RADIUS packet
41 */
42 public RADIUS customizePacket(RADIUS inPkt, InboundPacket eapPacket) {
43 return inPkt;
44 }
45
46 /**
47 * Customize the Ethernet header as per specific setup or RADIUS
48 * server requirements.
49 * <p>
50 * This default implementation returns the packet unaltered.
51 *
52 * @param inPkt Ethernet packet to be changed
53 * @param eapPacket Incoming packet containing EAP for which this RADIUS
54 * message is being created
55 * @return customized Ethernet packet
56 */
57 public Ethernet customizeEthernetIPHeaders(Ethernet inPkt,
58 InboundPacket eapPacket) {
59 return inPkt;
60 }
61}