Whamcloud - gitweb
7cb3ab73ef335286a1d8d2eaf2d8b06ff63632f0
[fs/lustre-release.git] / lnet / include / lnet / nal.h
1 #ifndef _NAL_H_
2 #define _NAL_H_
3
4 /*
5  * p30/nal.h
6  *
7  * The API side NAL declarations
8  */
9
10 #include <portals/types.h>
11
12 #ifdef yield
13 #undef yield
14 #endif
15
16 typedef struct nal_t nal_t;
17
18 struct nal_t {
19         ptl_ni_t ni;
20         int refct;
21         void *nal_data;
22         int *timeout;           /* for libp30api users */
23         int (*forward) (nal_t * nal, int index, /* Function ID */
24                         void *args, size_t arg_len, void *ret, size_t ret_len);
25
26         int (*shutdown) (nal_t * nal, int interface);
27
28         int (*validate) (nal_t * nal, void *base, size_t extent);
29
30         void (*yield) (nal_t * nal);
31
32         void (*lock) (nal_t * nal, unsigned long *flags);
33
34         void (*unlock) (nal_t * nal, unsigned long *flags);
35 };
36
37 typedef nal_t *(ptl_interface_t) (int, ptl_pt_index_t, ptl_ac_index_t, ptl_pid_t requested_pid);
38 extern nal_t *PTL_IFACE_IP(int, ptl_pt_index_t, ptl_ac_index_t, ptl_pid_t requested_pid);
39 extern nal_t *PTL_IFACE_MYR(int, ptl_pt_index_t, ptl_ac_index_t, ptl_pid_t requested_pid);
40
41 extern nal_t *ptl_hndl2nal(ptl_handle_any_t * any);
42
43 #ifndef PTL_IFACE_DEFAULT
44 #define PTL_IFACE_DEFAULT (PTL_IFACE_IP)
45 #endif
46
47 #endif