Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to get name of network adapter card if ip address is given in linux?

how to get name of network adapter card if ip address is given in linux?

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminlinuxtutorialquestion
6 Posts 3 Posters 0 Views 1 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.
  • A Offline
    A Offline
    an89
    wrote on last edited by
    #1

    can anybody suggest how to get name of network adapter card if ip address is given in linux?I have to do it programmatically.

    D 1 Reply Last reply
    0
    • A an89

      can anybody suggest how to get name of network adapter card if ip address is given in linux?I have to do it programmatically.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      an89 wrote:

      can anybody suggest how to get name of network adapter card...

      Try GetAdaptersInfo(). I doubt it'll work on Linux, however.

      "Love people and use things, not love things and use people." - Unknown

      "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

      C A 2 Replies Last reply
      0
      • D David Crow

        an89 wrote:

        can anybody suggest how to get name of network adapter card...

        Try GetAdaptersInfo(). I doubt it'll work on Linux, however.

        "Love people and use things, not love things and use people." - Unknown

        "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

        C Offline
        C Offline
        Cosmic Egg
        wrote on last edited by
        #3

        I think in linux ioctl(socketid, SIOCGIFCONF, &ifc); can be used. I think you can also use function pcap_findalldevs in libpcap library(opensource). alternatively you can also see the linux specific implementation of pcap_findalldevs in libpcap.

        A 1 Reply Last reply
        0
        • C Cosmic Egg

          I think in linux ioctl(socketid, SIOCGIFCONF, &ifc); can be used. I think you can also use function pcap_findalldevs in libpcap library(opensource). alternatively you can also see the linux specific implementation of pcap_findalldevs in libpcap.

          A Offline
          A Offline
          an89
          wrote on last edited by
          #4

          Thanks.... :-O

          1 Reply Last reply
          0
          • D David Crow

            an89 wrote:

            can anybody suggest how to get name of network adapter card...

            Try GetAdaptersInfo(). I doubt it'll work on Linux, however.

            "Love people and use things, not love things and use people." - Unknown

            "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

            A Offline
            A Offline
            an89
            wrote on last edited by
            #5

            it won't work as its win32 api.

            D 1 Reply Last reply
            0
            • A an89

              it won't work as its win32 api.

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              an89 wrote:

              ...as its win32 api.

              That's what I would expect from a VC++ forum.

              "Love people and use things, not love things and use people." - Unknown

              "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups