File indexing completed on 2025-01-18 10:12:37
0001
0002
0003
0004
0005
0006
0007 #ifndef _RPCSVC_YP_PROT_H
0008 #define _RPCSVC_YP_PROT_H
0009
0010 #include <rpc/rpc.h>
0011 #include <rpcsvc/ypclnt.h>
0012
0013 #ifdef __cplusplus
0014 extern "C" {
0015 #endif
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 #define YPPROG 100004
0068 #define YPVERS 2
0069 #define YPVERS_ORIG 1
0070 #define YPMAXRECORD 1024
0071 #define YPMAXDOMAIN 256
0072 #define YPMAXMAP 64
0073 #define YPMAXPEER 256
0074
0075
0076 #define YPMSGSZ 1600
0077
0078 typedef struct keydat {
0079 u_int keydat_len;
0080 char *keydat_val;
0081 } keydat_t;
0082
0083 typedef struct valdat {
0084 u_int valdat_len;
0085 char *valdat_val;
0086 } valdat_t;
0087
0088 struct ypmap_parms {
0089 char *domain;
0090 char *map;
0091 unsigned int ordernum;
0092 char *owner;
0093 };
0094 typedef struct ypmap_parms ypmap_parms;
0095
0096
0097
0098
0099
0100 struct ypreq_key {
0101 char *domain;
0102 char *map;
0103 keydat_t keydat;
0104 };
0105 typedef struct ypreq_key ypreq_key;
0106
0107 struct ypreq_nokey {
0108 char *domain;
0109 char *map;
0110 };
0111 typedef struct ypreq_nokey ypreq_nokey;
0112
0113 struct ypreq_xfr {
0114 struct ypmap_parms map_parms;
0115 u_int transid;
0116 u_int proto;
0117 u_int port;
0118 };
0119 typedef struct ypreq_xfr ypreq_xfr;
0120
0121 struct ypreq_newxfr {
0122 struct ypmap_parms map_parms;
0123 u_int transid;
0124 u_int proto;
0125 char *name;
0126 };
0127 typedef struct ypreq_newxfr ypreq_newxfr;
0128
0129 #define ypxfr_domain map_parms.domain
0130 #define ypxfr_map map_parms.map
0131 #define ypxfr_ordernum map_parms.ordernum
0132 #define ypxfr_owner map_parms.owner
0133
0134
0135
0136 enum ypstat {
0137 YP_TRUE = 1,
0138 #define YP_TRUE YP_TRUE
0139 YP_NOMORE = 2,
0140 #define YP_NOMORE YP_NOMORE
0141 YP_FALSE = 0,
0142 #define YP_FALSE YP_FALSE
0143 YP_NOMAP = -1,
0144 #define YP_NOMAP YP_NOMAP
0145 YP_NODOM = -2,
0146 #define YP_NODOM YP_NODOM
0147 YP_NOKEY = -3,
0148 #define YP_NOKEY YP_NOKEY
0149 YP_BADOP = -4,
0150 #define YP_BADOP YP_BADOP
0151 YP_BADDB = -5,
0152 #define YP_BADDB YP_BADDB
0153 YP_YPERR = -6,
0154 #define YP_YPERR YP_YPERR
0155 YP_BADARGS = -7,
0156 #define YP_BADARGS YP_BADARGS
0157 YP_VERS = -8
0158
0159 #define YP_VERS YP_VERS
0160 };
0161 typedef enum ypstat ypstat;
0162
0163
0164 enum ypxfrstat {
0165 YPXFR_SUCC = 1,
0166 YPXFR_AGE = 2,
0167 YPXFR_NOMAP = -1,
0168 YPXFR_NODOM = -2,
0169 YPXFR_RSRC = -3,
0170 YPXFR_RPC = -4,
0171 YPXFR_MADDR = -5,
0172 YPXFR_YPERR = -6,
0173 YPXFR_BADARGS = -7,
0174 YPXFR_DBM = -8,
0175 YPXFR_FILE = -9,
0176 YPXFR_SKEW = -10,
0177 YPXFR_CLEAR = -11,
0178 YPXFR_FORCE = -12,
0179 YPXFR_XFRERR = -13,
0180 YPXFR_REFUSED = -14
0181 };
0182 typedef enum ypxfrstat ypxfrstat;
0183
0184
0185
0186
0187
0188 struct ypresp_val {
0189 ypstat status;
0190 valdat_t valdat;
0191 };
0192 typedef struct ypresp_val ypresp_val;
0193
0194 struct ypresp_key_val {
0195 ypstat status;
0196 valdat_t valdat;
0197 keydat_t keydat;
0198 };
0199 typedef struct ypresp_key_val ypresp_key_val;
0200
0201 struct ypresp_master {
0202 ypstat status;
0203 char *master;
0204 };
0205 typedef struct ypresp_master ypresp_master;
0206
0207 struct ypresp_order {
0208 ypstat status;
0209 unsigned int ordernum;
0210 };
0211 typedef struct ypresp_order ypresp_order;
0212
0213 struct ypresp_xfr {
0214 u_int transid;
0215 ypxfrstat xfrstat;
0216 };
0217 typedef struct ypresp_xfr ypresp_xfr;
0218
0219 struct ypmaplist {
0220 char *map;
0221 #define ypml_name map
0222 struct ypmaplist *next;
0223 #define ypml_next next
0224 };
0225 typedef struct ypmaplist ypmaplist;
0226
0227 struct ypresp_maplist {
0228 ypstat status;
0229 struct ypmaplist *list;
0230 };
0231 typedef struct ypresp_maplist ypresp_maplist;
0232
0233
0234
0235
0236
0237
0238
0239
0240 #define YPPROC_NULL 0
0241 #define YPPROC_DOMAIN 1
0242 #define YPPROC_DOMAIN_NONACK 2
0243 #define YPPROC_MATCH 3
0244 #define YPPROC_FIRST 4
0245 #define YPPROC_NEXT 5
0246 #define YPPROC_XFR 6
0247 #define YPPROC_CLEAR 7
0248 #define YPPROC_ALL 8
0249 #define YPPROC_MASTER 9
0250 #define YPPROC_ORDER 10
0251 #define YPPROC_MAPLIST 11
0252 #define YPPROC_NEWXFR 12
0253
0254
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271 #define YPBINDPROG 100007
0272 #define YPBINDVERS 3
0273 #define YPBINDVERS_2 2
0274 #define YPBINDVERS_1 1
0275
0276
0277
0278 #define YPBINDPROC_NULL 0
0279 #define YPBINDPROC_DOMAIN 1
0280 #define YPBINDPROC_SETDOM 2
0281
0282
0283
0284
0285
0286
0287 enum ypbind_resptype {YPBIND_SUCC_VAL = 1, YPBIND_FAIL_VAL = 2};
0288 typedef enum ypbind_resptype ypbind_resptype;
0289
0290 struct ypbind2_binding {
0291 struct in_addr ypbind_binding_addr;
0292 unsigned short int ypbind_binding_port;
0293 };
0294 typedef struct ypbind2_binding ypbind2_binding;
0295
0296 struct ypbind2_resp {
0297 enum ypbind_resptype ypbind_status;
0298 union {
0299 u_int ypbind_error;
0300 struct ypbind2_binding ypbind_bindinfo;
0301 } ypbind_respbody;
0302 };
0303 typedef struct ypbind2_resp ypbind2_resp;
0304 #define ypbind2_error ypbind_respbody.ypbind_error
0305 #define ypbind2_bindinfo ypbind_respbody.ypbind_bindinfo
0306 #define ypbind2_addr ypbind_respbody.ypbind_bindinfo.ypbind_binding_addr
0307 #define ypbind2_port ypbind_respbody.ypbind_bindinfo.ypbind_binding_port
0308
0309 struct ypbind_oldsetdom {
0310 char ypoldsetdom_domain[YPMAXDOMAIN];
0311 ypbind2_binding ypoldsetdom_binding;
0312 };
0313 typedef struct ypbind_oldsetdom ypbind_oldsetdom;
0314 #define ypoldsetdom_addr ypoldsetdom_binding.ypbind_binding_addr
0315 #define ypoldsetdom_port ypoldsetdom_binding.ypbind_binding_port
0316
0317 struct ypbind2_setdom {
0318 char *ypsetdom_domain;
0319 struct ypbind2_binding ypsetdom_binding;
0320 u_int ypsetdom_vers;
0321 };
0322 typedef struct ypbind2_setdom ypbind2_setdom;
0323 #define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
0324 #define ypsetdom_port ypsetdom_binding.ypbind_binding_port
0325
0326 struct ypbind3_binding {
0327 struct netconfig *ypbind_nconf;
0328 struct netbuf *ypbind_svcaddr;
0329 char *ypbind_servername;
0330
0331
0332 rpcvers_t ypbind_hi_vers;
0333
0334
0335 rpcvers_t ypbind_lo_vers;
0336 };
0337 typedef struct ypbind3_binding ypbind3_binding;
0338
0339 struct ypbind3_resp {
0340 enum ypbind_resptype ypbind_status;
0341 union {
0342 u_long ypbind_error;
0343 struct ypbind3_binding *ypbind_bindinfo;
0344 } ypbind_respbody;
0345 };
0346 typedef struct ypbind3_resp ypbind3_resp;
0347 #define ypbind3_error ypbind_respbody.ypbind_error
0348 #define ypbind3_bindinfo ypbind_respbody.ypbind_bindinfo
0349 #define ypbind3_nconf ypbind_respbody.ypbind_bindinfo->ypbind_nconf
0350 #define ypbind3_svcaddr ypbind_respbody.ypbind_bindinfo->ypbind_svcaddr
0351 #define ypbind3_servername ypbind_respbody.ypbind_bindinfo->ypbind_servername
0352 #define ypbind3_hi_vers ypbind_respbody.ypbind_bindinfo->ypbind_hi_vers
0353 #define ypbind3_lo_vers ypbind_respbody.ypbind_bindinfo->ypbind_lo_vers
0354
0355 struct ypbind3_setdom {
0356 char *ypsetdom_domain;
0357 struct ypbind3_binding *ypsetdom_bindinfo;
0358 };
0359 typedef struct ypbind3_setdom ypbind3_setdom;
0360 #define ypsetdom3_nconf ypsetdom_bindinfo->ypbind_nconf
0361 #define ypsetdom3_svcaddr ypsetdom_bindinfo->ypbind_svcaddr
0362 #define ypsetdom3_servername ypsetdom_bindinfo->ypbind_servername
0363 #define ypsetdom3_hi_vers ypsetdom_bindinfo->ypbind_hi_vers
0364 #define ypsetdom3_lo_vers ypsetdom_bindinfo->ypbind_lo_vers
0365
0366
0367
0368
0369 #define YPBIND_ERR_ERR 1
0370 #define YPBIND_ERR_NOSERV 2
0371 #define YPBIND_ERR_RESC 3
0372 #define YPBIND_ERR_NODOMAIN 4
0373
0374
0375
0376
0377
0378
0379
0380 #define YPPUSHVERS 1
0381 #define YPPUSHVERS_ORIG 1
0382
0383
0384
0385 #define YPPUSHPROC_NULL 0
0386 #define YPPUSHPROC_XFRRESP 1
0387
0388
0389
0390 enum yppush_status {
0391 YPPUSH_SUCC = 1,
0392 #define YPPUSH_SUCC YPPUSH_SUCC
0393 YPPUSH_AGE = 2,
0394 #define YPPUSH_AGE YPPUSH_AGE
0395 YPPUSH_NOMAP = -1,
0396 #define YPPUSH_NOMAP YPPUSH_NOMAP
0397 YPPUSH_NODOM = -2,
0398 #define YPPUSH_NODOM YPPUSH_NODOM
0399 YPPUSH_RSRC = -3,
0400 #define YPPUSH_RSRC YPPUSH_RSRC
0401 YPPUSH_RPC = -4,
0402 #define YPPUSH_RPC YPPUSH_RPC
0403 YPPUSH_MADDR = -5,
0404 #define YPPUSH_MADDR YPPUSH_MADDR
0405 YPPUSH_YPERR = -6,
0406 #define YPPUSH_YPERR YPPUSH_YPERR
0407 YPPUSH_BADARGS = -7,
0408 #define YPPUSH_BADARGS YPPUSH_BADARGS
0409 YPPUSH_DBM = -8,
0410 #define YPPUSH_DBM YPPUSH_DBM
0411 YPPUSH_FILE = -9,
0412 #define YPPUSH_FILE YPPUSH_FILE
0413 YPPUSH_SKEW = -10,
0414 #define YPPUSH_SKEW YPPUSH_SKEW
0415 YPPUSH_CLEAR = -11,
0416 #define YPPUSH_CLEAR YPPUSH_CLEAR
0417 YPPUSH_FORCE = -12,
0418 #define YPPUSH_FORCE YPPUSH_FORCE
0419 YPPUSH_XFRERR = -13,
0420 #define YPPUSH_XFRERR YPPUSH_XFRERR
0421 YPPUSH_REFUSED = -14,
0422 #define YPPUSH_REFUSED YPPUSH_REFUSED
0423 YPPUSH_NOALIAS = -15
0424 #define YPPUSH_NOALIAS YPPUSH_NOALIAS
0425 };
0426 typedef enum yppush_status yppush_status;
0427
0428 struct yppushresp_xfr {
0429 u_int transid;
0430 yppush_status status;
0431 };
0432 typedef struct yppushresp_xfr yppushresp_xfr;
0433
0434 struct ypresp_all {
0435 bool_t more;
0436 union {
0437 struct ypresp_key_val val;
0438 } ypresp_all_u;
0439 };
0440 typedef struct ypresp_all ypresp_all;
0441
0442 extern bool_t xdr_domainname (XDR *__xdrs, char ** __objp);
0443 extern bool_t xdr_keydat (XDR *__xdrs, keydat_t *__objp);
0444 extern bool_t xdr_valdat (XDR *__xdrs, valdat_t *__objp);
0445 extern bool_t xdr_ypall (XDR *__xdrs, struct ypall_callback * __objp);
0446 extern bool_t xdr_ypbind2_binding (XDR *__xdrs, struct ypbind2_binding * __objp);
0447 extern bool_t xdr_ypbind2_resp (XDR *__xdrs, struct ypbind2_resp * __objp);
0448 extern bool_t xdr_ypbind2_setdom (XDR *__xdrs, struct ypbind2_setdom * __objp);
0449 extern bool_t xdr_ypbind3_binding (XDR *__xdrs, struct ypbind3_binding * __objp);
0450 extern bool_t xdr_ypbind3_resp (XDR *__xdrs, struct ypbind3_resp * __objp);
0451 extern bool_t xdr_ypbind3_setdom (XDR *__xdrs, struct ypbind3_setdom * __objp);
0452 extern bool_t xdr_ypbind_oldsetdom (XDR *__xdrs, struct ypbind_oldsetdom * __objp);
0453 extern bool_t xdr_ypbind_resptype (XDR *__xdrs, enum ypbind_resptype * __objp);
0454 extern bool_t xdr_ypmap_parms (XDR *__xdrs, struct ypmap_parms * __objp);
0455 extern bool_t xdr_ypmaplist (XDR *__xdrs, struct ypmaplist *__objp);
0456 extern bool_t xdr_yppushresp_xfr (XDR *__xdrs, struct yppushresp_xfr * __objp);
0457 extern bool_t xdr_ypreq_key (XDR *__xdrs, struct ypreq_key * __objp);
0458 extern bool_t xdr_ypreq_newxfr (XDR *__xdrs, struct ypreq_newxfr * __objp);
0459 extern bool_t xdr_ypreq_nokey (XDR *__xdrs, struct ypreq_nokey * __objp);
0460 extern bool_t xdr_ypreq_xfr (XDR *__xdrs, struct ypreq_xfr * __objp);
0461 extern bool_t xdr_ypresp_all (XDR *__xdrs, struct ypresp_all * __objp);
0462 extern bool_t xdr_ypresp_key_val (XDR *__xdrs, struct ypresp_key_val * __objp);
0463 extern bool_t xdr_ypresp_maplist (XDR *__xdrs, struct ypresp_maplist * __objp);
0464 extern bool_t xdr_ypresp_master (XDR *__xdrs, struct ypresp_master * __objp);
0465 extern bool_t xdr_ypresp_order (XDR *__xdrs, struct ypresp_order * __objp);
0466 extern bool_t xdr_ypresp_val (XDR *__xdrs, struct ypresp_val * __objp);
0467 extern bool_t xdr_ypresp_xfr (XDR *__xdrs, struct ypresp_xfr *__objp);
0468 extern bool_t xdr_ypstat (XDR *__xdrs, enum ypstat * __objp);
0469 extern bool_t xdr_ypxfrstat (XDR *__xdrs, enum ypxfrstat *__objp);
0470
0471
0472 extern const char *taddr2host (const struct netconfig *__nconf,
0473 const struct netbuf *__nbuf,
0474 char *__host, size_t __hostlen);
0475 extern const char *taddr2ipstr (const struct netconfig *__nconf,
0476 const struct netbuf *__nbuf,
0477 char *__buf, size_t __buflen);
0478 extern unsigned short taddr2port (const struct netconfig *__nconf,
0479 const struct netbuf *__nbuf);
0480
0481 #ifdef __cplusplus
0482 }
0483 #endif
0484
0485
0486 #endif