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 | */ |
| 16 | package org.opencord.aaa; |
| 17 | |
| 18 | import org.onlab.packet.RADIUS; |
| 19 | |
| 20 | import org.onosproject.net.packet.InboundPacket; |
| 21 | import org.onosproject.net.packet.PacketContext; |
| 22 | |
| 23 | /** |
| 24 | * Interface to the implementations for RADIUS server side communication. |
| 25 | */ |
| 26 | public interface RadiusCommunicator { |
| 27 | |
| 28 | /** |
| 29 | * Does initialization required for the implementation to work and applies the |
| 30 | * relevant part of the passed configuration. |
| 31 | * |
| 32 | * @param newCfg : New configuration to be applied |
| 33 | */ |
| 34 | void initializeLocalState(AaaConfig newCfg); |
| 35 | /** |
| 36 | * Clears up all local state. |
| 37 | */ |
| 38 | void clearLocalState(); |
| 39 | /** |
| 40 | * Shutdown, called when AAA app is deactivated. |
| 41 | */ |
| 42 | void deactivate(); |
| 43 | /** |
| 44 | * Provision intercepts on the switches if needed. |
| 45 | */ |
| 46 | void requestIntercepts(); |
| 47 | /** |
| 48 | * Clear intercepts from the switches if needed. |
| 49 | */ |
| 50 | void withdrawIntercepts(); |
| 51 | /** |
| 52 | * Send RADIUS packet to the RADIUS server. |
| 53 | * |
| 54 | * @param radiusPacket RADIUS packet to be sent to server. |
| 55 | * @param inPkt Incoming EAPOL packet |
| 56 | */ |
| 57 | void sendRadiusPacket(RADIUS radiusPacket, InboundPacket inPkt); |
| 58 | /** |
| 59 | * Handle packet from RADIUS server. |
| 60 | * |
| 61 | * @param context Incoming packet context. |
| 62 | */ |
| 63 | void handlePacketFromServer(PacketContext context); |
| 64 | } |