Re: Who could tell me about raw socket in winsocket?




"Lee Tow" <fbjlt@xxxxxxxxxxxxx> wrote in message
news:ujOGjcI0JHA.1372@xxxxxxxxxxxxxxxxxxxxxxx

1 When we create a socket,socket(AF_INET,SOCK_RAW,protocol),
I want to know what the parameter protocol can be assigned in detail?

You need to set it to IPPROTO_RAW.

2 What is the parameter protocol related to,it is related to sending
data or receiving date?

It is what it says it is - the "protocol" within the "address family" (in
your case, the AF_INET family) that the socket will send/receive packets
for. For RAW sockets, there is no defined protocol. That is the whole
point of using a RAW socket - you are in full control over what protocol you
decide to implement.

For example,when the parameter protocol is assigned to IPPROTO_ICMP,
we send ICMP package or IP package when sending data?We receive ICMP
package or IP package when receiving data?

ICMP is a protocol. IPPROTO_ICMP only sends/received ICMP packets.

--
Remy Lebeau (TeamB)


.



Relevant Pages

  • TCP/IP Applications FAQ
    ... waiting for an ICMP Echo Reply from the host. ... Each trio of packets 'expire' at a succeeding ... Of the rexec protocol. ...
    (comp.unix.questions)
  • TCP/IP Applications FAQ
    ... waiting for an ICMP Echo Reply from the host. ... Each trio of packets 'expire' at a succeeding ... Of the rexec protocol. ...
    (comp.unix.questions)
  • TCP/IP Applications FAQ
    ... waiting for an ICMP Echo Reply from the host. ... Each trio of packets 'expire' at a succeeding ... Of the rexec protocol. ...
    (comp.unix.questions)
  • TCP/IP Applications FAQ
    ... waiting for an ICMP Echo Reply from the host. ... Each trio of packets 'expire' at a succeeding ... Of the rexec protocol. ...
    (comp.unix.questions)
  • TCP/IP Applications FAQ
    ... waiting for an ICMP Echo Reply from the host. ... Each trio of packets 'expire' at a succeeding ... Of the rexec protocol. ...
    (comp.unix.questions)