[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[altq:1837] Problems with QCMD API



	I've been using ALTQ in a project. I had success using ALTQ through altqd 
(ALTQ Daemon), but I'm not having the same results with ALTQ API. I need some 
help with ALTQ API. I will explain it to you:
	I have FreeBSD 4.8 on two routers. These routers was compiled with ALTQ. The 
ideia of the project is to configurate ALTQ on two routers through RPCs 
(Remote Procedure Call).  There will be programs written in C language in the 
routers that will use the QCMD API to add, edit or remove interfaces, 
classes, and filters. The programs will not read the /etc/altq.conf.
	I have been using (no success) the QCMD API for the propose above, but I'm 
not having satisfactory results. The qop_apit.txt draft isn't very clear to 
me. 
	The program code below was written by me.

int main(int argc, char *argv[])
{
        char ifname[] = "ed0";
        int valor, bw, is_wrr, eff;

        l_debug = 6;
        bw = 1000000;
        is_wrr = 1;
        eff = 0;

        if (argv[1] != NULL)
        {
          if (strcmp(argv[1],"enable")==0)
           {
               qcmd_enable(ifname);
               if ((valor = qcmd_cbq_add_if(ifname, bw, is_wrr, eff)) != 0)
                     printf("ERRO\n");
               else
                     printf("OK\n");
               qcmd_cbq_add_class(ifname, "root_class", NULL, NULL, 0, 10000, 
NULL, NULL, NULL, NULL, NULL, NULL, NULL);
           } 
        }

 	return 0;
}

	Ps. There is a network card "ed0" in my system.

	When I run the program, I got the message: "bad interface: enable failed!". 
This message is printed by qcmd_enable function.
	
        Can somebody give me some TIPs how I use the QCMD API?	

	Thanks in advance,

	Tiago Fioreze