Carmelo Cascone | 42fdec3 | 2019-12-09 22:36:48 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019-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 | |
| 17 | package org.onosproject.pipelines.fabric.impl.behaviour.bng; |
| 18 | |
| 19 | import org.onlab.packet.IpAddress; |
| 20 | import org.onlab.packet.MacAddress; |
| 21 | import org.onlab.packet.VlanId; |
| 22 | import org.onosproject.core.ApplicationId; |
| 23 | import org.onosproject.net.behaviour.BngProgrammable; |
| 24 | |
| 25 | /** |
| 26 | * Mock implementation of BngProgrammable.Attachment. |
| 27 | */ |
| 28 | class MockAttachment implements BngProgrammable.Attachment { |
| 29 | |
| 30 | private final VlanId stag; |
| 31 | private final VlanId ctag; |
| 32 | private final MacAddress macAddress; |
| 33 | |
| 34 | MockAttachment(int seed) { |
| 35 | this.stag = VlanId.vlanId((short) seed); |
| 36 | this.ctag = VlanId.vlanId((short) seed); |
| 37 | this.macAddress = MacAddress.valueOf(seed); |
| 38 | } |
| 39 | |
| 40 | @Override |
| 41 | public ApplicationId appId() { |
| 42 | return null; |
| 43 | } |
| 44 | |
| 45 | @Override |
| 46 | public VlanId sTag() { |
| 47 | return stag; |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | public VlanId cTag() { |
| 52 | return ctag; |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | public MacAddress macAddress() { |
| 57 | return macAddress; |
| 58 | } |
| 59 | |
| 60 | @Override |
| 61 | public IpAddress ipAddress() { |
| 62 | return null; |
| 63 | } |
| 64 | |
| 65 | @Override |
| 66 | public boolean lineActive() { |
| 67 | return false; |
| 68 | } |
| 69 | |
| 70 | @Override |
| 71 | public AttachmentType type() { |
| 72 | return null; |
| 73 | } |
| 74 | |
| 75 | @Override |
| 76 | public short pppoeSessionId() { |
| 77 | return 0; |
| 78 | } |
| 79 | } |