LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_preg.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 98 158 62.0 %
Date: 2021-09-23 10:06:22 Functions: 4 10 40.0 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/librpc/gen_ndr/ndr_preg.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_misc.h"
       7        6304 : _PUBLIC_ enum ndr_err_code ndr_push_preg_entry(struct ndr_push *ndr, int ndr_flags, const struct preg_entry *r)
       8             : {
       9             :         {
      10        6304 :                 uint32_t _flags_save_STRUCT = ndr->flags;
      11        6304 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      12        6304 :                 NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      13        6304 :                 if (ndr_flags & NDR_SCALARS) {
      14        6304 :                         NDR_CHECK(ndr_push_align(ndr, 8));
      15        6304 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "[", 2, sizeof(uint8_t), CH_DOS));
      16             :                         {
      17        6304 :                                 uint32_t _flags_save_string = ndr->flags;
      18        6304 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
      19        6304 :                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->keyname));
      20        6304 :                                 ndr->flags = _flags_save_string;
      21             :                         }
      22        6304 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
      23             :                         {
      24        6304 :                                 uint32_t _flags_save_string = ndr->flags;
      25        6304 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
      26        6304 :                                 NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->valuename));
      27        6304 :                                 ndr->flags = _flags_save_string;
      28             :                         }
      29        6304 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
      30        6304 :                         NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type));
      31        6304 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
      32        6304 :                         NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_winreg_Data_GPO(&r->data, r->type, ndr->flags)));
      33        6304 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, ";", 2, sizeof(uint8_t), CH_DOS));
      34             :                         {
      35        6304 :                                 uint32_t _flags_save_winreg_Data_GPO = ndr->flags;
      36        6304 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
      37             :                                 {
      38             :                                         struct ndr_push *_ndr_data;
      39        6304 :                                         NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_data, 0, ndr_size_winreg_Data_GPO(&r->data, r->type, ndr->flags)));
      40        6304 :                                         NDR_CHECK(ndr_push_set_switch_value(_ndr_data, &r->data, r->type));
      41        6304 :                                         NDR_CHECK(ndr_push_winreg_Data_GPO(_ndr_data, NDR_SCALARS|NDR_BUFFERS, &r->data));
      42        6304 :                                         NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_data, 0, ndr_size_winreg_Data_GPO(&r->data, r->type, ndr->flags)));
      43             :                                 }
      44        6304 :                                 ndr->flags = _flags_save_winreg_Data_GPO;
      45             :                         }
      46        6304 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "]", 2, sizeof(uint8_t), CH_DOS));
      47        6304 :                         NDR_CHECK(ndr_push_trailer_align(ndr, 8));
      48             :                 }
      49        6304 :                 if (ndr_flags & NDR_BUFFERS) {
      50             :                         {
      51           0 :                                 uint32_t _flags_save_winreg_Data_GPO = ndr->flags;
      52           0 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
      53           0 :                                 ndr->flags = _flags_save_winreg_Data_GPO;
      54             :                         }
      55             :                 }
      56        6304 :                 ndr->flags = _flags_save_STRUCT;
      57             :         }
      58        6304 :         return NDR_ERR_SUCCESS;
      59             : }
      60             : 
      61        8574 : _PUBLIC_ enum ndr_err_code ndr_pull_preg_entry(struct ndr_pull *ndr, int ndr_flags, struct preg_entry *r)
      62             : {
      63        8574 :         uint32_t size__opening_bracket_0 = 0;
      64        8574 :         uint32_t size__sep1_0 = 0;
      65        8574 :         uint32_t size__sep2_0 = 0;
      66        8574 :         uint32_t size__sep3_0 = 0;
      67        8574 :         uint32_t size__sep4_0 = 0;
      68        8574 :         uint32_t size__closing_bracket_0 = 0;
      69             :         {
      70        8574 :                 uint32_t _flags_save_STRUCT = ndr->flags;
      71        8574 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
      72        8574 :                 NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
      73        8574 :                 if (ndr_flags & NDR_SCALARS) {
      74        8574 :                         NDR_CHECK(ndr_pull_align(ndr, 8));
      75        8574 :                         size__opening_bracket_0 = 2;
      76        8574 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_opening_bracket, size__opening_bracket_0, sizeof(uint8_t), CH_DOS));
      77             :                         {
      78        8574 :                                 uint32_t _flags_save_string = ndr->flags;
      79        8574 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
      80        8574 :                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->keyname));
      81        8574 :                                 ndr->flags = _flags_save_string;
      82             :                         }
      83        8574 :                         size__sep1_0 = 2;
      84        8574 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep1, size__sep1_0, sizeof(uint8_t), CH_DOS));
      85             :                         {
      86        8574 :                                 uint32_t _flags_save_string = ndr->flags;
      87        8574 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
      88        8574 :                                 NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->valuename));
      89        8574 :                                 ndr->flags = _flags_save_string;
      90             :                         }
      91        8574 :                         size__sep2_0 = 2;
      92        8574 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep2, size__sep2_0, sizeof(uint8_t), CH_DOS));
      93        8574 :                         NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type));
      94        8574 :                         size__sep3_0 = 2;
      95        8574 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep3, size__sep3_0, sizeof(uint8_t), CH_DOS));
      96        8574 :                         NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size));
      97        8574 :                         size__sep4_0 = 2;
      98        8574 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_sep4, size__sep4_0, sizeof(uint8_t), CH_DOS));
      99             :                         {
     100        8574 :                                 uint32_t _flags_save_winreg_Data_GPO = ndr->flags;
     101        8574 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     102             :                                 {
     103             :                                         struct ndr_pull *_ndr_data;
     104        8574 :                                         NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_data, 0, r->size));
     105        8574 :                                         NDR_CHECK(ndr_pull_set_switch_value(_ndr_data, &r->data, r->type));
     106        8574 :                                         NDR_CHECK(ndr_pull_winreg_Data_GPO(_ndr_data, NDR_SCALARS|NDR_BUFFERS, &r->data));
     107        8574 :                                         NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_data, 0, r->size));
     108             :                                 }
     109        8574 :                                 ndr->flags = _flags_save_winreg_Data_GPO;
     110             :                         }
     111        8574 :                         size__closing_bracket_0 = 2;
     112        8574 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->_closing_bracket, size__closing_bracket_0, sizeof(uint8_t), CH_DOS));
     113        8574 :                         NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     114             :                 }
     115        8574 :                 if (ndr_flags & NDR_BUFFERS) {
     116             :                         {
     117           0 :                                 uint32_t _flags_save_winreg_Data_GPO = ndr->flags;
     118           0 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     119           0 :                                 ndr->flags = _flags_save_winreg_Data_GPO;
     120             :                         }
     121             :                 }
     122        8574 :                 ndr->flags = _flags_save_STRUCT;
     123             :         }
     124        8574 :         return NDR_ERR_SUCCESS;
     125             : }
     126             : 
     127           0 : static void ndr_print_flags_preg_entry(struct ndr_print *ndr, const char *name, int unused, const struct preg_entry *r)
     128             : {
     129           0 :         ndr_print_preg_entry(ndr, name, r);
     130           0 : }
     131             : 
     132           0 : _PUBLIC_ void ndr_print_preg_entry(struct ndr_print *ndr, const char *name, const struct preg_entry *r)
     133             : {
     134           0 :         ndr_print_struct(ndr, name, "preg_entry");
     135           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     136             :         {
     137           0 :                 uint32_t _flags_save_STRUCT = ndr->flags;
     138           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
     139           0 :                 ndr->depth++;
     140             :                 {
     141           0 :                         uint32_t _flags_save_string = ndr->flags;
     142           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
     143           0 :                         ndr_print_string(ndr, "keyname", r->keyname);
     144           0 :                         ndr->flags = _flags_save_string;
     145             :                 }
     146             :                 {
     147           0 :                         uint32_t _flags_save_string = ndr->flags;
     148           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2);
     149           0 :                         ndr_print_string(ndr, "valuename", r->valuename);
     150           0 :                         ndr->flags = _flags_save_string;
     151             :                 }
     152           0 :                 ndr_print_winreg_Type(ndr, "type", r->type);
     153           0 :                 ndr_print_uint32(ndr, "size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_winreg_Data_GPO(&r->data, r->type, ndr->flags):r->size);
     154             :                 {
     155           0 :                         uint32_t _flags_save_winreg_Data_GPO = ndr->flags;
     156           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     157           0 :                         ndr_print_set_switch_value(ndr, &r->data, r->type);
     158           0 :                         ndr_print_winreg_Data_GPO(ndr, "data", &r->data);
     159           0 :                         ndr->flags = _flags_save_winreg_Data_GPO;
     160             :                 }
     161           0 :                 ndr->depth--;
     162           0 :                 ndr->flags = _flags_save_STRUCT;
     163             :         }
     164             : }
     165             : 
     166         126 : _PUBLIC_ enum ndr_err_code ndr_push_preg_header(struct ndr_push *ndr, int ndr_flags, const struct preg_header *r)
     167             : {
     168         126 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     169         126 :         if (ndr_flags & NDR_SCALARS) {
     170         126 :                 NDR_CHECK(ndr_push_align(ndr, 4));
     171         126 :                 NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "PReg", 4, sizeof(uint8_t), CH_DOS));
     172         126 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 1));
     173         126 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 4));
     174             :         }
     175         126 :         if (ndr_flags & NDR_BUFFERS) {
     176             :         }
     177         126 :         return NDR_ERR_SUCCESS;
     178             : }
     179             : 
     180         154 : _PUBLIC_ enum ndr_err_code ndr_pull_preg_header(struct ndr_pull *ndr, int ndr_flags, struct preg_header *r)
     181             : {
     182         154 :         uint32_t size_signature_0 = 0;
     183         154 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     184         154 :         if (ndr_flags & NDR_SCALARS) {
     185         154 :                 NDR_CHECK(ndr_pull_align(ndr, 4));
     186         154 :                 size_signature_0 = 4;
     187         154 :                 NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->signature, size_signature_0, sizeof(uint8_t), CH_DOS));
     188         154 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version));
     189         154 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
     190             :         }
     191         154 :         if (ndr_flags & NDR_BUFFERS) {
     192             :         }
     193         154 :         return NDR_ERR_SUCCESS;
     194             : }
     195             : 
     196           0 : static void ndr_print_flags_preg_header(struct ndr_print *ndr, const char *name, int unused, const struct preg_header *r)
     197             : {
     198           0 :         ndr_print_preg_header(ndr, name, r);
     199           0 : }
     200             : 
     201           0 : _PUBLIC_ void ndr_print_preg_header(struct ndr_print *ndr, const char *name, const struct preg_header *r)
     202             : {
     203           0 :         ndr_print_struct(ndr, name, "preg_header");
     204           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     205           0 :         ndr->depth++;
     206           0 :         ndr_print_string(ndr, "signature", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"PReg":r->signature);
     207           0 :         ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?1:r->version);
     208           0 :         ndr->depth--;
     209             : }
     210             : 
     211           0 : static void ndr_print_flags_preg_file(struct ndr_print *ndr, const char *name, int unused, const struct preg_file *r)
     212             : {
     213           0 :         ndr_print_preg_file(ndr, name, r);
     214           0 : }
     215             : 
     216           0 : _PUBLIC_ void ndr_print_preg_file(struct ndr_print *ndr, const char *name, const struct preg_file *r)
     217             : {
     218             :         uint32_t cntr_entries_0;
     219           0 :         ndr_print_struct(ndr, name, "preg_file");
     220           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     221             :         {
     222           0 :                 uint32_t _flags_save_STRUCT = ndr->flags;
     223           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
     224           0 :                 ndr->depth++;
     225           0 :                 ndr_print_preg_header(ndr, "header", &r->header);
     226           0 :                 ndr_print_uint32(ndr, "num_entries", r->num_entries);
     227           0 :                 ndr->print(ndr, "%s: ARRAY(%d)", "entries", (int)r->num_entries);
     228           0 :                 ndr->depth++;
     229           0 :                 for (cntr_entries_0 = 0; cntr_entries_0 < (r->num_entries); cntr_entries_0++) {
     230           0 :                         ndr_print_preg_entry(ndr, "entries", &r->entries[cntr_entries_0]);
     231             :                 }
     232           0 :                 ndr->depth--;
     233           0 :                 ndr->depth--;
     234           0 :                 ndr->flags = _flags_save_STRUCT;
     235             :         }
     236             : }
     237             : 
     238             : #ifndef SKIP_NDR_TABLE_preg
     239             : static const struct ndr_interface_public_struct preg_public_structs[] = {
     240             :         {
     241             :                 .name = "preg_entry",
     242             :                 .struct_size = sizeof(struct preg_entry ),
     243             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_preg_entry,
     244             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_preg_entry,
     245             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_preg_entry,
     246             :         },
     247             :         {
     248             :                 .name = "preg_header",
     249             :                 .struct_size = sizeof(struct preg_header ),
     250             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_preg_header,
     251             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_preg_header,
     252             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_preg_header,
     253             :         },
     254             :         {
     255             :                 .name = "preg_file",
     256             :                 .struct_size = sizeof(struct preg_file ),
     257             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_preg_file,
     258             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_preg_file,
     259             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_preg_file,
     260             :         },
     261             :         { .name = NULL }
     262             : };
     263             : 
     264             : static const struct ndr_interface_call preg_calls[] = {
     265             :         { .name = NULL }
     266             : };
     267             : 
     268             : static const char * const preg_endpoint_strings[] = {
     269             :         "ncacn_np:[\\pipe\\preg]", 
     270             : };
     271             : 
     272             : static const struct ndr_interface_string_array preg_endpoints = {
     273             :         .count  = 1,
     274             :         .names  = preg_endpoint_strings
     275             : };
     276             : 
     277             : static const char * const preg_authservice_strings[] = {
     278             :         "host", 
     279             : };
     280             : 
     281             : static const struct ndr_interface_string_array preg_authservices = {
     282             :         .count  = 1,
     283             :         .names  = preg_authservice_strings
     284             : };
     285             : 
     286             : 
     287             : const struct ndr_interface_table ndr_table_preg = {
     288             :         .name           = "preg",
     289             :         .syntax_id      = {
     290             :                 {0x67655250,0x0000,0x0000,{0x00,0x00},{0x00,0x00,0x00,0x00}},
     291             :                 NDR_PREG_VERSION
     292             :         },
     293             :         .helpstring     = NDR_PREG_HELPSTRING,
     294             :         .num_calls      = 0,
     295             :         .calls          = preg_calls,
     296             :         .num_public_structs     = 3,
     297             :         .public_structs         = preg_public_structs,
     298             :         .endpoints      = &preg_endpoints,
     299             :         .authservices   = &preg_authservices
     300             : };
     301             : 
     302             : #endif /* SKIP_NDR_TABLE_preg */

Generated by: LCOV version 1.13