Link to home
Create AccountLog in
Avatar of newbie_tw
newbie_tw

asked on

send message through socket?

Now I want to write a server - client program to send message between them. I want to use SOCK_RAW and IPPROTO_RAW to send so I don't want to use TCP/IP protocol. At server-side, I use libpcap to capture packet from the client. And I have two questions:
1. In sendto() function, there's parameter "const struct sockaddr *to", if I just want to send to a defined Mac address (ignore the IP address), what info I must supply here?
2. In case we broadcast the message, there're 2 network interface cards, how can I choose exactly what NIC will send out the message, other one will not send out any.

Thanks for your answers.
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.