LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-22-2011, 08:49 AM   #1
doc7
LQ Newbie
 
Registered: Feb 2011
Posts: 4

Rep: Reputation: Disabled
classifier module


helo there

i am kinda new so am not sure if this is the right forum. I want to write a classifier module that i Will put in /net/sched/ that will use qlen to find the number of skbs that the module is handling and also use gnet_stats_queue struct by using backlog to get the combined size of all skbs.

i am very new to kernel programming and your help by means of documentation or useful sites or even forums and even your ideas will much appreciated.

thank u
 
Old 02-28-2011, 05:50 AM   #2
doc7
LQ Newbie
 
Registered: Feb 2011
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by doc7 View Post
helo there

i am kinda new so am not sure if this is the right forum. I want to write a classifier module that i Will put in /net/sched/ that will use qlen to find the number of skbs that the module is handling and also use gnet_stats_queue struct by using backlog to get the combined size of all skbs.

i am very new to kernel programming and your help by means of documentation or useful sites or even forums and even your ideas will much appreciated.

thank u
hello there

this is the code that i have done so far and i am still trying to write a code on top of this one that will separate the VoIP traffic and other traffic to the FIFO queue and i am still trying to find out how this is done. anyone who has a clue please help me. i am very new in kernel programming.


#include <linux/compiler.h>

#include <net/sch_generic.h>

#include <linux/gen_stats.h>

#include<linux/netdevice.h>

#include <linux/pkt_sched.h>



struct simpler{
/*struct sk_buff_head*/
struct gnet_stats_queue qstats;
};

static int enqueue(struct sk_buff *skb, struct Qdisc *sch){
struct simple_sched_data *q =qdisc_priv(sch);
q=qdisc_enqueue(skb,sch);
if(likely(q==NET_XMIT_SUCCESS)){
sch->q.qlen++;
sch->q.qstats.backlog+=skb->len;
}
else {
sch->qstats.drops++;
return q;
}
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shaping traffic with SFQ external classifier (flow hash key dst) - no packet forward. Bogdan Linux - Networking 3 05-06-2009 11:08 PM
LXer: How To Set Up A Linux Layer 7 Packet Classifier On CentOS 5.1 LXer Syndicated Linux News 0 08-01-2008 07:10 PM
Problem running naive Bayesian classifier from DDJ article Peufelon Linux - Software 5 04-10-2006 05:22 PM
Application Layer Packet Classifier for Linux (l7-filter) stomach Linux - Software 1 09-10-2005 01:04 AM
enable Layer7 Classifier? joirnange Linux - Networking 2 12-28-2004 10:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration