Thread: Packet Filter using Unix Socket

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    24

    Packet Filter using Unix Socket

    I had by mistake posted in the C programming board,

    http://cboard.cprogramming.com/showt...threadid=48181

    Please take a look at the link and help me out.

    Thanks.

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Do you need to call:
    Code:
    setsockopt(handle->fd, SOL_SOCKET, SO_ATTACH_FILTER, 
    			       &fcode, sizeof(fcode))
    Search: pf_packet packet filter

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    24
    With SO_ATTACH_FILTER you will have to specify the filter code but i want to block all IP packets and send only the packets, which may be useful.

    (Definition of useful may be dependent on data and not on any header information)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Packet processing in Socket programming, please help
    By pumpkin in forum Networking/Device Communication
    Replies: 5
    Last Post: 05-28-2009, 01:33 AM
  2. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 03:25 AM
  3. Problem while constructing IP packet and sending using socket() system call
    By cavestine in forum Networking/Device Communication
    Replies: 10
    Last Post: 10-15-2007, 05:49 AM
  4. Datagram Unix socket problem
    By karas in forum C Programming
    Replies: 9
    Last Post: 07-27-2006, 10:08 AM
  5. Packet Filter Using Unix Sockets
    By doraiashok in forum C Programming
    Replies: 3
    Last Post: 12-12-2003, 02:56 PM