How can i get MAC Address by IP address in SCO UNIX C 
Author Message
 How can i get MAC Address by IP address in SCO UNIX C

Hi,

  Please tell me which function i can use to get the physical address

 In C language.



Fri, 04 Aug 2000 03:00:00 GMT  
 How can i get MAC Address by IP address in SCO UNIX C


Quote:

>Hi,

>  Please tell me which function i can use to get the physical address

> In C language.

The system() function may be used to launch the ``ifconfig'' command.
The output of this command may be parsed to discover the ethernet
address.

Please visit a SCO UNIX specific newsgroup; your query has nothing
to do with the C language and is annoyingly clueless. How
do you expect to find the MAC address of your system when you can't
even find the right newsgroup to ask a simple question?



Fri, 04 Aug 2000 03:00:00 GMT  
 How can i get MAC Address by IP address in SCO UNIX C

Quote:

>Hi,

>  Please tell me which function i can use to get the physical address

> In C language.

I don't know if it'll work in UNIX, but it works this works for me in DOS:
(I have the lsl, NetworkCardDriver and ipxodi loaded)

typedef struct strLocaladdress{
  unsigned char   network[4];
  unsigned char   node[6];
    };

struct strLocaladdress local_address;

void GetLocalAddress(struct strLocaladdress __far *pla)
   {
      union _REGS reg;
      struct _SREGS sreg;

      reg.x.bx=0x0009;
      sreg.es=_FP_SEG(pla);
      reg.x.si=_FP_OFF(pla);
      _int86x(0x7A,&reg,&reg,&sreg);
   }

and then call it by:

 static struct strLocaladdress local_address;
 GetLocalAddress(&local_address);

The GetLocalAdress function you probably have to rewrite, because it's a
call to
one of the previously loaded drivers, that have added/changed an interrupt
call.

I use it to make several old,small dos machines communicate with each other.

Denie Andriessen
D dot Andriessen at pink.nl  (you know what to do with this...)



Fri, 04 Aug 2000 03:00:00 GMT  
 How can i get MAC Address by IP address in SCO UNIX C

Quote:

>Hi,

>  Please tell me which function i can use to get the physical address

> In C language.

The C language has no support for networking, so the simple answer is
that there is no such function. To find out what facilities SCO Unix
might provide to do this you should ask in comp.unix.sco.programmer.
For a more general Unix answer ask in comp.unix.programmer (but first check
whether your question is answered in its socket FAQ).

--
-----------------------------------------


-----------------------------------------



Fri, 04 Aug 2000 03:00:00 GMT  
 How can i get MAC Address by IP address in SCO UNIX C

Quote:

> Hi,

>   Please tell me which function i can use to get the physical address

>  In C language.

Hi zhy,

The standard C language does not support what you want to do. Please
consider asking the Unix programming experts to get detailed Unix
specific advice:

Stephan
(initiator of the campaign against grumpiness in c.l.c)



Fri, 04 Aug 2000 03:00:00 GMT  
 How can i get MAC Address by IP address in SCO UNIX C

[lots's of very system specific stuff]

Just keep in mind that the solution of Denie Andriessen is absolutely
non portable and very far outside the realms of standard C. It will
probably only work with one very specific compiler and a very specific
compiler parameter list.

Topics like like this are much better suited for:

Stephan
(initiator of the campaign against grumpiness in c.l.c)



Fri, 04 Aug 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How to get MAC address from IP Address

2. convert mac address to ip address

3. IP address and Mac Address help!!!

4. MAC Address from IP Address

5. getting ip address of the default route interface (public ip vs private ip)

6. Determinig a machine's Physical Address (MAC Address)

7. MAC ADDRESS ie Ethernet Card Address

8. Get MAC for a list of IP addresses

9. IP and MAC(media access controler) address

10. ** UNIX ANSI C -- Retuning an IP address **** TIA!

11. Getting MAC Address in WIndows 98 and NT/2000/NT

12. Getting the MAC Address

 

 
Powered by phpBB® Forum Software