rusers.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Please do not edit this file.
  3. * It was generated using rpcgen.
  4. */
  5. #ifndef _RUSERS_H_RPCGEN
  6. #define _RUSERS_H_RPCGEN
  7. #include <rpc/rpc.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /*
  12. * Find out about remote users
  13. */
  14. #define RUSERS_MAXUSERLEN 32
  15. #define RUSERS_MAXLINELEN 32
  16. #define RUSERS_MAXHOSTLEN 257
  17. struct rusers_utmp {
  18. char *ut_user;
  19. char *ut_line;
  20. char *ut_host;
  21. int ut_type;
  22. int ut_time;
  23. u_int ut_idle;
  24. };
  25. typedef struct rusers_utmp rusers_utmp;
  26. typedef struct {
  27. u_int utmp_array_len;
  28. rusers_utmp *utmp_array_val;
  29. } utmp_array;
  30. /*
  31. * Values for ut_type field above.
  32. */
  33. #define RUSERS_EMPTY 0
  34. #define RUSERS_RUN_LVL 1
  35. #define RUSERS_BOOT_TIME 2
  36. #define RUSERS_OLD_TIME 3
  37. #define RUSERS_NEW_TIME 4
  38. #define RUSERS_INIT_PROCESS 5
  39. #define RUSERS_LOGIN_PROCESS 6
  40. #define RUSERS_USER_PROCESS 7
  41. #define RUSERS_DEAD_PROCESS 8
  42. #define RUSERS_ACCOUNTING 9
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. #include <rpc/xdr.h>
  47. /*
  48. * The following structures are used by version 2 of the rusersd protocol.
  49. * They were not developed with rpcgen, so they do not appear as RPCL.
  50. */
  51. #define RUSERSVERS_IDLE 2
  52. #define RUSERSVERS 3 /* current version */
  53. #define MAXUSERS 100
  54. /*
  55. * This is the structure used in version 2 of the rusersd RPC service.
  56. * It corresponds to the utmp structure for BSD systems.
  57. */
  58. struct ru_utmp {
  59. char ut_line[8]; /* tty name */
  60. char ut_name[8]; /* user id */
  61. char ut_host[16]; /* host name, if remote */
  62. long int ut_time; /* time on */
  63. };
  64. struct utmparr {
  65. struct ru_utmp **uta_arr;
  66. int uta_cnt;
  67. };
  68. typedef struct utmparr utmparr;
  69. extern bool_t xdr_utmparr (XDR *xdrs, struct utmparr *objp) __THROW;
  70. struct utmpidle {
  71. struct ru_utmp ui_utmp;
  72. unsigned int ui_idle;
  73. };
  74. struct utmpidlearr {
  75. struct utmpidle **uia_arr;
  76. int uia_cnt;
  77. };
  78. extern bool_t xdr_utmpidlearr (XDR *xdrs, struct utmpidlearr *objp) __THROW;
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #define RUSERSPROG 100002
  83. #define RUSERSVERS_3 3
  84. #if defined(__STDC__) || defined(__cplusplus)
  85. #define RUSERSPROC_NUM 1
  86. extern int * rusersproc_num_3(void *, CLIENT *);
  87. extern int * rusersproc_num_3_svc(void *, struct svc_req *);
  88. #define RUSERSPROC_NAMES 2
  89. extern utmp_array * rusersproc_names_3(void *, CLIENT *);
  90. extern utmp_array * rusersproc_names_3_svc(void *, struct svc_req *);
  91. #define RUSERSPROC_ALLNAMES 3
  92. extern utmp_array * rusersproc_allnames_3(void *, CLIENT *);
  93. extern utmp_array * rusersproc_allnames_3_svc(void *, struct svc_req *);
  94. extern int rusersprog_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
  95. #else /* K&R C */
  96. #define RUSERSPROC_NUM 1
  97. extern int * rusersproc_num_3();
  98. extern int * rusersproc_num_3_svc();
  99. #define RUSERSPROC_NAMES 2
  100. extern utmp_array * rusersproc_names_3();
  101. extern utmp_array * rusersproc_names_3_svc();
  102. #define RUSERSPROC_ALLNAMES 3
  103. extern utmp_array * rusersproc_allnames_3();
  104. extern utmp_array * rusersproc_allnames_3_svc();
  105. extern int rusersprog_3_freeresult ();
  106. #endif /* K&R C */
  107. /* the xdr functions */
  108. #if defined(__STDC__) || defined(__cplusplus)
  109. extern bool_t xdr_rusers_utmp (XDR *, rusers_utmp*);
  110. extern bool_t xdr_utmp_array (XDR *, utmp_array*);
  111. #else /* K&R C */
  112. extern bool_t xdr_rusers_utmp ();
  113. extern bool_t xdr_utmp_array ();
  114. #endif /* K&R C */
  115. #ifdef __cplusplus
  116. }
  117. #endif
  118. #endif /* !_RUSERS_H_RPCGEN */