blob: ba630d24864d76ac82d55864c02a33c9848068a8 [file] [log] [blame]
Anjali K K4a694f62018-07-12 19:09:19 +05301/*
2 * Copyright 2017-present Open Networking Laboratory
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
17package org.onlab.packet;
18
19/**
20 * Class representing EAPOL MKPDU Parameter Set.
21 * IEEE 802.1X Clause 11; Figure 11-7, Table 11-6
22 */
23public interface EAPOLMkpduParameterSet {
24 // Parameter Set Types.
25 public static final byte PARAMETERSET_TYPE_BASIC = 0;
26 public static final byte PARAMETERSET_TYPE_LIVE_PEER_LIST = 1;
27 public static final byte PARAMETERSET_TYPE_POTENTIAL_PEER_LIST = 2;
28 public static final byte PARAMETERSET_TYPE_MACSEC_SAK_USE = 3;
29 public static final byte PARAMETERSET_TYPE_DISTRIBUTED_SAK = 4;
30 public static final byte PARAMETERSET_TYPE_ICV_INDICATOR = (byte) 255;
31
32 // Member Identifier & Number fields.
33 public static final int FIELD_MI_LENGTH = 12;
34 public static final int FIELD_MN_LENGTH = 4;
35
36 // SCI field details.
37 public static final int FIELD_SCI_LENGTH = 8;
38
39 // Body Length field details.
40 public static final byte BODY_LENGTH_MSB_MASK = (byte) 0x0F;
41 public static final byte BODY_LENGTH_MSB_SHIFT = (byte) 0x08;
42 public static final byte BODY_LENGTH_OCTET_OFFSET = (byte) 0x04;
43
44 /**
45 * Retrieve Type of Parameter Set.
46 *
47 * @return parameter set type.
48 */
49 public byte getParameterSetType();
50
51 /**
52 * Total length; ie. including header and body length.
53 *
54 * @return short value.
55 */
56 public short getTotalLength();
57
58 /**
59 * Retrieve Body Length field of Parameter Set.
60 *
61 * @return body length of parameter set.
62 */
63 public short getBodyLength();
64
65 /**
66 * Utility function for Serializing Parameter Set.
67 *
68 * @return byte[] value
69 */
70 public byte[] serialize();
71}