LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_witness.c (source / functions) Hit Total Coverage
Test: coverage report for master 2b515b7d Lines: 653 1030 63.4 %
Date: 2024-02-28 12:06:22 Functions: 41 62 66.1 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/librpc/gen_ndr/ndr_witness.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_misc.h"
       7           0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_version(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum witness_version r)
       8             : {
       9             :         {
      10           0 :                 libndr_flags _flags_save_ENUM = ndr->flags;
      11           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      12           0 :                 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
      13           0 :                 ndr->flags = _flags_save_ENUM;
      14             :         }
      15           0 :         return NDR_ERR_SUCCESS;
      16             : }
      17             : 
      18           6 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_version(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum witness_version *r)
      19             : {
      20           6 :         uint32_t v;
      21             :         {
      22           6 :                 libndr_flags _flags_save_ENUM = ndr->flags;
      23           6 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      24           6 :                 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
      25           6 :                 *r = v;
      26           6 :                 ndr->flags = _flags_save_ENUM;
      27             :         }
      28           6 :         return NDR_ERR_SUCCESS;
      29             : }
      30             : 
      31           6 : _PUBLIC_ void ndr_print_witness_version(struct ndr_print *ndr, const char *name, enum witness_version r)
      32             : {
      33           6 :         const char *val = NULL;
      34             : 
      35             :         {
      36           6 :                 libndr_flags _flags_save_ENUM = ndr->flags;
      37           6 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      38           6 :                 switch (r) {
      39           2 :                         case WITNESS_V1: val = "WITNESS_V1"; break;
      40           0 :                         case WITNESS_V2: val = "WITNESS_V2"; break;
      41           4 :                         case WITNESS_UNSPECIFIED_VERSION: val = "WITNESS_UNSPECIFIED_VERSION"; break;
      42             :                 }
      43           6 :                 ndr_print_enum(ndr, name, "ENUM", val, r);
      44           6 :                 ndr->flags = _flags_save_ENUM;
      45             :         }
      46           6 : }
      47             : 
      48           0 : static enum ndr_err_code ndr_push_witness_interfaceInfo_state(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum witness_interfaceInfo_state r)
      49             : {
      50             :         {
      51           0 :                 libndr_flags _flags_save_ENUM = ndr->flags;
      52           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      53           0 :                 NDR_CHECK(ndr_push_enum_uint16(ndr, NDR_SCALARS, r));
      54           0 :                 ndr->flags = _flags_save_ENUM;
      55             :         }
      56           0 :         return NDR_ERR_SUCCESS;
      57             : }
      58             : 
      59           4 : static enum ndr_err_code ndr_pull_witness_interfaceInfo_state(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum witness_interfaceInfo_state *r)
      60             : {
      61           4 :         uint16_t v;
      62             :         {
      63           4 :                 libndr_flags _flags_save_ENUM = ndr->flags;
      64           4 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      65           4 :                 NDR_CHECK(ndr_pull_enum_uint16(ndr, NDR_SCALARS, &v));
      66           4 :                 *r = v;
      67           4 :                 ndr->flags = _flags_save_ENUM;
      68             :         }
      69           4 :         return NDR_ERR_SUCCESS;
      70             : }
      71             : 
      72           4 : _PUBLIC_ void ndr_print_witness_interfaceInfo_state(struct ndr_print *ndr, const char *name, enum witness_interfaceInfo_state r)
      73             : {
      74           4 :         const char *val = NULL;
      75             : 
      76             :         {
      77           4 :                 libndr_flags _flags_save_ENUM = ndr->flags;
      78           4 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      79           4 :                 switch (r) {
      80           0 :                         case WITNESS_STATE_UNKNOWN: val = "WITNESS_STATE_UNKNOWN"; break;
      81           4 :                         case WITNESS_STATE_AVAILABLE: val = "WITNESS_STATE_AVAILABLE"; break;
      82           0 :                         case WITNESS_STATE_UNAVAILABLE: val = "WITNESS_STATE_UNAVAILABLE"; break;
      83             :                 }
      84           4 :                 ndr_print_enum(ndr, name, "ENUM", val, r);
      85           4 :                 ndr->flags = _flags_save_ENUM;
      86             :         }
      87           4 : }
      88             : 
      89           0 : static enum ndr_err_code ndr_push_witness_interfaceInfo_flags(struct ndr_push *ndr, ndr_flags_type ndr_flags, uint32_t r)
      90             : {
      91           0 :         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
      92           0 :         return NDR_ERR_SUCCESS;
      93             : }
      94             : 
      95           4 : static enum ndr_err_code ndr_pull_witness_interfaceInfo_flags(struct ndr_pull *ndr, ndr_flags_type ndr_flags, uint32_t *r)
      96             : {
      97           4 :         uint32_t v;
      98           4 :         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
      99           4 :         *r = v;
     100           4 :         return NDR_ERR_SUCCESS;
     101             : }
     102             : 
     103           4 : _PUBLIC_ void ndr_print_witness_interfaceInfo_flags(struct ndr_print *ndr, const char *name, uint32_t r)
     104             : {
     105           4 :         ndr_print_uint32(ndr, name, r);
     106           4 :         ndr->depth++;
     107           4 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_INFO_IPv4_VALID", WITNESS_INFO_IPv4_VALID, r);
     108           4 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_INFO_IPv6_VALID", WITNESS_INFO_IPv6_VALID, r);
     109           4 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_INFO_WITNESS_IF", WITNESS_INFO_WITNESS_IF, r);
     110           4 :         ndr->depth--;
     111           4 : }
     112             : 
     113           0 : static enum ndr_err_code ndr_push_witness_interfaceInfo(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct witness_interfaceInfo *r)
     114             : {
     115           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     116           0 :         if (ndr_flags & NDR_SCALARS) {
     117           0 :                 NDR_CHECK(ndr_push_align(ndr, 4));
     118           0 :                 NDR_CHECK(ndr_push_charset_to_null(ndr, NDR_SCALARS, r->group_name, 260, sizeof(uint16_t), CH_UTF16));
     119           0 :                 NDR_CHECK(ndr_push_witness_version(ndr, NDR_SCALARS, r->version));
     120           0 :                 NDR_CHECK(ndr_push_witness_interfaceInfo_state(ndr, NDR_SCALARS, r->state));
     121             :                 {
     122           0 :                         libndr_flags _flags_save_ipv4address = ndr->flags;
     123           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     124           0 :                         NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipv4));
     125           0 :                         ndr->flags = _flags_save_ipv4address;
     126             :                 }
     127             :                 {
     128           0 :                         libndr_flags _flags_save_ipv6address = ndr->flags;
     129           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     130           0 :                         NDR_CHECK(ndr_push_ipv6address(ndr, NDR_SCALARS, r->ipv6));
     131           0 :                         ndr->flags = _flags_save_ipv6address;
     132             :                 }
     133           0 :                 NDR_CHECK(ndr_push_witness_interfaceInfo_flags(ndr, NDR_SCALARS, r->flags));
     134           0 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
     135             :         }
     136           0 :         if (ndr_flags & NDR_BUFFERS) {
     137           0 :         }
     138           0 :         return NDR_ERR_SUCCESS;
     139             : }
     140             : 
     141           4 : static enum ndr_err_code ndr_pull_witness_interfaceInfo(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct witness_interfaceInfo *r)
     142             : {
     143           4 :         uint32_t size_group_name_0 = 0;
     144           4 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     145           4 :         if (ndr_flags & NDR_SCALARS) {
     146           4 :                 NDR_CHECK(ndr_pull_align(ndr, 4));
     147           4 :                 size_group_name_0 = 260;
     148           4 :                 NDR_CHECK(ndr_pull_charset_to_null(ndr, NDR_SCALARS, &r->group_name, size_group_name_0, sizeof(uint16_t), CH_UTF16));
     149           4 :                 NDR_CHECK(ndr_pull_witness_version(ndr, NDR_SCALARS, &r->version));
     150           4 :                 NDR_CHECK(ndr_pull_witness_interfaceInfo_state(ndr, NDR_SCALARS, &r->state));
     151             :                 {
     152           4 :                         libndr_flags _flags_save_ipv4address = ndr->flags;
     153           4 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     154           4 :                         NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipv4));
     155           4 :                         ndr->flags = _flags_save_ipv4address;
     156             :                 }
     157             :                 {
     158           4 :                         libndr_flags _flags_save_ipv6address = ndr->flags;
     159           4 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     160           4 :                         NDR_CHECK(ndr_pull_ipv6address(ndr, NDR_SCALARS, &r->ipv6));
     161           4 :                         ndr->flags = _flags_save_ipv6address;
     162             :                 }
     163           8 :                 NDR_CHECK(ndr_pull_witness_interfaceInfo_flags(ndr, NDR_SCALARS, &r->flags));
     164           4 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
     165             :         }
     166           4 :         if (ndr_flags & NDR_BUFFERS) {
     167           4 :         }
     168           4 :         return NDR_ERR_SUCCESS;
     169             : }
     170             : 
     171           4 : _PUBLIC_ void ndr_print_witness_interfaceInfo(struct ndr_print *ndr, const char *name, const struct witness_interfaceInfo *r)
     172             : {
     173           4 :         ndr_print_struct(ndr, name, "witness_interfaceInfo");
     174           4 :         if (r == NULL) { ndr_print_null(ndr); return; }
     175           4 :         ndr->depth++;
     176           4 :         ndr_print_string(ndr, "group_name", r->group_name);
     177           4 :         ndr_print_witness_version(ndr, "version", r->version);
     178           4 :         ndr_print_witness_interfaceInfo_state(ndr, "state", r->state);
     179             :         {
     180           4 :                 libndr_flags _flags_save_ipv4address = ndr->flags;
     181           4 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     182           4 :                 ndr_print_ipv4address(ndr, "ipv4", r->ipv4);
     183           4 :                 ndr->flags = _flags_save_ipv4address;
     184             :         }
     185             :         {
     186           4 :                 libndr_flags _flags_save_ipv6address = ndr->flags;
     187           4 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     188           4 :                 ndr_print_ipv6address(ndr, "ipv6", r->ipv6);
     189           4 :                 ndr->flags = _flags_save_ipv6address;
     190             :         }
     191           4 :         ndr_print_witness_interfaceInfo_flags(ndr, "flags", r->flags);
     192           4 :         ndr->depth--;
     193             : }
     194             : 
     195           0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_interfaceList(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct witness_interfaceList *r)
     196             : {
     197           0 :         uint32_t cntr_interfaces_1;
     198           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     199           0 :         if (ndr_flags & NDR_SCALARS) {
     200           0 :                 NDR_CHECK(ndr_push_align(ndr, 5));
     201           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_interfaces));
     202           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->interfaces));
     203           0 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 5));
     204             :         }
     205           0 :         if (ndr_flags & NDR_BUFFERS) {
     206           0 :                 if (r->interfaces) {
     207           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->num_interfaces));
     208           0 :                         for (cntr_interfaces_1 = 0; cntr_interfaces_1 < (r->num_interfaces); cntr_interfaces_1++) {
     209           0 :                                 NDR_CHECK(ndr_push_witness_interfaceInfo(ndr, NDR_SCALARS, &r->interfaces[cntr_interfaces_1]));
     210             :                         }
     211             :                 }
     212             :         }
     213           0 :         return NDR_ERR_SUCCESS;
     214             : }
     215             : 
     216           2 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_interfaceList(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct witness_interfaceList *r)
     217             : {
     218           2 :         uint32_t _ptr_interfaces;
     219           2 :         uint32_t size_interfaces_1 = 0;
     220           2 :         uint32_t cntr_interfaces_1;
     221           2 :         TALLOC_CTX *_mem_save_interfaces_0 = NULL;
     222           2 :         TALLOC_CTX *_mem_save_interfaces_1 = NULL;
     223           2 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     224           2 :         if (ndr_flags & NDR_SCALARS) {
     225           2 :                 NDR_CHECK(ndr_pull_align(ndr, 5));
     226           2 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_interfaces));
     227           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_interfaces));
     228           2 :                 if (_ptr_interfaces) {
     229           2 :                         NDR_PULL_ALLOC(ndr, r->interfaces);
     230             :                 } else {
     231           0 :                         r->interfaces = NULL;
     232             :                 }
     233           2 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 5));
     234             :         }
     235           2 :         if (ndr_flags & NDR_BUFFERS) {
     236           2 :                 if (r->interfaces) {
     237           2 :                         _mem_save_interfaces_0 = NDR_PULL_GET_MEM_CTX(ndr);
     238           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->interfaces, 0);
     239           2 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->interfaces));
     240           2 :                         NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->interfaces, &size_interfaces_1));
     241           2 :                         NDR_PULL_ALLOC_N(ndr, r->interfaces, size_interfaces_1);
     242           2 :                         _mem_save_interfaces_1 = NDR_PULL_GET_MEM_CTX(ndr);
     243           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->interfaces, 0);
     244           6 :                         for (cntr_interfaces_1 = 0; cntr_interfaces_1 < (size_interfaces_1); cntr_interfaces_1++) {
     245           4 :                                 NDR_CHECK(ndr_pull_witness_interfaceInfo(ndr, NDR_SCALARS, &r->interfaces[cntr_interfaces_1]));
     246             :                         }
     247           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interfaces_1, 0);
     248           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interfaces_0, 0);
     249             :                 }
     250           2 :                 if (r->interfaces) {
     251           2 :                         NDR_CHECK(ndr_check_steal_array_size(ndr, (void*)&r->interfaces, r->num_interfaces));
     252             :                 }
     253             :         }
     254           0 :         return NDR_ERR_SUCCESS;
     255             : }
     256             : 
     257           0 : static void ndr_print_flags_witness_interfaceList(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct witness_interfaceList *r)
     258             : {
     259           0 :         ndr_print_witness_interfaceList(ndr, name, r);
     260           0 : }
     261             : 
     262           2 : _PUBLIC_ void ndr_print_witness_interfaceList(struct ndr_print *ndr, const char *name, const struct witness_interfaceList *r)
     263             : {
     264           2 :         uint32_t cntr_interfaces_1;
     265           2 :         ndr_print_struct(ndr, name, "witness_interfaceList");
     266           2 :         if (r == NULL) { ndr_print_null(ndr); return; }
     267           2 :         ndr->depth++;
     268           2 :         ndr_print_uint32(ndr, "num_interfaces", r->num_interfaces);
     269           2 :         ndr_print_ptr(ndr, "interfaces", r->interfaces);
     270           2 :         ndr->depth++;
     271           2 :         if (r->interfaces) {
     272           2 :                 ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "interfaces", (uint32_t)(r->num_interfaces));
     273           2 :                 ndr->depth++;
     274           6 :                 for (cntr_interfaces_1 = 0; cntr_interfaces_1 < (r->num_interfaces); cntr_interfaces_1++) {
     275           4 :                         ndr_print_witness_interfaceInfo(ndr, "interfaces", &r->interfaces[cntr_interfaces_1]);
     276             :                 }
     277           2 :                 ndr->depth--;
     278             :         }
     279           2 :         ndr->depth--;
     280           2 :         ndr->depth--;
     281             : }
     282             : 
     283          24 : _PUBLIC_ enum ndr_err_code ndr_push_witness_notifyResponse_type(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum witness_notifyResponse_type r)
     284             : {
     285          24 :         NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
     286           0 :         return NDR_ERR_SUCCESS;
     287             : }
     288             : 
     289          10 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_notifyResponse_type(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum witness_notifyResponse_type *r)
     290             : {
     291          10 :         uint32_t v;
     292          10 :         NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
     293          10 :         *r = v;
     294          10 :         return NDR_ERR_SUCCESS;
     295             : }
     296             : 
     297          10 : _PUBLIC_ void ndr_print_witness_notifyResponse_type(struct ndr_print *ndr, const char *name, enum witness_notifyResponse_type r)
     298             : {
     299          10 :         const char *val = NULL;
     300             : 
     301          10 :         switch (r) {
     302           4 :                 case WITNESS_NOTIFY_RESOURCE_CHANGE: val = "WITNESS_NOTIFY_RESOURCE_CHANGE"; break;
     303           6 :                 case WITNESS_NOTIFY_CLIENT_MOVE: val = "WITNESS_NOTIFY_CLIENT_MOVE"; break;
     304           0 :                 case WITNESS_NOTIFY_SHARE_MOVE: val = "WITNESS_NOTIFY_SHARE_MOVE"; break;
     305           0 :                 case WITNESS_NOTIFY_IP_CHANGE: val = "WITNESS_NOTIFY_IP_CHANGE"; break;
     306             :         }
     307          10 :         ndr_print_enum(ndr, name, "ENUM", val, r);
     308          10 : }
     309             : 
     310          10 : static enum ndr_err_code ndr_push_witness_ResourceChange_type(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum witness_ResourceChange_type r)
     311             : {
     312             :         {
     313          10 :                 libndr_flags _flags_save_ENUM = ndr->flags;
     314          10 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
     315          10 :                 NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
     316          10 :                 ndr->flags = _flags_save_ENUM;
     317             :         }
     318          10 :         return NDR_ERR_SUCCESS;
     319             : }
     320             : 
     321           4 : static enum ndr_err_code ndr_pull_witness_ResourceChange_type(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum witness_ResourceChange_type *r)
     322             : {
     323           4 :         uint32_t v;
     324             :         {
     325           4 :                 libndr_flags _flags_save_ENUM = ndr->flags;
     326           4 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
     327           4 :                 NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
     328           4 :                 *r = v;
     329           4 :                 ndr->flags = _flags_save_ENUM;
     330             :         }
     331           4 :         return NDR_ERR_SUCCESS;
     332             : }
     333             : 
     334           4 : _PUBLIC_ void ndr_print_witness_ResourceChange_type(struct ndr_print *ndr, const char *name, enum witness_ResourceChange_type r)
     335             : {
     336           4 :         const char *val = NULL;
     337             : 
     338             :         {
     339           4 :                 libndr_flags _flags_save_ENUM = ndr->flags;
     340           4 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
     341           4 :                 switch (r) {
     342           0 :                         case WITNESS_RESOURCE_STATE_UNKNOWN: val = "WITNESS_RESOURCE_STATE_UNKNOWN"; break;
     343           0 :                         case WITNESS_RESOURCE_STATE_AVAILABLE: val = "WITNESS_RESOURCE_STATE_AVAILABLE"; break;
     344           4 :                         case WITNESS_RESOURCE_STATE_UNAVAILABLE: val = "WITNESS_RESOURCE_STATE_UNAVAILABLE"; break;
     345             :                 }
     346           4 :                 ndr_print_enum(ndr, name, "ENUM", val, r);
     347           4 :                 ndr->flags = _flags_save_ENUM;
     348             :         }
     349           4 : }
     350             : 
     351          10 : _PUBLIC_ enum ndr_err_code ndr_push_witness_ResourceChange(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct witness_ResourceChange *r)
     352             : {
     353             :         {
     354          10 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     355          10 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     356          10 :                 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     357          10 :                 if (ndr_flags & NDR_SCALARS) {
     358          10 :                         NDR_CHECK(ndr_push_align(ndr, 4));
     359          10 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_witness_ResourceChange(r, ndr->flags)));
     360          10 :                         NDR_CHECK(ndr_push_witness_ResourceChange_type(ndr, NDR_SCALARS, r->type));
     361             :                         {
     362          10 :                                 libndr_flags _flags_save_string = ndr->flags;
     363          10 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
     364          10 :                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name));
     365          10 :                                 ndr->flags = _flags_save_string;
     366             :                         }
     367          10 :                         NDR_CHECK(ndr_push_trailer_align(ndr, 4));
     368             :                 }
     369          10 :                 if (ndr_flags & NDR_BUFFERS) {
     370          10 :                 }
     371          10 :                 ndr->flags = _flags_save_STRUCT;
     372             :         }
     373          10 :         return NDR_ERR_SUCCESS;
     374             : }
     375             : 
     376           4 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_ResourceChange(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct witness_ResourceChange *r)
     377             : {
     378             :         {
     379           4 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     380           4 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     381           4 :                 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     382           4 :                 if (ndr_flags & NDR_SCALARS) {
     383           4 :                         NDR_CHECK(ndr_pull_align(ndr, 4));
     384           4 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
     385           4 :                         NDR_CHECK(ndr_pull_witness_ResourceChange_type(ndr, NDR_SCALARS, &r->type));
     386             :                         {
     387           4 :                                 libndr_flags _flags_save_string = ndr->flags;
     388           4 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
     389           4 :                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name));
     390           4 :                                 ndr->flags = _flags_save_string;
     391             :                         }
     392           4 :                         NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
     393             :                 }
     394           4 :                 if (ndr_flags & NDR_BUFFERS) {
     395           4 :                 }
     396           4 :                 ndr->flags = _flags_save_STRUCT;
     397             :         }
     398           4 :         return NDR_ERR_SUCCESS;
     399             : }
     400             : 
     401           0 : static void ndr_print_flags_witness_ResourceChange(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct witness_ResourceChange *r)
     402             : {
     403           0 :         ndr_print_witness_ResourceChange(ndr, name, r);
     404           0 : }
     405             : 
     406           4 : _PUBLIC_ void ndr_print_witness_ResourceChange(struct ndr_print *ndr, const char *name, const struct witness_ResourceChange *r)
     407             : {
     408           4 :         ndr_print_struct(ndr, name, "witness_ResourceChange");
     409           4 :         if (r == NULL) { ndr_print_null(ndr); return; }
     410             :         {
     411           4 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     412           4 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     413           4 :                 ndr->depth++;
     414           4 :                 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_witness_ResourceChange(r, ndr->flags):r->length);
     415           4 :                 ndr_print_witness_ResourceChange_type(ndr, "type", r->type);
     416             :                 {
     417           4 :                         libndr_flags _flags_save_string = ndr->flags;
     418           4 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
     419           4 :                         ndr_print_string(ndr, "name", r->name);
     420           4 :                         ndr->flags = _flags_save_string;
     421             :                 }
     422           4 :                 ndr->depth--;
     423           4 :                 ndr->flags = _flags_save_STRUCT;
     424             :         }
     425             : }
     426             : 
     427          10 : _PUBLIC_ size_t ndr_size_witness_ResourceChange(const struct witness_ResourceChange *r, libndr_flags flags)
     428             : {
     429          10 :         flags |= LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN;
     430          10 :         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_witness_ResourceChange);
     431             : }
     432             : 
     433          10 : static enum ndr_err_code ndr_push_witness_IPaddrInfo_flags(struct ndr_push *ndr, ndr_flags_type ndr_flags, uint32_t r)
     434             : {
     435          10 :         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
     436           0 :         return NDR_ERR_SUCCESS;
     437             : }
     438             : 
     439           2 : static enum ndr_err_code ndr_pull_witness_IPaddrInfo_flags(struct ndr_pull *ndr, ndr_flags_type ndr_flags, uint32_t *r)
     440             : {
     441           2 :         uint32_t v;
     442           2 :         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
     443           2 :         *r = v;
     444           2 :         return NDR_ERR_SUCCESS;
     445             : }
     446             : 
     447           2 : _PUBLIC_ void ndr_print_witness_IPaddrInfo_flags(struct ndr_print *ndr, const char *name, uint32_t r)
     448             : {
     449           2 :         ndr_print_uint32(ndr, name, r);
     450           2 :         ndr->depth++;
     451           2 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_IPADDR_V4", WITNESS_IPADDR_V4, r);
     452           2 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_IPADDR_V6", WITNESS_IPADDR_V6, r);
     453           2 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_IPADDR_ONLINE", WITNESS_IPADDR_ONLINE, r);
     454           2 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_IPADDR_OFFLINE", WITNESS_IPADDR_OFFLINE, r);
     455           2 :         ndr->depth--;
     456           2 : }
     457             : 
     458          10 : static enum ndr_err_code ndr_push_witness_IPaddrInfo(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct witness_IPaddrInfo *r)
     459             : {
     460             :         {
     461          10 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     462          10 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     463          10 :                 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     464          10 :                 if (ndr_flags & NDR_SCALARS) {
     465          10 :                         NDR_CHECK(ndr_push_align(ndr, 4));
     466          20 :                         NDR_CHECK(ndr_push_witness_IPaddrInfo_flags(ndr, NDR_SCALARS, r->flags));
     467             :                         {
     468          10 :                                 libndr_flags _flags_save_ipv4address = ndr->flags;
     469          10 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     470          10 :                                 NDR_CHECK(ndr_push_ipv4address(ndr, NDR_SCALARS, r->ipv4));
     471          10 :                                 ndr->flags = _flags_save_ipv4address;
     472             :                         }
     473             :                         {
     474          10 :                                 libndr_flags _flags_save_ipv6address = ndr->flags;
     475          10 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     476          10 :                                 NDR_CHECK(ndr_push_ipv6address(ndr, NDR_SCALARS, r->ipv6));
     477          10 :                                 ndr->flags = _flags_save_ipv6address;
     478             :                         }
     479          10 :                         NDR_CHECK(ndr_push_trailer_align(ndr, 4));
     480             :                 }
     481          10 :                 if (ndr_flags & NDR_BUFFERS) {
     482          10 :                 }
     483          10 :                 ndr->flags = _flags_save_STRUCT;
     484             :         }
     485          10 :         return NDR_ERR_SUCCESS;
     486             : }
     487             : 
     488           2 : static enum ndr_err_code ndr_pull_witness_IPaddrInfo(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct witness_IPaddrInfo *r)
     489             : {
     490             :         {
     491           2 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     492           2 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     493           2 :                 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     494           2 :                 if (ndr_flags & NDR_SCALARS) {
     495           2 :                         NDR_CHECK(ndr_pull_align(ndr, 4));
     496           4 :                         NDR_CHECK(ndr_pull_witness_IPaddrInfo_flags(ndr, NDR_SCALARS, &r->flags));
     497             :                         {
     498           2 :                                 libndr_flags _flags_save_ipv4address = ndr->flags;
     499           2 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     500           2 :                                 NDR_CHECK(ndr_pull_ipv4address(ndr, NDR_SCALARS, &r->ipv4));
     501           2 :                                 ndr->flags = _flags_save_ipv4address;
     502             :                         }
     503             :                         {
     504           2 :                                 libndr_flags _flags_save_ipv6address = ndr->flags;
     505           2 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     506           2 :                                 NDR_CHECK(ndr_pull_ipv6address(ndr, NDR_SCALARS, &r->ipv6));
     507           2 :                                 ndr->flags = _flags_save_ipv6address;
     508             :                         }
     509           2 :                         NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
     510             :                 }
     511           2 :                 if (ndr_flags & NDR_BUFFERS) {
     512           2 :                 }
     513           2 :                 ndr->flags = _flags_save_STRUCT;
     514             :         }
     515           2 :         return NDR_ERR_SUCCESS;
     516             : }
     517             : 
     518           2 : _PUBLIC_ void ndr_print_witness_IPaddrInfo(struct ndr_print *ndr, const char *name, const struct witness_IPaddrInfo *r)
     519             : {
     520           2 :         ndr_print_struct(ndr, name, "witness_IPaddrInfo");
     521           2 :         if (r == NULL) { ndr_print_null(ndr); return; }
     522             :         {
     523           2 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     524           2 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     525           2 :                 ndr->depth++;
     526           2 :                 ndr_print_witness_IPaddrInfo_flags(ndr, "flags", r->flags);
     527             :                 {
     528           2 :                         libndr_flags _flags_save_ipv4address = ndr->flags;
     529           2 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     530           2 :                         ndr_print_ipv4address(ndr, "ipv4", r->ipv4);
     531           2 :                         ndr->flags = _flags_save_ipv4address;
     532             :                 }
     533             :                 {
     534           2 :                         libndr_flags _flags_save_ipv6address = ndr->flags;
     535           2 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_BIGENDIAN);
     536           2 :                         ndr_print_ipv6address(ndr, "ipv6", r->ipv6);
     537           2 :                         ndr->flags = _flags_save_ipv6address;
     538             :                 }
     539           2 :                 ndr->depth--;
     540           2 :                 ndr->flags = _flags_save_STRUCT;
     541             :         }
     542             : }
     543             : 
     544          20 : _PUBLIC_ enum ndr_err_code ndr_push_witness_IPaddrInfoList(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct witness_IPaddrInfoList *r)
     545             : {
     546          20 :         uint32_t cntr_addr_0;
     547             :         {
     548          20 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     549          20 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     550          20 :                 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     551          20 :                 if (ndr_flags & NDR_SCALARS) {
     552          20 :                         NDR_CHECK(ndr_push_align(ndr, 4));
     553          20 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_witness_IPaddrInfoList(r, ndr->flags)));
     554          20 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
     555          20 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num));
     556          30 :                         for (cntr_addr_0 = 0; cntr_addr_0 < (r->num); cntr_addr_0++) {
     557          10 :                                 NDR_CHECK(ndr_push_witness_IPaddrInfo(ndr, NDR_SCALARS, &r->addr[cntr_addr_0]));
     558             :                         }
     559          20 :                         NDR_CHECK(ndr_push_trailer_align(ndr, 4));
     560             :                 }
     561          20 :                 if (ndr_flags & NDR_BUFFERS) {
     562          20 :                 }
     563          20 :                 ndr->flags = _flags_save_STRUCT;
     564             :         }
     565          20 :         return NDR_ERR_SUCCESS;
     566             : }
     567             : 
     568           6 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_IPaddrInfoList(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct witness_IPaddrInfoList *r)
     569             : {
     570           6 :         uint32_t size_addr_0 = 0;
     571           6 :         uint32_t cntr_addr_0;
     572           6 :         TALLOC_CTX *_mem_save_addr_0 = NULL;
     573             :         {
     574           6 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     575           6 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     576           6 :                 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     577           6 :                 if (ndr_flags & NDR_SCALARS) {
     578           6 :                         NDR_CHECK(ndr_pull_align(ndr, 4));
     579           6 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->length));
     580           6 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved));
     581           6 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num));
     582           6 :                         size_addr_0 = r->num;
     583           6 :                         NDR_PULL_ALLOC_N(ndr, r->addr, size_addr_0);
     584           6 :                         _mem_save_addr_0 = NDR_PULL_GET_MEM_CTX(ndr);
     585           6 :                         NDR_PULL_SET_MEM_CTX(ndr, r->addr, 0);
     586           8 :                         for (cntr_addr_0 = 0; cntr_addr_0 < (size_addr_0); cntr_addr_0++) {
     587           2 :                                 NDR_CHECK(ndr_pull_witness_IPaddrInfo(ndr, NDR_SCALARS, &r->addr[cntr_addr_0]));
     588             :                         }
     589           6 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_addr_0, 0);
     590           6 :                         NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
     591             :                 }
     592           6 :                 if (ndr_flags & NDR_BUFFERS) {
     593           6 :                 }
     594           6 :                 ndr->flags = _flags_save_STRUCT;
     595             :         }
     596           6 :         return NDR_ERR_SUCCESS;
     597             : }
     598             : 
     599           0 : static void ndr_print_flags_witness_IPaddrInfoList(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct witness_IPaddrInfoList *r)
     600             : {
     601           0 :         ndr_print_witness_IPaddrInfoList(ndr, name, r);
     602           0 : }
     603             : 
     604           6 : _PUBLIC_ void ndr_print_witness_IPaddrInfoList(struct ndr_print *ndr, const char *name, const struct witness_IPaddrInfoList *r)
     605             : {
     606           6 :         uint32_t cntr_addr_0;
     607           6 :         ndr_print_struct(ndr, name, "witness_IPaddrInfoList");
     608           6 :         if (r == NULL) { ndr_print_null(ndr); return; }
     609             :         {
     610           6 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     611           6 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     612           6 :                 ndr->depth++;
     613           6 :                 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_witness_IPaddrInfoList(r, ndr->flags):r->length);
     614           6 :                 ndr_print_uint32(ndr, "reserved", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->reserved);
     615           6 :                 ndr_print_uint32(ndr, "num", r->num);
     616           6 :                 ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "addr", (uint32_t)(r->num));
     617           6 :                 ndr->depth++;
     618           8 :                 for (cntr_addr_0 = 0; cntr_addr_0 < (r->num); cntr_addr_0++) {
     619           2 :                         ndr_print_witness_IPaddrInfo(ndr, "addr", &r->addr[cntr_addr_0]);
     620             :                 }
     621           6 :                 ndr->depth--;
     622           6 :                 ndr->depth--;
     623           6 :                 ndr->flags = _flags_save_STRUCT;
     624             :         }
     625             : }
     626             : 
     627          20 : _PUBLIC_ size_t ndr_size_witness_IPaddrInfoList(const struct witness_IPaddrInfoList *r, libndr_flags flags)
     628             : {
     629          20 :         flags |= LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN;
     630          20 :         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_witness_IPaddrInfoList);
     631             : }
     632             : 
     633          24 : _PUBLIC_ enum ndr_err_code ndr_push_witness_notifyResponse_message(struct ndr_push *ndr, ndr_flags_type ndr_flags, const union witness_notifyResponse_message *r)
     634             : {
     635          24 :         uint32_t level;
     636             :         {
     637          24 :                 libndr_flags _flags_save_UNION = ndr->flags;
     638          24 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     639          24 :                 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     640          24 :                 if (ndr_flags & NDR_SCALARS) {
     641             :                         /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     642          24 :                         NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     643          24 :                         NDR_CHECK(ndr_push_union_align(ndr, 4));
     644          24 :                         switch (level) {
     645           8 :                                 case WITNESS_NOTIFY_RESOURCE_CHANGE: {
     646           8 :                                         NDR_CHECK(ndr_push_witness_ResourceChange(ndr, NDR_SCALARS, &r->resource_change));
     647           0 :                                 break; }
     648             : 
     649          16 :                                 case WITNESS_NOTIFY_CLIENT_MOVE: {
     650          16 :                                         NDR_CHECK(ndr_push_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->client_move));
     651           0 :                                 break; }
     652             : 
     653           0 :                                 case WITNESS_NOTIFY_SHARE_MOVE: {
     654           0 :                                         NDR_CHECK(ndr_push_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->share_move));
     655           0 :                                 break; }
     656             : 
     657           0 :                                 case WITNESS_NOTIFY_IP_CHANGE: {
     658           0 :                                         NDR_CHECK(ndr_push_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->ip_change));
     659           0 :                                 break; }
     660             : 
     661           0 :                                 default: {
     662             :                                         {
     663           0 :                                                 libndr_flags _flags_save_DATA_BLOB = ndr->flags;
     664           0 :                                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     665           0 :                                                 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->data));
     666           0 :                                                 ndr->flags = _flags_save_DATA_BLOB;
     667             :                                         }
     668           0 :                                 break; }
     669             : 
     670             :                         }
     671             :                 }
     672          24 :                 ndr->flags = _flags_save_UNION;
     673             :         }
     674          24 :         return NDR_ERR_SUCCESS;
     675             : }
     676             : 
     677          10 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_notifyResponse_message(struct ndr_pull *ndr, ndr_flags_type ndr_flags, union witness_notifyResponse_message *r)
     678             : {
     679          10 :         uint32_t level;
     680             :         {
     681          10 :                 libndr_flags _flags_save_UNION = ndr->flags;
     682          10 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     683          10 :                 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     684          10 :                 if (ndr_flags & NDR_SCALARS) {
     685             :                         /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     686          10 :                         NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     687          10 :                         NDR_CHECK(ndr_pull_union_align(ndr, 4));
     688          10 :                         switch (level) {
     689           4 :                                 case WITNESS_NOTIFY_RESOURCE_CHANGE: {
     690           4 :                                         NDR_CHECK(ndr_pull_witness_ResourceChange(ndr, NDR_SCALARS, &r->resource_change));
     691           0 :                                 break; }
     692             : 
     693           6 :                                 case WITNESS_NOTIFY_CLIENT_MOVE: {
     694           6 :                                         NDR_CHECK(ndr_pull_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->client_move));
     695           0 :                                 break; }
     696             : 
     697           0 :                                 case WITNESS_NOTIFY_SHARE_MOVE: {
     698           0 :                                         NDR_CHECK(ndr_pull_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->share_move));
     699           0 :                                 break; }
     700             : 
     701           0 :                                 case WITNESS_NOTIFY_IP_CHANGE: {
     702           0 :                                         NDR_CHECK(ndr_pull_witness_IPaddrInfoList(ndr, NDR_SCALARS, &r->ip_change));
     703           0 :                                 break; }
     704             : 
     705           0 :                                 default: {
     706             :                                         {
     707           0 :                                                 libndr_flags _flags_save_DATA_BLOB = ndr->flags;
     708           0 :                                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     709           0 :                                                 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->data));
     710           0 :                                                 ndr->flags = _flags_save_DATA_BLOB;
     711             :                                         }
     712           0 :                                 break; }
     713             : 
     714             :                         }
     715             :                 }
     716          10 :                 ndr->flags = _flags_save_UNION;
     717             :         }
     718          10 :         return NDR_ERR_SUCCESS;
     719             : }
     720             : 
     721          10 : _PUBLIC_ void ndr_print_witness_notifyResponse_message(struct ndr_print *ndr, const char *name, const union witness_notifyResponse_message *r)
     722             : {
     723          10 :         uint32_t level;
     724             :         {
     725          10 :                 libndr_flags _flags_save_UNION = ndr->flags;
     726          10 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_LITTLE_ENDIAN);
     727          10 :                 level = ndr_print_steal_switch_value(ndr, r);
     728          10 :                 ndr_print_union(ndr, name, level, "witness_notifyResponse_message");
     729          10 :                 switch (level) {
     730           4 :                         case WITNESS_NOTIFY_RESOURCE_CHANGE:
     731           4 :                                 ndr_print_witness_ResourceChange(ndr, "resource_change", &r->resource_change);
     732           4 :                         break;
     733             : 
     734           6 :                         case WITNESS_NOTIFY_CLIENT_MOVE:
     735           6 :                                 ndr_print_witness_IPaddrInfoList(ndr, "client_move", &r->client_move);
     736           6 :                         break;
     737             : 
     738           0 :                         case WITNESS_NOTIFY_SHARE_MOVE:
     739           0 :                                 ndr_print_witness_IPaddrInfoList(ndr, "share_move", &r->share_move);
     740           0 :                         break;
     741             : 
     742           0 :                         case WITNESS_NOTIFY_IP_CHANGE:
     743           0 :                                 ndr_print_witness_IPaddrInfoList(ndr, "ip_change", &r->ip_change);
     744           0 :                         break;
     745             : 
     746           0 :                         default:
     747             :                                 {
     748           0 :                                         libndr_flags _flags_save_DATA_BLOB = ndr->flags;
     749           0 :                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     750           0 :                                         ndr_print_DATA_BLOB(ndr, "data", r->data);
     751           0 :                                         ndr->flags = _flags_save_DATA_BLOB;
     752             :                                 }
     753           0 :                         break;
     754             : 
     755             :                 }
     756          10 :                 ndr->flags = _flags_save_UNION;
     757             :         }
     758          10 : }
     759             : 
     760           0 : static void ndr_print_flags_witness_notifyResponse(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct witness_notifyResponse *r)
     761             : {
     762           0 :         ndr_print_witness_notifyResponse(ndr, name, r);
     763           0 : }
     764             : 
     765          10 : _PUBLIC_ void ndr_print_witness_notifyResponse(struct ndr_print *ndr, const char *name, const struct witness_notifyResponse *r)
     766             : {
     767          10 :         uint32_t cntr_messages_1;
     768          10 :         ndr_print_struct(ndr, name, "witness_notifyResponse");
     769          10 :         if (r == NULL) { ndr_print_null(ndr); return; }
     770             :         {
     771          10 :                 libndr_flags _flags_save_STRUCT = ndr->flags;
     772          10 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
     773          10 :                 ndr->depth++;
     774          10 :                 ndr_print_witness_notifyResponse_type(ndr, "type", r->type);
     775          10 :                 ndr_print_uint32(ndr, "length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_witness_notifyResponse(r, ndr->flags) - 20:r->length);
     776          10 :                 ndr_print_uint32(ndr, "num", r->num);
     777             :                 {
     778          10 :                         libndr_flags _flags_save_witness_notifyResponse_message = ndr->flags;
     779          10 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     780          10 :                         ndr_print_ptr(ndr, "messages", r->messages);
     781          10 :                         ndr->depth++;
     782          10 :                         if (r->messages) {
     783          10 :                                 ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "messages", (uint32_t)(r->num));
     784          10 :                                 ndr->depth++;
     785          20 :                                 for (cntr_messages_1 = 0; cntr_messages_1 < (r->num); cntr_messages_1++) {
     786          10 :                                         ndr_print_set_switch_value(ndr, &r->messages[cntr_messages_1], r->type);
     787          10 :                                         ndr_print_witness_notifyResponse_message(ndr, "messages", &r->messages[cntr_messages_1]);
     788             :                                 }
     789          10 :                                 ndr->depth--;
     790             :                         }
     791          10 :                         ndr->depth--;
     792          10 :                         ndr->flags = _flags_save_witness_notifyResponse_message;
     793             :                 }
     794          10 :                 ndr->depth--;
     795          10 :                 ndr->flags = _flags_save_STRUCT;
     796             :         }
     797             : }
     798             : 
     799          72 : _PUBLIC_ size_t ndr_size_witness_notifyResponse(const struct witness_notifyResponse *r, libndr_flags flags)
     800             : {
     801          72 :         flags |= LIBNDR_PRINT_ARRAY_HEX;
     802          72 :         return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_witness_notifyResponse);
     803             : }
     804             : 
     805           0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_RegisterEx_flags(struct ndr_push *ndr, ndr_flags_type ndr_flags, uint32_t r)
     806             : {
     807           0 :         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r));
     808           0 :         return NDR_ERR_SUCCESS;
     809             : }
     810             : 
     811           0 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_RegisterEx_flags(struct ndr_pull *ndr, ndr_flags_type ndr_flags, uint32_t *r)
     812             : {
     813           0 :         uint32_t v;
     814           0 :         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v));
     815           0 :         *r = v;
     816           0 :         return NDR_ERR_SUCCESS;
     817             : }
     818             : 
     819           0 : _PUBLIC_ void ndr_print_witness_RegisterEx_flags(struct ndr_print *ndr, const char *name, uint32_t r)
     820             : {
     821           0 :         ndr_print_uint32(ndr, name, r);
     822           0 :         ndr->depth++;
     823           0 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_REGISTER_NONE", WITNESS_REGISTER_NONE, r);
     824           0 :         ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "WITNESS_REGISTER_IP_NOTIFICATION", WITNESS_REGISTER_IP_NOTIFICATION, r);
     825           0 :         ndr->depth--;
     826           0 : }
     827             : 
     828           0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_GetInterfaceList(struct ndr_push *ndr, ndr_flags_type flags, const struct witness_GetInterfaceList *r)
     829             : {
     830           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
     831           0 :         if (flags & NDR_IN) {
     832           0 :         }
     833           0 :         if (flags & NDR_OUT) {
     834           0 :                 if (r->out.interface_list == NULL) {
     835           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     836             :                 }
     837           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.interface_list));
     838           0 :                 if (*r->out.interface_list) {
     839           0 :                         NDR_CHECK(ndr_push_witness_interfaceList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.interface_list));
     840             :                 }
     841           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
     842             :         }
     843           0 :         return NDR_ERR_SUCCESS;
     844             : }
     845             : 
     846           2 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_GetInterfaceList(struct ndr_pull *ndr, ndr_flags_type flags, struct witness_GetInterfaceList *r)
     847             : {
     848           2 :         uint32_t _ptr_interface_list;
     849           2 :         TALLOC_CTX *_mem_save_interface_list_0 = NULL;
     850           2 :         TALLOC_CTX *_mem_save_interface_list_1 = NULL;
     851           2 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
     852           2 :         if (flags & NDR_IN) {
     853           0 :                 NDR_ZERO_STRUCT(r->out);
     854             : 
     855           0 :                 NDR_PULL_ALLOC(ndr, r->out.interface_list);
     856           0 :                 NDR_ZERO_STRUCTP(r->out.interface_list);
     857             :         }
     858           2 :         if (flags & NDR_OUT) {
     859             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
     860             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
     861           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
     862           2 :                         NDR_PULL_ALLOC(ndr, r->out.interface_list);
     863             :                 }
     864           2 :                 _mem_save_interface_list_0 = NDR_PULL_GET_MEM_CTX(ndr);
     865           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.interface_list, LIBNDR_FLAG_REF_ALLOC);
     866           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_interface_list));
     867           2 :                 if (_ptr_interface_list) {
     868           2 :                         NDR_PULL_ALLOC(ndr, *r->out.interface_list);
     869             :                 } else {
     870           0 :                         *r->out.interface_list = NULL;
     871             :                 }
     872           2 :                 if (*r->out.interface_list) {
     873           2 :                         _mem_save_interface_list_1 = NDR_PULL_GET_MEM_CTX(ndr);
     874           2 :                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.interface_list, 0);
     875           2 :                         NDR_CHECK(ndr_pull_witness_interfaceList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.interface_list));
     876           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interface_list_1, 0);
     877             :                 }
     878           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_interface_list_0, LIBNDR_FLAG_REF_ALLOC);
     879           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
     880             :         }
     881           0 :         return NDR_ERR_SUCCESS;
     882             : }
     883             : 
     884           2 : _PUBLIC_ void ndr_print_witness_GetInterfaceList(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct witness_GetInterfaceList *r)
     885             : {
     886           2 :         ndr_print_struct(ndr, name, "witness_GetInterfaceList");
     887           2 :         if (r == NULL) { ndr_print_null(ndr); return; }
     888           2 :         ndr->depth++;
     889           2 :         if (flags & NDR_SET_VALUES) {
     890           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
     891             :         }
     892           2 :         if (flags & NDR_IN) {
     893           0 :                 ndr_print_struct(ndr, "in", "witness_GetInterfaceList");
     894           0 :                 ndr->depth++;
     895           0 :                 ndr->depth--;
     896             :         }
     897           2 :         if (flags & NDR_OUT) {
     898           2 :                 ndr_print_struct(ndr, "out", "witness_GetInterfaceList");
     899           2 :                 ndr->depth++;
     900           2 :                 ndr_print_ptr(ndr, "interface_list", r->out.interface_list);
     901           2 :                 ndr->depth++;
     902           2 :                 ndr_print_ptr(ndr, "interface_list", *r->out.interface_list);
     903           2 :                 ndr->depth++;
     904           2 :                 if (*r->out.interface_list) {
     905           2 :                         ndr_print_witness_interfaceList(ndr, "interface_list", *r->out.interface_list);
     906             :                 }
     907           2 :                 ndr->depth--;
     908           2 :                 ndr->depth--;
     909           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
     910           2 :                 ndr->depth--;
     911             :         }
     912           2 :         ndr->depth--;
     913             : }
     914             : 
     915           0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_Register(struct ndr_push *ndr, ndr_flags_type flags, const struct witness_Register *r)
     916             : {
     917           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
     918           0 :         if (flags & NDR_IN) {
     919           0 :                 NDR_CHECK(ndr_push_witness_version(ndr, NDR_SCALARS, r->in.version));
     920           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.net_name));
     921           0 :                 if (r->in.net_name) {
     922           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.net_name, CH_UTF16)));
     923           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
     924           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.net_name, CH_UTF16)));
     925           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.net_name, ndr_charset_length(r->in.net_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
     926             :                 }
     927           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ip_address));
     928           0 :                 if (r->in.ip_address) {
     929           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ip_address, CH_UTF16)));
     930           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
     931           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ip_address, CH_UTF16)));
     932           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ip_address, ndr_charset_length(r->in.ip_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
     933             :                 }
     934           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client_computer_name));
     935           0 :                 if (r->in.client_computer_name) {
     936           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_computer_name, CH_UTF16)));
     937           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
     938           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_computer_name, CH_UTF16)));
     939           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client_computer_name, ndr_charset_length(r->in.client_computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
     940             :                 }
     941             :         }
     942           0 :         if (flags & NDR_OUT) {
     943           0 :                 if (r->out.context_handle == NULL) {
     944           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
     945             :                 }
     946           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.context_handle));
     947           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
     948             :         }
     949           0 :         return NDR_ERR_SUCCESS;
     950             : }
     951             : 
     952           4 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_Register(struct ndr_pull *ndr, ndr_flags_type flags, struct witness_Register *r)
     953             : {
     954           4 :         uint32_t _ptr_net_name;
     955           4 :         uint32_t size_net_name_1 = 0;
     956           4 :         uint32_t length_net_name_1 = 0;
     957           4 :         uint32_t _ptr_ip_address;
     958           4 :         uint32_t size_ip_address_1 = 0;
     959           4 :         uint32_t length_ip_address_1 = 0;
     960           4 :         uint32_t _ptr_client_computer_name;
     961           4 :         uint32_t size_client_computer_name_1 = 0;
     962           4 :         uint32_t length_client_computer_name_1 = 0;
     963           4 :         TALLOC_CTX *_mem_save_context_handle_0 = NULL;
     964           4 :         TALLOC_CTX *_mem_save_net_name_0 = NULL;
     965           4 :         TALLOC_CTX *_mem_save_ip_address_0 = NULL;
     966           4 :         TALLOC_CTX *_mem_save_client_computer_name_0 = NULL;
     967           4 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
     968           4 :         if (flags & NDR_IN) {
     969           2 :                 NDR_ZERO_STRUCT(r->out);
     970             : 
     971           2 :                 NDR_CHECK(ndr_pull_witness_version(ndr, NDR_SCALARS, &r->in.version));
     972           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_name));
     973           2 :                 if (_ptr_net_name) {
     974           2 :                         NDR_PULL_ALLOC(ndr, r->in.net_name);
     975             :                 } else {
     976           0 :                         r->in.net_name = NULL;
     977             :                 }
     978           2 :                 if (r->in.net_name) {
     979           2 :                         _mem_save_net_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
     980           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.net_name, 0);
     981           2 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.net_name));
     982           2 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.net_name));
     983           2 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.net_name, &size_net_name_1));
     984           2 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.net_name, &length_net_name_1));
     985           2 :                         if (length_net_name_1 > size_net_name_1) {
     986           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_net_name_1, length_net_name_1);
     987             :                         }
     988           2 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_net_name_1, sizeof(uint16_t)));
     989           2 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.net_name, length_net_name_1, sizeof(uint16_t), CH_UTF16));
     990           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_name_0, 0);
     991             :                 }
     992           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ip_address));
     993           2 :                 if (_ptr_ip_address) {
     994           2 :                         NDR_PULL_ALLOC(ndr, r->in.ip_address);
     995             :                 } else {
     996           0 :                         r->in.ip_address = NULL;
     997             :                 }
     998           2 :                 if (r->in.ip_address) {
     999           2 :                         _mem_save_ip_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1000           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.ip_address, 0);
    1001           2 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ip_address));
    1002           2 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ip_address));
    1003           2 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.ip_address, &size_ip_address_1));
    1004           2 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.ip_address, &length_ip_address_1));
    1005           2 :                         if (length_ip_address_1 > size_ip_address_1) {
    1006           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_ip_address_1, length_ip_address_1);
    1007             :                         }
    1008           2 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_ip_address_1, sizeof(uint16_t)));
    1009           2 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ip_address, length_ip_address_1, sizeof(uint16_t), CH_UTF16));
    1010           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ip_address_0, 0);
    1011             :                 }
    1012           2 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_computer_name));
    1013           2 :                 if (_ptr_client_computer_name) {
    1014           2 :                         NDR_PULL_ALLOC(ndr, r->in.client_computer_name);
    1015             :                 } else {
    1016           0 :                         r->in.client_computer_name = NULL;
    1017             :                 }
    1018           2 :                 if (r->in.client_computer_name) {
    1019           2 :                         _mem_save_client_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1020           2 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.client_computer_name, 0);
    1021           2 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client_computer_name));
    1022           2 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client_computer_name));
    1023           2 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.client_computer_name, &size_client_computer_name_1));
    1024           2 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.client_computer_name, &length_client_computer_name_1));
    1025           2 :                         if (length_client_computer_name_1 > size_client_computer_name_1) {
    1026           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_client_computer_name_1, length_client_computer_name_1);
    1027             :                         }
    1028           2 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_client_computer_name_1, sizeof(uint16_t)));
    1029           2 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_computer_name, length_client_computer_name_1, sizeof(uint16_t), CH_UTF16));
    1030           2 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_computer_name_0, 0);
    1031             :                 }
    1032           2 :                 NDR_PULL_ALLOC(ndr, r->out.context_handle);
    1033           2 :                 NDR_ZERO_STRUCTP(r->out.context_handle);
    1034             :         }
    1035           4 :         if (flags & NDR_OUT) {
    1036             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1037             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1038           2 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1039           2 :                         NDR_PULL_ALLOC(ndr, r->out.context_handle);
    1040             :                 }
    1041           2 :                 _mem_save_context_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1042           2 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.context_handle, LIBNDR_FLAG_REF_ALLOC);
    1043           2 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.context_handle));
    1044           2 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_context_handle_0, LIBNDR_FLAG_REF_ALLOC);
    1045           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1046             :         }
    1047           0 :         return NDR_ERR_SUCCESS;
    1048             : }
    1049             : 
    1050           4 : _PUBLIC_ void ndr_print_witness_Register(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct witness_Register *r)
    1051             : {
    1052           4 :         ndr_print_struct(ndr, name, "witness_Register");
    1053           4 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1054           4 :         ndr->depth++;
    1055           4 :         if (flags & NDR_SET_VALUES) {
    1056           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1057             :         }
    1058           4 :         if (flags & NDR_IN) {
    1059           2 :                 ndr_print_struct(ndr, "in", "witness_Register");
    1060           2 :                 ndr->depth++;
    1061           2 :                 ndr_print_witness_version(ndr, "version", r->in.version);
    1062           2 :                 ndr_print_ptr(ndr, "net_name", r->in.net_name);
    1063           2 :                 ndr->depth++;
    1064           2 :                 if (r->in.net_name) {
    1065           2 :                         ndr_print_string(ndr, "net_name", r->in.net_name);
    1066             :                 }
    1067           2 :                 ndr->depth--;
    1068           2 :                 ndr_print_ptr(ndr, "ip_address", r->in.ip_address);
    1069           2 :                 ndr->depth++;
    1070           2 :                 if (r->in.ip_address) {
    1071           2 :                         ndr_print_string(ndr, "ip_address", r->in.ip_address);
    1072             :                 }
    1073           2 :                 ndr->depth--;
    1074           2 :                 ndr_print_ptr(ndr, "client_computer_name", r->in.client_computer_name);
    1075           2 :                 ndr->depth++;
    1076           2 :                 if (r->in.client_computer_name) {
    1077           2 :                         ndr_print_string(ndr, "client_computer_name", r->in.client_computer_name);
    1078             :                 }
    1079           2 :                 ndr->depth--;
    1080           2 :                 ndr->depth--;
    1081             :         }
    1082           4 :         if (flags & NDR_OUT) {
    1083           2 :                 ndr_print_struct(ndr, "out", "witness_Register");
    1084           2 :                 ndr->depth++;
    1085           2 :                 ndr_print_ptr(ndr, "context_handle", r->out.context_handle);
    1086           2 :                 ndr->depth++;
    1087           2 :                 ndr_print_policy_handle(ndr, "context_handle", r->out.context_handle);
    1088           2 :                 ndr->depth--;
    1089           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1090           2 :                 ndr->depth--;
    1091             :         }
    1092           4 :         ndr->depth--;
    1093             : }
    1094             : 
    1095           0 : _PUBLIC_ enum ndr_err_code ndr_push_witness_UnRegister(struct ndr_push *ndr, ndr_flags_type flags, const struct witness_UnRegister *r)
    1096             : {
    1097           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1098           0 :         if (flags & NDR_IN) {
    1099           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.context_handle));
    1100             :         }
    1101           0 :         if (flags & NDR_OUT) {
    1102           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1103             :         }
    1104           0 :         return NDR_ERR_SUCCESS;
    1105             : }
    1106             : 
    1107           4 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_UnRegister(struct ndr_pull *ndr, ndr_flags_type flags, struct witness_UnRegister *r)
    1108             : {
    1109           4 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1110           4 :         if (flags & NDR_IN) {
    1111           2 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.context_handle));
    1112             :         }
    1113           4 :         if (flags & NDR_OUT) {
    1114             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1115             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1116           2 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1117             :         }
    1118           0 :         return NDR_ERR_SUCCESS;
    1119             : }
    1120             : 
    1121           4 : _PUBLIC_ void ndr_print_witness_UnRegister(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct witness_UnRegister *r)
    1122             : {
    1123           4 :         ndr_print_struct(ndr, name, "witness_UnRegister");
    1124           4 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1125           4 :         ndr->depth++;
    1126           4 :         if (flags & NDR_SET_VALUES) {
    1127           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1128             :         }
    1129           4 :         if (flags & NDR_IN) {
    1130           2 :                 ndr_print_struct(ndr, "in", "witness_UnRegister");
    1131           2 :                 ndr->depth++;
    1132           2 :                 ndr_print_policy_handle(ndr, "context_handle", &r->in.context_handle);
    1133           2 :                 ndr->depth--;
    1134             :         }
    1135           4 :         if (flags & NDR_OUT) {
    1136           2 :                 ndr_print_struct(ndr, "out", "witness_UnRegister");
    1137           2 :                 ndr->depth++;
    1138           2 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1139           2 :                 ndr->depth--;
    1140             :         }
    1141           4 :         ndr->depth--;
    1142             : }
    1143             : 
    1144           6 : _PUBLIC_ enum ndr_err_code ndr_push_witness_AsyncNotify(struct ndr_push *ndr, ndr_flags_type flags, const struct witness_AsyncNotify *r)
    1145             : {
    1146           6 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1147           6 :         if (flags & NDR_IN) {
    1148           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, &r->in.context_handle));
    1149             :         }
    1150           6 :         if (flags & NDR_OUT) {
    1151           6 :                 if (r->out.response == NULL) {
    1152           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1153             :                 }
    1154           6 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.response));
    1155           6 :                 if (*r->out.response) {
    1156           6 :                         NDR_CHECK(ndr_push_witness_notifyResponse(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.response));
    1157             :                 }
    1158           6 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1159             :         }
    1160           0 :         return NDR_ERR_SUCCESS;
    1161             : }
    1162             : 
    1163          12 : _PUBLIC_ enum ndr_err_code ndr_pull_witness_AsyncNotify(struct ndr_pull *ndr, ndr_flags_type flags, struct witness_AsyncNotify *r)
    1164             : {
    1165          12 :         uint32_t _ptr_response;
    1166          12 :         TALLOC_CTX *_mem_save_response_0 = NULL;
    1167          12 :         TALLOC_CTX *_mem_save_response_1 = NULL;
    1168          12 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1169          12 :         if (flags & NDR_IN) {
    1170           2 :                 NDR_ZERO_STRUCT(r->out);
    1171             : 
    1172           2 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, &r->in.context_handle));
    1173           2 :                 NDR_PULL_ALLOC(ndr, r->out.response);
    1174           2 :                 NDR_ZERO_STRUCTP(r->out.response);
    1175             :         }
    1176          12 :         if (flags & NDR_OUT) {
    1177             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1178             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1179          10 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1180          10 :                         NDR_PULL_ALLOC(ndr, r->out.response);
    1181             :                 }
    1182          10 :                 _mem_save_response_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1183          10 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.response, LIBNDR_FLAG_REF_ALLOC);
    1184          10 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_response));
    1185          10 :                 if (_ptr_response) {
    1186          10 :                         NDR_PULL_ALLOC(ndr, *r->out.response);
    1187             :                 } else {
    1188           0 :                         *r->out.response = NULL;
    1189             :                 }
    1190          10 :                 if (*r->out.response) {
    1191          10 :                         _mem_save_response_1 = NDR_PULL_GET_MEM_CTX(ndr);
    1192          10 :                         NDR_PULL_SET_MEM_CTX(ndr, *r->out.response, 0);
    1193          10 :                         NDR_CHECK(ndr_pull_witness_notifyResponse(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.response));
    1194          10 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_response_1, 0);
    1195             :                 }
    1196          10 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_response_0, LIBNDR_FLAG_REF_ALLOC);
    1197          10 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1198             :         }
    1199           0 :         return NDR_ERR_SUCCESS;
    1200             : }
    1201             : 
    1202          12 : _PUBLIC_ void ndr_print_witness_AsyncNotify(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct witness_AsyncNotify *r)
    1203             : {
    1204          12 :         ndr_print_struct(ndr, name, "witness_AsyncNotify");
    1205          12 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1206          12 :         ndr->depth++;
    1207          12 :         if (flags & NDR_SET_VALUES) {
    1208           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1209             :         }
    1210          12 :         if (flags & NDR_IN) {
    1211           2 :                 ndr_print_struct(ndr, "in", "witness_AsyncNotify");
    1212           2 :                 ndr->depth++;
    1213           2 :                 ndr_print_policy_handle(ndr, "context_handle", &r->in.context_handle);
    1214           2 :                 ndr->depth--;
    1215             :         }
    1216          12 :         if (flags & NDR_OUT) {
    1217          10 :                 ndr_print_struct(ndr, "out", "witness_AsyncNotify");
    1218          10 :                 ndr->depth++;
    1219          10 :                 ndr_print_ptr(ndr, "response", r->out.response);
    1220          10 :                 ndr->depth++;
    1221          10 :                 ndr_print_ptr(ndr, "response", *r->out.response);
    1222          10 :                 ndr->depth++;
    1223          10 :                 if (*r->out.response) {
    1224          10 :                         ndr_print_witness_notifyResponse(ndr, "response", *r->out.response);
    1225             :                 }
    1226          10 :                 ndr->depth--;
    1227          10 :                 ndr->depth--;
    1228          10 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1229          10 :                 ndr->depth--;
    1230             :         }
    1231          12 :         ndr->depth--;
    1232             : }
    1233             : 
    1234           0 : static enum ndr_err_code ndr_push_witness_RegisterEx(struct ndr_push *ndr, ndr_flags_type flags, const struct witness_RegisterEx *r)
    1235             : {
    1236           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
    1237           0 :         if (flags & NDR_IN) {
    1238           0 :                 NDR_CHECK(ndr_push_witness_version(ndr, NDR_SCALARS, r->in.version));
    1239           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.net_name));
    1240           0 :                 if (r->in.net_name) {
    1241           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.net_name, CH_UTF16)));
    1242           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    1243           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.net_name, CH_UTF16)));
    1244           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.net_name, ndr_charset_length(r->in.net_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    1245             :                 }
    1246           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.share_name));
    1247           0 :                 if (r->in.share_name) {
    1248           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_name, CH_UTF16)));
    1249           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    1250           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.share_name, CH_UTF16)));
    1251           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.share_name, ndr_charset_length(r->in.share_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    1252             :                 }
    1253           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.ip_address));
    1254           0 :                 if (r->in.ip_address) {
    1255           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ip_address, CH_UTF16)));
    1256           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    1257           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.ip_address, CH_UTF16)));
    1258           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.ip_address, ndr_charset_length(r->in.ip_address, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    1259             :                 }
    1260           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.client_computer_name));
    1261           0 :                 if (r->in.client_computer_name) {
    1262           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_computer_name, CH_UTF16)));
    1263           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, 0));
    1264           0 :                         NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_charset_length(r->in.client_computer_name, CH_UTF16)));
    1265           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.client_computer_name, ndr_charset_length(r->in.client_computer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
    1266             :                 }
    1267           0 :                 NDR_CHECK(ndr_push_witness_RegisterEx_flags(ndr, NDR_SCALARS, r->in.flags));
    1268           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
    1269             :         }
    1270           0 :         if (flags & NDR_OUT) {
    1271           0 :                 if (r->out.context_handle == NULL) {
    1272           0 :                         return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
    1273             :                 }
    1274           0 :                 NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->out.context_handle));
    1275           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
    1276             :         }
    1277           0 :         return NDR_ERR_SUCCESS;
    1278             : }
    1279             : 
    1280           0 : static enum ndr_err_code ndr_pull_witness_RegisterEx(struct ndr_pull *ndr, ndr_flags_type flags, struct witness_RegisterEx *r)
    1281             : {
    1282           0 :         uint32_t _ptr_net_name;
    1283           0 :         uint32_t size_net_name_1 = 0;
    1284           0 :         uint32_t length_net_name_1 = 0;
    1285           0 :         uint32_t _ptr_share_name;
    1286           0 :         uint32_t size_share_name_1 = 0;
    1287           0 :         uint32_t length_share_name_1 = 0;
    1288           0 :         uint32_t _ptr_ip_address;
    1289           0 :         uint32_t size_ip_address_1 = 0;
    1290           0 :         uint32_t length_ip_address_1 = 0;
    1291           0 :         uint32_t _ptr_client_computer_name;
    1292           0 :         uint32_t size_client_computer_name_1 = 0;
    1293           0 :         uint32_t length_client_computer_name_1 = 0;
    1294           0 :         TALLOC_CTX *_mem_save_context_handle_0 = NULL;
    1295           0 :         TALLOC_CTX *_mem_save_net_name_0 = NULL;
    1296           0 :         TALLOC_CTX *_mem_save_share_name_0 = NULL;
    1297           0 :         TALLOC_CTX *_mem_save_ip_address_0 = NULL;
    1298           0 :         TALLOC_CTX *_mem_save_client_computer_name_0 = NULL;
    1299           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
    1300           0 :         if (flags & NDR_IN) {
    1301           0 :                 NDR_ZERO_STRUCT(r->out);
    1302             : 
    1303           0 :                 NDR_CHECK(ndr_pull_witness_version(ndr, NDR_SCALARS, &r->in.version));
    1304           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_net_name));
    1305           0 :                 if (_ptr_net_name) {
    1306           0 :                         NDR_PULL_ALLOC(ndr, r->in.net_name);
    1307             :                 } else {
    1308           0 :                         r->in.net_name = NULL;
    1309             :                 }
    1310           0 :                 if (r->in.net_name) {
    1311           0 :                         _mem_save_net_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1312           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.net_name, 0);
    1313           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.net_name));
    1314           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.net_name));
    1315           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.net_name, &size_net_name_1));
    1316           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.net_name, &length_net_name_1));
    1317           0 :                         if (length_net_name_1 > size_net_name_1) {
    1318           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_net_name_1, length_net_name_1);
    1319             :                         }
    1320           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_net_name_1, sizeof(uint16_t)));
    1321           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.net_name, length_net_name_1, sizeof(uint16_t), CH_UTF16));
    1322           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_net_name_0, 0);
    1323             :                 }
    1324           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_share_name));
    1325           0 :                 if (_ptr_share_name) {
    1326           0 :                         NDR_PULL_ALLOC(ndr, r->in.share_name);
    1327             :                 } else {
    1328           0 :                         r->in.share_name = NULL;
    1329             :                 }
    1330           0 :                 if (r->in.share_name) {
    1331           0 :                         _mem_save_share_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1332           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.share_name, 0);
    1333           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.share_name));
    1334           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.share_name));
    1335           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.share_name, &size_share_name_1));
    1336           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.share_name, &length_share_name_1));
    1337           0 :                         if (length_share_name_1 > size_share_name_1) {
    1338           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_share_name_1, length_share_name_1);
    1339             :                         }
    1340           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_share_name_1, sizeof(uint16_t)));
    1341           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.share_name, length_share_name_1, sizeof(uint16_t), CH_UTF16));
    1342           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_share_name_0, 0);
    1343             :                 }
    1344           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_ip_address));
    1345           0 :                 if (_ptr_ip_address) {
    1346           0 :                         NDR_PULL_ALLOC(ndr, r->in.ip_address);
    1347             :                 } else {
    1348           0 :                         r->in.ip_address = NULL;
    1349             :                 }
    1350           0 :                 if (r->in.ip_address) {
    1351           0 :                         _mem_save_ip_address_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1352           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.ip_address, 0);
    1353           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.ip_address));
    1354           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.ip_address));
    1355           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.ip_address, &size_ip_address_1));
    1356           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.ip_address, &length_ip_address_1));
    1357           0 :                         if (length_ip_address_1 > size_ip_address_1) {
    1358           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_ip_address_1, length_ip_address_1);
    1359             :                         }
    1360           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_ip_address_1, sizeof(uint16_t)));
    1361           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.ip_address, length_ip_address_1, sizeof(uint16_t), CH_UTF16));
    1362           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ip_address_0, 0);
    1363             :                 }
    1364           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_client_computer_name));
    1365           0 :                 if (_ptr_client_computer_name) {
    1366           0 :                         NDR_PULL_ALLOC(ndr, r->in.client_computer_name);
    1367             :                 } else {
    1368           0 :                         r->in.client_computer_name = NULL;
    1369             :                 }
    1370           0 :                 if (r->in.client_computer_name) {
    1371           0 :                         _mem_save_client_computer_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1372           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.client_computer_name, 0);
    1373           0 :                         NDR_CHECK(ndr_pull_array_size(ndr, &r->in.client_computer_name));
    1374           0 :                         NDR_CHECK(ndr_pull_array_length(ndr, &r->in.client_computer_name));
    1375           0 :                         NDR_CHECK(ndr_steal_array_size(ndr, (void*)&r->in.client_computer_name, &size_client_computer_name_1));
    1376           0 :                         NDR_CHECK(ndr_steal_array_length(ndr, (void*)&r->in.client_computer_name, &length_client_computer_name_1));
    1377           0 :                         if (length_client_computer_name_1 > size_client_computer_name_1) {
    1378           0 :                                 return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %"PRIu32": should exceed array length %"PRIu32"", size_client_computer_name_1, length_client_computer_name_1);
    1379             :                         }
    1380           0 :                         NDR_CHECK(ndr_check_string_terminator(ndr, length_client_computer_name_1, sizeof(uint16_t)));
    1381           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.client_computer_name, length_client_computer_name_1, sizeof(uint16_t), CH_UTF16));
    1382           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_client_computer_name_0, 0);
    1383             :                 }
    1384           0 :                 NDR_CHECK(ndr_pull_witness_RegisterEx_flags(ndr, NDR_SCALARS, &r->in.flags));
    1385           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
    1386           0 :                 NDR_PULL_ALLOC(ndr, r->out.context_handle);
    1387           0 :                 NDR_ZERO_STRUCTP(r->out.context_handle);
    1388             :         }
    1389           0 :         if (flags & NDR_OUT) {
    1390             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    1391             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
    1392           0 :                 if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
    1393           0 :                         NDR_PULL_ALLOC(ndr, r->out.context_handle);
    1394             :                 }
    1395           0 :                 _mem_save_context_handle_0 = NDR_PULL_GET_MEM_CTX(ndr);
    1396           0 :                 NDR_PULL_SET_MEM_CTX(ndr, r->out.context_handle, LIBNDR_FLAG_REF_ALLOC);
    1397           0 :                 NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->out.context_handle));
    1398           0 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_context_handle_0, LIBNDR_FLAG_REF_ALLOC);
    1399           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
    1400             :         }
    1401           0 :         return NDR_ERR_SUCCESS;
    1402             : }
    1403             : 
    1404           0 : _PUBLIC_ void ndr_print_witness_RegisterEx(struct ndr_print *ndr, const char *name, ndr_flags_type flags, const struct witness_RegisterEx *r)
    1405             : {
    1406           0 :         ndr_print_struct(ndr, name, "witness_RegisterEx");
    1407           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
    1408           0 :         ndr->depth++;
    1409           0 :         if (flags & NDR_SET_VALUES) {
    1410           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
    1411             :         }
    1412           0 :         if (flags & NDR_IN) {
    1413           0 :                 ndr_print_struct(ndr, "in", "witness_RegisterEx");
    1414           0 :                 ndr->depth++;
    1415           0 :                 ndr_print_witness_version(ndr, "version", r->in.version);
    1416           0 :                 ndr_print_ptr(ndr, "net_name", r->in.net_name);
    1417           0 :                 ndr->depth++;
    1418           0 :                 if (r->in.net_name) {
    1419           0 :                         ndr_print_string(ndr, "net_name", r->in.net_name);
    1420             :                 }
    1421           0 :                 ndr->depth--;
    1422           0 :                 ndr_print_ptr(ndr, "share_name", r->in.share_name);
    1423           0 :                 ndr->depth++;
    1424           0 :                 if (r->in.share_name) {
    1425           0 :                         ndr_print_string(ndr, "share_name", r->in.share_name);
    1426             :                 }
    1427           0 :                 ndr->depth--;
    1428           0 :                 ndr_print_ptr(ndr, "ip_address", r->in.ip_address);
    1429           0 :                 ndr->depth++;
    1430           0 :                 if (r->in.ip_address) {
    1431           0 :                         ndr_print_string(ndr, "ip_address", r->in.ip_address);
    1432             :                 }
    1433           0 :                 ndr->depth--;
    1434           0 :                 ndr_print_ptr(ndr, "client_computer_name", r->in.client_computer_name);
    1435           0 :                 ndr->depth++;
    1436           0 :                 if (r->in.client_computer_name) {
    1437           0 :                         ndr_print_string(ndr, "client_computer_name", r->in.client_computer_name);
    1438             :                 }
    1439           0 :                 ndr->depth--;
    1440           0 :                 ndr_print_witness_RegisterEx_flags(ndr, "flags", r->in.flags);
    1441           0 :                 ndr_print_uint32(ndr, "timeout", r->in.timeout);
    1442           0 :                 ndr->depth--;
    1443             :         }
    1444           0 :         if (flags & NDR_OUT) {
    1445           0 :                 ndr_print_struct(ndr, "out", "witness_RegisterEx");
    1446           0 :                 ndr->depth++;
    1447           0 :                 ndr_print_ptr(ndr, "context_handle", r->out.context_handle);
    1448           0 :                 ndr->depth++;
    1449           0 :                 ndr_print_policy_handle(ndr, "context_handle", r->out.context_handle);
    1450           0 :                 ndr->depth--;
    1451           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
    1452           0 :                 ndr->depth--;
    1453             :         }
    1454           0 :         ndr->depth--;
    1455             : }
    1456             : 
    1457             : #ifndef SKIP_NDR_TABLE_witness
    1458             : static const struct ndr_interface_public_struct witness_public_structs[] = {
    1459             :         {
    1460             :                 .name = "witness_interfaceList",
    1461             :                 .struct_size = sizeof(struct witness_interfaceList ),
    1462             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_witness_interfaceList,
    1463             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_witness_interfaceList,
    1464             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_witness_interfaceList,
    1465             :         },
    1466             :         {
    1467             :                 .name = "witness_ResourceChange",
    1468             :                 .struct_size = sizeof(struct witness_ResourceChange ),
    1469             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_witness_ResourceChange,
    1470             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_witness_ResourceChange,
    1471             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_witness_ResourceChange,
    1472             :         },
    1473             :         {
    1474             :                 .name = "witness_IPaddrInfoList",
    1475             :                 .struct_size = sizeof(struct witness_IPaddrInfoList ),
    1476             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_witness_IPaddrInfoList,
    1477             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_witness_IPaddrInfoList,
    1478             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_witness_IPaddrInfoList,
    1479             :         },
    1480             :         {
    1481             :                 .name = "witness_notifyResponse",
    1482             :                 .struct_size = sizeof(struct witness_notifyResponse ),
    1483             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_witness_notifyResponse,
    1484             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_witness_notifyResponse,
    1485             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_witness_notifyResponse,
    1486             :         },
    1487             :         { .name = NULL }
    1488             : };
    1489             : 
    1490             : static const struct ndr_interface_call witness_calls[] = {
    1491             :         {
    1492             :                 "witness_GetInterfaceList",
    1493             :                 sizeof(struct witness_GetInterfaceList),
    1494             :                 (ndr_push_flags_fn_t) ndr_push_witness_GetInterfaceList,
    1495             :                 (ndr_pull_flags_fn_t) ndr_pull_witness_GetInterfaceList,
    1496             :                 (ndr_print_function_t) ndr_print_witness_GetInterfaceList,
    1497             :                 { 0, NULL },
    1498             :                 { 0, NULL },
    1499             :         },
    1500             :         {
    1501             :                 "witness_Register",
    1502             :                 sizeof(struct witness_Register),
    1503             :                 (ndr_push_flags_fn_t) ndr_push_witness_Register,
    1504             :                 (ndr_pull_flags_fn_t) ndr_pull_witness_Register,
    1505             :                 (ndr_print_function_t) ndr_print_witness_Register,
    1506             :                 { 0, NULL },
    1507             :                 { 0, NULL },
    1508             :         },
    1509             :         {
    1510             :                 "witness_UnRegister",
    1511             :                 sizeof(struct witness_UnRegister),
    1512             :                 (ndr_push_flags_fn_t) ndr_push_witness_UnRegister,
    1513             :                 (ndr_pull_flags_fn_t) ndr_pull_witness_UnRegister,
    1514             :                 (ndr_print_function_t) ndr_print_witness_UnRegister,
    1515             :                 { 0, NULL },
    1516             :                 { 0, NULL },
    1517             :         },
    1518             :         {
    1519             :                 "witness_AsyncNotify",
    1520             :                 sizeof(struct witness_AsyncNotify),
    1521             :                 (ndr_push_flags_fn_t) ndr_push_witness_AsyncNotify,
    1522             :                 (ndr_pull_flags_fn_t) ndr_pull_witness_AsyncNotify,
    1523             :                 (ndr_print_function_t) ndr_print_witness_AsyncNotify,
    1524             :                 { 0, NULL },
    1525             :                 { 0, NULL },
    1526             :         },
    1527             :         {
    1528             :                 "witness_RegisterEx",
    1529             :                 sizeof(struct witness_RegisterEx),
    1530             :                 (ndr_push_flags_fn_t) ndr_push_witness_RegisterEx,
    1531             :                 (ndr_pull_flags_fn_t) ndr_pull_witness_RegisterEx,
    1532             :                 (ndr_print_function_t) ndr_print_witness_RegisterEx,
    1533             :                 { 0, NULL },
    1534             :                 { 0, NULL },
    1535             :         },
    1536             :         { .name = NULL }
    1537             : };
    1538             : 
    1539             : static const char * const witness_endpoint_strings[] = {
    1540             :         "ncacn_ip_tcp:", 
    1541             : };
    1542             : 
    1543             : static const struct ndr_interface_string_array witness_endpoints = {
    1544             :         .count  = 1,
    1545             :         .names  = witness_endpoint_strings
    1546             : };
    1547             : 
    1548             : static const char * const witness_authservice_strings[] = {
    1549             :         "cifs", 
    1550             : };
    1551             : 
    1552             : static const struct ndr_interface_string_array witness_authservices = {
    1553             :         .count  = 1,
    1554             :         .names  = witness_authservice_strings
    1555             : };
    1556             : 
    1557             : 
    1558             : const struct ndr_interface_table ndr_table_witness = {
    1559             :         .name           = "witness",
    1560             :         .syntax_id      = {
    1561             :                 {0xccd8c074,0xd0e5,0x4a40,{0x92,0xb4},{0xd0,0x74,0xfa,0xa6,0xba,0x28}},
    1562             :                 NDR_WITNESS_VERSION
    1563             :         },
    1564             :         .helpstring     = NDR_WITNESS_HELPSTRING,
    1565             :         .num_calls      = 5,
    1566             :         .calls          = witness_calls,
    1567             :         .num_public_structs     = 4,
    1568             :         .public_structs         = witness_public_structs,
    1569             :         .endpoints      = &witness_endpoints,
    1570             :         .authservices   = &witness_authservices
    1571             : };
    1572             : 
    1573             : #endif /* SKIP_NDR_TABLE_witness */

Generated by: LCOV version 1.14