Example #1
0
 private static void CreateDefaultDomain()
 {
     if ( domains.ContainsKey( HpiConst.SAHPI_UNSPECIFIED_DOMAIN_ID ) ) {
     return;
     }
     string host = Environment.GetEnvironmentVariable( "OPENHPI_DAEMON_HOST" );
     if ( host == null ) {
     host = "localhost";
     }
     int port;
     string portstr = Environment.GetEnvironmentVariable( "OPENHPI_DAEMON_PORT" );
     if ( portstr != null ) {
     try {
     port = Convert.ToInt32( portstr );
     } catch ( FormatException ) {
     port = OhpiConst.DEFAULT_PORT;
     }
     } else {
     port = OhpiConst.DEFAULT_PORT;
     }
     HpiDomain d = new HpiDomain( HpiConst.SAHPI_UNSPECIFIED_DOMAIN_ID,
                          host,
                          port,
                          HpiUtil.MakeRootSaHpiEntityPathT() );
     domains[d.GetLocalDid()] = d;
 }
Example #2
0
            private static void CreateDefaultDomain()
            {
                if (domains.ContainsKey(HpiConst.SAHPI_UNSPECIFIED_DOMAIN_ID))
                {
                    return;
                }
                string host = Environment.GetEnvironmentVariable("OPENHPI_DAEMON_HOST");

                if (host == null)
                {
                    host = "localhost";
                }
                int    port;
                string portstr = Environment.GetEnvironmentVariable("OPENHPI_DAEMON_PORT");

                if (portstr != null)
                {
                    try {
                        port = Convert.ToInt32(portstr);
                    } catch (FormatException) {
                        port = OhpiConst.DEFAULT_PORT;
                    }
                }
                else
                {
                    port = OhpiConst.DEFAULT_PORT;
                }
                HpiDomain d = new HpiDomain(HpiConst.SAHPI_UNSPECIFIED_DOMAIN_ID,
                                            host,
                                            port,
                                            HpiUtil.MakeRootSaHpiEntityPathT());

                domains[d.GetLocalDid()] = d;
            }
Example #3
0
            public static long oHpiDomainAdd(
                SaHpiTextBufferT Host,
                int Port,
                SaHpiEntityPathT EntityRoot,
                out long DomainId
                )
            {
                DomainId = 0;

                String s = HpiUtil.FromSaHpiTextBufferT(Host);

                if (s == null)
                {
                    return(HpiConst.SA_ERR_HPI_INVALID_PARAMS);
                }

                HpiDomain d = HpiCore.CreateDomain(s, Port, EntityRoot);

                if (d == null)
                {
                    return(HpiConst.SA_ERR_HPI_INTERNAL_ERROR);
                }

                DomainId = d.GetLocalDid();

                return(HpiConst.SA_OK);
            }