Logo Search packages:      
Sourcecode: libnetfilter-queue version File versions  Download package

int nfq_set_mode ( struct nfq_q_handle *  qh,
u_int8_t  mode,
u_int32_t  range 

nfq_set_mode - set the amount of packet data that nfqueue copies to userspace

qh Netfilter queue handle obtained by call to nfq_create_queue().
mode the part of the packet that we are interested in
range size of the packet that we want to get
Sets the amount of data to be copied to userspace for each packet queued to the given queue.

  • NFQNL_COPY_NONE - do not copy any data
  • NFQNL_COPY_META - copy only packet metadata
  • NFQNL_COPY_PACKET - copy entire packet

Definition at line 541 of file libnetfilter_queue.c.

      union {
            char buf[NFNL_HEADER_LEN
                  +NFA_LENGTH(sizeof(struct nfqnl_msg_config_params))];
            struct nlmsghdr nmh;
      } u;
      struct nfqnl_msg_config_params params;

      nfnl_fill_hdr(qh->h->nfnlssh, &u.nmh, 0, AF_UNSPEC, qh->id,

      params.copy_range = htonl(range);
      params.copy_mode = mode;
      nfnl_addattr_l(&u.nmh, sizeof(u), NFQA_CFG_PARAMS, &params,

      return nfnl_query(qh->h->nfnlh, &u.nmh);

Generated by  Doxygen 1.6.0   Back to index