static GSList *
parse_classes (ParserState *parser_state)
{
	GSList *ret = NULL;
	xmlChar *en = xmlTextReaderGetAttribute (parser_state->reader, BAD_CAST "class");
	xmlChar *dis = xmlTextReaderGetAttribute (parser_state->reader, BAD_CAST "class-disabled");

	ret = add_classes (ret, (gchar const *)en, TRUE);
	ret = add_classes (ret, (gchar const *)dis, FALSE);

	xmlFree (en);
	xmlFree (dis);

	return ret;
}
Пример #2
0
PyMODINIT_FUNC
initpybreezyslam(void) 
{    
    if (!types_are_ready())    {
        return;
    }
    
    PyObject * module = Py_InitModule("pybreezyslam", module_methods);
       
    if (module == NULL)
    {
        return;
    }

    add_classes(module);    
}
Пример #3
0
PyMODINIT_FUNC
PyInit_pybreezyslam(void) 
{    
    if (!types_are_ready())
    {
        return NULL;
    }
    
    PyObject* module = PyModule_Create(&moduledef);
    
    if (module == NULL)
    {
        return NULL;
    }
    
    add_classes(module);
    
    return module;
}
Пример #4
0
void add_new_entries_to_table() {
// call dump of netlink qos layer in kernel and adds received object into qos_table 
//(specifically their statistics values & some parts of configuration (htb))
	struct tcmsg t;
	struct rtnl_handle rth;
	extern int rth_initialized;
	char d[16];

	memset(&rth,0,sizeof(struct rtnl_handle));
	memset(&t, 0, sizeof(t));
	t.tcm_family = AF_UNSPEC;
	memset(&d, 0, sizeof(d));
	
	if (rtnl_open(&rth, 0) < 0) {
		snmp_log(LOG_NOTICE, "Cannot open rtnetlink");
		return;
	}

//	if(rth_initialized==0) {
	    ll_init_map(&rth);
//	    rth_initialized=1;
//	}

	if (rtnl_dump_request(&rth, RTM_GETQDISC, &t, sizeof(t)) < 0) {
		snmp_log(LOG_WARNING,"qos-ext: add_new_entries to table: cannot send dump request");
		return;
	}


	if (rtnl_dump_filter(&rth, insert_entry, NULL, NULL, NULL) < 0) {
		snmp_log(LOG_WARNING, "qos-ext: add_new entries to table: qdisc dump terminated");
		return;
	}

	rtnl_close(&rth);

	add_classes();		
}