Capture packets at ethernet port in C language [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How to capture packets delivered to my Ethernet port but are discarded because they do not have the same MAC address as my Ethernet card?
I am trying to develop a program in C language. Hence require pointers on how the above can be achieved?
I am trying to do this in Linux.

Under Linux you may use libpcap library. This is the easiest way. You may also do it "by hand" using appropriate socket type (sock_packet, sock_raw) with promiscuous mode for ethernet interface. Google for "linsniff.c" program if you are looking for example.

Related

Convert a MFRC522 arduino chip to an USB device [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I'm tying to convert a MFRC522 arduino chip to an USB device so as to use it natively on windows (with a cli or software) and without an Arduino. I don't know if I was clear (sorry for my bad english). Can anyone help me to do this.
No, you can't do that because you need some mediation between the RFID reader and the PC USB port.
You don't have to use Arduino, but you do need a processor to "translate" the information from the reader and some hardware to speak to USB.

How to get remote host MAC address by using its ip address in c programming in linux [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Can some one tell me, how to get remote host MAC address by using its ip address in linux by using c programming(could be netlink sockets or BSD sockets)?
This can't be done using C programming. If it was possible then there wouldn't be any protocol like ARP to get the link layer address.
You can implement ARP request and reply using socket programming. But that's not what you want in this case I think. Anyway in that case you can refer to this discussion
link.
You can have a look at this for that purpose source code.

Packet analyzer in c [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need to capture packets which are coming from interface (say eth0) and need to print those packet details (same as wireshark) through C language. Packet can be any general packet. is there any way to achieve this ??
(I don't want to use any application like wireshark for this purpose)
OS:Centos
Try having a look at libpcap. http://www.tcpdump.org/ I believe it will do what you want.

How NTP protocol works? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I try to find ant NTP documentation for "dummies", I don't understand how NTP works. I need to write an NTP client which should just print current local time. What should I send to the server? What will I receive?
If you want to implement your own client then you need the RFC 5905 - Network Time Protocol Version 4 which specifies the protocol and algorithms of NTP. This document describes exactly what you should send to the server and what you will receive.

Connecting with a specific interface in Linux [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have connected two ethernet cards in the CPU. I have then connected one card to internet another one card to the modem. Its working fine. from modem i have connected to another linux pc.when i m ping the another pc ip address from my machine its not pinging.how to configure it
If you have two interfaces, you have two IP addresses.
Bind your socket to the IP address/port you want to use.
You can read this socket tutorial for operations step by step on Linux.

Resources