Validating a specific MAC address

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • palsuddeath@hotmail.com

    #1

    Validating a specific MAC address

    Hello all!

    I'm no programmer, but I have to try to complete some code for a
    project that we are working on. There will be a web page that is set up
    to register devices online. Part of the registration process will
    require the user to select the type of device from a select box, and
    then enter the MAC address for the device.

    On the web page there will be two fields, a select box, and a text
    field. The select box will have four choices:
    <SELECT name="Device">
    <option value="" selected>[choose yours]
    <option value="GameCube ">GameCube
    <option value="PS2">PS2
    <option value="XBox">XB ox
    The text field will have a default value of XX-XX-XX-XX-XX-XX. I
    already have a way to validate that they only put in 0-9, A-F, or a-f.


    For the sake of example, let's say that GameCubes have a factory set
    MAC address that begins with 00-00-00-00, PS2s have a factory set MAC
    address that begins with 00-00-00-01, and XBoxes have a factory set MAC
    address that begins with 00-00-00-02.


    I want to validate that when the user selects GameCube as their device,
    that they also input a MAC address that begins with 00-00-00-00. Does
    this make sense?


    Please let me know if you need more details.

    Thanks for any help that you can provide!

    Lee

  • Ivan Marsh

    #2
    Re: Validating a specific MAC address

    On Wed, 09 Feb 2005 11:01:36 -0800, palsuddeath wrote:
    [color=blue]
    > I want to validate that when the user selects GameCube as their device,
    > that they also input a MAC address that begins with 00-00-00-00. Does
    > this make sense?[/color]

    Assuming the network interface isn't manufactured by the company that
    makes the device: The MAC address is for the network interface and the
    prefix is assigned to the company that makes the network interface not the
    company that makes the GameCube. If they start using a network interface
    made by a different company your code won't work.

    --
    Life is short, but wide. -KV

    Comment

    • palsuddeath

      #3
      Re: Validating a specific MAC address

      So are you saying that my assumption that all GameCubes have the same
      beginning MAC address is flawed? How could I verify this?

      Thanks!

      Lee

      Comment

      • Ivan Marsh

        #4
        Re: Validating a specific MAC address

        On Wed, 09 Feb 2005 11:36:33 -0800, palsuddeath wrote:
        [color=blue]
        > So are you saying that my assumption that all GameCubes have the same
        > beginning MAC address is flawed? How could I verify this?[/color]

        I'm saying that, for what ever reason (price, availability, performance)
        the NIC built into any given device isn't always necessarily going to be
        manufactured by the manufacturer of the device.

        Nintendo does have an OUI, but you'll have to check that all of the
        manufacturers you're dealing with have one... and then assume they never
        use anyone else's devices.

        00-09-BF (hex) Nintendo Co.,Ltd.
        0009BF (base 16) Nintendo Co.,Ltd.
        11-1 HOKOTATE-CHO
        KAMITOBA, MINAMI-KU
        KYOTO 601-8501
        JAPAN

        You can check the MAC(OUI) address registry here:
        IEEE offers Registration Authority programs or registries which maintain lists of unique identifiers under standards and issue unique identifiers to those wishing to register them.


        --
        Life is short, but wide. -KV

        Comment

        • palsuddeath

          #5
          Re: Validating a specific MAC address

          Okay, then just for fun, let's assume that the vendors I'm dealing with
          have an OUI as listed above. How could I write the code to accomodate
          this?

          Comment

          • Ivan Marsh

            #6
            Re: Validating a specific MAC address

            On Wed, 09 Feb 2005 13:09:39 -0800, palsuddeath wrote:
            [color=blue]
            > Okay, then just for fun, let's assume that the vendors I'm dealing with
            > have an OUI as listed above. How could I write the code to accomodate
            > this?[/color]

            Well, you have the list of devices you are using and you have the list of
            MAC addresses assigned to those companies, I'd have a SELECT box of the
            devices automatically pop the manufacturers prefix and only let the user
            enter the unique portion.

            html>
            <body>
            <FORM NAME='test' ACTION='test.ht ml' METHOD='POST'>
            <SELECT name="Device" onchange='updat eprefix(this.va lue);'>
            <option value="" selected>[choose yours]</option>
            <option value="00-00-00">GameCube</option>
            <option value="00-00-01">PS2</option>
            <option value="00-00-02">XBox</option>
            </SELECT>
            <input disabled name='prefix' id='prefix' type='text' value='NA'>
            </form>
            </body>
            </html>

            <script type='text/javascript'>
            function updateprefix(ne wprefix) {
            document.test.p refix.value = newprefix;
            }
            </script>


            --
            Life is short, but wide. -KV

            Comment

            Working...