Implementation of QSUP library. More...
#include <linux/aquosa/qres_config.h>
#include "qsup_lib.h"
#include <linux/aquosa/qsup_gw.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <linux/aquosa/qos_debug.h>
Go to the source code of this file.
Defines | |
#define | IOCTL_OP_ADD_LEVEL_RULE _IOR (QSUP_MAJOR_NUM, QSUP_OP_ADD_LEVEL_RULE, qsup_iparams_t) |
#define | IOCTL_OP_ADD_GROUP_RULE _IOR (QSUP_MAJOR_NUM, QSUP_OP_ADD_GROUP_RULE, qsup_iparams_t) |
#define | IOCTL_OP_ADD_USER_RULE _IOR (QSUP_MAJOR_NUM, QSUP_OP_ADD_USER_RULE, qsup_iparams_t) |
#define | IOCTL_OP_FIND_CONSTR _IOWR(QSUP_MAJOR_NUM, QSUP_OP_FIND_CONSTR, qsup_iparams_t) |
#define | IOCTL_OP_GET_AVAIL_GUA_BW _IOWR(QSUP_MAJOR_NUM, QSUP_OP_GET_AVAIL_GUA_BW, qsup_iparams_t) |
#define | IOCTL_OP_RESERVE_SPARE _IOR (QSUP_MAJOR_NUM, QSUP_OP_RESERVE_SPARE, qsup_iparams_t) |
#define | QSUP_DEV_PATHNAME QOS_DEV_PATH "/" QSUP_DEV_NAME |
Functions | |
qos_rv | qsup_init () |
Initialize the QSUP subsystem just after module load into the kernel. | |
qos_rv | qsup_cleanup () |
Cleanup the QSUP subsystem before unloading the module from kernel. | |
static qos_rv | check_open () |
qos_rv | qsup_add_level_rule (int level_id, qos_bw_t max_level_bw) |
Add a level rule to the QSUP. | |
qos_rv | qsup_add_group_rule (int group_id, qsup_constraints_t *rule) |
Add a group constraint for the specified group. | |
qos_rv | qsup_add_user_rule (int user_id, qsup_constraints_t *rule) |
Add a user constraint for the specified user. | |
qos_rv | qsup_find_constraint (int uid, int gid, qsup_constraints_t *rule) |
qos_rv | qsup_reserve_spare (qos_bw_t spare_bw) |
Set the spare bandwidth for admission control purposes. | |
qos_rv | qsup_get_available_bandwidth (int uid, int gid, qos_bw_t *bw) |
Retrieve total available bandwidth for the specified user and group, after both the minimum values of existing contracts, and the reserved spare bandwidth. | |
Variables | |
int | qsup_fd = -1 |
File descriptor of the QoS SUP Device. |
Implementation of QSUP library.
Definition in file qsup_lib.c.
#define IOCTL_OP_ADD_GROUP_RULE _IOR (QSUP_MAJOR_NUM, QSUP_OP_ADD_GROUP_RULE, qsup_iparams_t) |
Definition at line 21 of file qsup_lib.c.
Referenced by qsup_add_group_rule().
#define IOCTL_OP_ADD_LEVEL_RULE _IOR (QSUP_MAJOR_NUM, QSUP_OP_ADD_LEVEL_RULE, qsup_iparams_t) |
Definition at line 20 of file qsup_lib.c.
Referenced by qsup_add_level_rule().
#define IOCTL_OP_ADD_USER_RULE _IOR (QSUP_MAJOR_NUM, QSUP_OP_ADD_USER_RULE, qsup_iparams_t) |
Definition at line 22 of file qsup_lib.c.
Referenced by qsup_add_user_rule().
#define IOCTL_OP_FIND_CONSTR _IOWR(QSUP_MAJOR_NUM, QSUP_OP_FIND_CONSTR, qsup_iparams_t) |
Definition at line 23 of file qsup_lib.c.
Referenced by qsup_find_constraint().
#define IOCTL_OP_GET_AVAIL_GUA_BW _IOWR(QSUP_MAJOR_NUM, QSUP_OP_GET_AVAIL_GUA_BW, qsup_iparams_t) |
Definition at line 24 of file qsup_lib.c.
Referenced by qsup_get_available_bandwidth().
#define IOCTL_OP_RESERVE_SPARE _IOR (QSUP_MAJOR_NUM, QSUP_OP_RESERVE_SPARE, qsup_iparams_t) |
Definition at line 25 of file qsup_lib.c.
Referenced by qsup_reserve_spare().
#define QSUP_DEV_PATHNAME QOS_DEV_PATH "/" QSUP_DEV_NAME |
Definition at line 30 of file qsup_lib.c.
Referenced by qsup_init().
static qos_rv check_open | ( | ) | [inline, static] |
Definition at line 54 of file qsup_lib.c.
References qsup_init().
Referenced by qsup_add_group_rule(), qsup_add_level_rule(), qsup_add_user_rule(), qsup_find_constraint(), qsup_get_available_bandwidth(), and qsup_reserve_spare().
qos_rv qsup_find_constraint | ( | int | uid, | |
int | gid, | |||
qsup_constraints_t * | rule | |||
) |
Definition at line 103 of file qsup_lib.c.
References check_open(), qsup_iparams_t::found_rule, IOCTL_OP_FIND_CONSTR, qos_chk_rv, qos_int_rv, QOS_OK, qsup_fd, and qsup_iparams_t::u.
int qsup_fd = -1 |
File descriptor of the QoS SUP Device.
Definition at line 28 of file qsup_lib.c.
Referenced by qsup_add_group_rule(), qsup_add_level_rule(), qsup_add_user_rule(), qsup_cleanup(), qsup_find_constraint(), qsup_get_available_bandwidth(), qsup_init(), and qsup_reserve_spare().