QoS Supervisor Kernel Module
[QoS Supervisor Component]

Mediates bandwidth requests made to the QoS Resource Reservation Kernel Module, enforcing system-level security policy and QoS behaviour configured through the use of level, group and user rules. More...

Data Structures

struct  qsup_level_rule_t
 Level rule: applies to all servers within level. More...
struct  qsup_group_rule_t
 Group rule: applies to all users in the group. More...
struct  qsup_user_rule_t
 User rule: applies to one user only. More...
struct  qsup_server_t
 QoS Sup related data for each server. More...

Files

file  qsup.h
 

QoS Supervisor kernel-interface.


file  qsup_gw.h
 

Common defines and structures for the US to KS gateway.


file  qsup_gw_ks.h
 

QSUP UserSpace to KernelSpace gateway common interface.


Defines

#define QSUP_DEFAULT_SRV_UID   0
 UID of the user authorized to create the default server.
#define QSUP_DEFAULT_SRV_GID   0
 GID of the group authorized to create the default server.

Typedefs

typedef struct qsup_level_rule_t qsup_level_rule_t
 Level rule: applies to all servers within level.
typedef struct qsup_group_rule_t qsup_group_rule_t
 Group rule: applies to all users in the group.
typedef struct qsup_user_rule_t qsup_user_rule_t
 User rule: applies to one user only.
typedef struct qsup_server_t qsup_server_t
 QoS Sup related data for each server.

Functions

qos_rv qsup_init (void)
 Initialize the QSUP subsystem just after module load into the kernel.
qos_rv qsup_cleanup (void)
 Cleanup the QSUP subsystem before unloading the module from kernel.
qos_rv qsup_add_level_rule (int level, qos_bw_t max_bw)
 Add a level rule to the QSUP.
qos_rv qsup_add_group_constraints (int gid, qsup_constraints_t *constr)
 Add a group rule to the QSUP.
qos_rv qsup_add_user_constraints (int uid, qsup_constraints_t *constr)
 Add a user rule to the QSUP.
qos_rv qsup_create_server (qsup_server_t **p_srv, int uid, int gid, qres_params_t *param)
 Create a new qsup_server_t structure.
qos_rv qsup_init_server (qsup_server_t *srv, int uid, int gid, qres_params_t *param)
 Initialize a new qsup_server_t structure.
qos_rv qsup_destroy_server (qsup_server_t *srv)
 Destroy a qsup_server_t and free associated resources.
qos_rv qsup_cleanup_server (qsup_server_t *srv)
qos_rv qsup_set_required_bw (qsup_server_t *srv, qos_bw_t server_req)
 Sets the required bandwidth for the specified server.
qos_bw_t qsup_get_required_bw (qsup_server_t *srv)
 Gets the required bandwidth for the specified server.
qos_bw_t qsup_get_guaranteed_bw (qsup_server_t *srv)
 Gets the minimum granted bandwidth for the specified server.
qos_bw_t qsup_get_approved_bw (qsup_server_t *srv)
 Returns the bandwidth approved for the specified server.
qos_bw_t qsup_get_max_gua_bw (int uid, int gid)
 Returns the maximum guaranteed bandwidth for the specified user.
qos_rv qsup_get_avail_gua_bw (int uid, int gid, qos_bw_t *p_avail_bw)
 Returns in *p_avail_bw the available guaranteed bw for the specified user.
qos_rv qsup_get_avail_bw (int uid, int gid, qos_bw_t *p_avail_bw)
 Returns in *p_avail_bw the available bw for the specified user.
void qsup_dump (void)
 Dumps into the log system the QSUP server complete state.
qsup_constraints_tqsup_find_constr (int uid, int gid)
 Find the constraints in force for the supplied uid/gid pair.
qos_rv qsup_reserve_spare (qos_bw_t spare_bw)
 Set the spare bandwidth for admission control purposes.
static int qsup_authorize_op (qsup_iparams_t *iparams)
 Check authorizations for requested operation.
qos_rv qsup_gw_ks (qsup_op_t op, void __user *up_iparams, unsigned long size)
 Main US-to-KS gateway function.
qos_rv qsup_init_ks (void)
 Initialize QSUP.
qos_rv qsup_cleanup_ks (void)
 Cleanup QSUP module.
qos_rv qsup_init_default_server (qsup_server_t *default_qsup, qres_time_t Q, qres_time_t Q_min, qres_time_t P)
 Initialize the QSUP default server.

Detailed Description

Mediates bandwidth requests made to the QoS Resource Reservation Kernel Module, enforcing system-level security policy and QoS behaviour configured through the use of level, group and user rules.

Such rules may be configured through the use of the QoS Supervisor Library interface.


Define Documentation

#define QSUP_DEFAULT_SRV_GID   0

GID of the group authorized to create the default server.

Definition at line 22 of file qsup_gw_ks.h.

Referenced by qos_func_define().

#define QSUP_DEFAULT_SRV_UID   0

UID of the user authorized to create the default server.

Definition at line 20 of file qsup_gw_ks.h.

Referenced by qos_func_define().


Typedef Documentation

Group rule: applies to all users in the group.

Level rule: applies to all servers within level.

typedef struct qsup_server_t qsup_server_t

QoS Sup related data for each server.

User rule: applies to one user only.


Function Documentation

qos_rv qsup_add_group_constraints ( int  gid,
qsup_constraints_t constr 
)

Add a group rule to the QSUP.

Definition at line 139 of file qsup.c.

References qsup_group_rule_t::constr, qsup_group_rule_t::gid, qsup_group_rule_t::next, num_group_rules, qos_create, QOS_E_NO_MEMORY, and QOS_OK.

Referenced by main(), and qsup_gw_ks().

qos_rv qsup_add_level_rule ( int  level,
qos_bw_t  max_bw 
)

Add a level rule to the QSUP.

Definition at line 129 of file qsup.c.

qos_rv qsup_add_user_constraints ( int  uid,
qsup_constraints_t constr 
)

Add a user rule to the QSUP.

Definition at line 153 of file qsup.c.

References qsup_user_rule_t::constr, qsup_user_rule_t::next, num_user_rules, QOS_E_NO_MEMORY, qos_malloc(), QOS_OK, and qsup_user_rule_t::uid.

Referenced by main().

static int qsup_authorize_op ( qsup_iparams_t iparams  )  [inline, static]

Check authorizations for requested operation.

Operations on QSUP rules may only be done by root.

Parameters:
iparams Ptr to the iparams struct, in kernel-space.
Returns:
1 on success, 0 otherwise.

Definition at line 32 of file qsup_gw_ks.h.

References kal_get_current_uid().

Referenced by qsup_gw_ks().

qos_rv qsup_cleanup ( void   ) 

Cleanup the QSUP subsystem before unloading the module from kernel.

Definition at line 186 of file qsup.c.

qos_rv qsup_cleanup_ks ( void   ) 

Cleanup QSUP module.

Definition at line 34 of file qsup_gw_ks.c.

References qsup_cleanup().

qos_rv qsup_cleanup_server ( qsup_server_t srv  ) 
qos_rv qsup_create_server ( qsup_server_t **  p_srv,
int  uid,
int  gid,
qres_params_t param 
)

Create a new qsup_server_t structure.

Returns:
The server_id of the new server, if greater than or equal to zero, or a QOS_E_ error code, if negative

Definition at line 389 of file qsup.c.

References qos_create, QOS_E_NO_MEMORY, qos_free(), qos_log_err, QOS_OK, qos_strerror(), and qsup_init_server().

Referenced by main().

qos_rv qsup_destroy_server ( qsup_server_t srv  ) 

Destroy a qsup_server_t and free associated resources.

Definition at line 440 of file qsup.c.

References qos_free(), and qsup_cleanup_server().

Referenced by main().

void qsup_dump ( void   ) 
qsup_constraints_t* qsup_find_constr ( int  uid,
int  gid 
)
qos_bw_t qsup_get_approved_bw ( qsup_server_t srv  ) 

Returns the bandwidth approved for the specified server.

Definition at line 577 of file qsup.c.

References coeff_apply, qsup_server_t::p_level_coeff, qsup_server_t::p_user_coeff, prof_func, prof_return, prof_vars, qsup_server_t::req_bw, and qsup_server_t::used_gua_bw.

Referenced by _qres_get_bandwidth(), main(), qos_func_define(), and qsup_dump().

qos_rv qsup_get_avail_bw ( int  uid,
int  gid,
qos_bw_t p_avail_bw 
)

Returns in *p_avail_bw the available bw for the specified user.

Definition at line 303 of file qsup.c.

References get_user_info(), qsup_constraints_t::max_bw, qos_chk_go_msg, QOS_OK, qsup_find_constr(), and qsup_user_t::user_req.

qos_rv qsup_get_avail_gua_bw ( int  uid,
int  gid,
qos_bw_t p_avail_bw 
)

Returns in *p_avail_bw the available guaranteed bw for the specified user.

Definition at line 288 of file qsup.c.

References get_user_info(), qsup_constraints_t::max_min_bw, qos_chk_go_msg, QOS_OK, qsup_find_constr(), and qsup_user_t::user_gua.

Referenced by qsup_gw_ks().

qos_bw_t qsup_get_guaranteed_bw ( qsup_server_t srv  ) 

Gets the minimum granted bandwidth for the specified server.

Definition at line 550 of file qsup.c.

References qsup_server_t::gua_bw.

qos_bw_t qsup_get_max_gua_bw ( int  uid,
int  gid 
)

Returns the maximum guaranteed bandwidth for the specified user.

Definition at line 282 of file qsup.c.

References qsup_constraints_t::max_min_bw, and qsup_find_constr().

qos_bw_t qsup_get_required_bw ( qsup_server_t srv  ) 

Gets the required bandwidth for the specified server.

Definition at line 546 of file qsup.c.

References qsup_server_t::req_bw.

qos_rv qsup_gw_ks ( qsup_op_t  op,
void __user *  up_iparams,
unsigned long  size 
)

Main US-to-KS gateway function.

Copies parameters from US to KS, checks if requested operation is allowed by the calling process, distinguishes among various kinds of requests, calling appropriate per-request functions. If needed, copies return parameters back from KS to US.

Todo:
avoid copy_from_user and copy_to_user with entire iparams struct when unneeded.

Copies parameters from US to KS, checks if requested operation is allowed by the calling process, distinguishes among various kinds of requests, calling appropriate per-request functions. If needed, copies return parameters back from KS to US.

Todo:
avoid copy_from_user and copy_to_user with entire iparams struct when unneeded.

Definition at line 48 of file qsup_gw_ks.c.

References qsup_iparams_t::avail, qsup_iparams_t::found_rule, qsup_iparams_t::group_rule, qsup_iparams_t::level_rule, QOS_E_INTERNAL_ERROR, QOS_E_INVALID_PARAM, QOS_E_UNAUTHORIZED, qos_log_debug, qos_log_err, QOS_OK, qsup_add_group_constraints(), qsup_add_level_rule(), qsup_authorize_op(), qsup_find_constr(), qsup_get_avail_gua_bw(), QSUP_OP_ADD_GROUP_RULE, QSUP_OP_ADD_LEVEL_RULE, QSUP_OP_ADD_USER_RULE, QSUP_OP_FIND_CONSTR, QSUP_OP_GET_AVAIL_GUA_BW, QSUP_OP_RESERVE_SPARE, qsup_reserve_spare(), rres_get_spinlock(), qsup_iparams_t::spare_bw, qsup_iparams_t::u, and qsup_iparams_t::user_rule.

Referenced by qsup_device_ioctl().

qos_rv qsup_init ( void   ) 

Initialize the QSUP subsystem just after module load into the kernel.

Definition at line 167 of file qsup.c.

qos_rv qsup_init_default_server ( qsup_server_t default_qsup,
qres_time_t  Q,
qres_time_t  Q_min,
qres_time_t  P 
)

Initialize the QSUP default server.

qos_rv qsup_init_ks ( void   ) 

Initialize QSUP.

Definition at line 25 of file qsup_gw_ks.c.

References qos_chk_ok_ret, qos_log_debug, QOS_OK, and qsup_init().

Referenced by qres_init_module(), and qsup_init_module().

qos_rv qsup_init_server ( qsup_server_t srv,
int  uid,
int  gid,
qres_params_t param 
)
qos_rv qsup_reserve_spare ( qos_bw_t  bw  ) 

Set the spare bandwidth for admission control purposes.

Definition at line 594 of file qsup.c.

qos_rv qsup_set_required_bw ( qsup_server_t srv,
qos_bw_t  server_req 
)
Generated on Mon Aug 2 22:39:17 2010 for qosres by  doxygen 1.6.3