Home | History | Annotate | Line # | Download | only in altq
      1 /*	$NetBSD: altq_localq.c,v 1.10 2007/03/04 05:59:01 christos Exp $	*/
      2 /*	$KAME: altq_localq.c,v 1.7 2003/07/10 12:07:48 kjc Exp $	*/
      3 /*
      4  * a skeleton file for implementing a new queueing discipline.
      5  * this file is in the public domain.
      6  */
      7 
      8 #include <sys/cdefs.h>
      9 __KERNEL_RCSID(0, "$NetBSD: altq_localq.c,v 1.10 2007/03/04 05:59:01 christos Exp $");
     10 
     11 #ifdef _KERNEL_OPT
     12 #include "opt_altq.h"
     13 #endif
     14 
     15 #ifdef ALTQ_LOCALQ  /* localq is enabled by ALTQ_LOCALQ option in opt_altq.h */
     16 
     17 #include <sys/param.h>
     18 #include <sys/mbuf.h>
     19 #include <sys/socket.h>
     20 #include <sys/sockio.h>
     21 
     22 #include <net/if.h>
     23 #include <netinet/in.h>
     24 
     25 #include <altq/altq.h>
     26 #include <altq/altq_conf.h>
     27 
     28 #ifdef ALTQ3_COMPAT
     29 /*
     30  * localq device interface
     31  */
     32 altqdev_decl(localq);
     33 
     34 int
     35 localqopen(dev_t dev, int flag, int fmt,
     36     struct lwp *l)
     37 {
     38 	/* everything will be done when the queueing scheme is attached. */
     39 	return 0;
     40 }
     41 
     42 int
     43 localqclose(dev_t dev, int flag, int fmt,
     44     struct lwp *l)
     45 {
     46 	int error = 0;
     47 
     48 	return error;
     49 }
     50 
     51 int
     52 localqioctl(dev_t dev, ioctlcmd_t cmd, void *addr,
     53     int flag, struct lwp *l)
     54 {
     55 	int error = 0;
     56 
     57 	return error;
     58 }
     59 
     60 #ifdef KLD_MODULE
     61 
     62 static struct altqsw localq_sw =
     63 	{"localq", localqopen, localqclose, localqioctl};
     64 
     65 ALTQ_MODULE(altq_localq, ALTQT_LOCALQ, &localq_sw);
     66 
     67 #endif /* KLD_MODULE */
     68 
     69 #endif /* ALTQ3_COMPAT */
     70 #endif /* ALTQ_LOCALQ */
     71