[Click] fopen , fread

Vandorpe Wouter Wouter.Vandorpe at howest.be
Sun Apr 24 09:45:51 EDT 2005


Hello,

thx for the replay's, it helped me in this way,
i've solved the problem as follow,

In element with handler while configuring:
     if (router()->attachment("rtpQos"))
	return errh->error("router has more than one rtpQos element");
     router()->set_attachment("rtpQos", this);
and I made a function in rtpQos:
int rtpQos::return_Loss_percentage()
{
return _Loss();//_Loss has value of handler i wanted to read
}

In the element rtpQosFeedback (to send rtp with loss of packets)

 if(rtpQos* rq = (rtpQos*) router()->attachment("rtpQos")){
        _Loss = rq -> return_Loss_percentage();
 }else{
        _Loss = 0;
        errorhandler();
 }

problem solved :)

grtz,
Wouter Vandorpe

-----Oorspronkelijk bericht-----
Van: Beyers Cronje [mailto:bcronje at gmail.com]
Verzonden: wo 20-4-2005 0:32
Aan: Vandorpe Wouter
CC: click at amsterdam.lcs.mit.edu
Onderwerp: Re: [Click] fopen , fread
 
Hi Wouter,

Have a look at <clickdir>/elements/standard/unqueue2 and 
<clickdir>/elements/standard/aqm/red
 
In short, you gain a pointer to your rtpQos element, this can be done
using a configuration option or using upstream or downstream element
finder routines. Once you have the pointer you can call your handler
funtions.

Regards

Beyers


On 4/19/05, wouter.vandorpe at howest.be <wouter.vandorpe at howest.be> wrote:
> Hi,
> 
> i'm trying to read a handler value from on element into an onther.
> This i do with (see below).
> But after a successfull installation of the element (make-install) i
> try to start click.
> and the following appears.
> 
> click:/home/guest/click-1.4.3# click-install
> /home/guest/configQosInteraction
> /usr/local/lib/click.o: unresolved symbol fopen
> /usr/local/lib/click.o: unresolved symbol fclose
> click-install: '/sbin/insmod /usr/local/lib/click.o' failed
> click:/home/guest/click-1.4.3#
> 
> How do i compile the use off fopen, fread, etc into click.o?
> 
> Are do ya have other possibilities to read a handler from one
> elemenent into the other.
> 
> regards
> wouter vandorpe
> 
> -----------------------------------
> int qosfeedback::readHandler_rtpQos_Loss(){
>         FILE *fp;
>         fp = fopen("/click/rtpQos at 83/Loss", "r");
>         if(fp == 0)
>                 click_chatter("Cannot open /click/rtpQos at 83/Loss");
>         else{
>                 click_chatter("Openen van /click/rtpQos at 83/Loss");
>                 }
>         fclose(fp);
>         return (0);
> }
> ---------------------------------
> 
> http://www.gordano.com - Messaging for educators.
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>




More information about the click mailing list