Ejemplo n.º 1
0
        public string dumpRouteEntry(IPHlpAPI32Wrapper.MIB_IPFORWARDROW row)
        {
            adapterIDs idList = new adapterIDs();

            //Active Routes:
            //         1         2         3         4         5         6         7         8
            //1234567890123456789012345678901234567890123456789012345678901234567890123456789012
            //Network Destination        Netmask          Gateway          Interface           Metric
            string s = "";

            s += (new IPAddress(row.dwForwardDest)).ToString().PadRight(27);
            s += (new IPAddress(row.dwForwardMask)).ToString().PadRight(17);
            s += (new IPAddress(row.dwForwardNextHop)).ToString().PadRight(17);

            //interface
            //s += "".PadLeft(6) + row.dwForwardIfIndex.ToString("000") + "     ";
            s += "".PadLeft(2) + idList.getIPstrForID((int)row.dwForwardIfIndex).PadLeft(17);
            //metric
            s += row.dwForwardMetric1.ToString().PadLeft(5);

            return(s);
        }
Ejemplo n.º 2
0
        public string dumpRouteEntry(IPHlpAPI32Wrapper.MIB_IPFORWARDROW row){
            adapterIDs idList = new adapterIDs();

            //Active Routes:
            //         1         2         3         4         5         6         7         8
            //1234567890123456789012345678901234567890123456789012345678901234567890123456789012
            //Network Destination        Netmask          Gateway          Interface           Metric
            string s = "";

            s += (new IPAddress(row.dwForwardDest)).ToString().PadRight(27);
            s += (new IPAddress(row.dwForwardMask)).ToString().PadRight(17);
            s += (new IPAddress(row.dwForwardNextHop)).ToString().PadRight(17);

            //interface
            //s += "".PadLeft(6) + row.dwForwardIfIndex.ToString("000") + "     ";
            s += "".PadLeft(2) + idList.getIPstrForID((int)row.dwForwardIfIndex).PadLeft(17) ;
            //metric
            s += row.dwForwardMetric1.ToString().PadLeft(5);

            return s;
        }