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
Forum Updated to NodeBB v4.3 + New Features

Networking: arp-request in Unix

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 6 Posters 987 Views 5 Watching
  • 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.
  • S Offline
    S Offline
    sitesv
    wrote on 28 Aug 2020, 16:03 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 28 Aug 2020, 17:26 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
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 28 Aug 2020, 17:39 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.

        S 1 Reply Last reply 31 Aug 2020, 13:05
        1
        • M mrjj
          28 Aug 2020, 17:39

          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.

          S Offline
          S Offline
          sitesv
          wrote on 31 Aug 2020, 13:05 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.

          P K 2 Replies Last reply 31 Aug 2020, 13:45
          0
          • S sitesv
            31 Aug 2020, 13:05

            @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.

            P Offline
            P Offline
            Pablo J. Rogina
            wrote on 31 Aug 2020, 13:45 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
            • S sitesv
              31 Aug 2020, 13:05

              @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.

              K Offline
              K Offline
              KroMignon
              wrote on 31 Aug 2020, 13:55 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
              • K Offline
                K Offline
                Kent-Dorfman
                wrote on 31 Aug 2020, 19:41 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

                1/7

                28 Aug 2020, 16:03

                • Login

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