Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4470026

Add NetworkInterface.getHardwareAddress()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • generic
    • generic



      Name: bsC130419 Date: 06/14/2001


      J2SE 1.4 beta documentation

      Request
      -------
      Add NetworkInterface.getHardwareAddress()

      This would return a byte array. Hardware addresses that don't fit into an even
      number of bytes would be zero-padded. The actual contents of the byte array
      would be undefined.

      Rationale
      ---------
      I use the hardware address of a machine's network interface as a hardware ID.
      I use the hardware ID to machine-lock my software--something that Java
      programmers will care about when they actually start writing commercial
      software.

      Currently, I do this by exec'ing an ipconfig/all or an ifconfig and parsing--
      truly revolting, not to mention platform-specific.

      Commentary
      ----------
      Directly addressing the underlying issue (generating a hardware ID) might yield
      a better solution. However, my solution is quick, and only mildly dirty.

      Someone who understands network interfaces better than me might be able to
      suggest a higher-level object for getHardwareAddress() to return.
      (Review ID: 126591)
      ======================================================================

            Unassigned Unassigned
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: