home *** CD-ROM | disk | FTP | other *** search
/ Steganos Hacker Tools / SHT151.iso / programme / scanner / nmapNTsp1 / Win_2000.exe / nmapNT-src / nmapNT / RPC / Rpc_cut.h
Encoding:
C/C++ Source or Header  |  2000-03-27  |  3.2 KB  |  119 lines

  1. /*
  2.  * Copyright (c) 1999, 2000
  3.  *    Politecnico di Torino.  All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that: (1) source code distributions
  7.  * retain the above copyright notice and this paragraph in its entirety, (2)
  8.  * distributions including binary code include the above copyright notice and
  9.  * this paragraph in its entirety in the documentation or other materials
  10.  * provided with the distribution, and (3) all advertising materials mentioning
  11.  * features or use of this software display the following acknowledgement:
  12.  * ``This product includes software developed by the Politecnico
  13.  * di Torino, and its contributors.'' Neither the name of
  14.  * the University nor the names of its contributors may be used to endorse
  15.  * or promote products derived from this software without specific prior
  16.  * written permission.
  17.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  18.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  19.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  20.  */
  21.  
  22. #define u_long unsigned long
  23. #define u_int unsigned int
  24. #define u_short unsigned short
  25. #define enum_t int
  26. #define caddr_t char*
  27.  
  28. struct opaque_auth {
  29.     enum_t    oa_flavor;        /* flavor of auth */
  30.     caddr_t    oa_base;        /* address of more auth stuff */
  31.     u_int    oa_length;        /* not to exceed MAX_AUTH_BYTES */
  32. };
  33.  
  34. struct accepted_reply {
  35.     struct opaque_auth    ar_verf;
  36.     enum accept_stat    ar_stat;
  37.     union {
  38.         struct {
  39.             u_long    low;
  40.             u_long    high;
  41.         } AR_versions;
  42.         /*struct {
  43.             caddr_t    where;
  44.             xdrproc_t proc;
  45.         } AR_results;
  46.         /* and many other null cases */
  47.     } ru;
  48. #define    ar_results    ru.AR_results
  49. #define    ar_vers        ru.AR_versions
  50. };
  51.  
  52. struct rejected_reply {
  53.     enum reject_stat rj_stat;
  54.     union {
  55.         struct {
  56.             u_long low;
  57.             u_long high;
  58.         } RJ_versions;
  59.         enum auth_stat RJ_why;  /* why authentication did not work */
  60.     } ru;
  61. #define    rj_vers    ru.RJ_versions
  62. #define    rj_why    ru.RJ_why
  63. };
  64.  
  65. struct reply_body {
  66.     enum reply_stat rp_stat;
  67.     union {
  68.         struct accepted_reply RP_ar;
  69.         struct rejected_reply RP_dr;
  70.     } ru;
  71. #define    rp_acpt    ru.RP_ar
  72. #define    rp_rjct    ru.RP_dr
  73. };
  74.  
  75. struct call_body {
  76.     u_long cb_rpcvers;    /* must be equal to two */
  77.     u_long cb_prog;
  78.     u_long cb_vers;
  79.     u_long cb_proc;
  80.     struct opaque_auth cb_cred;
  81.     struct opaque_auth cb_verf; /* protocol specific - provided by client */
  82. };
  83.  
  84. struct rpc_msg {
  85.     u_long            rm_xid;
  86.     enum msg_type        rm_direction;
  87.     union {
  88.         struct call_body RM_cmb;
  89.         struct reply_body RM_rmb;
  90.     } ru;
  91. #define    rm_call        ru.RM_cmb
  92. #define    rm_reply    ru.RM_rmb
  93. };
  94.  
  95. #define    MSG_ACCEPTED 0
  96. #define MSG_DENIED 1
  97.  
  98. #define SUCCESS 0
  99. #define PROG_UNAVAIL 1
  100. #define PROG_MISMATCH 2
  101. #define PROC_UNAVAIL 3
  102. #define GARBAGE_ARGS 4
  103. #define SYSTEM_ERR 5
  104.  
  105. #define PMAPPORT        ((u_short)111)
  106. #define PMAPPROG        ((u_long)100000)
  107. #define PMAPVERS        ((u_long)2)
  108. #define PMAPVERS_PROTO        ((u_long)2)
  109. #define PMAPVERS_ORIG        ((u_long)1)
  110. #define PMAPPROC_NULL        ((u_long)0)
  111. #define PMAPPROC_SET        ((u_long)1)
  112. #define PMAPPROC_UNSET        ((u_long)2)
  113. #define PMAPPROC_GETPORT    ((u_long)3)
  114. #define PMAPPROC_DUMP        ((u_long)4)
  115. #define PMAPPROC_CALLIT        ((u_long)5)
  116.  
  117. #define CALL 0
  118. #define REPLY 1
  119.