root/librpc/gen_ndr/ndr_echo.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. ndr_push_echo_info1
  2. ndr_pull_echo_info1
  3. ndr_print_echo_info1
  4. ndr_push_echo_info2
  5. ndr_pull_echo_info2
  6. ndr_print_echo_info2
  7. ndr_push_echo_info3
  8. ndr_pull_echo_info3
  9. ndr_print_echo_info3
  10. ndr_push_STRUCT_echo_info4
  11. ndr_pull_STRUCT_echo_info4
  12. ndr_print_STRUCT_echo_info4
  13. ndr_push_echo_info5
  14. ndr_pull_echo_info5
  15. ndr_print_echo_info5
  16. ndr_push_echo_info6
  17. ndr_pull_echo_info6
  18. ndr_print_echo_info6
  19. ndr_push_echo_info7
  20. ndr_pull_echo_info7
  21. ndr_print_echo_info7
  22. ndr_push_echo_Info
  23. ndr_pull_echo_Info
  24. ndr_print_echo_Info
  25. ndr_push_echo_Enum1
  26. ndr_pull_echo_Enum1
  27. ndr_print_echo_Enum1
  28. ndr_push_echo_Enum1_32
  29. ndr_pull_echo_Enum1_32
  30. ndr_print_echo_Enum1_32
  31. ndr_push_echo_Enum2
  32. ndr_pull_echo_Enum2
  33. ndr_print_echo_Enum2
  34. ndr_push_echo_Enum3
  35. ndr_pull_echo_Enum3
  36. ndr_print_echo_Enum3
  37. ndr_push_echo_Surrounding
  38. ndr_pull_echo_Surrounding
  39. ndr_print_echo_Surrounding
  40. ndr_push_echo_AddOne
  41. ndr_pull_echo_AddOne
  42. ndr_print_echo_AddOne
  43. ndr_push_echo_EchoData
  44. ndr_pull_echo_EchoData
  45. ndr_print_echo_EchoData
  46. ndr_push_echo_SinkData
  47. ndr_pull_echo_SinkData
  48. ndr_print_echo_SinkData
  49. ndr_push_echo_SourceData
  50. ndr_pull_echo_SourceData
  51. ndr_print_echo_SourceData
  52. ndr_push_echo_TestCall
  53. ndr_pull_echo_TestCall
  54. ndr_print_echo_TestCall
  55. ndr_push_echo_TestCall2
  56. ndr_pull_echo_TestCall2
  57. ndr_print_echo_TestCall2
  58. ndr_push_echo_TestSleep
  59. ndr_pull_echo_TestSleep
  60. ndr_print_echo_TestSleep
  61. ndr_push_echo_TestEnum
  62. ndr_pull_echo_TestEnum
  63. ndr_print_echo_TestEnum
  64. ndr_push_echo_TestSurrounding
  65. ndr_pull_echo_TestSurrounding
  66. ndr_print_echo_TestSurrounding
  67. ndr_push_echo_TestDoublePointer
  68. ndr_pull_echo_TestDoublePointer
  69. ndr_print_echo_TestDoublePointer

   1 /* parser auto-generated by pidl */
   2 
   3 #include "includes.h"
   4 #include "../librpc/gen_ndr/ndr_echo.h"
   5 
   6 _PUBLIC_ enum ndr_err_code ndr_push_echo_info1(struct ndr_push *ndr, int ndr_flags, const struct echo_info1 *r)
     /* [<][>][^][v][top][bottom][index][help] */
   7 {
   8         if (ndr_flags & NDR_SCALARS) {
   9                 NDR_CHECK(ndr_push_align(ndr, 1));
  10                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v));
  11         }
  12         if (ndr_flags & NDR_BUFFERS) {
  13         }
  14         return NDR_ERR_SUCCESS;
  15 }
  16 
  17 _PUBLIC_ enum ndr_err_code ndr_pull_echo_info1(struct ndr_pull *ndr, int ndr_flags, struct echo_info1 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  18 {
  19         if (ndr_flags & NDR_SCALARS) {
  20                 NDR_CHECK(ndr_pull_align(ndr, 1));
  21                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v));
  22         }
  23         if (ndr_flags & NDR_BUFFERS) {
  24         }
  25         return NDR_ERR_SUCCESS;
  26 }
  27 
  28 _PUBLIC_ void ndr_print_echo_info1(struct ndr_print *ndr, const char *name, const struct echo_info1 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  29 {
  30         ndr_print_struct(ndr, name, "echo_info1");
  31         ndr->depth++;
  32         ndr_print_uint8(ndr, "v", r->v);
  33         ndr->depth--;
  34 }
  35 
  36 static enum ndr_err_code ndr_push_echo_info2(struct ndr_push *ndr, int ndr_flags, const struct echo_info2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  37 {
  38         if (ndr_flags & NDR_SCALARS) {
  39                 NDR_CHECK(ndr_push_align(ndr, 2));
  40                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->v));
  41         }
  42         if (ndr_flags & NDR_BUFFERS) {
  43         }
  44         return NDR_ERR_SUCCESS;
  45 }
  46 
  47 static enum ndr_err_code ndr_pull_echo_info2(struct ndr_pull *ndr, int ndr_flags, struct echo_info2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  48 {
  49         if (ndr_flags & NDR_SCALARS) {
  50                 NDR_CHECK(ndr_pull_align(ndr, 2));
  51                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->v));
  52         }
  53         if (ndr_flags & NDR_BUFFERS) {
  54         }
  55         return NDR_ERR_SUCCESS;
  56 }
  57 
  58 _PUBLIC_ void ndr_print_echo_info2(struct ndr_print *ndr, const char *name, const struct echo_info2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  59 {
  60         ndr_print_struct(ndr, name, "echo_info2");
  61         ndr->depth++;
  62         ndr_print_uint16(ndr, "v", r->v);
  63         ndr->depth--;
  64 }
  65 
  66 static enum ndr_err_code ndr_push_echo_info3(struct ndr_push *ndr, int ndr_flags, const struct echo_info3 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  67 {
  68         if (ndr_flags & NDR_SCALARS) {
  69                 NDR_CHECK(ndr_push_align(ndr, 4));
  70                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->v));
  71         }
  72         if (ndr_flags & NDR_BUFFERS) {
  73         }
  74         return NDR_ERR_SUCCESS;
  75 }
  76 
  77 static enum ndr_err_code ndr_pull_echo_info3(struct ndr_pull *ndr, int ndr_flags, struct echo_info3 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  78 {
  79         if (ndr_flags & NDR_SCALARS) {
  80                 NDR_CHECK(ndr_pull_align(ndr, 4));
  81                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->v));
  82         }
  83         if (ndr_flags & NDR_BUFFERS) {
  84         }
  85         return NDR_ERR_SUCCESS;
  86 }
  87 
  88 _PUBLIC_ void ndr_print_echo_info3(struct ndr_print *ndr, const char *name, const struct echo_info3 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  89 {
  90         ndr_print_struct(ndr, name, "echo_info3");
  91         ndr->depth++;
  92         ndr_print_uint32(ndr, "v", r->v);
  93         ndr->depth--;
  94 }
  95 
  96 static enum ndr_err_code ndr_push_STRUCT_echo_info4(struct ndr_push *ndr, int ndr_flags, const struct echo_info4 *r)
     /* [<][>][^][v][top][bottom][index][help] */
  97 {
  98         if (ndr_flags & NDR_SCALARS) {
  99                 NDR_CHECK(ndr_push_align(ndr, 8));
 100                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v));
 101         }
 102         if (ndr_flags & NDR_BUFFERS) {
 103         }
 104         return NDR_ERR_SUCCESS;
 105 }
 106 
 107 static enum ndr_err_code ndr_pull_STRUCT_echo_info4(struct ndr_pull *ndr, int ndr_flags, struct echo_info4 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 108 {
 109         if (ndr_flags & NDR_SCALARS) {
 110                 NDR_CHECK(ndr_pull_align(ndr, 8));
 111                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v));
 112         }
 113         if (ndr_flags & NDR_BUFFERS) {
 114         }
 115         return NDR_ERR_SUCCESS;
 116 }
 117 
 118 _PUBLIC_ void ndr_print_STRUCT_echo_info4(struct ndr_print *ndr, const char *name, const struct echo_info4 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 119 {
 120         ndr_print_struct(ndr, name, "echo_info4");
 121         ndr->depth++;
 122         ndr_print_hyper(ndr, "v", r->v);
 123         ndr->depth--;
 124 }
 125 
 126 static enum ndr_err_code ndr_push_echo_info5(struct ndr_push *ndr, int ndr_flags, const struct echo_info5 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 127 {
 128         if (ndr_flags & NDR_SCALARS) {
 129                 NDR_CHECK(ndr_push_align(ndr, 8));
 130                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
 131                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->v2));
 132         }
 133         if (ndr_flags & NDR_BUFFERS) {
 134         }
 135         return NDR_ERR_SUCCESS;
 136 }
 137 
 138 static enum ndr_err_code ndr_pull_echo_info5(struct ndr_pull *ndr, int ndr_flags, struct echo_info5 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 139 {
 140         if (ndr_flags & NDR_SCALARS) {
 141                 NDR_CHECK(ndr_pull_align(ndr, 8));
 142                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
 143                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->v2));
 144         }
 145         if (ndr_flags & NDR_BUFFERS) {
 146         }
 147         return NDR_ERR_SUCCESS;
 148 }
 149 
 150 _PUBLIC_ void ndr_print_echo_info5(struct ndr_print *ndr, const char *name, const struct echo_info5 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 151 {
 152         ndr_print_struct(ndr, name, "echo_info5");
 153         ndr->depth++;
 154         ndr_print_uint8(ndr, "v1", r->v1);
 155         ndr_print_hyper(ndr, "v2", r->v2);
 156         ndr->depth--;
 157 }
 158 
 159 static enum ndr_err_code ndr_push_echo_info6(struct ndr_push *ndr, int ndr_flags, const struct echo_info6 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 160 {
 161         if (ndr_flags & NDR_SCALARS) {
 162                 NDR_CHECK(ndr_push_align(ndr, 1));
 163                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
 164                 NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1));
 165         }
 166         if (ndr_flags & NDR_BUFFERS) {
 167         }
 168         return NDR_ERR_SUCCESS;
 169 }
 170 
 171 static enum ndr_err_code ndr_pull_echo_info6(struct ndr_pull *ndr, int ndr_flags, struct echo_info6 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 172 {
 173         if (ndr_flags & NDR_SCALARS) {
 174                 NDR_CHECK(ndr_pull_align(ndr, 1));
 175                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
 176                 NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1));
 177         }
 178         if (ndr_flags & NDR_BUFFERS) {
 179         }
 180         return NDR_ERR_SUCCESS;
 181 }
 182 
 183 _PUBLIC_ void ndr_print_echo_info6(struct ndr_print *ndr, const char *name, const struct echo_info6 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 184 {
 185         ndr_print_struct(ndr, name, "echo_info6");
 186         ndr->depth++;
 187         ndr_print_uint8(ndr, "v1", r->v1);
 188         ndr_print_echo_info1(ndr, "info1", &r->info1);
 189         ndr->depth--;
 190 }
 191 
 192 static enum ndr_err_code ndr_push_echo_info7(struct ndr_push *ndr, int ndr_flags, const struct echo_info7 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 193 {
 194         if (ndr_flags & NDR_SCALARS) {
 195                 NDR_CHECK(ndr_push_align(ndr, 8));
 196                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->v1));
 197                 NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
 198         }
 199         if (ndr_flags & NDR_BUFFERS) {
 200         }
 201         return NDR_ERR_SUCCESS;
 202 }
 203 
 204 static enum ndr_err_code ndr_pull_echo_info7(struct ndr_pull *ndr, int ndr_flags, struct echo_info7 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 205 {
 206         if (ndr_flags & NDR_SCALARS) {
 207                 NDR_CHECK(ndr_pull_align(ndr, 8));
 208                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->v1));
 209                 NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
 210         }
 211         if (ndr_flags & NDR_BUFFERS) {
 212         }
 213         return NDR_ERR_SUCCESS;
 214 }
 215 
 216 _PUBLIC_ void ndr_print_echo_info7(struct ndr_print *ndr, const char *name, const struct echo_info7 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 217 {
 218         ndr_print_struct(ndr, name, "echo_info7");
 219         ndr->depth++;
 220         ndr_print_uint8(ndr, "v1", r->v1);
 221         ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4);
 222         ndr->depth--;
 223 }
 224 
 225 static enum ndr_err_code ndr_push_echo_Info(struct ndr_push *ndr, int ndr_flags, const union echo_Info *r)
     /* [<][>][^][v][top][bottom][index][help] */
 226 {
 227         if (ndr_flags & NDR_SCALARS) {
 228                 int level = ndr_push_get_switch_value(ndr, r);
 229                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
 230                 switch (level) {
 231                         case 1: {
 232                                 NDR_CHECK(ndr_push_echo_info1(ndr, NDR_SCALARS, &r->info1));
 233                         break; }
 234 
 235                         case 2: {
 236                                 NDR_CHECK(ndr_push_echo_info2(ndr, NDR_SCALARS, &r->info2));
 237                         break; }
 238 
 239                         case 3: {
 240                                 NDR_CHECK(ndr_push_echo_info3(ndr, NDR_SCALARS, &r->info3));
 241                         break; }
 242 
 243                         case 4: {
 244                                 NDR_CHECK(ndr_push_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
 245                         break; }
 246 
 247                         case 5: {
 248                                 NDR_CHECK(ndr_push_echo_info5(ndr, NDR_SCALARS, &r->info5));
 249                         break; }
 250 
 251                         case 6: {
 252                                 NDR_CHECK(ndr_push_echo_info6(ndr, NDR_SCALARS, &r->info6));
 253                         break; }
 254 
 255                         case 7: {
 256                                 NDR_CHECK(ndr_push_echo_info7(ndr, NDR_SCALARS, &r->info7));
 257                         break; }
 258 
 259                         default:
 260                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
 261                 }
 262         }
 263         if (ndr_flags & NDR_BUFFERS) {
 264                 int level = ndr_push_get_switch_value(ndr, r);
 265                 switch (level) {
 266                         case 1:
 267                         break;
 268 
 269                         case 2:
 270                         break;
 271 
 272                         case 3:
 273                         break;
 274 
 275                         case 4:
 276                         break;
 277 
 278                         case 5:
 279                         break;
 280 
 281                         case 6:
 282                         break;
 283 
 284                         case 7:
 285                         break;
 286 
 287                         default:
 288                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
 289                 }
 290         }
 291         return NDR_ERR_SUCCESS;
 292 }
 293 
 294 static enum ndr_err_code ndr_pull_echo_Info(struct ndr_pull *ndr, int ndr_flags, union echo_Info *r)
     /* [<][>][^][v][top][bottom][index][help] */
 295 {
 296         int level;
 297         uint16_t _level;
 298         level = ndr_pull_get_switch_value(ndr, r);
 299         if (ndr_flags & NDR_SCALARS) {
 300                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
 301                 if (_level != level) {
 302                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
 303                 }
 304                 switch (level) {
 305                         case 1: {
 306                                 NDR_CHECK(ndr_pull_echo_info1(ndr, NDR_SCALARS, &r->info1));
 307                         break; }
 308 
 309                         case 2: {
 310                                 NDR_CHECK(ndr_pull_echo_info2(ndr, NDR_SCALARS, &r->info2));
 311                         break; }
 312 
 313                         case 3: {
 314                                 NDR_CHECK(ndr_pull_echo_info3(ndr, NDR_SCALARS, &r->info3));
 315                         break; }
 316 
 317                         case 4: {
 318                                 NDR_CHECK(ndr_pull_STRUCT_echo_info4(ndr, NDR_SCALARS, &r->info4));
 319                         break; }
 320 
 321                         case 5: {
 322                                 NDR_CHECK(ndr_pull_echo_info5(ndr, NDR_SCALARS, &r->info5));
 323                         break; }
 324 
 325                         case 6: {
 326                                 NDR_CHECK(ndr_pull_echo_info6(ndr, NDR_SCALARS, &r->info6));
 327                         break; }
 328 
 329                         case 7: {
 330                                 NDR_CHECK(ndr_pull_echo_info7(ndr, NDR_SCALARS, &r->info7));
 331                         break; }
 332 
 333                         default:
 334                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
 335                 }
 336         }
 337         if (ndr_flags & NDR_BUFFERS) {
 338                 switch (level) {
 339                         case 1:
 340                         break;
 341 
 342                         case 2:
 343                         break;
 344 
 345                         case 3:
 346                         break;
 347 
 348                         case 4:
 349                         break;
 350 
 351                         case 5:
 352                         break;
 353 
 354                         case 6:
 355                         break;
 356 
 357                         case 7:
 358                         break;
 359 
 360                         default:
 361                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
 362                 }
 363         }
 364         return NDR_ERR_SUCCESS;
 365 }
 366 
 367 _PUBLIC_ void ndr_print_echo_Info(struct ndr_print *ndr, const char *name, const union echo_Info *r)
     /* [<][>][^][v][top][bottom][index][help] */
 368 {
 369         int level;
 370         level = ndr_print_get_switch_value(ndr, r);
 371         ndr_print_union(ndr, name, level, "echo_Info");
 372         switch (level) {
 373                 case 1:
 374                         ndr_print_echo_info1(ndr, "info1", &r->info1);
 375                 break;
 376 
 377                 case 2:
 378                         ndr_print_echo_info2(ndr, "info2", &r->info2);
 379                 break;
 380 
 381                 case 3:
 382                         ndr_print_echo_info3(ndr, "info3", &r->info3);
 383                 break;
 384 
 385                 case 4:
 386                         ndr_print_STRUCT_echo_info4(ndr, "info4", &r->info4);
 387                 break;
 388 
 389                 case 5:
 390                         ndr_print_echo_info5(ndr, "info5", &r->info5);
 391                 break;
 392 
 393                 case 6:
 394                         ndr_print_echo_info6(ndr, "info6", &r->info6);
 395                 break;
 396 
 397                 case 7:
 398                         ndr_print_echo_info7(ndr, "info7", &r->info7);
 399                 break;
 400 
 401                 default:
 402                         ndr_print_bad_level(ndr, name, level);
 403         }
 404 }
 405 
 406 static enum ndr_err_code ndr_push_echo_Enum1(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1 r)
     /* [<][>][^][v][top][bottom][index][help] */
 407 {
 408         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r));
 409         return NDR_ERR_SUCCESS;
 410 }
 411 
 412 static enum ndr_err_code ndr_pull_echo_Enum1(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 413 {
 414         uint16_t v;
 415         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v));
 416         *r = v;
 417         return NDR_ERR_SUCCESS;
 418 }
 419 
 420 _PUBLIC_ void ndr_print_echo_Enum1(struct ndr_print *ndr, const char *name, enum echo_Enum1 r)
     /* [<][>][^][v][top][bottom][index][help] */
 421 {
 422         const char *val = NULL;
 423 
 424         switch (r) {
 425                 case ECHO_ENUM1: val = "ECHO_ENUM1"; break;
 426                 case ECHO_ENUM2: val = "ECHO_ENUM2"; break;
 427         }
 428         ndr_print_enum(ndr, name, "ENUM", val, r);
 429 }
 430 
 431 static enum ndr_err_code ndr_push_echo_Enum1_32(struct ndr_push *ndr, int ndr_flags, enum echo_Enum1_32 r)
     /* [<][>][^][v][top][bottom][index][help] */
 432 {
 433         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
 434         return NDR_ERR_SUCCESS;
 435 }
 436 
 437 static enum ndr_err_code ndr_pull_echo_Enum1_32(struct ndr_pull *ndr, int ndr_flags, enum echo_Enum1_32 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 438 {
 439         uint32_t v;
 440         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
 441         *r = v;
 442         return NDR_ERR_SUCCESS;
 443 }
 444 
 445 _PUBLIC_ void ndr_print_echo_Enum1_32(struct ndr_print *ndr, const char *name, enum echo_Enum1_32 r)
     /* [<][>][^][v][top][bottom][index][help] */
 446 {
 447         const char *val = NULL;
 448 
 449         switch (r) {
 450                 case ECHO_ENUM1_32: val = "ECHO_ENUM1_32"; break;
 451                 case ECHO_ENUM2_32: val = "ECHO_ENUM2_32"; break;
 452         }
 453         ndr_print_enum(ndr, name, "ENUM", val, r);
 454 }
 455 
 456 static enum ndr_err_code ndr_push_echo_Enum2(struct ndr_push *ndr, int ndr_flags, const struct echo_Enum2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 457 {
 458         if (ndr_flags & NDR_SCALARS) {
 459                 NDR_CHECK(ndr_push_align(ndr, 4));
 460                 NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1));
 461                 NDR_CHECK(ndr_push_echo_Enum1_32(ndr, NDR_SCALARS, r->e2));
 462         }
 463         if (ndr_flags & NDR_BUFFERS) {
 464         }
 465         return NDR_ERR_SUCCESS;
 466 }
 467 
 468 static enum ndr_err_code ndr_pull_echo_Enum2(struct ndr_pull *ndr, int ndr_flags, struct echo_Enum2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 469 {
 470         if (ndr_flags & NDR_SCALARS) {
 471                 NDR_CHECK(ndr_pull_align(ndr, 4));
 472                 NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1));
 473                 NDR_CHECK(ndr_pull_echo_Enum1_32(ndr, NDR_SCALARS, &r->e2));
 474         }
 475         if (ndr_flags & NDR_BUFFERS) {
 476         }
 477         return NDR_ERR_SUCCESS;
 478 }
 479 
 480 _PUBLIC_ void ndr_print_echo_Enum2(struct ndr_print *ndr, const char *name, const struct echo_Enum2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 481 {
 482         ndr_print_struct(ndr, name, "echo_Enum2");
 483         ndr->depth++;
 484         ndr_print_echo_Enum1(ndr, "e1", r->e1);
 485         ndr_print_echo_Enum1_32(ndr, "e2", r->e2);
 486         ndr->depth--;
 487 }
 488 
 489 static enum ndr_err_code ndr_push_echo_Enum3(struct ndr_push *ndr, int ndr_flags, const union echo_Enum3 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 490 {
 491         if (ndr_flags & NDR_SCALARS) {
 492                 int level = ndr_push_get_switch_value(ndr, r);
 493                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
 494                 switch (level) {
 495                         case ECHO_ENUM1: {
 496                                 NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, r->e1));
 497                         break; }
 498 
 499                         case ECHO_ENUM2: {
 500                                 NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, &r->e2));
 501                         break; }
 502 
 503                         default:
 504                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
 505                 }
 506         }
 507         if (ndr_flags & NDR_BUFFERS) {
 508                 int level = ndr_push_get_switch_value(ndr, r);
 509                 switch (level) {
 510                         case ECHO_ENUM1:
 511                         break;
 512 
 513                         case ECHO_ENUM2:
 514                         break;
 515 
 516                         default:
 517                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
 518                 }
 519         }
 520         return NDR_ERR_SUCCESS;
 521 }
 522 
 523 static enum ndr_err_code ndr_pull_echo_Enum3(struct ndr_pull *ndr, int ndr_flags, union echo_Enum3 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 524 {
 525         int level;
 526         uint16_t _level;
 527         level = ndr_pull_get_switch_value(ndr, r);
 528         if (ndr_flags & NDR_SCALARS) {
 529                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
 530                 if (_level != level) {
 531                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level);
 532                 }
 533                 switch (level) {
 534                         case ECHO_ENUM1: {
 535                                 NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, &r->e1));
 536                         break; }
 537 
 538                         case ECHO_ENUM2: {
 539                                 NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, &r->e2));
 540                         break; }
 541 
 542                         default:
 543                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
 544                 }
 545         }
 546         if (ndr_flags & NDR_BUFFERS) {
 547                 switch (level) {
 548                         case ECHO_ENUM1:
 549                         break;
 550 
 551                         case ECHO_ENUM2:
 552                         break;
 553 
 554                         default:
 555                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level);
 556                 }
 557         }
 558         return NDR_ERR_SUCCESS;
 559 }
 560 
 561 _PUBLIC_ void ndr_print_echo_Enum3(struct ndr_print *ndr, const char *name, const union echo_Enum3 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 562 {
 563         int level;
 564         level = ndr_print_get_switch_value(ndr, r);
 565         ndr_print_union(ndr, name, level, "echo_Enum3");
 566         switch (level) {
 567                 case ECHO_ENUM1:
 568                         ndr_print_echo_Enum1(ndr, "e1", r->e1);
 569                 break;
 570 
 571                 case ECHO_ENUM2:
 572                         ndr_print_echo_Enum2(ndr, "e2", &r->e2);
 573                 break;
 574 
 575                 default:
 576                         ndr_print_bad_level(ndr, name, level);
 577         }
 578 }
 579 
 580 static enum ndr_err_code ndr_push_echo_Surrounding(struct ndr_push *ndr, int ndr_flags, const struct echo_Surrounding *r)
     /* [<][>][^][v][top][bottom][index][help] */
 581 {
 582         uint32_t cntr_surrounding_0;
 583         if (ndr_flags & NDR_SCALARS) {
 584                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->x));
 585                 NDR_CHECK(ndr_push_align(ndr, 4));
 586                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->x));
 587                 for (cntr_surrounding_0 = 0; cntr_surrounding_0 < r->x; cntr_surrounding_0++) {
 588                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->surrounding[cntr_surrounding_0]));
 589                 }
 590         }
 591         if (ndr_flags & NDR_BUFFERS) {
 592         }
 593         return NDR_ERR_SUCCESS;
 594 }
 595 
 596 static enum ndr_err_code ndr_pull_echo_Surrounding(struct ndr_pull *ndr, int ndr_flags, struct echo_Surrounding *r)
     /* [<][>][^][v][top][bottom][index][help] */
 597 {
 598         uint32_t cntr_surrounding_0;
 599         TALLOC_CTX *_mem_save_surrounding_0;
 600         if (ndr_flags & NDR_SCALARS) {
 601                 NDR_CHECK(ndr_pull_array_size(ndr, &r->surrounding));
 602                 NDR_CHECK(ndr_pull_align(ndr, 4));
 603                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->x));
 604                 NDR_PULL_ALLOC_N(ndr, r->surrounding, ndr_get_array_size(ndr, &r->surrounding));
 605                 _mem_save_surrounding_0 = NDR_PULL_GET_MEM_CTX(ndr);
 606                 NDR_PULL_SET_MEM_CTX(ndr, r->surrounding, 0);
 607                 for (cntr_surrounding_0 = 0; cntr_surrounding_0 < r->x; cntr_surrounding_0++) {
 608                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->surrounding[cntr_surrounding_0]));
 609                 }
 610                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_surrounding_0, 0);
 611                 if (r->surrounding) {
 612                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->surrounding, r->x));
 613                 }
 614         }
 615         if (ndr_flags & NDR_BUFFERS) {
 616         }
 617         return NDR_ERR_SUCCESS;
 618 }
 619 
 620 _PUBLIC_ void ndr_print_echo_Surrounding(struct ndr_print *ndr, const char *name, const struct echo_Surrounding *r)
     /* [<][>][^][v][top][bottom][index][help] */
 621 {
 622         uint32_t cntr_surrounding_0;
 623         ndr_print_struct(ndr, name, "echo_Surrounding");
 624         ndr->depth++;
 625         ndr_print_uint32(ndr, "x", r->x);
 626         ndr->print(ndr, "%s: ARRAY(%d)", "surrounding", (int)r->x);
 627         ndr->depth++;
 628         for (cntr_surrounding_0=0;cntr_surrounding_0<r->x;cntr_surrounding_0++) {
 629                 char *idx_0=NULL;
 630                 if (asprintf(&idx_0, "[%d]", cntr_surrounding_0) != -1) {
 631                         ndr_print_uint16(ndr, "surrounding", r->surrounding[cntr_surrounding_0]);
 632                         free(idx_0);
 633                 }
 634         }
 635         ndr->depth--;
 636         ndr->depth--;
 637 }
 638 
 639 static enum ndr_err_code ndr_push_echo_AddOne(struct ndr_push *ndr, int flags, const struct echo_AddOne *r)
     /* [<][>][^][v][top][bottom][index][help] */
 640 {
 641         if (flags & NDR_IN) {
 642                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.in_data));
 643         }
 644         if (flags & NDR_OUT) {
 645                 if (r->out.out_data == NULL) {
 646                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 647                 }
 648                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.out_data));
 649         }
 650         return NDR_ERR_SUCCESS;
 651 }
 652 
 653 static enum ndr_err_code ndr_pull_echo_AddOne(struct ndr_pull *ndr, int flags, struct echo_AddOne *r)
     /* [<][>][^][v][top][bottom][index][help] */
 654 {
 655         TALLOC_CTX *_mem_save_out_data_0;
 656         if (flags & NDR_IN) {
 657                 ZERO_STRUCT(r->out);
 658 
 659                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.in_data));
 660                 NDR_PULL_ALLOC(ndr, r->out.out_data);
 661                 ZERO_STRUCTP(r->out.out_data);
 662         }
 663         if (flags & NDR_OUT) {
 664                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 665                         NDR_PULL_ALLOC(ndr, r->out.out_data);
 666                 }
 667                 _mem_save_out_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
 668                 NDR_PULL_SET_MEM_CTX(ndr, r->out.out_data, LIBNDR_FLAG_REF_ALLOC);
 669                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.out_data));
 670                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_out_data_0, LIBNDR_FLAG_REF_ALLOC);
 671         }
 672         return NDR_ERR_SUCCESS;
 673 }
 674 
 675 _PUBLIC_ void ndr_print_echo_AddOne(struct ndr_print *ndr, const char *name, int flags, const struct echo_AddOne *r)
     /* [<][>][^][v][top][bottom][index][help] */
 676 {
 677         ndr_print_struct(ndr, name, "echo_AddOne");
 678         ndr->depth++;
 679         if (flags & NDR_SET_VALUES) {
 680                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 681         }
 682         if (flags & NDR_IN) {
 683                 ndr_print_struct(ndr, "in", "echo_AddOne");
 684                 ndr->depth++;
 685                 ndr_print_uint32(ndr, "in_data", r->in.in_data);
 686                 ndr->depth--;
 687         }
 688         if (flags & NDR_OUT) {
 689                 ndr_print_struct(ndr, "out", "echo_AddOne");
 690                 ndr->depth++;
 691                 ndr_print_ptr(ndr, "out_data", r->out.out_data);
 692                 ndr->depth++;
 693                 ndr_print_uint32(ndr, "out_data", *r->out.out_data);
 694                 ndr->depth--;
 695                 ndr->depth--;
 696         }
 697         ndr->depth--;
 698 }
 699 
 700 static enum ndr_err_code ndr_push_echo_EchoData(struct ndr_push *ndr, int flags, const struct echo_EchoData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 701 {
 702         if (flags & NDR_IN) {
 703                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
 704                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
 705                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.in_data, r->in.len));
 706         }
 707         if (flags & NDR_OUT) {
 708                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
 709                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.out_data, r->in.len));
 710         }
 711         return NDR_ERR_SUCCESS;
 712 }
 713 
 714 static enum ndr_err_code ndr_pull_echo_EchoData(struct ndr_pull *ndr, int flags, struct echo_EchoData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 715 {
 716         if (flags & NDR_IN) {
 717                 ZERO_STRUCT(r->out);
 718 
 719                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
 720                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.in_data));
 721                 NDR_PULL_ALLOC_N(ndr, r->in.in_data, ndr_get_array_size(ndr, &r->in.in_data));
 722                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.in_data, ndr_get_array_size(ndr, &r->in.in_data)));
 723                 if (r->in.in_data) {
 724                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.in_data, r->in.len));
 725                 }
 726         }
 727         if (flags & NDR_OUT) {
 728                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.out_data));
 729                 NDR_PULL_ALLOC_N(ndr, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data));
 730                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.out_data, ndr_get_array_size(ndr, &r->out.out_data)));
 731                 if (r->out.out_data) {
 732                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.out_data, r->in.len));
 733                 }
 734         }
 735         return NDR_ERR_SUCCESS;
 736 }
 737 
 738 _PUBLIC_ void ndr_print_echo_EchoData(struct ndr_print *ndr, const char *name, int flags, const struct echo_EchoData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 739 {
 740         ndr_print_struct(ndr, name, "echo_EchoData");
 741         ndr->depth++;
 742         if (flags & NDR_SET_VALUES) {
 743                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 744         }
 745         if (flags & NDR_IN) {
 746                 ndr_print_struct(ndr, "in", "echo_EchoData");
 747                 ndr->depth++;
 748                 ndr_print_uint32(ndr, "len", r->in.len);
 749                 ndr_print_array_uint8(ndr, "in_data", r->in.in_data, r->in.len);
 750                 ndr->depth--;
 751         }
 752         if (flags & NDR_OUT) {
 753                 ndr_print_struct(ndr, "out", "echo_EchoData");
 754                 ndr->depth++;
 755                 ndr_print_array_uint8(ndr, "out_data", r->out.out_data, r->in.len);
 756                 ndr->depth--;
 757         }
 758         ndr->depth--;
 759 }
 760 
 761 static enum ndr_err_code ndr_push_echo_SinkData(struct ndr_push *ndr, int flags, const struct echo_SinkData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 762 {
 763         if (flags & NDR_IN) {
 764                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
 765                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
 766                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, r->in.len));
 767         }
 768         if (flags & NDR_OUT) {
 769         }
 770         return NDR_ERR_SUCCESS;
 771 }
 772 
 773 static enum ndr_err_code ndr_pull_echo_SinkData(struct ndr_pull *ndr, int flags, struct echo_SinkData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 774 {
 775         if (flags & NDR_IN) {
 776                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
 777                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.data));
 778                 NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data));
 779                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_size(ndr, &r->in.data)));
 780                 if (r->in.data) {
 781                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.data, r->in.len));
 782                 }
 783         }
 784         if (flags & NDR_OUT) {
 785         }
 786         return NDR_ERR_SUCCESS;
 787 }
 788 
 789 _PUBLIC_ void ndr_print_echo_SinkData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SinkData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 790 {
 791         ndr_print_struct(ndr, name, "echo_SinkData");
 792         ndr->depth++;
 793         if (flags & NDR_SET_VALUES) {
 794                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 795         }
 796         if (flags & NDR_IN) {
 797                 ndr_print_struct(ndr, "in", "echo_SinkData");
 798                 ndr->depth++;
 799                 ndr_print_uint32(ndr, "len", r->in.len);
 800                 ndr_print_array_uint8(ndr, "data", r->in.data, r->in.len);
 801                 ndr->depth--;
 802         }
 803         if (flags & NDR_OUT) {
 804                 ndr_print_struct(ndr, "out", "echo_SinkData");
 805                 ndr->depth++;
 806                 ndr->depth--;
 807         }
 808         ndr->depth--;
 809 }
 810 
 811 static enum ndr_err_code ndr_push_echo_SourceData(struct ndr_push *ndr, int flags, const struct echo_SourceData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 812 {
 813         if (flags & NDR_IN) {
 814                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
 815         }
 816         if (flags & NDR_OUT) {
 817                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.len));
 818                 NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.len));
 819         }
 820         return NDR_ERR_SUCCESS;
 821 }
 822 
 823 static enum ndr_err_code ndr_pull_echo_SourceData(struct ndr_pull *ndr, int flags, struct echo_SourceData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 824 {
 825         if (flags & NDR_IN) {
 826                 ZERO_STRUCT(r->out);
 827 
 828                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.len));
 829         }
 830         if (flags & NDR_OUT) {
 831                 NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data));
 832                 NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data));
 833                 NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data)));
 834                 if (r->out.data) {
 835                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.len));
 836                 }
 837         }
 838         return NDR_ERR_SUCCESS;
 839 }
 840 
 841 _PUBLIC_ void ndr_print_echo_SourceData(struct ndr_print *ndr, const char *name, int flags, const struct echo_SourceData *r)
     /* [<][>][^][v][top][bottom][index][help] */
 842 {
 843         ndr_print_struct(ndr, name, "echo_SourceData");
 844         ndr->depth++;
 845         if (flags & NDR_SET_VALUES) {
 846                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 847         }
 848         if (flags & NDR_IN) {
 849                 ndr_print_struct(ndr, "in", "echo_SourceData");
 850                 ndr->depth++;
 851                 ndr_print_uint32(ndr, "len", r->in.len);
 852                 ndr->depth--;
 853         }
 854         if (flags & NDR_OUT) {
 855                 ndr_print_struct(ndr, "out", "echo_SourceData");
 856                 ndr->depth++;
 857                 ndr_print_array_uint8(ndr, "data", r->out.data, r->in.len);
 858                 ndr->depth--;
 859         }
 860         ndr->depth--;
 861 }
 862 
 863 static enum ndr_err_code ndr_push_echo_TestCall(struct ndr_push *ndr, int flags, const struct echo_TestCall *r)
     /* [<][>][^][v][top][bottom][index][help] */
 864 {
 865         if (flags & NDR_IN) {
 866                 if (r->in.s1 == NULL) {
 867                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 868                 }
 869                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16)));
 870                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
 871                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.s1, CH_UTF16)));
 872                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.s1, ndr_charset_length(r->in.s1, CH_UTF16), sizeof(uint16_t), CH_UTF16));
 873         }
 874         if (flags & NDR_OUT) {
 875                 if (r->out.s2 == NULL) {
 876                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 877                 }
 878                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.s2));
 879                 if (*r->out.s2) {
 880                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16)));
 881                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
 882                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(*r->out.s2, CH_UTF16)));
 883                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, *r->out.s2, ndr_charset_length(*r->out.s2, CH_UTF16), sizeof(uint16_t), CH_UTF16));
 884                 }
 885         }
 886         return NDR_ERR_SUCCESS;
 887 }
 888 
 889 static enum ndr_err_code ndr_pull_echo_TestCall(struct ndr_pull *ndr, int flags, struct echo_TestCall *r)
     /* [<][>][^][v][top][bottom][index][help] */
 890 {
 891         uint32_t _ptr_s2;
 892         TALLOC_CTX *_mem_save_s2_0;
 893         TALLOC_CTX *_mem_save_s2_1;
 894         if (flags & NDR_IN) {
 895                 ZERO_STRUCT(r->out);
 896 
 897                 NDR_CHECK(ndr_pull_array_size(ndr, &r->in.s1));
 898                 NDR_CHECK(ndr_pull_array_length(ndr, &r->in.s1));
 899                 if (ndr_get_array_length(ndr, &r->in.s1) > ndr_get_array_size(ndr, &r->in.s1)) {
 900                         return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.s1), ndr_get_array_length(ndr, &r->in.s1));
 901                 }
 902                 NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.s1), sizeof(uint16_t)));
 903                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.s1, ndr_get_array_length(ndr, &r->in.s1), sizeof(uint16_t), CH_UTF16));
 904                 NDR_PULL_ALLOC(ndr, r->out.s2);
 905                 ZERO_STRUCTP(r->out.s2);
 906         }
 907         if (flags & NDR_OUT) {
 908                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 909                         NDR_PULL_ALLOC(ndr, r->out.s2);
 910                 }
 911                 _mem_save_s2_0 = NDR_PULL_GET_MEM_CTX(ndr);
 912                 NDR_PULL_SET_MEM_CTX(ndr, r->out.s2, LIBNDR_FLAG_REF_ALLOC);
 913                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_s2));
 914                 if (_ptr_s2) {
 915                         NDR_PULL_ALLOC(ndr, *r->out.s2);
 916                 } else {
 917                         *r->out.s2 = NULL;
 918                 }
 919                 if (*r->out.s2) {
 920                         _mem_save_s2_1 = NDR_PULL_GET_MEM_CTX(ndr);
 921                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.s2, 0);
 922                         NDR_CHECK(ndr_pull_array_size(ndr, r->out.s2));
 923                         NDR_CHECK(ndr_pull_array_length(ndr, r->out.s2));
 924                         if (ndr_get_array_length(ndr, r->out.s2) > ndr_get_array_size(ndr, r->out.s2)) {
 925                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, r->out.s2), ndr_get_array_length(ndr, r->out.s2));
 926                         }
 927                         NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t)));
 928                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, r->out.s2, ndr_get_array_length(ndr, r->out.s2), sizeof(uint16_t), CH_UTF16));
 929                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_1, 0);
 930                 }
 931                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_s2_0, LIBNDR_FLAG_REF_ALLOC);
 932         }
 933         return NDR_ERR_SUCCESS;
 934 }
 935 
 936 _PUBLIC_ void ndr_print_echo_TestCall(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall *r)
     /* [<][>][^][v][top][bottom][index][help] */
 937 {
 938         ndr_print_struct(ndr, name, "echo_TestCall");
 939         ndr->depth++;
 940         if (flags & NDR_SET_VALUES) {
 941                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
 942         }
 943         if (flags & NDR_IN) {
 944                 ndr_print_struct(ndr, "in", "echo_TestCall");
 945                 ndr->depth++;
 946                 ndr_print_ptr(ndr, "s1", r->in.s1);
 947                 ndr->depth++;
 948                 ndr_print_string(ndr, "s1", r->in.s1);
 949                 ndr->depth--;
 950                 ndr->depth--;
 951         }
 952         if (flags & NDR_OUT) {
 953                 ndr_print_struct(ndr, "out", "echo_TestCall");
 954                 ndr->depth++;
 955                 ndr_print_ptr(ndr, "s2", r->out.s2);
 956                 ndr->depth++;
 957                 ndr_print_ptr(ndr, "s2", *r->out.s2);
 958                 ndr->depth++;
 959                 if (*r->out.s2) {
 960                         ndr_print_string(ndr, "s2", *r->out.s2);
 961                 }
 962                 ndr->depth--;
 963                 ndr->depth--;
 964                 ndr->depth--;
 965         }
 966         ndr->depth--;
 967 }
 968 
 969 static enum ndr_err_code ndr_push_echo_TestCall2(struct ndr_push *ndr, int flags, const struct echo_TestCall2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 970 {
 971         if (flags & NDR_IN) {
 972                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level));
 973         }
 974         if (flags & NDR_OUT) {
 975                 if (r->out.info == NULL) {
 976                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 977                 }
 978                 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.info, r->in.level));
 979                 NDR_CHECK(ndr_push_echo_Info(ndr, NDR_SCALARS, r->out.info));
 980                 NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
 981         }
 982         return NDR_ERR_SUCCESS;
 983 }
 984 
 985 static enum ndr_err_code ndr_pull_echo_TestCall2(struct ndr_pull *ndr, int flags, struct echo_TestCall2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
 986 {
 987         TALLOC_CTX *_mem_save_info_0;
 988         if (flags & NDR_IN) {
 989                 ZERO_STRUCT(r->out);
 990 
 991                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level));
 992                 NDR_PULL_ALLOC(ndr, r->out.info);
 993                 ZERO_STRUCTP(r->out.info);
 994         }
 995         if (flags & NDR_OUT) {
 996                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 997                         NDR_PULL_ALLOC(ndr, r->out.info);
 998                 }
 999                 _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
1000                 NDR_PULL_SET_MEM_CTX(ndr, r->out.info, LIBNDR_FLAG_REF_ALLOC);
1001                 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.info, r->in.level));
1002                 NDR_CHECK(ndr_pull_echo_Info(ndr, NDR_SCALARS, r->out.info));
1003                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, LIBNDR_FLAG_REF_ALLOC);
1004                 NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
1005         }
1006         return NDR_ERR_SUCCESS;
1007 }
1008 
1009 _PUBLIC_ void ndr_print_echo_TestCall2(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestCall2 *r)
     /* [<][>][^][v][top][bottom][index][help] */
1010 {
1011         ndr_print_struct(ndr, name, "echo_TestCall2");
1012         ndr->depth++;
1013         if (flags & NDR_SET_VALUES) {
1014                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1015         }
1016         if (flags & NDR_IN) {
1017                 ndr_print_struct(ndr, "in", "echo_TestCall2");
1018                 ndr->depth++;
1019                 ndr_print_uint16(ndr, "level", r->in.level);
1020                 ndr->depth--;
1021         }
1022         if (flags & NDR_OUT) {
1023                 ndr_print_struct(ndr, "out", "echo_TestCall2");
1024                 ndr->depth++;
1025                 ndr_print_ptr(ndr, "info", r->out.info);
1026                 ndr->depth++;
1027                 ndr_print_set_switch_value(ndr, r->out.info, r->in.level);
1028                 ndr_print_echo_Info(ndr, "info", r->out.info);
1029                 ndr->depth--;
1030                 ndr_print_NTSTATUS(ndr, "result", r->out.result);
1031                 ndr->depth--;
1032         }
1033         ndr->depth--;
1034 }
1035 
1036 static enum ndr_err_code ndr_push_echo_TestSleep(struct ndr_push *ndr, int flags, const struct echo_TestSleep *r)
     /* [<][>][^][v][top][bottom][index][help] */
1037 {
1038         if (flags & NDR_IN) {
1039                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.seconds));
1040         }
1041         if (flags & NDR_OUT) {
1042                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->out.result));
1043         }
1044         return NDR_ERR_SUCCESS;
1045 }
1046 
1047 static enum ndr_err_code ndr_pull_echo_TestSleep(struct ndr_pull *ndr, int flags, struct echo_TestSleep *r)
     /* [<][>][^][v][top][bottom][index][help] */
1048 {
1049         if (flags & NDR_IN) {
1050                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.seconds));
1051         }
1052         if (flags & NDR_OUT) {
1053                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->out.result));
1054         }
1055         return NDR_ERR_SUCCESS;
1056 }
1057 
1058 _PUBLIC_ void ndr_print_echo_TestSleep(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSleep *r)
     /* [<][>][^][v][top][bottom][index][help] */
1059 {
1060         ndr_print_struct(ndr, name, "echo_TestSleep");
1061         ndr->depth++;
1062         if (flags & NDR_SET_VALUES) {
1063                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1064         }
1065         if (flags & NDR_IN) {
1066                 ndr_print_struct(ndr, "in", "echo_TestSleep");
1067                 ndr->depth++;
1068                 ndr_print_uint32(ndr, "seconds", r->in.seconds);
1069                 ndr->depth--;
1070         }
1071         if (flags & NDR_OUT) {
1072                 ndr_print_struct(ndr, "out", "echo_TestSleep");
1073                 ndr->depth++;
1074                 ndr_print_uint32(ndr, "result", r->out.result);
1075                 ndr->depth--;
1076         }
1077         ndr->depth--;
1078 }
1079 
1080 static enum ndr_err_code ndr_push_echo_TestEnum(struct ndr_push *ndr, int flags, const struct echo_TestEnum *r)
     /* [<][>][^][v][top][bottom][index][help] */
1081 {
1082         if (flags & NDR_IN) {
1083                 if (r->in.foo1 == NULL) {
1084                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1085                 }
1086                 NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, *r->in.foo1));
1087                 if (r->in.foo2 == NULL) {
1088                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1089                 }
1090                 NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2));
1091                 if (r->in.foo3 == NULL) {
1092                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1093                 }
1094                 NDR_CHECK(ndr_push_set_switch_value(ndr, r->in.foo3, *r->in.foo1));
1095                 NDR_CHECK(ndr_push_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3));
1096         }
1097         if (flags & NDR_OUT) {
1098                 if (r->out.foo1 == NULL) {
1099                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1100                 }
1101                 NDR_CHECK(ndr_push_echo_Enum1(ndr, NDR_SCALARS, *r->out.foo1));
1102                 if (r->out.foo2 == NULL) {
1103                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1104                 }
1105                 NDR_CHECK(ndr_push_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2));
1106                 if (r->out.foo3 == NULL) {
1107                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1108                 }
1109                 NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.foo3, *r->out.foo1));
1110                 NDR_CHECK(ndr_push_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3));
1111         }
1112         return NDR_ERR_SUCCESS;
1113 }
1114 
1115 static enum ndr_err_code ndr_pull_echo_TestEnum(struct ndr_pull *ndr, int flags, struct echo_TestEnum *r)
     /* [<][>][^][v][top][bottom][index][help] */
1116 {
1117         TALLOC_CTX *_mem_save_foo1_0;
1118         TALLOC_CTX *_mem_save_foo2_0;
1119         TALLOC_CTX *_mem_save_foo3_0;
1120         if (flags & NDR_IN) {
1121                 ZERO_STRUCT(r->out);
1122 
1123                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1124                         NDR_PULL_ALLOC(ndr, r->in.foo1);
1125                 }
1126                 _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1127                 NDR_PULL_SET_MEM_CTX(ndr, r->in.foo1, LIBNDR_FLAG_REF_ALLOC);
1128                 NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->in.foo1));
1129                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC);
1130                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1131                         NDR_PULL_ALLOC(ndr, r->in.foo2);
1132                 }
1133                 _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1134                 NDR_PULL_SET_MEM_CTX(ndr, r->in.foo2, LIBNDR_FLAG_REF_ALLOC);
1135                 NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->in.foo2));
1136                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC);
1137                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1138                         NDR_PULL_ALLOC(ndr, r->in.foo3);
1139                 }
1140                 _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1141                 NDR_PULL_SET_MEM_CTX(ndr, r->in.foo3, LIBNDR_FLAG_REF_ALLOC);
1142                 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->in.foo3, *r->in.foo1));
1143                 NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->in.foo3));
1144                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC);
1145                 NDR_PULL_ALLOC(ndr, r->out.foo1);
1146                 *r->out.foo1 = *r->in.foo1;
1147                 NDR_PULL_ALLOC(ndr, r->out.foo2);
1148                 *r->out.foo2 = *r->in.foo2;
1149                 NDR_PULL_ALLOC(ndr, r->out.foo3);
1150                 *r->out.foo3 = *r->in.foo3;
1151         }
1152         if (flags & NDR_OUT) {
1153                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1154                         NDR_PULL_ALLOC(ndr, r->out.foo1);
1155                 }
1156                 _mem_save_foo1_0 = NDR_PULL_GET_MEM_CTX(ndr);
1157                 NDR_PULL_SET_MEM_CTX(ndr, r->out.foo1, LIBNDR_FLAG_REF_ALLOC);
1158                 NDR_CHECK(ndr_pull_echo_Enum1(ndr, NDR_SCALARS, r->out.foo1));
1159                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo1_0, LIBNDR_FLAG_REF_ALLOC);
1160                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1161                         NDR_PULL_ALLOC(ndr, r->out.foo2);
1162                 }
1163                 _mem_save_foo2_0 = NDR_PULL_GET_MEM_CTX(ndr);
1164                 NDR_PULL_SET_MEM_CTX(ndr, r->out.foo2, LIBNDR_FLAG_REF_ALLOC);
1165                 NDR_CHECK(ndr_pull_echo_Enum2(ndr, NDR_SCALARS, r->out.foo2));
1166                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo2_0, LIBNDR_FLAG_REF_ALLOC);
1167                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1168                         NDR_PULL_ALLOC(ndr, r->out.foo3);
1169                 }
1170                 _mem_save_foo3_0 = NDR_PULL_GET_MEM_CTX(ndr);
1171                 NDR_PULL_SET_MEM_CTX(ndr, r->out.foo3, LIBNDR_FLAG_REF_ALLOC);
1172                 NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.foo3, *r->out.foo1));
1173                 NDR_CHECK(ndr_pull_echo_Enum3(ndr, NDR_SCALARS, r->out.foo3));
1174                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_foo3_0, LIBNDR_FLAG_REF_ALLOC);
1175         }
1176         return NDR_ERR_SUCCESS;
1177 }
1178 
1179 _PUBLIC_ void ndr_print_echo_TestEnum(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestEnum *r)
     /* [<][>][^][v][top][bottom][index][help] */
1180 {
1181         ndr_print_struct(ndr, name, "echo_TestEnum");
1182         ndr->depth++;
1183         if (flags & NDR_SET_VALUES) {
1184                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1185         }
1186         if (flags & NDR_IN) {
1187                 ndr_print_struct(ndr, "in", "echo_TestEnum");
1188                 ndr->depth++;
1189                 ndr_print_ptr(ndr, "foo1", r->in.foo1);
1190                 ndr->depth++;
1191                 ndr_print_echo_Enum1(ndr, "foo1", *r->in.foo1);
1192                 ndr->depth--;
1193                 ndr_print_ptr(ndr, "foo2", r->in.foo2);
1194                 ndr->depth++;
1195                 ndr_print_echo_Enum2(ndr, "foo2", r->in.foo2);
1196                 ndr->depth--;
1197                 ndr_print_ptr(ndr, "foo3", r->in.foo3);
1198                 ndr->depth++;
1199                 ndr_print_set_switch_value(ndr, r->in.foo3, *r->in.foo1);
1200                 ndr_print_echo_Enum3(ndr, "foo3", r->in.foo3);
1201                 ndr->depth--;
1202                 ndr->depth--;
1203         }
1204         if (flags & NDR_OUT) {
1205                 ndr_print_struct(ndr, "out", "echo_TestEnum");
1206                 ndr->depth++;
1207                 ndr_print_ptr(ndr, "foo1", r->out.foo1);
1208                 ndr->depth++;
1209                 ndr_print_echo_Enum1(ndr, "foo1", *r->out.foo1);
1210                 ndr->depth--;
1211                 ndr_print_ptr(ndr, "foo2", r->out.foo2);
1212                 ndr->depth++;
1213                 ndr_print_echo_Enum2(ndr, "foo2", r->out.foo2);
1214                 ndr->depth--;
1215                 ndr_print_ptr(ndr, "foo3", r->out.foo3);
1216                 ndr->depth++;
1217                 ndr_print_set_switch_value(ndr, r->out.foo3, *r->out.foo1);
1218                 ndr_print_echo_Enum3(ndr, "foo3", r->out.foo3);
1219                 ndr->depth--;
1220                 ndr->depth--;
1221         }
1222         ndr->depth--;
1223 }
1224 
1225 static enum ndr_err_code ndr_push_echo_TestSurrounding(struct ndr_push *ndr, int flags, const struct echo_TestSurrounding *r)
     /* [<][>][^][v][top][bottom][index][help] */
1226 {
1227         if (flags & NDR_IN) {
1228                 if (r->in.data == NULL) {
1229                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1230                 }
1231                 NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->in.data));
1232         }
1233         if (flags & NDR_OUT) {
1234                 if (r->out.data == NULL) {
1235                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1236                 }
1237                 NDR_CHECK(ndr_push_echo_Surrounding(ndr, NDR_SCALARS, r->out.data));
1238         }
1239         return NDR_ERR_SUCCESS;
1240 }
1241 
1242 static enum ndr_err_code ndr_pull_echo_TestSurrounding(struct ndr_pull *ndr, int flags, struct echo_TestSurrounding *r)
     /* [<][>][^][v][top][bottom][index][help] */
1243 {
1244         TALLOC_CTX *_mem_save_data_0;
1245         if (flags & NDR_IN) {
1246                 ZERO_STRUCT(r->out);
1247 
1248                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1249                         NDR_PULL_ALLOC(ndr, r->in.data);
1250                 }
1251                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1252                 NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
1253                 NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->in.data));
1254                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1255                 NDR_PULL_ALLOC(ndr, r->out.data);
1256                 *r->out.data = *r->in.data;
1257         }
1258         if (flags & NDR_OUT) {
1259                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1260                         NDR_PULL_ALLOC(ndr, r->out.data);
1261                 }
1262                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1263                 NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC);
1264                 NDR_CHECK(ndr_pull_echo_Surrounding(ndr, NDR_SCALARS, r->out.data));
1265                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1266         }
1267         return NDR_ERR_SUCCESS;
1268 }
1269 
1270 _PUBLIC_ void ndr_print_echo_TestSurrounding(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestSurrounding *r)
     /* [<][>][^][v][top][bottom][index][help] */
1271 {
1272         ndr_print_struct(ndr, name, "echo_TestSurrounding");
1273         ndr->depth++;
1274         if (flags & NDR_SET_VALUES) {
1275                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1276         }
1277         if (flags & NDR_IN) {
1278                 ndr_print_struct(ndr, "in", "echo_TestSurrounding");
1279                 ndr->depth++;
1280                 ndr_print_ptr(ndr, "data", r->in.data);
1281                 ndr->depth++;
1282                 ndr_print_echo_Surrounding(ndr, "data", r->in.data);
1283                 ndr->depth--;
1284                 ndr->depth--;
1285         }
1286         if (flags & NDR_OUT) {
1287                 ndr_print_struct(ndr, "out", "echo_TestSurrounding");
1288                 ndr->depth++;
1289                 ndr_print_ptr(ndr, "data", r->out.data);
1290                 ndr->depth++;
1291                 ndr_print_echo_Surrounding(ndr, "data", r->out.data);
1292                 ndr->depth--;
1293                 ndr->depth--;
1294         }
1295         ndr->depth--;
1296 }
1297 
1298 static enum ndr_err_code ndr_push_echo_TestDoublePointer(struct ndr_push *ndr, int flags, const struct echo_TestDoublePointer *r)
     /* [<][>][^][v][top][bottom][index][help] */
1299 {
1300         if (flags & NDR_IN) {
1301                 if (r->in.data == NULL) {
1302                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
1303                 }
1304                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->in.data));
1305                 if (*r->in.data) {
1306                         NDR_CHECK(ndr_push_unique_ptr(ndr, **r->in.data));
1307                         if (**r->in.data) {
1308                                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, ***r->in.data));
1309                         }
1310                 }
1311         }
1312         if (flags & NDR_OUT) {
1313                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.result));
1314         }
1315         return NDR_ERR_SUCCESS;
1316 }
1317 
1318 static enum ndr_err_code ndr_pull_echo_TestDoublePointer(struct ndr_pull *ndr, int flags, struct echo_TestDoublePointer *r)
     /* [<][>][^][v][top][bottom][index][help] */
1319 {
1320         uint32_t _ptr_data;
1321         TALLOC_CTX *_mem_save_data_0;
1322         TALLOC_CTX *_mem_save_data_1;
1323         TALLOC_CTX *_mem_save_data_2;
1324         if (flags & NDR_IN) {
1325                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
1326                         NDR_PULL_ALLOC(ndr, r->in.data);
1327                 }
1328                 _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr);
1329                 NDR_PULL_SET_MEM_CTX(ndr, r->in.data, LIBNDR_FLAG_REF_ALLOC);
1330                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1331                 if (_ptr_data) {
1332                         NDR_PULL_ALLOC(ndr, *r->in.data);
1333                 } else {
1334                         *r->in.data = NULL;
1335                 }
1336                 if (*r->in.data) {
1337                         _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr);
1338                         NDR_PULL_SET_MEM_CTX(ndr, *r->in.data, 0);
1339                         NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data));
1340                         if (_ptr_data) {
1341                                 NDR_PULL_ALLOC(ndr, **r->in.data);
1342                         } else {
1343                                 **r->in.data = NULL;
1344                         }
1345                         if (**r->in.data) {
1346                                 _mem_save_data_2 = NDR_PULL_GET_MEM_CTX(ndr);
1347                                 NDR_PULL_SET_MEM_CTX(ndr, **r->in.data, 0);
1348                                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, **r->in.data));
1349                                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_2, 0);
1350                         }
1351                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0);
1352                 }
1353                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC);
1354         }
1355         if (flags & NDR_OUT) {
1356                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.result));
1357         }
1358         return NDR_ERR_SUCCESS;
1359 }
1360 
1361 _PUBLIC_ void ndr_print_echo_TestDoublePointer(struct ndr_print *ndr, const char *name, int flags, const struct echo_TestDoublePointer *r)
     /* [<][>][^][v][top][bottom][index][help] */
1362 {
1363         ndr_print_struct(ndr, name, "echo_TestDoublePointer");
1364         ndr->depth++;
1365         if (flags & NDR_SET_VALUES) {
1366                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
1367         }
1368         if (flags & NDR_IN) {
1369                 ndr_print_struct(ndr, "in", "echo_TestDoublePointer");
1370                 ndr->depth++;
1371                 ndr_print_ptr(ndr, "data", r->in.data);
1372                 ndr->depth++;
1373                 ndr_print_ptr(ndr, "data", *r->in.data);
1374                 ndr->depth++;
1375                 if (*r->in.data) {
1376                         ndr_print_ptr(ndr, "data", **r->in.data);
1377                         ndr->depth++;
1378                         if (**r->in.data) {
1379                                 ndr_print_uint16(ndr, "data", ***r->in.data);
1380                         }
1381                         ndr->depth--;
1382                 }
1383                 ndr->depth--;
1384                 ndr->depth--;
1385                 ndr->depth--;
1386         }
1387         if (flags & NDR_OUT) {
1388                 ndr_print_struct(ndr, "out", "echo_TestDoublePointer");
1389                 ndr->depth++;
1390                 ndr_print_uint16(ndr, "result", r->out.result);
1391                 ndr->depth--;
1392         }
1393         ndr->depth--;
1394 }
1395 
1396 static const struct ndr_interface_call rpcecho_calls[] = {
1397         {
1398                 "echo_AddOne",
1399                 sizeof(struct echo_AddOne),
1400                 (ndr_push_flags_fn_t) ndr_push_echo_AddOne,
1401                 (ndr_pull_flags_fn_t) ndr_pull_echo_AddOne,
1402                 (ndr_print_function_t) ndr_print_echo_AddOne,
1403                 false,
1404         },
1405         {
1406                 "echo_EchoData",
1407                 sizeof(struct echo_EchoData),
1408                 (ndr_push_flags_fn_t) ndr_push_echo_EchoData,
1409                 (ndr_pull_flags_fn_t) ndr_pull_echo_EchoData,
1410                 (ndr_print_function_t) ndr_print_echo_EchoData,
1411                 false,
1412         },
1413         {
1414                 "echo_SinkData",
1415                 sizeof(struct echo_SinkData),
1416                 (ndr_push_flags_fn_t) ndr_push_echo_SinkData,
1417                 (ndr_pull_flags_fn_t) ndr_pull_echo_SinkData,
1418                 (ndr_print_function_t) ndr_print_echo_SinkData,
1419                 false,
1420         },
1421         {
1422                 "echo_SourceData",
1423                 sizeof(struct echo_SourceData),
1424                 (ndr_push_flags_fn_t) ndr_push_echo_SourceData,
1425                 (ndr_pull_flags_fn_t) ndr_pull_echo_SourceData,
1426                 (ndr_print_function_t) ndr_print_echo_SourceData,
1427                 false,
1428         },
1429         {
1430                 "echo_TestCall",
1431                 sizeof(struct echo_TestCall),
1432                 (ndr_push_flags_fn_t) ndr_push_echo_TestCall,
1433                 (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall,
1434                 (ndr_print_function_t) ndr_print_echo_TestCall,
1435                 false,
1436         },
1437         {
1438                 "echo_TestCall2",
1439                 sizeof(struct echo_TestCall2),
1440                 (ndr_push_flags_fn_t) ndr_push_echo_TestCall2,
1441                 (ndr_pull_flags_fn_t) ndr_pull_echo_TestCall2,
1442                 (ndr_print_function_t) ndr_print_echo_TestCall2,
1443                 false,
1444         },
1445         {
1446                 "echo_TestSleep",
1447                 sizeof(struct echo_TestSleep),
1448                 (ndr_push_flags_fn_t) ndr_push_echo_TestSleep,
1449                 (ndr_pull_flags_fn_t) ndr_pull_echo_TestSleep,
1450                 (ndr_print_function_t) ndr_print_echo_TestSleep,
1451                 false,
1452         },
1453         {
1454                 "echo_TestEnum",
1455                 sizeof(struct echo_TestEnum),
1456                 (ndr_push_flags_fn_t) ndr_push_echo_TestEnum,
1457                 (ndr_pull_flags_fn_t) ndr_pull_echo_TestEnum,
1458                 (ndr_print_function_t) ndr_print_echo_TestEnum,
1459                 false,
1460         },
1461         {
1462                 "echo_TestSurrounding",
1463                 sizeof(struct echo_TestSurrounding),
1464                 (ndr_push_flags_fn_t) ndr_push_echo_TestSurrounding,
1465                 (ndr_pull_flags_fn_t) ndr_pull_echo_TestSurrounding,
1466                 (ndr_print_function_t) ndr_print_echo_TestSurrounding,
1467                 false,
1468         },
1469         {
1470                 "echo_TestDoublePointer",
1471                 sizeof(struct echo_TestDoublePointer),
1472                 (ndr_push_flags_fn_t) ndr_push_echo_TestDoublePointer,
1473                 (ndr_pull_flags_fn_t) ndr_pull_echo_TestDoublePointer,
1474                 (ndr_print_function_t) ndr_print_echo_TestDoublePointer,
1475                 false,
1476         },
1477         { NULL, 0, NULL, NULL, NULL, false }
1478 };
1479 
1480 static const char * const rpcecho_endpoint_strings[] = {
1481         "ncacn_np:[\\pipe\\rpcecho]", 
1482         "ncacn_ip_tcp:", 
1483         "ncalrpc:", 
1484 };
1485 
1486 static const struct ndr_interface_string_array rpcecho_endpoints = {
1487         .count  = 3,
1488         .names  = rpcecho_endpoint_strings
1489 };
1490 
1491 static const char * const rpcecho_authservice_strings[] = {
1492         "host", 
1493 };
1494 
1495 static const struct ndr_interface_string_array rpcecho_authservices = {
1496         .count  = 1,
1497         .names  = rpcecho_authservice_strings
1498 };
1499 
1500 
1501 const struct ndr_interface_table ndr_table_rpcecho = {
1502         .name           = "rpcecho",
1503         .syntax_id      = {
1504                 {0x60a15ec5,0x4de8,0x11d7,{0xa6,0x37},{0x00,0x50,0x56,0xa2,0x01,0x82}},
1505                 NDR_RPCECHO_VERSION
1506         },
1507         .helpstring     = NDR_RPCECHO_HELPSTRING,
1508         .num_calls      = 10,
1509         .calls          = rpcecho_calls,
1510         .endpoints      = &rpcecho_endpoints,
1511         .authservices   = &rpcecho_authservices
1512 };
1513 

/* [<][>][^][v][top][bottom][index][help] */