Package org.onosproject.net.behaviour
Interface BngProgrammable
-
- All Superinterfaces:
Behaviour
,HandlerBehaviour
public interface BngProgrammable extends HandlerBehaviour
BNG programmable behavior. Provides means to update device forwarding state to perform BNG user plane functions (e.g., tunnel termination, accounting, etc.). An implementation of this API should not write state directly to the device, but instead, always rely on core ONOS subsystems (e.g., FlowRuleService, GroupService, etc).
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
BngProgrammable.Attachment
Immutable representation of an attachment in the BNG context.static class
BngProgrammable.BngCounterType
Counters to implement BNG accounting.static class
BngProgrammable.BngProgrammableException
An exception indicating a an error happened in the BNG programmable behaviour.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cleanUp(ApplicationId appId)
Remove any state previously created by this API for the given application ID.boolean
init(ApplicationId appId)
Provision rules to punt BNG control packets to ONOS.PiCounterCellData
readControlTrafficCounter()
Read the control plane traffic counter of packets punted before attachment creation (e.g., when an attachment is not created yet).PiCounterCellData
readCounter(BngProgrammable.Attachment attachmentInfo, BngProgrammable.BngCounterType counter)
Read a specific counter value of a specific attachment.Map<BngProgrammable.BngCounterType,PiCounterCellData>
readCounters(BngProgrammable.Attachment attachmentInfo)
Read all counters for a given attachment and returns a map with keys BngCounterType and values the ones obtained from the device.void
removeAttachment(BngProgrammable.Attachment attachmentInfo)
Remove any state associated with the given attachment, including termination flow rules.void
resetControlTrafficCounter()
Reset the control plane traffic counter of packets punted before attachment creation (e.g., when an attachment is not created yet).void
resetCounter(BngProgrammable.Attachment attachmentInfo, BngProgrammable.BngCounterType counter)
Reset the given counter of a specific attachment.void
resetCounters(BngProgrammable.Attachment attachmentInfo)
Reset the all the counters of a specific attachment.void
setupAttachment(BngProgrammable.Attachment attachmentInfo)
Set up the necessary state to enable termination of the attachment traffic.-
Methods inherited from interface org.onosproject.net.driver.HandlerBehaviour
handler, setHandler
-
-
-
-
Method Detail
-
init
boolean init(ApplicationId appId)
Provision rules to punt BNG control packets to ONOS. Control packets might include Session Discovery, Authentication, Address Assignment etc. Apps are expected to call this method as the first one when they are ready to process attachment connection requests.- Parameters:
appId
- Application ID of the caller of this API.- Returns:
- True if initialized, false otherwise.
-
cleanUp
void cleanUp(ApplicationId appId) throws BngProgrammable.BngProgrammableException
Remove any state previously created by this API for the given application ID.- Parameters:
appId
- Application ID of the application using the BngProgrammable.- Throws:
BngProgrammable.BngProgrammableException
- while writing on BNG device.
-
setupAttachment
void setupAttachment(BngProgrammable.Attachment attachmentInfo) throws BngProgrammable.BngProgrammableException
Set up the necessary state to enable termination of the attachment traffic. If the attachment is active, packets will be forwarded/terminated after calling this method, if not they will be dropped. State, if already present in the data plane, will not be cleaned (e.g., counters).- Parameters:
attachmentInfo
- Attachment information to configure the line termination.- Throws:
BngProgrammable.BngProgrammableException
- while writing on BNG device.
-
removeAttachment
void removeAttachment(BngProgrammable.Attachment attachmentInfo) throws BngProgrammable.BngProgrammableException
Remove any state associated with the given attachment, including termination flow rules. Calling this method while an attachment is generating/receiving traffic, will eventually cause all packets to be dropped for that attachment.- Parameters:
attachmentInfo
- Attachment information to remove the line termination.- Throws:
BngProgrammable.BngProgrammableException
- while writing on BNG device.
-
readCounters
Map<BngProgrammable.BngCounterType,PiCounterCellData> readCounters(BngProgrammable.Attachment attachmentInfo) throws BngProgrammable.BngProgrammableException
Read all counters for a given attachment and returns a map with keys BngCounterType and values the ones obtained from the device. If a specific BngCounterType is not found in the map, it means the device does not support it.- Parameters:
attachmentInfo
- Attachment information.- Returns:
- The counter values of the attachment.
- Throws:
BngProgrammable.BngProgrammableException
- while reading from BNG device.
-
readCounter
PiCounterCellData readCounter(BngProgrammable.Attachment attachmentInfo, BngProgrammable.BngCounterType counter) throws BngProgrammable.BngProgrammableException
Read a specific counter value of a specific attachment. If the given BngCounterType is not supported by the device, returns null.- Parameters:
attachmentInfo
- Attachment information.counter
- The counter to be read.- Returns:
- The value of the specific counter.
- Throws:
BngProgrammable.BngProgrammableException
- while reading from BNG device.
-
readControlTrafficCounter
PiCounterCellData readControlTrafficCounter() throws BngProgrammable.BngProgrammableException
Read the control plane traffic counter of packets punted before attachment creation (e.g., when an attachment is not created yet). If unsupported, return null value.- Returns:
- The value of the control traffic counter.
- Throws:
BngProgrammable.BngProgrammableException
- while reading from BNG device.
-
resetCounter
void resetCounter(BngProgrammable.Attachment attachmentInfo, BngProgrammable.BngCounterType counter) throws BngProgrammable.BngProgrammableException
Reset the given counter of a specific attachment.- Parameters:
attachmentInfo
- Attachment information.counter
- The counter to be reset.- Throws:
BngProgrammable.BngProgrammableException
- while writing on BNG device.
-
resetCounters
void resetCounters(BngProgrammable.Attachment attachmentInfo) throws BngProgrammable.BngProgrammableException
Reset the all the counters of a specific attachment.- Parameters:
attachmentInfo
- Attachment information.- Throws:
BngProgrammable.BngProgrammableException
- while writing on BNG device.
-
resetControlTrafficCounter
void resetControlTrafficCounter() throws BngProgrammable.BngProgrammableException
Reset the control plane traffic counter of packets punted before attachment creation (e.g., when an attachment is not created yet).- Throws:
BngProgrammable.BngProgrammableException
- while writing on BNG device.
-
-