/* * Copyright (c) 2013 Contextream, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.lispflowmapping.type.lisp; import java.util.ArrayList; import java.util.List; import org.opendaylight.lispflowmapping.type.lisp.address.LispAddress; import org.opendaylight.lispflowmapping.type.lisp.address.LispNoAddress; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; /** *
* 0 1 2 3 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | | Record TTL | * | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * R | Locator Count | EID mask-len | ACT |A| Reserved | * e +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * c | Rsvd | Map-Version Number | EID-Prefix-AFI | * o +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * r | EID-Prefix | * d +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | /| Priority | Weight | M Priority | M Weight | * | L +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | o | Unused Flags |L|p|R| Loc-AFI | * | c +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | \| Locator | * +-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ** * @author gmainzer * */ @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) public class EidToLocatorRecord { /** * Record TTL: This is the time in minutes the recipient of the Map-Reply * will store the mapping. If the TTL is 0, the entry SHOULD be removed from * the cache immediately. If the value is 0xffffffff, the recipient can * decide locally how long to store the mapping. */ @XmlElement private int recordTtl; /** * EID mask-len: This is the mask length for the EID-Prefix. */ @XmlElement private byte maskLength; /** * ACT: This 3-bit field describes Negative Map-Reply actions. In any other * message type, these bits are set to 0 and ignored on receipt. These bits * are used only when the 'Locator Count' field is set to 0. The action bits * are encoded only in Map-Reply messages. The actions defined are used by * an ITR or PITR when a destination EID matches a negative Map-Cache entry. * Unassigned values should cause a Map-Cache entry to be created, and when * packets match this negative cache entry, they will be dropped. The * current assigned values are: */ @XmlElement private MapReplyAction action; /** * A: The Authoritative bit, when sent, is always set to 1 by an ETR. When a * Map-Server is proxy Map-Replying [RFC6833] for a LISP site, the * Authoritative bit is set to 0. This indicates to requesting ITRs that the * Map-Reply was not originated by a LISP node managed at the site that owns * the EID-Prefix. */ @XmlElement private boolean authoritative; /** * Map-Version Number: When this 12-bit value is non-zero, the Map-Reply * sender is informing the ITR what the version number is for the EID record * contained in the Map-Reply. The ETR can allocate this number internally * but MUST coordinate this value with other ETRs for the site. When this * value is 0, there is no versioning information conveyed. The Map-Version * Number can be included in Map-Request and Map-Register messages. See * Section 6.6.3 for more details. */ @XmlElement private short mapVersion; /** * EID-Prefix-AFI: Address family of the EID-Prefix according to [AFI]. * * EID-Prefix: This prefix is 4 octets for an IPv4 address family and 16 * octets for an IPv6 address family. */ private LispAddress prefix; /** * To be used on the NB interface, prior to parse and convert it into a specific LISP address type */ @XmlElement private String prefixString; public String getPrefixString() { return prefixString; } /** * Locator Count: This is the number of Locator entries. A Locator entry * comprises what is labeled above as 'Loc'. The Locator count can be 0, * indicating that there are no Locators for the EID-Prefix. * * private byte locatorCount; */ @XmlElement private List