blob: 018ccb8d650f0bcf6ccb531b6e75ae9c3e4117d8 [file] [log] [blame]
Simon Huntb4381772017-10-31 11:07:39 -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.impl;
17
18import org.onlab.packet.RADIUS;
19import org.onosproject.net.packet.InboundPacket;
20import org.onosproject.net.packet.PacketContext;
21import org.opencord.aaa.api.AaaConfig;
22
23/**
24 * Interface to the implementations for RADIUS server side communication.
25 */
26public interface RadiusCommunicator {
27
28 /**
29 * Initializes the local state of the communicator, using the relevant
30 * parameters from the supplied configuration.
31 *
32 * @param newCfg new configuration to be applied
33 */
34 void initializeLocalState(AaaConfig newCfg);
35
36 /**
37 * Clears local state.
38 */
39 void clearLocalState();
40
41 /**
42 * Callback invoked when the AAA application is deactivated.
43 */
44 void deactivate();
45
46 /**
47 * Provisions intercepts on the switches (if needed).
48 */
49 void requestIntercepts();
50
51 /**
52 * Clears intercepts from the switches (if needed).
53 */
54 void withdrawIntercepts();
55
56 /**
57 * Sends the given RADIUS packet to the RADIUS server. The incoming
58 * EAPOL packet (from the switch to ONOS) is provided as reference.
59 *
60 * @param radiusPacket RADIUS packet to be sent to server
61 * @param inPkt incoming EAPOL packet
62 */
63 void sendRadiusPacket(RADIUS radiusPacket, InboundPacket inPkt);
64
65 /**
66 * Handles the packet from RADIUS server.
67 *
68 * @param context incoming packet context
69 */
70 void handlePacketFromServer(PacketContext context);
71}