[Click] Adding EtherType() accessor

Pekka Nikander pekka.nikander at nomadiclab.com
Tue Jan 4 10:50:11 EST 2011


Well, I'd probably create a subclass of EtherEncap that is able to copy the EtherType from a given offset at the current packet.  Something like:

  MyEtherEncap(COPY_OFFSET=12, vlb02, vlb20)

--Pekka Nikander
  
On 2011-01 -04, at 04:50 , Philip Prindeville wrote:

> Ok, I need to add an additional accessor.
> 
> We have a scenario where we need to forward a packet (well, more like bridge it) between two RouterBricks nodes within the same cluster.
> 
> In this case, we take the existing packet, wrap it in a second ethernet header, and send it from node a to node b, for instance:
> 
> clone [1] -> EtherEncap(EtherType, vlb02, vlb20) -> [2] output;
> 
> Otherwise, I have to classify the packet, and then use the corresponding output from the classify to manually set the EtherType literal to pass in.  Ugly.
> 
> What's a fragment of code that I can use to model my changes on?
> 
> Thanks.
> 
> -Philip
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click




More information about the click mailing list