blob: 6e1d6fb0d07f8c510300e236c52a0e2f52208d16 [file] [log] [blame]
Sean Condon0e89bda2017-03-21 14:23:19 +00001/*
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.onosproject.incubator.net.l2monitoring.cfm.identifier;
17
18/**
19 * Representation of a Maintenance Association ID.
20 *
21 * The MA Id consists of a name and a name type.
22 * In certain applications the MA name and type together with the MD Name and
23 * name type are embedded in to a TLV and passed between systems, and so it is
24 * important that all combinations of the name and name type can be represented here.
25 *
26 * IEEE 802.1Q Table 21-20—Short MA Name Format.
27 */
28public interface MaIdShort {
29
30 /**
31 * Get the MA name as a string.
32 * @return A string representation of the name
33 */
34 String maName();
35
36 /**
37 * Get the length of the MD name.
38 * @return The length of the name in bytes
39 */
40 int getNameLength();
41
42 /**
43 * The type of the name.
44 * @return An enumerated value
45 */
46 MaIdType nameType();
47
48 /**
49 * Supported types of MD identifier.
50 */
51 enum MaIdType {
52 /**
53 * Implemented as {@link org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaIdCharStr}.
54 */
55 CHARACTERSTRING,
56 /**
57 * Implemented as {@link org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaId2Octet}.
58 */
59 TWOOCTET,
60 /**
61 * Implemented as {@link org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaIdIccY1731}.
62 */
63 ICCY1731,
64 /**
65 * Implemented as {@link org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaIdPrimaryVid}.
66 */
67 PRIMARYVID,
68 /**
69 * Implemented as {@link org.onosproject.incubator.net.l2monitoring.cfm.identifier.MaIdRfc2685VpnId}.
70 */
71 RFC2685VPNID
72 }
73}