xref: /netbsd/sys/altq/altq_localq.c (revision 53524e44)
1*53524e44Schristos /*	$NetBSD: altq_localq.c,v 1.10 2007/03/04 05:59:01 christos Exp $	*/
2dd191f37Speter /*	$KAME: altq_localq.c,v 1.7 2003/07/10 12:07:48 kjc Exp $	*/
3de250bcaSitojun /*
4de250bcaSitojun  * a skeleton file for implementing a new queueing discipline.
5de250bcaSitojun  * this file is in the public domain.
6de250bcaSitojun  */
768de460fSthorpej 
8a13b5687Slukem #include <sys/cdefs.h>
9*53524e44Schristos __KERNEL_RCSID(0, "$NetBSD: altq_localq.c,v 1.10 2007/03/04 05:59:01 christos Exp $");
10a13b5687Slukem 
11dd191f37Speter #ifdef _KERNEL_OPT
1268de460fSthorpej #include "opt_altq.h"
13dd191f37Speter #endif
14dd191f37Speter 
1568de460fSthorpej #ifdef ALTQ_LOCALQ  /* localq is enabled by ALTQ_LOCALQ option in opt_altq.h */
1668de460fSthorpej 
1768de460fSthorpej #include <sys/param.h>
1868de460fSthorpej #include <sys/mbuf.h>
1968de460fSthorpej #include <sys/socket.h>
2068de460fSthorpej #include <sys/sockio.h>
2168de460fSthorpej 
2268de460fSthorpej #include <net/if.h>
2368de460fSthorpej #include <netinet/in.h>
2468de460fSthorpej 
2568de460fSthorpej #include <altq/altq.h>
2668de460fSthorpej #include <altq/altq_conf.h>
2768de460fSthorpej 
28dd191f37Speter #ifdef ALTQ3_COMPAT
2968de460fSthorpej /*
3068de460fSthorpej  * localq device interface
3168de460fSthorpej  */
3268de460fSthorpej altqdev_decl(localq);
3368de460fSthorpej 
3468de460fSthorpej int
localqopen(dev_t dev,int flag,int fmt,struct lwp * l)35168cd830Schristos localqopen(dev_t dev, int flag, int fmt,
36168cd830Schristos     struct lwp *l)
3768de460fSthorpej {
3868de460fSthorpej 	/* everything will be done when the queueing scheme is attached. */
3968de460fSthorpej 	return 0;
4068de460fSthorpej }
4168de460fSthorpej 
4268de460fSthorpej int
localqclose(dev_t dev,int flag,int fmt,struct lwp * l)43168cd830Schristos localqclose(dev_t dev, int flag, int fmt,
44168cd830Schristos     struct lwp *l)
4568de460fSthorpej {
4668de460fSthorpej 	int error = 0;
4768de460fSthorpej 
4868de460fSthorpej 	return error;
4968de460fSthorpej }
5068de460fSthorpej 
5168de460fSthorpej int
localqioctl(dev_t dev,ioctlcmd_t cmd,void * addr,int flag,struct lwp * l)52*53524e44Schristos localqioctl(dev_t dev, ioctlcmd_t cmd, void *addr,
53168cd830Schristos     int flag, struct lwp *l)
5468de460fSthorpej {
5568de460fSthorpej 	int error = 0;
5668de460fSthorpej 
5768de460fSthorpej 	return error;
5868de460fSthorpej }
5968de460fSthorpej 
6068de460fSthorpej #ifdef KLD_MODULE
6168de460fSthorpej 
6268de460fSthorpej static struct altqsw localq_sw =
6368de460fSthorpej 	{"localq", localqopen, localqclose, localqioctl};
6468de460fSthorpej 
6568de460fSthorpej ALTQ_MODULE(altq_localq, ALTQT_LOCALQ, &localq_sw);
6668de460fSthorpej 
6768de460fSthorpej #endif /* KLD_MODULE */
6868de460fSthorpej 
69dd191f37Speter #endif /* ALTQ3_COMPAT */
7068de460fSthorpej #endif /* ALTQ_LOCALQ */
71