home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / src / proto / PINT-reqproto-module.h < prev    next >
C/C++ Source or Header  |  2007-06-01  |  2KB  |  70 lines

  1. /*
  2.  * (C) 2001 Clemson University and The University of Chicago
  3.  *
  4.  * See COPYING in top-level directory.
  5.  */
  6.  
  7. /* File to be included for modules of the Encoding Library */
  8.  
  9. #ifndef PINT_ENCODING_MODULE_H
  10. #define PINT_ENCODING_MODULE_H
  11.  
  12. /*defines the interface to the encoding modules */
  13. typedef struct
  14. {
  15.     int (*encode_req) (
  16.     struct PVFS_server_req * request,
  17.     struct PINT_encoded_msg * target_msg);
  18.     int (*encode_resp) (
  19.     struct PVFS_server_resp * response,
  20.     struct PINT_encoded_msg * target_msg);
  21.     int (*decode_req) (
  22.     void *input_buffer,
  23.     int input_size,
  24.     struct PINT_decoded_msg * target_msg,
  25.     PVFS_BMI_addr_t target_addr);
  26.     int (*decode_resp) (
  27.     void *input_buffer,
  28.     int input_size,
  29.     struct PINT_decoded_msg * target_msg,
  30.     PVFS_BMI_addr_t target_addr);
  31.     void (*encode_release) (
  32.     struct PINT_encoded_msg * msg,
  33.     enum PINT_encode_msg_type input_type);
  34.     void (*decode_release) (
  35.     struct PINT_decoded_msg * msg,
  36.     enum PINT_encode_msg_type input_type);
  37.     int (*encode_calc_max_size) (
  38.     enum PINT_encode_msg_type input_type,
  39.     enum PVFS_server_op op_type);
  40. } PINT_encoding_functions;
  41.  
  42. /* size of generic header placed at the beginning of all encoded buffers;
  43.  * indicates encoding type and protocol version
  44.  */
  45. #define PINT_ENC_GENERIC_HEADER_SIZE 8
  46.  
  47. typedef struct
  48. {
  49.     PINT_encoding_functions *op;
  50.     const char *name;
  51.     void (*init_fun) (void);
  52.     void (*finalize_fun) (void);
  53.     char generic_header[PINT_ENC_GENERIC_HEADER_SIZE];
  54.     int enc_type;
  55. } PINT_encoding_table_values;
  56.  
  57. /* Defined encoders */
  58. extern PINT_encoding_table_values le_bytefield_table;
  59.  
  60. #endif /* PINT_ENCODING_MODULE_H */
  61.  
  62. /*
  63.  * Local variables:
  64.  *  c-indent-level: 4
  65.  *  c-basic-offset: 4
  66.  * End:
  67.  *
  68.  * vim: ts=8 sts=4 sw=4 expandtab
  69.  */
  70.