Re: Missing definition of struct "pkt_buff" for libnetfilter_queue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-11-16, at 21:05:27 +0200, shockedder shockedder wrote:
> On Wed, Nov 16, 2022 at 8:16 PM Jeremy Sowden wrote:
> > On 2022-11-16, at 19:42:01 +0200, Shockedder wrote:
> > > I'm running with a slightly older version of "libnetfilter_queue"
> > > (1.0.2).
> > >
> > > I have installed both the standard and devel packages, along with
> > > the same for "libnfnetlink" I can't for the life of me find the
> > > definition of "struct pkt_buff" in any of the source or headers.
> >
> >   https://git.netfilter.org/libnetfilter_queue/tree/src/internal.h?h=libnetfilter_queue-1.0.2
> >
> > The public API for `struct [pkt_buff]` is:
> >
> >   https://git.netfilter.org/libnetfilter_queue/tree/include/libnetfilter_queue/pktbuff.h?h=libnetfilter_queue-1.0.2
> >
> > > Due to that I'm getting errors when trying to compile accessing
> > > structure members:
> > >
> > >   "etf_nq.c:78:93: error: dereferencing pointer to incomplete type 'struct pkt_buff'
> > >        fprintf(stdout,"[PACKET] UDP pB->th pointer val=%p pktb_tail pointer val=%p\n",pktBuff->transport_header,pktb_tail(pktBuff));"
> >
> > Try:
> >
> >   fprintf(stdout,"[PACKET] UDP pB->th pointer val=%p pktb_tail pointer val=%p\n",
> >           (void *) pktb_transport_header(pktBuff), pktb_tail(pktBuff));"
>
> Thank you very much, you've saved me a lot of hair-pulling.  Looking
> once more, I've been able to find that header file in the source
> download for "libnetfilter_queue".
>
> However it is not present in the standard lib and devel packages hence
> the initial issue. Is there a reason for this ?

Encapsulation:

  https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)#Information_hiding

> Is it a bug ?

Since the internal structure of `struct pkt_buff` is intended to be
private, and the header file is only necessary to build the library
itself, there is no need to include it in the binary packages.  For
those developing against the library, the public API in
libnetfilter_queue/pktbuff.h will be present in the devel package.

J.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux