blob: 4c0e539af122f68c2c0256648c71545abb7adece [file] [log] [blame]
Jian Li6b77dc02016-07-14 16:04:25 +09001/*
2 * Copyright 2016-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 */
16package org.onosproject.lisp.msg.types;
17
18import org.onlab.packet.MacAddress;
19
20/**
21 * MAC address that is used by LISP Locator.
22 */
23public class LispMacAddress extends LispAfiAddress {
24
25 protected final MacAddress address;
26
27 /**
28 * Initializes MAC address.
29 *
30 * @param address MAC address
31 */
32 public LispMacAddress(MacAddress address) {
33 super(AddressFamilyIdentifierEnum.MAC);
34 this.address = address;
35 }
36
37 /**
38 * Obtains LISP locator's MAC address.
39 *
40 * @return MAC address
41 */
42 public MacAddress getAddress() {
43 return address;
44 }
45
46 @Override
47 public int hashCode() {
48 return address.hashCode();
49 }
50
51 @Override
52 public boolean equals(Object obj) {
53 return address.equals(obj);
54 }
55
56 @Override
57 public String toString() {
58 return address.toString();
59 }
60}