Thanks for the quick response,
In theory I know what to do -> strip mac from/to, push a new header, put
the mac from/to back on the packet and send it.
But what exactly do i need to copy? lets say that's my function signature:
void processPacket(const struct pfring_pkthdr *h,const u_char *p, const
u_char *user_bytes)
which one has the entire packet? and how do I replace my modified packet
with the one that was received?


On Tue, Jan 7, 2014 at 12:08 PM, Alfredo Cardigliano
<[email protected]>wrote:

> Hi Philip
> in order to add a new vlan header you have to shift the payload, thus you
> need to copy the packet (you should do this by yourself).
>
> Alfredo
>
> > Il giorno 07/gen/2014, alle ore 10:46, Philip Roth <
> [email protected]> ha scritto:
> >
> > Hi guys,
> > I'm trying to simulate a qinq packet using pf_ring.
> > It's my first try with pf_ring and I have a working app that can receive
> packets and write to console, using pfring_loop.
> > Now I want to two new vlan headers to the captured packet, but I can't
> figure out how to modify the packet and add new header. Is it even possible?
> >
> > Thanks,
> >    Philip
> >
> >
> >
> > _______________________________________________
> > Ntop-misc mailing list
> > [email protected]
> > http://listgateway.unipi.it/mailman/listinfo/ntop-misc
> _______________________________________________
> Ntop-misc mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop-misc
>
_______________________________________________
Ntop-misc mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-misc

Reply via email to