SSF.OS.BGP4.Comm
Class OpenMessage

java.lang.Object
  |
  +--SSF.OS.ProtocolMessage
        |
        +--SSF.OS.BGP4.Comm.Message
              |
              +--SSF.OS.BGP4.Comm.OpenMessage
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class OpenMessage
extends Message

A BGP Open message. Used to initiate negotiation of a peering session with a neighboring BGP speaker.

See Also:
Serialized Form

Field Summary
 java.lang.String as_nh
          The NHI prefix address of the autonomous system of the sender.
 IPaddress bgpid
          The BGP Identifier of the sender.
 long hold_time
          The length of time (in logical clock ticks) that the sender proposes for the value of the Hold Timer.
 
Fields inherited from class SSF.OS.BGP4.Comm.Message
KEEPALIVE, nh, NOTICEUPDATE, NOTIFICATION, OCTETS_IN_HEADER, OPEN, RUN, STARTSTOP, TIMEOUT, TRANSPORT, typ, typeNames, UPDATE, version
 
Constructor Summary
OpenMessage()
          Empty constructor.
OpenMessage(IPaddress bgp_id, java.lang.String bgp_as, java.lang.String nh, long ht)
          Initializes member data.
 
Method Summary
 int body_bytecount()
          Returns the number of octets (bytes) in the message body only.
 void readExternal(java.io.ObjectInput in)
          Reads the contents of this object from a serialization stream.
 void writeExternal(java.io.ObjectOutput out)
          Writes the contents of this object to a serialization stream.
 
Methods inherited from class SSF.OS.BGP4.Comm.Message
bytecount, header_bytecount, toString, type2str, version
 
Methods inherited from class SSF.OS.ProtocolMessage
carryPayload, copy, dropHeader, dropPayload, frombytes, fromVersion, payload, previous, size, tobytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

as_nh

public java.lang.String as_nh
The NHI prefix address of the autonomous system of the sender.


hold_time

public long hold_time
The length of time (in logical clock ticks) that the sender proposes for the value of the Hold Timer. The value in seconds is BGPSession.ticks2secs(hold_time).


bgpid

public IPaddress bgpid
The BGP Identifier of the sender. Each BGP speaker (router running BGP) has a BGP Identifier. A given BGP speaker sets the value of its BGP Identifier to an IP address assigned to that BGP speaker (randomly picks one of its interface's addresses, essentially). It is chosen at startup and never changes.

Constructor Detail

OpenMessage

public OpenMessage()
Empty constructor. Used to deserialize this object.


OpenMessage

public OpenMessage(IPaddress bgp_id,
                   java.lang.String bgp_as,
                   java.lang.String nh,
                   long ht)
Initializes member data.

Parameters:
bgp_id - The BGP ID of the BGPSession composing this message.
bgp_as - The NHI address prefix of the AS of the BGPSession composing this message.
nh - The NHI address prefix of the sender of this message.
ht - The proposed value for the Hold Timer.
Method Detail

body_bytecount

public int body_bytecount()
Returns the number of octets (bytes) in the message body only. It is the sum of one octet for the version, two octets for the AS number, two octets for the hold time, four octets for the BGP identifier, one octet for the optional parameters length, and a variable number of octets for optional parameters.

Overrides:
body_bytecount in class Message
Returns:
the number of octets (bytes) in the message body

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes the contents of this object to a serialization stream.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class Message
Throws:
java.io.IOException - if there's an error writing the data

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the contents of this object from a serialization stream.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class Message
Throws:
java.io.IOException - if there's an error reading in the data
java.lang.ClassNotFoundException - if a class name is unrecognized