/*
 *
 * qos.h -- Traffic Squeezer QoS management code.
 *
 * Author: Kiran K (2006-2008)
 *         kiran_cyberpro at yahoo dot com
 *
 *
 * Traffic Squeezer is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2, or (at your option) any
 * later version.
 *
 * Traffic Squeezer is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GNU Zebra; see the file COPYING.  If not, write to the Free
 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

#ifndef _QOS_
#define _QOS_

#include "common.h"

typedef enum _traffic_type_ {
	ALL_TRAFFIC = 0,
	ARP = 1,
	IP,
	TCP,
	TCP_ACK,
	UDP,
	SCTP,
	FTP,
	HTTP,
	ICMP,
	SFTP
} traffic_type_t;

typedef enum _qdisc_type_ {
        DEFAULT_PRIORITY = 0,
        HTB = 1,
        CBQ
} qdisc_t;

#define ROOT_NODE_INDEX   -1


typedef struct _class_node_ {

  int            parent;  /* if parent is "-1(ROOT_NODE_INDEX)" i.e the root node */
  
  traffic_type_t traffic_type;
  qdisc_t        qdisc;
  BYTEx2         bandwidth;
} class_node_t;



int add_class();               /* add a new class under a specified parent */
int del_class();               /* delete the specified class */

int set_class_traffic_type();  /* set class traffic type  (i.e TCP/UDP/IP/FTP or ALL_TRAFFIC */
int set_class_qdisk();         /* set the class qdisk mechanism */
int set_class_bandwidth();     /* set the specified class bandwidth */

int get_parent_class();        /* get parent of the current class */
int get_child_classes();       /* get all the children of the current class */
int get_gui_qos();             /* render the QoS GUI mechanism using JavaScript (can be moved later to web.c) */



static int has_children();     /* returns TRUE if the node has children/grandchildren */
static int init_class(class_node_t *class_node);       /* clear/set defaults in a newly created node */





#endif





