Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PString PIPSocket::GetGatewayInterface (  )  [static, inherited]

Get the name for the interface that is being used as the gateway, that is, the interface that packets on the default route will be sent.

The string returned may be used in the Connect() function to open that interface.

Note that the driver does not need to be open for this function to work.

String name of the gateway device, or empty string if there is none.

Definition at line 1947 of file ethsock.cxx.

References PString::Empty().

  PWaitAndSignal m(GetSNMPMutex());

  PWin32SnmpLibrary & snmp = PWin32SnmpLibrary::Current();

  AsnInteger ifNum = -1;
  PWin32AsnOid gatewayOid = "";
  if (!snmp.GetOid(gatewayOid, ifNum) && ifNum >= 0)
    return PString::Empty();

  return snmp.GetInterfaceName(ifNum);

Generated by  Doxygen 1.6.0   Back to index