Package com.slytechs.utils.net

Examples of com.slytechs.utils.net.Address


   */
  public List<Address> getAddresses() {
    final List<Address> addresses = new ArrayList<Address>();

    for (final PcapAddr a : device.getAddresses()) {
      addresses.add(new Address(a.getAddr().getData()));
    }

    return addresses;
  }
View Full Code Here


    return(v);
  }

  public static Address parseAddress(String word) {

    Address r = null;
    /**
     * Try parsing Ipv4 address.
     */
    String[] c;
    if ( (c = word.split("\\.")).length == 4) {
      r = new IpAddress(parseIntoArray(new byte[4], c, 10));

    } else if ( (c = word.split(":")).length == 16) {
      r = new IpAddress(parseIntoArray(new byte[16], c, 16));

    } else if ( (c = word.split("-")).length == 6 || (c = word.split(":")).length == 6) {
      r = new MacAddress(parseIntoArray(new byte[6], c, 16));

    } else if (c.length > 1) { // Catch all. Allow any type of address separated :
      r = new Address(parseIntoArray(new byte[c.length], c, 16));
    }
    else
      return null;
    
    return r;
View Full Code Here

TOP

Related Classes of com.slytechs.utils.net.Address

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.