Ejemplo n.º 1
0
  private static void printSSLTaggedComponent(TaggedComponent taggedComponent, PrintWriter out) {
    org.omg.SSLIOP.SSL ssl = null;
    if (taggedComponent.tag == 20) {
      CDRInputStream in = new CDRInputStream(taggedComponent.component_data);
      try {
        in.openEncapsulatedArray();
        ssl = org.omg.SSLIOP.SSLHelper.read(in);
      } catch (Exception ex) {
        return;
      }
      int ssl_port = ssl.port;
      if (ssl_port < 0) {
        ssl_port += 65536;
      }

      out.print("\t\ttarget_supports\t:\t");
      // dump               ( ssl.target_supports );
      decodeAssociationOption(ssl.target_supports, out);
      out.println();
      out.print("\t\ttarget_requires\t:\t");
      // dump               ( ssl.target_requires );
      decodeAssociationOption(ssl.target_requires, out);
      out.println();
      out.println("\t\tSSL Port\t:\t" + ssl_port);
    }
  }
Ejemplo n.º 2
0
 /** Decodes a CDR encapsulation of a UtcT. */
 public static UtcT fromCDR(byte[] buffer) {
   final CDRInputStream in = new CDRInputStream(buffer);
   try {
     in.openEncapsulatedArray();
     return UtcTHelper.read(in);
   } finally {
     in.close();
   }
 }
Ejemplo n.º 3
0
  private static void printJavaCodebaseComponent(TaggedComponent taggedComponent, PrintWriter out) {
    final CDRInputStream in = new CDRInputStream(taggedComponent.component_data);

    try {
      in.openEncapsulatedArray();
      String codebase = in.read_string();

      out.println("\t\tCodebase: " + codebase);
    } finally {
      in.close();
    }
  }
Ejemplo n.º 4
0
  private static void printTagGroupTaggedComponent(
      TaggedComponent taggedComponent, PrintWriter out) {
    final CDRInputStream is =
        new CDRInputStream((org.omg.CORBA.ORB) null, taggedComponent.component_data);

    is.openEncapsulatedArray();
    TagGroupTaggedComponent tagGroup = TagGroupTaggedComponentHelper.read(is);
    is.close();

    out.println(
        "\t\tVersion: " + tagGroup.group_version.major + ":" + tagGroup.group_version.minor);
    out.println("\t\tDomain: " + tagGroup.group_domain_id);
    out.println("\t\tObjectGroupID: " + tagGroup.object_group_id);
    out.println("\t\tObject Version: " + tagGroup.object_group_ref_version);
  }
Ejemplo n.º 5
0
  private static void printOrbTypeComponent(TaggedComponent taggedComponent, PrintWriter out) {
    final CDRInputStream is = new CDRInputStream(taggedComponent.component_data);

    try {
      is.openEncapsulatedArray();
      int type = is.read_long();

      out.print("\t\tType: " + type);
      if (type == ORBConstants.JACORB_ORB_ID) {
        out.println(" (JacORB)");
      } else {
        out.println(" (Foreign)");
      }
    } finally {
      is.close();
    }
  }
Ejemplo n.º 6
0
  public Any decode(byte[] data) throws FormatMismatch {
    final CDRInputStream in = new CDRInputStream(orb, data);

    try {
      in.setGIOPMinor(giopMinor);

      in.openEncapsulatedArray();
      Any result = in.read_any();

      // not necessary, since stream is never used again
      // in.closeEncapsulation();

      return result;
    } finally {
      in.close();
    }
  }
Ejemplo n.º 7
0
  public Any decode_value(byte[] data, TypeCode tc) throws FormatMismatch, TypeMismatch {
    final CDRInputStream in = new CDRInputStream(orb, data);

    try {
      in.setGIOPMinor(giopMinor);

      in.openEncapsulatedArray();
      Any result = orb.create_any();
      result.read_value(in, tc);

      // not necessary, since stream is never used again
      // in.closeEncasupaltion();

      return result;
    } finally {
      in.close();
    }
  }
Ejemplo n.º 8
0
  private static void printCodeSetComponent(TaggedComponent taggedComponent, PrintWriter out) {
    final CDRInputStream is = new CDRInputStream(taggedComponent.component_data);

    try {
      is.openEncapsulatedArray();

      org.omg.CONV_FRAME.CodeSetComponentInfo codeSet = CodeSetComponentInfoHelper.read(is);

      if (codeSet != null) {
        out.println(
            "\t\tForChar native code set Id: "
                + CodeSet.csName(codeSet.ForCharData.native_code_set));
        out.print("\t\tChar Conversion Code Sets: ");
        for (int ji = 0; ji < codeSet.ForCharData.conversion_code_sets.length; ji++) {
          out.println(CodeSet.csName(codeSet.ForCharData.conversion_code_sets[ji]));

          if (ji < (codeSet.ForCharData.conversion_code_sets.length - 1)) {
            out.print(", ");
          }
        }
        if (codeSet.ForCharData.conversion_code_sets.length == 0) {
          out.print("\n");
        }

        out.println(
            "\t\tForWChar native code set Id: "
                + CodeSet.csName(codeSet.ForWcharData.native_code_set));
        out.print("\t\tWChar Conversion Code Sets: ");
        for (int ji = 0; ji < codeSet.ForWcharData.conversion_code_sets.length; ji++) {
          out.println(CodeSet.csName(codeSet.ForWcharData.conversion_code_sets[ji]));

          if (ji < (codeSet.ForWcharData.conversion_code_sets.length - 1)) {
            out.print(", ");
          }
        }
        if (codeSet.ForCharData.conversion_code_sets.length == 0) {
          out.print("\n");
        }
      }
    } finally {
      is.close();
    }
  }
Ejemplo n.º 9
0
  private static void printTlsSecTrans(byte[] tagData, PrintWriter out) {
    CDRInputStream in = new CDRInputStream(tagData);

    try {
      in.openEncapsulatedArray();
      TLS_SEC_TRANS tls = TLS_SEC_TRANSHelper.read(in);
      out.println("\t\t\tTLS SEC TRANS target requires: " + tls.target_requires);
      out.println("\t\t\tTLS SEC TRANS target supports: " + tls.target_supports);

      for (int i = 0; i < tls.addresses.length; i++) {
        int ssl_port = tls.addresses[i].port;
        if (ssl_port < 0) {
          ssl_port += 65536;
        }
        out.println("\t\t\tTLS SEC TRANS address: " + tls.addresses[i].host_name + ":" + ssl_port);
      }
    } catch (Exception ex) {
      out.print("\t\t\tTLS SEC TRANS: ");
      dumpHex(tagData, out);
      out.println();
    }
  }
Ejemplo n.º 10
0
  private static void printAlternateAddress(
      ORB orb, TaggedComponent taggedComponent, PrintWriter out) {
    final CDRInputStream is = new CDRInputStream(taggedComponent.component_data);

    try {
      is.openEncapsulatedArray();
      String hostname = is.read_string();
      short port = is.read_ushort();

      IIOPAddress result = new IIOPAddress(hostname, port);
      try {
        result.configure(((org.jacorb.orb.ORB) orb).getConfiguration());
      } catch (ConfigurationException ce) {
        ((org.jacorb.orb.ORB) orb)
            .getConfiguration()
            .getLogger("PrintIOR")
            .warn("ConfigurationException", ce);
      }

      out.println("\t\tAddress: " + result.toString());
    } finally {
      is.close();
    }
  }
Ejemplo n.º 11
0
  private static void printPolicyComponent(TaggedComponent taggedComponent, PrintWriter out) {
    final CDRInputStream is = new CDRInputStream(taggedComponent.component_data);

    try {
      int val;
      int count = 0;

      is.openEncapsulatedArray();
      int len = is.read_long();

      while (len-- != 0) {
        val = is.read_long();
        out.print("\t\t#" + count++ + ": ");
        is.openEncapsulation();
        switch (val) {
          case PRIORITY_BANDED_CONNECTION_POLICY_TYPE.value:
            {
              long i;
              short low;
              short high;

              out.println("RTCORBA::PRIORITY_BANDED_CONNECTION");
              val = is.read_long();
              for (i = 0; i < val; i++) {
                low = is.read_short();
                high = is.read_short();
                out.println("\t\t\tBand " + i + ": " + low + "-" + high);
              }
              break;
            }
          case PRIORITY_MODEL_POLICY_TYPE.value:
            {
              out.print("RTCORBA::PRIORITY_MODEL");
              val = is.read_long();
              switch (val) {
                case PriorityModel._CLIENT_PROPAGATED:
                  {
                    out.print(" (CLIENT_PROPAGATED, ");
                    break;
                  }
                case PriorityModel._SERVER_DECLARED:
                  {
                    out.print(" (SERVER_DECLARED, ");
                    break;
                  }
                default:
                  {
                    out.print(" (Unknown, ");
                    break;
                  }
              }
              short prio = is.read_short();
              out.println(prio + ")");
              break;
            }
          default:
            {
              out.println("Unknown (" + val + ")");
              break;
            }
        }
        is.closeEncapsulation();
      }

    } finally {
      is.close();
    }
  }
Ejemplo n.º 12
0
  private static void printCSIMechComponent(TaggedComponent taggedComponent, PrintWriter out) {
    final CDRInputStream is = new CDRInputStream(taggedComponent.component_data);

    try {
      is.openEncapsulatedArray();
      CompoundSecMechList csmList = CompoundSecMechListHelper.read(is);

      if (csmList != null) {
        out.println("\t\tis stateful: " + csmList.stateful);
        for (int i = 0; i < csmList.mechanism_list.length; i++) {
          out.println("\t\tCompoundSecMech #" + i);
          out.println("\t\t\ttarget_requires: " + csmList.mechanism_list[i].target_requires);
          out.print("\t\t\ttransport mechanism tag: ");
          switch (csmList.mechanism_list[i].transport_mech.tag) {
            case TAG_TLS_SEC_TRANS.value:
              {
                out.println("TAG_TLS_SEC_TRANS");
                printTlsSecTrans(csmList.mechanism_list[i].transport_mech.component_data, out);
                break;
              }
            case TAG_NULL_TAG.value:
              {
                out.println("TAG_NULL_TAG");
                break;
              }
            default:
              {
                out.println("Unknown tag : " + csmList.mechanism_list[i].transport_mech.tag);
              }
          }
          out.println(
              "\t\t\tAS_ContextSec target_supports: "
                  + csmList.mechanism_list[i].as_context_mech.target_supports);
          out.println(
              "\t\t\tAS_ContextSec target_requires: "
                  + csmList.mechanism_list[i].as_context_mech.target_requires);
          out.print("\t\t\tAS_ContextSec mech: ");
          dumpHex(csmList.mechanism_list[i].as_context_mech.client_authentication_mech, out);
          out.println();
          out.print("\t\t\tAS_ContextSec target_name: ");
          printNTExportedName(csmList.mechanism_list[i].as_context_mech.target_name, out);
          out.println(
              "\t\t\tSAS_ContextSec target_supports: "
                  + csmList.mechanism_list[i].sas_context_mech.target_supports);
          out.println(
              "\t\t\tSAS_ContextSec target_requires: "
                  + csmList.mechanism_list[i].sas_context_mech.target_requires);

          for (int j = 0;
              j < csmList.mechanism_list[i].sas_context_mech.supported_naming_mechanisms.length;
              j++) {
            out.print("\t\t\tSAS_ContextSec Naming mech: ");
            dumpHex(csmList.mechanism_list[i].sas_context_mech.supported_naming_mechanisms[j], out);
            out.println();
          }
          out.println(
              "\t\t\tSAS_ContextSec Naming types: "
                  + csmList.mechanism_list[i].sas_context_mech.supported_identity_types);
          out.println();
        }
      }
    } finally {
      is.close();
    }
  }