o If the DisCoRegistration is set to "sip_focus_uri", then it contains an Address-of-Record (AoR) as an opaque string and opaque "coordinates" string, that describes the relative network position. o If registration type is set to "sip_focus_node" then it contains the Destination list for the peer and an opaque string "coordinates" describing the focus' relative network position.
Exemple #1
0
 /// <summary>
 /// Deserializes a DisCoRegistration from byte stream.
 /// </summary>
 /// <param name="rm">Not used.</param>
 /// <param name="reader">
 /// The binary reader containing the entire RELOAD message</param>
 /// <param name="usage_size">Not used. DisCoReg has fixed length</param>
 /// <returns></returns>
 public IUsage FromReader(ReloadMessage rm, BinaryReader reader, long usage_size) {
   codePoint = Usage_Code_Point.DISCO;
   UInt16 len = 0; // used for length of opaque values            
   try {
     /* lenght of resource name and resource name */
     len = (UInt16)(Conv.NetworkToHostOrder((short)reader.ReadInt16()));
     resourceName = Encoding.ASCII.GetString(reader.ReadBytes(len), 0, len);
     /* length of rest PDU */
     length = (UInt16)(Conv.NetworkToHostOrder((short)reader.ReadInt16()));
     /* length of coordiate and coordinate */
     len = (UInt16)(Conv.NetworkToHostOrder((short)reader.ReadInt16()));
     string coord = Encoding.UTF8.GetString(reader.ReadBytes(len), 0, len);
     /* node_id of remote peer */
     NodeId nodeId = new NodeId(reader.ReadBytes(ReloadGlobals.NODE_ID_DIGITS));
     /* Instanciate DisCo data */
     data = new DisCoRegistrationData(coord, nodeId);
     usage_size = usage_size - (length + 1);
   }
   catch (Exception ex) {
     myManager.m_ReloadConfig.Logger(ReloadGlobals.TRACEFLAGS.T_ERROR,
         String.Format("DisCoRegistration FromBytes(): {0}", ex.Message));
   }
   return this;
 }
Exemple #2
0
 /// <summary>
 /// This constructor instanciates a DisCoRegistration containing the Destination List towards the focus and its coordinate value.
 /// </summary>
 /// <param name="coordinate">The focus' relative position in the network.</param>
 /// <param name="dest_list"></param>
 public DisCoRegistration(string resName, string coordinate,
     NodeId nodeId, UsageManager manager) {
   if (coordinate == null || nodeId == null)
     throw new ArgumentNullException("DisCoRegistration does not accept null parameters");
   myManager = manager;
   resourceName = resName;
   length = (UInt16)(resName.Length + 2);
   length += (UInt16)nodeId.Digits;
   length += (UInt16)(coordinate.Length + 2);
   length += 2; // length itself
   data = new DisCoRegistrationData(coordinate, nodeId);
 }