[Click] Basic question about IP header fields.

Josh Butler tuna_armadillo at hotmail.com
Mon Sep 10 11:12:47 EDT 2007


Hi,

This is my first question and probably won't be my last. I've been doing a project involving Click for a while, but owing to my very basic programming skills have struggled quite a lot, though I've enjoyed messing about with click in the process - I've been writing a bit of an idiot's guide as I've gone along! 

I've got my head round creating the router configuration scripts by combining elements and am now looking to go inside the elements and make some changes. I've chosen the tee element as one of the easier elements to look at and modify, and have a good understanding of what it does in push mode.

I now want to modify this element in a very basic way, using a simple if statement if possible so that I can push packets through either the element's first or second output port depending on some criteria such as the type of service field within the IP header. Here's what I mean in pseudocode, if that's the correct term;

if (type_of_service_field <= n){
    output(0).push(p);
    }
    else {
    output(1).push(p);    
    }

I've looked through all the material on the click site and can't find a simple answer to the question of how to access the different fields within the IP header. Maybe I'm being stupid, but a bit of help would be awesome.

Thanks,
Josh

_________________________________________________________________
100’s of Music vouchers to be won with MSN Music
https://www.musicmashup.co.uk


More information about the click mailing list