libgate.h

Go to the documentation of this file.
00001 /*
00002 ** libgate.h for gate-srv in /home/pwipwi/lse/lseos/lseos-srv/basic/gate
00003 **
00004 ** Made by (Christophe Eymard)
00005 ** Login   <eymard_c@epita.fr>
00006 **
00007 ** Started on  Thu Mar 10 19:05:29 2005 Christophe Eymard
00008 ** Last update Sun Mar 20 15:37:59 2005 Christophe Eymard
00009 */
00010 
00011 #ifndef LIBGATE_H_
00012 # define LIBGATE_H_
00013 
00014 # include <libc.h>
00015 
00016 # define GATE_NAME_SZ   64
00017 # define OK             0
00018 # define NOT_OK         1
00019 
00020 enum                    e_libgate_errors
00021 {
00022   ENOGATE = 2,
00023   EREGISTERED,
00024   ENOPROCESS,
00025   EGATEEMPTY,
00026   ENOCLASS,
00027   ECOPY
00028 };
00029 
00030 /*
00031 ** XXX : For now, those are just random ideas that I launched like that. These
00032 **      numbers are not meant to be definitive.
00033 */
00034 enum                    gate_classes
00035 {
00036   CLASS_KERNEL = 1,
00037   CLASS_NETWORK,
00038   CLASS_ETHERNET
00039 };
00040 
00041 typedef                 struct
00042 {
00043   int                   class;
00044   int                   gate_id;
00045   int                   minor;
00046   char                  manufacturer[GATE_NAME_SZ];
00047   char                  dev_name[GATE_NAME_SZ];
00048   int                   gate_index; // Index in the gate table
00049 } t_gate_infos;
00050 
00063 int                     gatesrv_register(int                    class,
00064                                          int                    gate_id,
00065                                          int                    minor,
00066                                          char                   *manufacturer,
00067                                          char                   *dev_name);
00068 
00077 int                     gatesrv_unregister(int                  gate_id);
00078 
00091 int                     gatesrv_get_first(int                   class,
00092                                           t_gate_infos          *gi,
00093                                           int                   *occur);
00094 
00107 int                     gatesrv_get_next(int                    class,
00108                                          t_gate_infos           *gi,
00109                                          int                    *occur);
00110 
00120 int                     gatesrv_use(t_gate_infos                *gi);
00121 
00122 
00131 int                     gatesrv_unuse(t_gate_infos              *gi);
00132 
00133 #endif /* !LIBGATE_H_ */

Generated on Wed May 24 23:04:18 2006 for LSE/OS by  doxygen 1.4.6