예제 #1
0
/**
 * Construct a DHCP server with a default configuration.
 */
VBoxNetDhcp::VBoxNetDhcp():VBoxNetBaseService("VBoxNetDhcp", "VBoxNetDhcp")
{
    /*   m_enmTrunkType          = kIntNetTrunkType_WhateverNone; */
    RTMAC mac;
    mac.au8[0]     = 0x08;
    mac.au8[1]     = 0x00;
    mac.au8[2]     = 0x27;
    mac.au8[3]     = 0x40;
    mac.au8[4]     = 0x41;
    mac.au8[5]     = 0x42;
    setMacAddress(mac);

    RTNETADDRIPV4 address;
    address.u = RT_H2N_U32_C(RT_BSWAP_U32_C(RT_MAKE_U32_FROM_U8( 10,  0,  2,  5)));
    setIpv4Address(address);

    setSendBufSize(8 * _1K);
    setRecvBufSize(50 * _1K);

    m_uCurMsgType           = UINT8_MAX;
    m_cbCurMsg              = 0;
    m_pCurMsg               = NULL;
    memset(&m_CurHdrs, '\0', sizeof(m_CurHdrs));

    m_fIgnoreCmdLineParameters = true;

    for(unsigned int i = 0; i < RT_ELEMENTS(g_aOptionDefs); ++i)
        addCommandLineOption(&g_aOptionDefs[i]);
}
예제 #2
0
void rspfApplicationUsage::addUsageExplanation(Type type,const rspfString& option,const rspfString& explanation)
{
    switch(type)
    {
        case(RSPF_COMMAND_LINE_OPTION):
            addCommandLineOption(option,explanation);
            break;
        case(RSPF_ENVIRONMENTAL_VARIABLE):
            addEnvironmentalVariable(option,explanation);
            break;
    }
}
예제 #3
0
VBoxNetLwipNAT::VBoxNetLwipNAT(SOCKET icmpsock4, SOCKET icmpsock6) : VBoxNetBaseService("VBoxNetNAT", "nat-network")
{
    LogFlowFuncEnter();

    m_ProxyOptions.ipv6_enabled = 0;
    m_ProxyOptions.ipv6_defroute = 0;
    m_ProxyOptions.icmpsock4 = icmpsock4;
    m_ProxyOptions.icmpsock6 = icmpsock6;
    m_ProxyOptions.tftp_root = NULL;
    m_ProxyOptions.src4 = NULL;
    m_ProxyOptions.src6 = NULL;
    RT_ZERO(m_src4);
    RT_ZERO(m_src6);
    m_src4.sin_family = AF_INET;
    m_src6.sin6_family = AF_INET6;
#if HAVE_SA_LEN
    m_src4.sin_len = sizeof(m_src4);
    m_src6.sin6_len = sizeof(m_src6);
#endif
    m_ProxyOptions.nameservers = NULL;

    m_LwipNetIf.name[0] = 'N';
    m_LwipNetIf.name[1] = 'T';

    RTMAC mac;
    mac.au8[0] = 0x52;
    mac.au8[1] = 0x54;
    mac.au8[2] = 0;
    mac.au8[3] = 0x12;
    mac.au8[4] = 0x35;
    mac.au8[5] = 0;
    setMacAddress(mac);

    RTNETADDRIPV4 address;
    address.u     = RT_MAKE_U32_FROM_U8( 10,  0,  2,  2); // NB: big-endian
    setIpv4Address(address);

    address.u     = RT_H2N_U32_C(0xffffff00);
    setIpv4Netmask(address);

    fDontLoadRulesOnStartup = false;

    for(unsigned int i = 0; i < RT_ELEMENTS(g_aGetOptDef); ++i)
        addCommandLineOption(&g_aGetOptDef[i]);

    LogFlowFuncLeave();
}
CAMLprim value wrapLALInferenceIFOData(value options) {
  CAMLparam1(options);
  CAMLlocal2(data, option);

  LALInferenceIFOData *d = NULL;
  ProcessParamsTable *ppt = NULL;

  /* Set srate. */
  option = Field(options, 0);
  ppt = addCommandLineOption(ppt, "--srate", String_val(option));

  /* Flow's */
  option = Field(options, 1);
  if (caml_string_length(option) == 0) {
    /* Do nothing. */
  } else {
    ppt = addCommandLineOption(ppt, "--flow", String_val(option));
  }

  /* Fhigh's */
  option = Field(options, 2);
  if (caml_string_length(option) == 0) {
    /* Do nothing. */
  } else {
    ppt = addCommandLineOption(ppt, "--fhigh", String_val(option));
  }

  option = Field(options, 3);
  ppt = addCommandLineOption(ppt, "--cache", String_val(option));
  
  option = Field(options, 4);
  ppt = addCommandLineOption(ppt, "--IFO", String_val(option));

  option = Field(options, 5);
  ppt = addCommandLineOption(ppt, "--dataseed", String_val(option));
  
  option = Field(options, 6);
  ppt = addCommandLineOption(ppt, "--PSDstart", String_val(option));
  
  option = Field(options, 7);
  ppt = addCommandLineOption(ppt, "--trigtime", String_val(option));
  
  option = Field(options, 8);
  ppt = addCommandLineOption(ppt, "--PSDlength", String_val(option));

  option = Field(options, 9);
  ppt = addCommandLineOption(ppt, "--seglen", String_val(option));

  option = Field(options, 10);
  if (Is_block(option)) {
    ppt = addCommandLineOption(ppt, "--injXML", String_val(Field(option,0)));
  }

  d = LALInferenceReadData(ppt);
  LALInferenceInjectInspiralSignal(d,ppt);
		
  LALInferenceIFOData *dElt = d;
  while (dElt != NULL) {
    /*If two IFOs have the same sampling rate, they should have the
      same timeModelh*, freqModelh*, and modelParams variables to
      avoid excess computation in model waveform generation in the
      future*/
    LALInferenceIFOData * dEltCompare=d;
    int foundIFOwithSameSampleRate=0;
    while (dEltCompare != NULL && dEltCompare!=dElt) {
      if(dEltCompare->timeData->deltaT == dElt->timeData->deltaT){
        dElt->timeModelhPlus=dEltCompare->timeModelhPlus;
        dElt->freqModelhPlus=dEltCompare->freqModelhPlus;
        dElt->timeModelhCross=dEltCompare->timeModelhCross;				
        dElt->freqModelhCross=dEltCompare->freqModelhCross;				
        dElt->modelParams=dEltCompare->modelParams;	
        foundIFOwithSameSampleRate=1;	
        break;
      }
      dEltCompare = dEltCompare->next;
    }
    if(!foundIFOwithSameSampleRate){
      dElt->timeModelhPlus  = XLALCreateREAL8TimeSeries("timeModelhPlus",
                                                        &(dElt->timeData->epoch),
                                                        0.0,
                                                        dElt->timeData->deltaT,
                                                        &lalDimensionlessUnit,
                                                        dElt->timeData->data->length);
      dElt->timeModelhCross = XLALCreateREAL8TimeSeries("timeModelhCross",
                                                        &(dElt->timeData->epoch),
                                                        0.0,
                                                        dElt->timeData->deltaT,
                                                        &lalDimensionlessUnit,
                                                        dElt->timeData->data->length);
      dElt->freqModelhPlus = XLALCreateCOMPLEX16FrequencySeries("freqModelhPlus",
                                                                &(dElt->freqData->epoch),
                                                                0.0,
                                                                dElt->freqData->deltaF,
                                                                &lalDimensionlessUnit,
                                                                dElt->freqData->data->length);
      dElt->freqModelhCross = XLALCreateCOMPLEX16FrequencySeries("freqModelhCross",
                                                                 &(dElt->freqData->epoch),
                                                                 0.0,
                                                                 dElt->freqData->deltaF,
                                                                 &lalDimensionlessUnit,
                                                                 dElt->freqData->data->length);
      dElt->modelParams = calloc(1, sizeof(LALInferenceVariables));
    }
    dElt = dElt->next;
  }

  deletePPT(ppt);

  data = alloc_ifo_data(d);

  CAMLreturn(data);
}