Subversion Repositories HelenOS

Rev

Rev 2880 | Rev 2894 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. /** @addtogroup sctrace
  2.  * @{
  3.  */
  4. /** @file
  5.  */
  6.  
  7. #ifndef PROTO_H_
  8. #define PROTO_H_
  9.  
  10. #include <libadt/hash_table.h>
  11.  
  12. typedef struct {
  13.     char *name;
  14. } oper_t;
  15.  
  16. typedef struct {
  17.     /** Protocol name */
  18.     char *name;
  19.  
  20.     /** Maps method number to operation */
  21.     hash_table_t method_oper;
  22. } proto_t;
  23.  
  24. /* Maps service number to protocol */
  25. extern hash_table_t srv_proto;
  26.  
  27. void proto_init(void);
  28. void proto_cleanup(void);
  29.  
  30. void proto_register(int srv, proto_t *proto);
  31. proto_t *proto_get_by_srv(int srv);
  32. proto_t *proto_new(char *name);
  33. void proto_add_oper(proto_t *proto, int method, oper_t *oper);
  34. oper_t *proto_get_oper(proto_t *proto, int method);
  35.  
  36. oper_t *oper_new(char *name);
  37.  
  38.  
  39. #endif
  40.  
  41. /** @}
  42.  */
  43.