public class BGP4Open extends BGP4Message
From RFC 4271, Section 4.2
RFC 4271. 4.2. OPEN Message Format After a TCP connection is established, the first message sent by each side is an OPEN message. If the OPEN message is acceptable, a KEEPALIVE message confirming the OPEN is sent back. In addition to the fixed-size BGP header, the OPEN message contains the following fields: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 +-+-+-+-+-+-+-+-+ | Version | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | My Autonomous System | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Hold Time | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | BGP Identifier | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Opt Parm Len | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Optional Parameters (variable) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+Version: This 1-octet unsigned integer indicates the protocol version number of the message. The current BGP version number is 4. My Autonomous System: This 2-octet unsigned integer indicates the Autonomous System number of the sender. Hold Time: This 2-octet unsigned integer indicates the number of seconds the sender proposes for the value of the Hold Timer. Upon receipt of an OPEN message, a BGP speaker MUST calculate the value of the Hold Timer by using the smaller of its configured Hold Time and the Hold Time received in the OPEN message. The Hold Time MUST be either zero or at least three seconds. An implementation MAY reject connections on the basis of the Hold Time. The calculated value indicates the maximum number of seconds that may elapse between the receipt of successive KEEPALIVE and/or UPDATE messages from the sender. BGP Identifier: This 4-octet unsigned integer indicates the BGP Identifier of the sender. A given BGP speaker sets the value of its BGP Identifier to an IP address that is assigned to that BGP speaker. The value of the BGP Identifier is determined upon startup and is the same for every local interface and BGP peer. Optional Parameters Length: This 1-octet unsigned integer indicates the total length of the Optional Parameters field in octets. If the value of this field is zero, no Optional Parameters are present. Optional Parameters: This field contains a list of optional parameters, in which each parameter is encoded as a
0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-... | Parm. Type | Parm. Length | Parameter Value (variable) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-...Parameter Type is a one octet field that unambiguously identifies individual parameters. Parameter Length is a one octet field that contains the length of the Parameter Value field in octets. Parameter Value is a variable length field that is interpreted according to the value of the Parameter Type field. [RFC3392] defines the Capabilities Optional Parameter. The minimum length of the OPEN message is 29 octets (including the message header).
BGPHeaderLength, BGPMarkerLength, log, messageBytes
Constructor and Description |
---|
BGP4Open()
Construct new PCEP Open message from scratch
|
BGP4Open(byte[] bytes)
Construct new PCEP Open message from scratch
|
Modifier and Type | Method and Description |
---|---|
void |
decode() |
void |
encode() |
Inet4Address |
getBGPIdentifier() |
int |
getBGPOpenMessageMandatoryFileds() |
int |
getHoldTime() |
int |
getMyAutonomousSystem() |
int |
getOptionalParameterLength() |
LinkedList<BGP4OptionalParameter> |
getParametersList() |
int |
getVersion() |
void |
setBGPIdentifier(Inet4Address bGPIdentifier) |
void |
setBGPOpenMessageMandatoryFileds(int bGPOpenMessageMandatoryFileds) |
void |
setHoldTime(int holdTime) |
void |
setMyAutonomousSystem(int myAutonomousSystem) |
void |
setOptionalParameterLength(int optionalParameterLength) |
void |
setParametersList(LinkedList<BGP4OptionalParameter> parametersList) |
void |
setVersion(int version) |
String |
toString() |
encodeHeader, getBGPHeaderLength, getBGPMarkerLength, getBytes, getLength, getMessageType, getMessageType, setMessageLength, setMessageType
public BGP4Open()
public BGP4Open(byte[] bytes)
public void encode()
public void decode()
public int getVersion()
public void setVersion(int version)
public int getMyAutonomousSystem()
public void setMyAutonomousSystem(int myAutonomousSystem)
public int getHoldTime()
public void setHoldTime(int holdTime)
public Inet4Address getBGPIdentifier()
public void setBGPIdentifier(Inet4Address bGPIdentifier)
public int getOptionalParameterLength()
public void setOptionalParameterLength(int optionalParameterLength)
public LinkedList<BGP4OptionalParameter> getParametersList()
public void setParametersList(LinkedList<BGP4OptionalParameter> parametersList)
public int getBGPOpenMessageMandatoryFileds()
public void setBGPOpenMessageMandatoryFileds(int bGPOpenMessageMandatoryFileds)
Copyright © 2016. All rights reserved.