Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Networking: arp-request in Unix

Networking: arp-request in Unix

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 6 Posters 977 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sitesvS Offline
    sitesvS Offline
    sitesv
    wrote on last edited by
    #1

    Hi!
    Is there a qt api for arp-requesting?
    I need to find out the MAC address by IP.
    Thank you.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK, no, that is outside of Qt's scope.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        What is the use case ?
        I needed it on a "controlled" pc so i just run arp command with QProcess and read the output.
        But that might not be an option in all cases.

        sitesvS 1 Reply Last reply
        1
        • mrjjM mrjj

          Hi
          What is the use case ?
          I needed it on a "controlled" pc so i just run arp command with QProcess and read the output.
          But that might not be an option in all cases.

          sitesvS Offline
          sitesvS Offline
          sitesv
          wrote on last edited by
          #4

          @mrjj said in Networking: arp-request in Unix:

          Hi
          What is the use case ?
          I needed it on a "controlled" pc so i just run arp command with QProcess and read the output.
          But that might not be an option in all cases.

          Hi!
          This is needs for the simple hardware configuration of the device. On Windows-host pc I use SendArp... But, as I see, there is no alternative API for Linux.

          Pablo J. RoginaP KroMignonK 2 Replies Last reply
          0
          • sitesvS sitesv

            @mrjj said in Networking: arp-request in Unix:

            Hi
            What is the use case ?
            I needed it on a "controlled" pc so i just run arp command with QProcess and read the output.
            But that might not be an option in all cases.

            Hi!
            This is needs for the simple hardware configuration of the device. On Windows-host pc I use SendArp... But, as I see, there is no alternative API for Linux.

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @sitesv said in Networking: arp-request in Unix:

            there is no alternative API for Linux.

            maybe the arping command is of some help?

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            4
            • sitesvS sitesv

              @mrjj said in Networking: arp-request in Unix:

              Hi
              What is the use case ?
              I needed it on a "controlled" pc so i just run arp command with QProcess and read the output.
              But that might not be an option in all cases.

              Hi!
              This is needs for the simple hardware configuration of the device. On Windows-host pc I use SendArp... But, as I see, there is no alternative API for Linux.

              KroMignonK Offline
              KroMignonK Offline
              KroMignon
              wrote on last edited by KroMignon
              #6

              @sitesv I think ping -c 1 <ip_address> and then arp -a | grep <ip_address>should do the job?
              No need to install extra packages for that

              It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

              1 Reply Last reply
              2
              • Kent-DorfmanK Offline
                Kent-DorfmanK Offline
                Kent-Dorfman
                wrote on last edited by Kent-Dorfman
                #7

                There are many ways to do what you seek in linux, just none are Qt specific. It's a Linux systems programming exercise, not Qt. Firstly, you're not going to get a real MAC address for any IP that isn't directly connected. You may get the MAC of the router gateway though. I'd just send a dgram to the destination IP, then read /proc/net/arp to see if an entry was added.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved