[Click] ip address print

Eddie Kohler kohler at cs.ucla.edu
Fri Oct 3 18:10:17 EDT 2008


My guess; Elsewhere in your code, you set an IP address, but forgot to 
use something like htonl().

Other possibilities; you did not set the IP header annotation correctly.

To check this; place IPPrint -> CheckIPHeader(VERBOSE true) after MyElement.

Eddie


Se Gi Hong wrote:
> Hello all,
> 
> I am printing IP address from received packet, but some of IP addresses 
> are printed reversely, such as 1.0.192.168 (it should be 192.168.1.0). 
> Do you know the reason and how can I fix it?
> 
> Here is the simple code for printing it.
> 
> void MyElement::push(int, Packet *p){
>     const click_ip *iph=p->ip_header();
>     click_chatter("src ip address is %s\n", 
> IPAddress(iph->ip_src).s().c_str());
>     output(0).push(p);
> 
> }
> 
> Thanks,
> SeGi
> 
> 
> Se Gi Hong wrote:
>> Hello all,
>>
>> I am running Click as a kernel module. I am wondering how to pass 
>> information, such as file name and IP address, from the user level to 
>> the Click in the kernel level. I am thinking of using syscall, but I 
>> think there must be an alternative way.
>>
>> Thanks,
>> SeGi
>>
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list