libgate.h File Reference

#include <libc.h>

Go to the source code of this file.

Data Structures

struct  t_gate_infos

Defines

#define GATE_NAME_SZ   64
#define OK   0
#define NOT_OK   1

Enumerations

enum  e_libgate_errors {
  ENOGATE = 2, EREGISTERED, ENOPROCESS, EGATEEMPTY,
  ENOCLASS, ECOPY
}
enum  gate_classes { CLASS_KERNEL = 1, CLASS_NETWORK, CLASS_ETHERNET }

Functions

int gatesrv_register (int class, int gate_id, int minor, char *manufacturer, char *dev_name)
int gatesrv_unregister (int gate_id)
int gatesrv_get_first (int class, t_gate_infos *gi, int *occur)
int gatesrv_get_next (int class, t_gate_infos *gi, int *occur)
int gatesrv_use (t_gate_infos *gi)
int gatesrv_unuse (t_gate_infos *gi)


Define Documentation

#define GATE_NAME_SZ   64
 

#define NOT_OK   1
 

#define OK   0
 


Enumeration Type Documentation

enum e_libgate_errors
 

Enumerator:
ENOGATE 
EREGISTERED 
ENOPROCESS 
EGATEEMPTY 
ENOCLASS 
ECOPY 

enum gate_classes
 

Enumerator:
CLASS_KERNEL 
CLASS_NETWORK 
CLASS_ETHERNET 


Function Documentation

int gatesrv_get_first int  class,
t_gate_infos gi,
int *  occur
 

This call is used to get the first occurence of gates that are of a given class.

Parameters:
class The class of the gate we're looking for.
gi The t_gate_infos structure that shall be actualized. It must be allocated before the call.
occur The occurence of the element in the tab
Returns:
1 if the gate was found, -1 if there was an error, and errno shall be set correctly, and 0 if there is no (more) device.

int gatesrv_get_next int  class,
t_gate_infos gi,
int *  occur
 

Gets the next occurence in the gate list of this class. Typical error is the fact that the user that used this function did not call gate_get_first before.

Parameters:
class the class we're looking in.
gi the t_gate_infos structure that shall be actualized.
occur same as above.
Returns:
1 if there was a gate, -1 if there was an error, or 0 if there was no more gate on the list.

int gatesrv_register int  class,
int  gate_id,
int  minor,
char *  manufacturer,
char *  dev_name
 

Registers a gate at the gate service.

Parameters:
class The class of this gate (what kind of gate it is)
gate_id The number the gate is registered as.
manufacturer The name of the manufacturer who built the hardware the gate is handling.
dev_name The name of the device handled.
Returns:
0 if all happened smoothly, or -1 if there was a problem. errno is set accordingly.

int gatesrv_unregister int  gate_id  ) 
 

Unregister the gate from the gate service.

Parameters:
gate_id The number of the gate we want to unregister.
Returns:
0 if all happened smoothly, otherwise -1 and errno shall be set accordingly.

int gatesrv_unuse t_gate_infos gi  ) 
 

Tells the gate srv that the program is done with a particular gate, and should not be notified anymore that the gate had a problem.

Parameters:
gi The t_gate_infos structure.
Returns:
0 if all is allright, or -1 if an error happened.

int gatesrv_use t_gate_infos gi  ) 
 

Tells the gate-srv that that particular gate shall be used. It is primordial for the process to use that function so that it can be notified when a gate dies (so that it won't call it again).

Parameters:
gi The gate info structure that describes the gate.
Returns:
0 if all happened smoothly, -1 if there was an error.


Generated on Wed May 24 23:06:01 2006 for LSE/OS by  doxygen 1.4.6