]> rtime.felk.cvut.cz Git - frescor/fwp.git/blobdiff - fwp/lib/fwp/fwp_vres.h
Fixed const qualifiers
[frescor/fwp.git] / fwp / lib / fwp / fwp_vres.h
index 01ebe91d31df2377caeb6b374e58c6b177260ef5..62561f56ea66fce1139133f716c3980960114723 100644 (file)
@@ -1,8 +1,56 @@
+/**************************************************************************/
+/* ---------------------------------------------------------------------- */
+/* Copyright (C) 2006 - 2008 FRESCOR consortium partners:                */
+/*                                                                       */
+/*   Universidad de Cantabria,              SPAIN                        */
+/*   University of York,                    UK                           */
+/*   Scuola Superiore Sant'Anna,            ITALY                        */
+/*   Kaiserslautern University,             GERMANY                      */
+/*   Univ. Politécnica  Valencia,           SPAIN                       */
+/*   Czech Technical University in Prague,  CZECH REPUBLIC               */
+/*   ENEA                                   SWEDEN                       */
+/*   Thales Communication S.A.              FRANCE                       */
+/*   Visual Tools S.A.                      SPAIN                        */
+/*   Rapita Systems Ltd                     UK                           */
+/*   Evidence                               ITALY                        */
+/*                                                                       */
+/*   See http://www.frescor.org for a link to partners' websites         */
+/*                                                                       */
+/*          FRESCOR project (FP6/2005/IST/5-034026) is funded            */
+/*       in part by the European Union Sixth Framework Programme         */
+/*       The European Union is not liable of any use that may be         */
+/*       made of this code.                                              */
+/*                                                                       */
+/*                                                                       */
+/*  This file is part of FWP (Frescor WLAN Protocol)                     */
+/*                                                                       */
+/* FWP is free software; you can redistribute it and/or modify it        */
+/* under terms of the GNU General Public License as published by the     */
+/* Free Software Foundation; either version 2, or (at your option) any   */
+/* later version.  FWP 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 FWP; see file       */
+/* COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,  */
+/* Cambridge, MA 02139, USA.                                             */
+/*                                                                       */
+/* As a special exception, including FWP header files in a file,         */
+/* instantiating FWP generics or templates, or linking other files       */
+/* with FWP objects to produce an executable application, does not       */
+/* by itself cause the resulting executable application to be covered    */
+/* by the GNU General Public License. This exception does not            */
+/* however invalidate any other reasons why the executable file might be  */
+/* covered by the GNU Public License.                                    */
+/**************************************************************************/
 #ifndef _FWP_VRES_H
 #define _FWP_VRES_H
 
+#include <netinet/in.h>
+#include <stdbool.h>
+
 struct fwp_vres;
-typedef struct fwp_vres* fwp_vres_d_t;
+typedef struct fwp_vres fwp_vres_t;
 
 /** WMM defines 4 queues */
 typedef enum  {
@@ -12,15 +60,13 @@ typedef enum  {
        FWP_AC_BK = 3
 } fwp_ac_t;
 
-fwp_ac_t fwp_vres_get_ac(fwp_vres_d_t vresd);
+fwp_ac_t fwp_vres_get_ac(fwp_vres_t *vres);
 
 
 #ifdef _FWP_INTERNALS_
 
 #include "fwp_msgb.h"
 
-typedef struct fwp_vres  fwp_vres_t;
-
 typedef unsigned int fwp_vres_id_t;
 typedef unsigned int fwp_vparam_id_t;
 typedef unsigned long int fwp_budget_t;
@@ -32,26 +78,27 @@ typedef struct timespec  fwp_period_t;
  */
 typedef
 struct fwp_vres_params {
-       /** STA-unique identifier of vres params assigned by manager*/  
-       fwp_vparam_id_t id; 
        fwp_budget_t    budget;         /**< bytes per period */
        /** all time units are in microseconds */       
        fwp_period_t    period; 
        fwp_ac_t        ac_id;          /**< AC id ~ priority of vres */
+       struct in_addr  src;
 } fwp_vres_params_t;
 
 int fwp_vres_table_init(unsigned int max_vres);
 
-fwp_vres_d_t fwp_vres_alloc();
-fwp_vres_id_t fwp_vres_get_id(fwp_vres_d_t vresd);
-int fwp_vres_set_params(fwp_vres_d_t vresd, fwp_vres_params_t *params);
-int fwp_vres_create(fwp_vres_params_t *params, fwp_vres_d_t *vresdp);
-int fwp_vres_destroy(fwp_vres_d_t vresd);
+fwp_vres_t *fwp_vres_alloc();
+fwp_vres_id_t fwp_vres_get_id(fwp_vres_t *vres);
+int fwp_vres_set_params(fwp_vres_t *vres, fwp_vres_params_t *params);
+int fwp_vres_create(fwp_vres_params_t *params, fwp_vres_t **vresp);
+int fwp_vres_destroy(fwp_vres_t *vres);
 
-int fwp_vres_send(fwp_vres_d_t vresd, struct fwp_msgb* msgb);
-/*int _fwp_vres_bind(fwp_vres_d_t vresd, fwp_endpoint_d_t epointd);*/
-int fwp_vres_bind(fwp_vres_d_t vresd, int sockd);
-int fwp_vres_unbind(fwp_vres_d_t vresd);
+int fwp_vres_consume_budget(struct fwp_vres *vres, size_t size, bool can_block);
+struct fwp_endpoint;
+int fwp_vres_enqueue(struct fwp_vres *vres, struct fwp_endpoint *ep,
+                    const void *msg, size_t size);
+int fwp_vres_bind(fwp_vres_t *vres, struct fwp_endpoint *ep, int sockd);
+int fwp_vres_unbind(fwp_vres_t *vres);
 
 extern fwp_vres_params_t fwp_vres_params_default;