What difference between the raw sockets

This is a discussion on What difference between the raw sockets within the Linux Programming forums, part of the Platform Specific Boards category; I read some codes about socket in linux,I find sometimes it creates raw socket using socket(AF_INET,SOCK_RAW,IPPROTO_RAW), sometimes using socket(AF_INET,SOCK_RAW,IPPROTO_ICMP), I ...

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    50

    What difference between the raw sockets

    I read some codes about socket in linux,I find
    sometimes it creates raw socket using socket(AF_INET,SOCK_RAW,IPPROTO_RAW),
    sometimes using socket(AF_INET,SOCK_RAW,IPPROTO_ICMP),
    I want to know what difference between them?and what time we
    creates raw socket using socket (AF_INET, SOCK_RAW, IPPROTO_RAW)?
    and what time using socket (AF_INET, SOCK_RAW,IPPROTO_ICMP)?
    Thank you very much.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,762
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sockets tutorial, datagram sockets example not working for me
    By caesius in forum Networking/Device Communication
    Replies: 14
    Last Post: 12-26-2009, 03:40 PM
  2. Difference between Unix sockets and winsock.
    By antex in forum Networking/Device Communication
    Replies: 15
    Last Post: 01-21-2005, 04:53 PM
  3. Sockets
    By Cowboy in forum Networking/Device Communication
    Replies: 6
    Last Post: 12-01-2004, 01:41 PM
  4. ssl sockets
    By champ in forum Linux Programming
    Replies: 1
    Last Post: 04-06-2003, 12:51 AM
  5. Sockets
    By Twiggy in forum Windows Programming
    Replies: 8
    Last Post: 03-31-2003, 09:01 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21