LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_smb_acl.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 212 345 61.4 %
Date: 2024-04-21 15:09:00 Functions: 13 23 56.5 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/librpc/gen_ndr/ndr_smb_acl.h"
       5             : 
       6     9328720 : static enum ndr_err_code ndr_push_smb_acl_tag_t(struct ndr_push *ndr, ndr_flags_type ndr_flags, enum smb_acl_tag_t r)
       7             : {
       8     9328720 :         NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r));
       9     9309479 :         return NDR_ERR_SUCCESS;
      10             : }
      11             : 
      12     9250462 : static enum ndr_err_code ndr_pull_smb_acl_tag_t(struct ndr_pull *ndr, ndr_flags_type ndr_flags, enum smb_acl_tag_t *r)
      13             : {
      14       20344 :         uint16_t v;
      15     9250462 :         NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v));
      16     9250462 :         *r = v;
      17     9250462 :         return NDR_ERR_SUCCESS;
      18             : }
      19             : 
      20           0 : _PUBLIC_ void ndr_print_smb_acl_tag_t(struct ndr_print *ndr, const char *name, enum smb_acl_tag_t r)
      21             : {
      22           0 :         const char *val = NULL;
      23             : 
      24           0 :         switch (r) {
      25           0 :                 case SMB_ACL_TAG_INVALID: val = "SMB_ACL_TAG_INVALID"; break;
      26           0 :                 case SMB_ACL_USER: val = "SMB_ACL_USER"; break;
      27           0 :                 case SMB_ACL_USER_OBJ: val = "SMB_ACL_USER_OBJ"; break;
      28           0 :                 case SMB_ACL_GROUP: val = "SMB_ACL_GROUP"; break;
      29           0 :                 case SMB_ACL_GROUP_OBJ: val = "SMB_ACL_GROUP_OBJ"; break;
      30           0 :                 case SMB_ACL_OTHER: val = "SMB_ACL_OTHER"; break;
      31           0 :                 case SMB_ACL_MASK: val = "SMB_ACL_MASK"; break;
      32             :         }
      33           0 :         ndr_print_enum(ndr, name, "ENUM", val, r);
      34           0 : }
      35             : 
      36     1193644 : static enum ndr_err_code ndr_push_smb_acl_user(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct smb_acl_user *r)
      37             : {
      38     1193644 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      39     1193644 :         if (ndr_flags & NDR_SCALARS) {
      40     1193644 :                 NDR_CHECK(ndr_push_align(ndr, 8));
      41     1193644 :                 NDR_CHECK(ndr_push_uid_t(ndr, NDR_SCALARS, r->uid));
      42     1193644 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
      43             :         }
      44     1193644 :         if (ndr_flags & NDR_BUFFERS) {
      45        2364 :         }
      46     1193644 :         return NDR_ERR_SUCCESS;
      47             : }
      48             : 
      49     1184206 : static enum ndr_err_code ndr_pull_smb_acl_user(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct smb_acl_user *r)
      50             : {
      51     1184206 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      52     1184206 :         if (ndr_flags & NDR_SCALARS) {
      53     1184206 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
      54     1184206 :                 NDR_CHECK(ndr_pull_uid_t(ndr, NDR_SCALARS, &r->uid));
      55     1184206 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
      56             :         }
      57     1184206 :         if (ndr_flags & NDR_BUFFERS) {
      58        2530 :         }
      59     1184206 :         return NDR_ERR_SUCCESS;
      60             : }
      61             : 
      62           0 : _PUBLIC_ void ndr_print_smb_acl_user(struct ndr_print *ndr, const char *name, const struct smb_acl_user *r)
      63             : {
      64           0 :         ndr_print_struct(ndr, name, "smb_acl_user");
      65           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
      66           0 :         ndr->depth++;
      67           0 :         ndr_print_uid_t(ndr, "uid", r->uid);
      68           0 :         ndr->depth--;
      69             : }
      70             : 
      71     2011868 : static enum ndr_err_code ndr_push_smb_acl_group(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct smb_acl_group *r)
      72             : {
      73     2011868 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      74     2011868 :         if (ndr_flags & NDR_SCALARS) {
      75     2011868 :                 NDR_CHECK(ndr_push_align(ndr, 8));
      76     2011868 :                 NDR_CHECK(ndr_push_gid_t(ndr, NDR_SCALARS, r->gid));
      77     2011868 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
      78             :         }
      79     2011868 :         if (ndr_flags & NDR_BUFFERS) {
      80        5597 :         }
      81     2011868 :         return NDR_ERR_SUCCESS;
      82             : }
      83             : 
      84     1992540 : static enum ndr_err_code ndr_pull_smb_acl_group(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct smb_acl_group *r)
      85             : {
      86     1992540 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      87     1992540 :         if (ndr_flags & NDR_SCALARS) {
      88     1992540 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
      89     1992540 :                 NDR_CHECK(ndr_pull_gid_t(ndr, NDR_SCALARS, &r->gid));
      90     1992540 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
      91             :         }
      92     1992540 :         if (ndr_flags & NDR_BUFFERS) {
      93        5954 :         }
      94     1992540 :         return NDR_ERR_SUCCESS;
      95             : }
      96             : 
      97           0 : _PUBLIC_ void ndr_print_smb_acl_group(struct ndr_print *ndr, const char *name, const struct smb_acl_group *r)
      98             : {
      99           0 :         ndr_print_struct(ndr, name, "smb_acl_group");
     100           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     101           0 :         ndr->depth++;
     102           0 :         ndr_print_gid_t(ndr, "gid", r->gid);
     103           0 :         ndr->depth--;
     104             : }
     105             : 
     106    18657440 : static enum ndr_err_code ndr_push_smb_acl_entry_info(struct ndr_push *ndr, ndr_flags_type ndr_flags, const union smb_acl_entry_info *r)
     107             : {
     108       38482 :         uint32_t level;
     109    18657440 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     110    18657440 :         if (ndr_flags & NDR_SCALARS) {
     111             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     112     9328720 :                 NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     113     9328720 :                 NDR_CHECK(ndr_push_union_align(ndr, 8));
     114     9328720 :                 NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, level));
     115     9328720 :                 NDR_CHECK(ndr_push_union_align(ndr, 8));
     116     9328720 :                 switch (level) {
     117     1193644 :                         case SMB_ACL_USER: {
     118     1193644 :                                 NDR_CHECK(ndr_push_smb_acl_user(ndr, NDR_SCALARS, &r->user));
     119     1191280 :                         break; }
     120             : 
     121     1528007 :                         case SMB_ACL_USER_OBJ: {
     122     1528007 :                         break; }
     123             : 
     124     2011868 :                         case SMB_ACL_GROUP: {
     125     2011868 :                                 NDR_CHECK(ndr_push_smb_acl_group(ndr, NDR_SCALARS, &r->group));
     126     2006271 :                         break; }
     127             : 
     128     1528007 :                         case SMB_ACL_GROUP_OBJ: {
     129     1528007 :                         break; }
     130             : 
     131     1528007 :                         case SMB_ACL_OTHER: {
     132     1528007 :                         break; }
     133             : 
     134     1527907 :                         case SMB_ACL_MASK: {
     135     1527907 :                         break; }
     136             : 
     137           0 :                         default:
     138           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     139             :                 }
     140             :         }
     141    18657440 :         if (ndr_flags & NDR_BUFFERS) {
     142     9328720 :                 if (!(ndr_flags & NDR_SCALARS)) {
     143             :                         /* We didn't get it above, and the token is not needed after this. */
     144     9328720 :                         NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
     145             :                 }
     146     9328720 :                 switch (level) {
     147     1191280 :                         case SMB_ACL_USER:
     148     1191280 :                         break;
     149             : 
     150     1528007 :                         case SMB_ACL_USER_OBJ:
     151     1528007 :                         break;
     152             : 
     153     2006271 :                         case SMB_ACL_GROUP:
     154     2006271 :                         break;
     155             : 
     156     1528007 :                         case SMB_ACL_GROUP_OBJ:
     157     1528007 :                         break;
     158             : 
     159     1528007 :                         case SMB_ACL_OTHER:
     160     1528007 :                         break;
     161             : 
     162     1527907 :                         case SMB_ACL_MASK:
     163     1527907 :                         break;
     164             : 
     165           0 :                         default:
     166           0 :                                 return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32, level);
     167             :                 }
     168             :         }
     169    18618958 :         return NDR_ERR_SUCCESS;
     170             : }
     171             : 
     172    18500924 : static enum ndr_err_code ndr_pull_smb_acl_entry_info(struct ndr_pull *ndr, ndr_flags_type ndr_flags, union smb_acl_entry_info *r)
     173             : {
     174       40688 :         uint32_t level;
     175       40688 :         uint16_t _level;
     176    18500924 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     177    18500924 :         if (ndr_flags & NDR_SCALARS) {
     178             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     179     9250462 :                 NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     180     9250462 :                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
     181     9250462 :                 NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &_level));
     182     9250462 :                 if (_level != level) {
     183           0 :                         return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu16" for r at %s", (uint16_t)_level, __location__);
     184             :                 }
     185     9250462 :                 NDR_CHECK(ndr_pull_union_align(ndr, 8));
     186     9250462 :                 switch (level) {
     187     1184206 :                         case SMB_ACL_USER: {
     188     1184206 :                                 NDR_CHECK(ndr_pull_smb_acl_user(ndr, NDR_SCALARS, &r->user));
     189     1181676 :                         break; }
     190             : 
     191     1515464 :                         case SMB_ACL_USER_OBJ: {
     192     1515464 :                         break; }
     193             : 
     194     1992540 :                         case SMB_ACL_GROUP: {
     195     1992540 :                                 NDR_CHECK(ndr_pull_smb_acl_group(ndr, NDR_SCALARS, &r->group));
     196     1986586 :                         break; }
     197             : 
     198     1515464 :                         case SMB_ACL_GROUP_OBJ: {
     199     1515464 :                         break; }
     200             : 
     201     1515464 :                         case SMB_ACL_OTHER: {
     202     1515464 :                         break; }
     203             : 
     204     1515464 :                         case SMB_ACL_MASK: {
     205     1515464 :                         break; }
     206             : 
     207           0 :                         default:
     208           0 :                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32" at %s", level, __location__);
     209             :                 }
     210             :         }
     211    18500924 :         if (ndr_flags & NDR_BUFFERS) {
     212     9250462 :                 if (!(ndr_flags & NDR_SCALARS)) {
     213             :                         /* We didn't get it above, and the token is not needed after this. */
     214     9250462 :                         NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     215             :                 }
     216     9250462 :                 switch (level) {
     217     1181676 :                         case SMB_ACL_USER:
     218     1181676 :                         break;
     219             : 
     220     1515464 :                         case SMB_ACL_USER_OBJ:
     221     1515464 :                         break;
     222             : 
     223     1986586 :                         case SMB_ACL_GROUP:
     224     1986586 :                         break;
     225             : 
     226     1515464 :                         case SMB_ACL_GROUP_OBJ:
     227     1515464 :                         break;
     228             : 
     229     1515464 :                         case SMB_ACL_OTHER:
     230     1515464 :                         break;
     231             : 
     232     1515464 :                         case SMB_ACL_MASK:
     233     1515464 :                         break;
     234             : 
     235           0 :                         default:
     236           0 :                                 return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %"PRIu32" at %s", level, __location__);
     237             :                 }
     238             :         }
     239    18460236 :         return NDR_ERR_SUCCESS;
     240             : }
     241             : 
     242           0 : _PUBLIC_ void ndr_print_smb_acl_entry_info(struct ndr_print *ndr, const char *name, const union smb_acl_entry_info *r)
     243             : {
     244           0 :         uint32_t level;
     245           0 :         level = ndr_print_steal_switch_value(ndr, r);
     246           0 :         ndr_print_union(ndr, name, level, "smb_acl_entry_info");
     247           0 :         switch (level) {
     248           0 :                 case SMB_ACL_USER:
     249           0 :                         ndr_print_smb_acl_user(ndr, "user", &r->user);
     250           0 :                 break;
     251             : 
     252           0 :                 case SMB_ACL_USER_OBJ:
     253           0 :                 break;
     254             : 
     255           0 :                 case SMB_ACL_GROUP:
     256           0 :                         ndr_print_smb_acl_group(ndr, "group", &r->group);
     257           0 :                 break;
     258             : 
     259           0 :                 case SMB_ACL_GROUP_OBJ:
     260           0 :                 break;
     261             : 
     262           0 :                 case SMB_ACL_OTHER:
     263           0 :                 break;
     264             : 
     265           0 :                 case SMB_ACL_MASK:
     266           0 :                 break;
     267             : 
     268           0 :                 default:
     269           0 :                         ndr_print_bad_level(ndr, name, level);
     270             :         }
     271           0 : }
     272             : 
     273    18657440 : static enum ndr_err_code ndr_push_smb_acl_entry(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct smb_acl_entry *r)
     274             : {
     275    18657440 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     276    18657440 :         if (ndr_flags & NDR_SCALARS) {
     277     9328720 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     278     9347961 :                 NDR_CHECK(ndr_push_smb_acl_tag_t(ndr, NDR_SCALARS, r->a_type));
     279     9328720 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->a_type));
     280     9328720 :                 NDR_CHECK(ndr_push_smb_acl_entry_info(ndr, NDR_SCALARS, &r->info));
     281     9328720 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->a_perm));
     282     9328720 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     283             :         }
     284    18657440 :         if (ndr_flags & NDR_BUFFERS) {
     285     9328720 :                 NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->a_type));
     286     9328720 :                 NDR_CHECK(ndr_push_smb_acl_entry_info(ndr, NDR_BUFFERS, &r->info));
     287             :         }
     288    18618958 :         return NDR_ERR_SUCCESS;
     289             : }
     290             : 
     291    18500924 : static enum ndr_err_code ndr_pull_smb_acl_entry(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct smb_acl_entry *r)
     292             : {
     293    18500924 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     294    18500924 :         if (ndr_flags & NDR_SCALARS) {
     295     9250462 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     296     9270806 :                 NDR_CHECK(ndr_pull_smb_acl_tag_t(ndr, NDR_SCALARS, &r->a_type));
     297     9250462 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->a_type));
     298     9250462 :                 NDR_CHECK(ndr_pull_smb_acl_entry_info(ndr, NDR_SCALARS, &r->info));
     299     9250462 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->a_perm));
     300     9250462 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     301             :         }
     302    18500924 :         if (ndr_flags & NDR_BUFFERS) {
     303     9250462 :                 NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->a_type));
     304     9250462 :                 NDR_CHECK(ndr_pull_smb_acl_entry_info(ndr, NDR_BUFFERS, &r->info));
     305             :         }
     306    18460236 :         return NDR_ERR_SUCCESS;
     307             : }
     308             : 
     309           0 : _PUBLIC_ void ndr_print_smb_acl_entry(struct ndr_print *ndr, const char *name, const struct smb_acl_entry *r)
     310             : {
     311           0 :         ndr_print_struct(ndr, name, "smb_acl_entry");
     312           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     313           0 :         ndr->depth++;
     314           0 :         ndr_print_smb_acl_tag_t(ndr, "a_type", r->a_type);
     315           0 :         ndr_print_set_switch_value(ndr, &r->info, r->a_type);
     316           0 :         ndr_print_smb_acl_entry_info(ndr, "info", &r->info);
     317           0 :         ndr_print_uint32(ndr, "a_perm", r->a_perm);
     318           0 :         ndr->depth--;
     319             : }
     320             : 
     321     1530867 : _PUBLIC_ enum ndr_err_code ndr_push_smb_acl_t(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct smb_acl_t *r)
     322             : {
     323        2820 :         uint32_t cntr_acl_0;
     324     1530867 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     325     1530867 :         if (ndr_flags & NDR_SCALARS) {
     326     1530867 :                 NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, r->count));
     327     1530867 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     328     1530867 :                 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, r->count));
     329     1530867 :                 NDR_CHECK(ndr_push_int32(ndr, NDR_SCALARS, 0));
     330    10859587 :                 for (cntr_acl_0 = 0; cntr_acl_0 < (r->count); cntr_acl_0++) {
     331     9328720 :                         NDR_CHECK(ndr_push_smb_acl_entry(ndr, NDR_SCALARS, &r->acl[cntr_acl_0]));
     332             :                 }
     333     1530867 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     334             :         }
     335     1530867 :         if (ndr_flags & NDR_BUFFERS) {
     336    10859587 :                 for (cntr_acl_0 = 0; cntr_acl_0 < (r->count); cntr_acl_0++) {
     337     9328720 :                         NDR_CHECK(ndr_push_smb_acl_entry(ndr, NDR_BUFFERS, &r->acl[cntr_acl_0]));
     338             :                 }
     339             :         }
     340     1528047 :         return NDR_ERR_SUCCESS;
     341             : }
     342             : 
     343     1518453 : _PUBLIC_ enum ndr_err_code ndr_pull_smb_acl_t(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct smb_acl_t *r)
     344             : {
     345     1518453 :         uint32_t size_acl_0 = 0;
     346        2965 :         uint32_t cntr_acl_0;
     347     1518453 :         TALLOC_CTX *_mem_save_acl_0 = NULL;
     348     1518453 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     349     1518453 :         if (ndr_flags & NDR_SCALARS) {
     350     1518453 :                 NDR_CHECK(ndr_pull_array_size(ndr, &r->acl));
     351     1518429 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     352     1518429 :                 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->count));
     353     1518429 :                 NDR_CHECK(ndr_pull_int32(ndr, NDR_SCALARS, &r->next));
     354     1518429 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->acl, &size_acl_0));
     355     1518429 :                 NDR_PULL_ALLOC_N(ndr, r->acl, size_acl_0);
     356     1518429 :                 _mem_save_acl_0 = NDR_PULL_GET_MEM_CTX(ndr);
     357     1518429 :                 NDR_PULL_SET_MEM_CTX(ndr, r->acl, 0);
     358    10768891 :                 for (cntr_acl_0 = 0; cntr_acl_0 < (size_acl_0); cntr_acl_0++) {
     359     9250462 :                         NDR_CHECK(ndr_pull_smb_acl_entry(ndr, NDR_SCALARS, &r->acl[cntr_acl_0]));
     360             :                 }
     361     1518429 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acl_0, 0);
     362     1518429 :                 if (r->acl) {
     363     1518429 :                         NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->acl, r->count));
     364             :                 }
     365     1518429 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     366             :         }
     367     1518429 :         if (ndr_flags & NDR_BUFFERS) {
     368     1518429 :                 NDR_CHECK(ndr_get_array_size(ndr, (void*)&r->acl, &size_acl_0));
     369     1518429 :                 _mem_save_acl_0 = NDR_PULL_GET_MEM_CTX(ndr);
     370     1518429 :                 NDR_PULL_SET_MEM_CTX(ndr, r->acl, 0);
     371    10768891 :                 for (cntr_acl_0 = 0; cntr_acl_0 < (size_acl_0); cntr_acl_0++) {
     372     9250462 :                         NDR_CHECK(ndr_pull_smb_acl_entry(ndr, NDR_BUFFERS, &r->acl[cntr_acl_0]));
     373             :                 }
     374     1518429 :                 NDR_PULL_SET_MEM_CTX(ndr, _mem_save_acl_0, 0);
     375    10748547 :                 for (cntr_acl_0 = 0; cntr_acl_0 < (size_acl_0); cntr_acl_0++) {
     376             :                 }
     377             :         }
     378     1515464 :         return NDR_ERR_SUCCESS;
     379             : }
     380             : 
     381           0 : static void ndr_print_flags_smb_acl_t(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct smb_acl_t *r)
     382             : {
     383           0 :         ndr_print_smb_acl_t(ndr, name, r);
     384           0 : }
     385             : 
     386           0 : _PUBLIC_ void ndr_print_smb_acl_t(struct ndr_print *ndr, const char *name, const struct smb_acl_t *r)
     387             : {
     388           0 :         uint32_t cntr_acl_0;
     389           0 :         ndr_print_struct(ndr, name, "smb_acl_t");
     390           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     391           0 :         ndr->depth++;
     392           0 :         ndr_print_int32(ndr, "count", r->count);
     393           0 :         ndr_print_int32(ndr, "next", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?0:r->next);
     394           0 :         ndr->print(ndr, "%s: ARRAY(%"PRIu32")", "acl", (uint32_t)(r->count));
     395           0 :         ndr->depth++;
     396           0 :         for (cntr_acl_0 = 0; cntr_acl_0 < (r->count); cntr_acl_0++) {
     397           0 :                 ndr_print_smb_acl_entry(ndr, "acl", &r->acl[cntr_acl_0]);
     398             :         }
     399           0 :         ndr->depth--;
     400           0 :         ndr->depth--;
     401             : }
     402             : 
     403      913158 : _PUBLIC_ enum ndr_err_code ndr_push_smb_acl_wrapper(struct ndr_push *ndr, ndr_flags_type ndr_flags, const struct smb_acl_wrapper *r)
     404             : {
     405      913158 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     406      913158 :         if (ndr_flags & NDR_SCALARS) {
     407      913158 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     408      913158 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->access_acl));
     409      913158 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->default_acl));
     410      913158 :                 NDR_CHECK(ndr_push_uid_t(ndr, NDR_SCALARS, r->owner));
     411      913158 :                 NDR_CHECK(ndr_push_gid_t(ndr, NDR_SCALARS, r->group));
     412      913158 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->mode));
     413      913158 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     414             :         }
     415      913158 :         if (ndr_flags & NDR_BUFFERS) {
     416      913158 :                 if (r->access_acl) {
     417      906191 :                         NDR_CHECK(ndr_push_smb_acl_t(ndr, NDR_SCALARS|NDR_BUFFERS, r->access_acl));
     418             :                 }
     419      913158 :                 if (r->default_acl) {
     420      461992 :                         NDR_CHECK(ndr_push_smb_acl_t(ndr, NDR_SCALARS|NDR_BUFFERS, r->default_acl));
     421             :                 }
     422             :         }
     423      911634 :         return NDR_ERR_SUCCESS;
     424             : }
     425             : 
     426           0 : _PUBLIC_ enum ndr_err_code ndr_pull_smb_acl_wrapper(struct ndr_pull *ndr, ndr_flags_type ndr_flags, struct smb_acl_wrapper *r)
     427             : {
     428           0 :         uint32_t _ptr_access_acl;
     429           0 :         TALLOC_CTX *_mem_save_access_acl_0 = NULL;
     430           0 :         uint32_t _ptr_default_acl;
     431           0 :         TALLOC_CTX *_mem_save_default_acl_0 = NULL;
     432           0 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     433           0 :         if (ndr_flags & NDR_SCALARS) {
     434           0 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     435           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_access_acl));
     436           0 :                 if (_ptr_access_acl) {
     437           0 :                         NDR_PULL_ALLOC(ndr, r->access_acl);
     438             :                 } else {
     439           0 :                         r->access_acl = NULL;
     440             :                 }
     441           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_acl));
     442           0 :                 if (_ptr_default_acl) {
     443           0 :                         NDR_PULL_ALLOC(ndr, r->default_acl);
     444             :                 } else {
     445           0 :                         r->default_acl = NULL;
     446             :                 }
     447           0 :                 NDR_CHECK(ndr_pull_uid_t(ndr, NDR_SCALARS, &r->owner));
     448           0 :                 NDR_CHECK(ndr_pull_gid_t(ndr, NDR_SCALARS, &r->group));
     449           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->mode));
     450           0 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     451             :         }
     452           0 :         if (ndr_flags & NDR_BUFFERS) {
     453           0 :                 if (r->access_acl) {
     454           0 :                         _mem_save_access_acl_0 = NDR_PULL_GET_MEM_CTX(ndr);
     455           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->access_acl, 0);
     456           0 :                         NDR_CHECK(ndr_pull_smb_acl_t(ndr, NDR_SCALARS|NDR_BUFFERS, r->access_acl));
     457           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_access_acl_0, 0);
     458             :                 }
     459           0 :                 if (r->default_acl) {
     460           0 :                         _mem_save_default_acl_0 = NDR_PULL_GET_MEM_CTX(ndr);
     461           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->default_acl, 0);
     462           0 :                         NDR_CHECK(ndr_pull_smb_acl_t(ndr, NDR_SCALARS|NDR_BUFFERS, r->default_acl));
     463           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_acl_0, 0);
     464             :                 }
     465             :         }
     466           0 :         return NDR_ERR_SUCCESS;
     467             : }
     468             : 
     469           0 : static void ndr_print_flags_smb_acl_wrapper(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct smb_acl_wrapper *r)
     470             : {
     471           0 :         ndr_print_smb_acl_wrapper(ndr, name, r);
     472           0 : }
     473             : 
     474           0 : _PUBLIC_ void ndr_print_smb_acl_wrapper(struct ndr_print *ndr, const char *name, const struct smb_acl_wrapper *r)
     475             : {
     476           0 :         ndr_print_struct(ndr, name, "smb_acl_wrapper");
     477           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     478           0 :         ndr->depth++;
     479           0 :         ndr_print_ptr(ndr, "access_acl", r->access_acl);
     480           0 :         ndr->depth++;
     481           0 :         if (r->access_acl) {
     482           0 :                 ndr_print_smb_acl_t(ndr, "access_acl", r->access_acl);
     483             :         }
     484           0 :         ndr->depth--;
     485           0 :         ndr_print_ptr(ndr, "default_acl", r->default_acl);
     486           0 :         ndr->depth++;
     487           0 :         if (r->default_acl) {
     488           0 :                 ndr_print_smb_acl_t(ndr, "default_acl", r->default_acl);
     489             :         }
     490           0 :         ndr->depth--;
     491           0 :         ndr_print_uid_t(ndr, "owner", r->owner);
     492           0 :         ndr_print_gid_t(ndr, "group", r->group);
     493           0 :         ndr_print_uint32(ndr, "mode", r->mode);
     494           0 :         ndr->depth--;
     495             : }
     496             : 
     497             : #ifndef SKIP_NDR_TABLE_smb_acl
     498             : static const struct ndr_interface_public_struct smb_acl_public_structs[] = {
     499             :         {
     500             :                 .name = "smb_acl_t",
     501             :                 .struct_size = sizeof(struct smb_acl_t ),
     502             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_smb_acl_t,
     503             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_smb_acl_t,
     504             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_smb_acl_t,
     505             :         },
     506             :         {
     507             :                 .name = "smb_acl_wrapper",
     508             :                 .struct_size = sizeof(struct smb_acl_wrapper ),
     509             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_smb_acl_wrapper,
     510             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_smb_acl_wrapper,
     511             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_smb_acl_wrapper,
     512             :         },
     513             :         { .name = NULL }
     514             : };
     515             : 
     516             : static const struct ndr_interface_call smb_acl_calls[] = {
     517             :         { .name = NULL }
     518             : };
     519             : 
     520             : static const char * const smb_acl_endpoint_strings[] = {
     521             :         "ncacn_np:[\\pipe\\smb_acl]", 
     522             : };
     523             : 
     524             : static const struct ndr_interface_string_array smb_acl_endpoints = {
     525             :         .count  = 1,
     526             :         .names  = smb_acl_endpoint_strings
     527             : };
     528             : 
     529             : static const char * const smb_acl_authservice_strings[] = {
     530             :         "host", 
     531             : };
     532             : 
     533             : static const struct ndr_interface_string_array smb_acl_authservices = {
     534             :         .count  = 1,
     535             :         .names  = smb_acl_authservice_strings
     536             : };
     537             : 
     538             : 
     539             : const struct ndr_interface_table ndr_table_smb_acl = {
     540             :         .name           = "smb_acl",
     541             :         .num_calls      = 0,
     542             :         .calls          = smb_acl_calls,
     543             :         .num_public_structs     = 2,
     544             :         .public_structs         = smb_acl_public_structs,
     545             :         .endpoints      = &smb_acl_endpoints,
     546             :         .authservices   = &smb_acl_authservices
     547             : };
     548             : 
     549             : #endif /* SKIP_NDR_TABLE_smb_acl */

Generated by: LCOV version 1.14