blob: 70d4ae28fdb43269069cc14a9a351e71c9c755ba [file] [log] [blame]
Taras Lemkin96a0d342018-03-26 14:52:58 +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 *
16 */
17package org.onosproject.dhcprelay;
18
19import org.onlab.packet.Ethernet;
20import org.onosproject.net.ConnectPoint;
21
22/**
23 * Container for Ethernet packet and destination port.
24 */
25final class InternalPacket {
26 private Ethernet packet;
27 private ConnectPoint destLocation;
28
29 private InternalPacket(Ethernet newPacket, ConnectPoint newLocation) {
30 packet = newPacket;
31 destLocation = newLocation;
32 }
33
34 public Ethernet getPacket() {
35 return packet;
36 }
37
38 public ConnectPoint getDestLocation() {
39 return destLocation;
40 }
41
42 /**
43 * Build {@link InternalPacket} object instance.
44 *
45 * @param newPacket {@link Ethernet} packet to be sent
46 * @param newLocation {@link ConnectPoint} packet destination
47 * @return new instance of {@link InternalPacket} class
48 */
49 public static InternalPacket internalPacket(Ethernet newPacket, ConnectPoint newLocation) {
50 return new InternalPacket(newPacket, newLocation);
51 }
52}