Changeset f436fd0 for router


Ignore:
Timestamp:
Oct 21, 2016 10:23:48 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
c24ddf5
Parents:
dc523b7
Message:

Add MTU to command line utils

Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/CommandLine.java

    rdc523b7 rf436fd0  
    2323        "net.i2p.router.tasks.CryptoChecker",
    2424        "net.i2p.router.transport.GeoIPv6",
     25        "net.i2p.router.transport.udp.MTU",
    2526        //"net.i2p.router.transport.UPnP"
    2627    });
  • router/java/src/net/i2p/router/transport/udp/MTU.java

    rdc523b7 rf436fd0  
    1414 * Get the MTU for the network interface of an address.
    1515 * Not available until Java 6 / Android API 9.
    16  * @since 0.9.2
     16 *
     17 * Public only for command line test.
     18 * Not for external use, not a public API.
     19 *
     20 * @since 0.9.2. public since 0.9.27
    1721 */
    18 abstract class MTU {
     22public class MTU {
    1923
    2024    private static final boolean hasMTU = SystemVersion.isJava6();
    2125   
     26    private MTU() {};
     27
    2228    /**
    2329     * The MTU for the socket interface, if available.
     
    101107    }
    102108
     109    public static void main(String args[]) {
    103110/****
    104     public static void main(String args[]) {
    105111        System.out.println("Cmd line interfaces:");
    106112        for (int i = 0; i < args.length; i++) {
     
    113119        }
    114120        System.out.println("All interfaces:");
     121****/
    115122        try {
    116123            Enumeration<NetworkInterface> ifcs = NetworkInterface.getNetworkInterfaces();
     
    120127                    for(Enumeration<InetAddress> addrs =  ifc.getInetAddresses(); addrs.hasMoreElements();) {
    121128                        InetAddress addr = addrs.nextElement();
    122                         System.out.println("MTU of " + addr.getHostAddress() + " is " + getMTU(addr));
     129                        System.out.println("I2P MTU for " + addr.getHostAddress() + " is " + getMTU(addr));
    123130                    }
    124131                }
     
    128135        }
    129136    }
    130 ****/
    131137}
Note: See TracChangeset for help on using the changeset viewer.