LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_bkupblobs.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 0 213 0.0 %
Date: 2021-09-23 10:06:22 Functions: 0 15 0.0 %

          Line data    Source code
       1             : /* parser auto-generated by pidl */
       2             : 
       3             : #include "includes.h"
       4             : #include "bin/default/librpc/gen_ndr/ndr_bkupblobs.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_misc.h"
       7             : #include "librpc/gen_ndr/ndr_security.h"
       8             : #include "librpc/gen_ndr/ndr_fscc.h"
       9           0 : static enum ndr_err_code ndr_push_bkup_StreamId(struct ndr_push *ndr, int ndr_flags, enum bkup_StreamId r)
      10             : {
      11           0 :         NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
      12           0 :         return NDR_ERR_SUCCESS;
      13             : }
      14             : 
      15           0 : static enum ndr_err_code ndr_pull_bkup_StreamId(struct ndr_pull *ndr, int ndr_flags, enum bkup_StreamId *r)
      16             : {
      17             :         uint32_t v;
      18           0 :         NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
      19           0 :         *r = v;
      20           0 :         return NDR_ERR_SUCCESS;
      21             : }
      22             : 
      23           0 : _PUBLIC_ void ndr_print_bkup_StreamId(struct ndr_print *ndr, const char *name, enum bkup_StreamId r)
      24             : {
      25           0 :         const char *val = NULL;
      26             : 
      27           0 :         switch (r) {
      28           0 :                 case STREAM_ID_DATA: val = "STREAM_ID_DATA"; break;
      29           0 :                 case STREAM_ID_EX_DATA: val = "STREAM_ID_EX_DATA"; break;
      30           0 :                 case STREAM_ID_SECURITY_DATA: val = "STREAM_ID_SECURITY_DATA"; break;
      31           0 :                 case STREAM_ID_ALTERNATE_DATA: val = "STREAM_ID_ALTERNATE_DATA"; break;
      32           0 :                 case STREAM_ID_LINK: val = "STREAM_ID_LINK"; break;
      33           0 :                 case STREAM_ID_OBJECTID: val = "STREAM_ID_OBJECTID"; break;
      34           0 :                 case STREAM_ID_REPARSE_DATA: val = "STREAM_ID_REPARSE_DATA"; break;
      35           0 :                 case STREAM_ID_SPARSE_BLOCK: val = "STREAM_ID_SPARSE_BLOCK"; break;
      36           0 :                 case STREAM_ID_TXFS_DATA: val = "STREAM_ID_TXFS_DATA"; break;
      37             :         }
      38           0 :         ndr_print_enum(ndr, name, "ENUM", val, r);
      39           0 : }
      40             : 
      41           0 : static enum ndr_err_code ndr_push_bkup_StreamAttribute(struct ndr_push *ndr, int ndr_flags, enum bkup_StreamAttribute r)
      42             : {
      43           0 :         NDR_CHECK(ndr_push_enum_uint32(ndr, NDR_SCALARS, r));
      44           0 :         return NDR_ERR_SUCCESS;
      45             : }
      46             : 
      47           0 : static enum ndr_err_code ndr_pull_bkup_StreamAttribute(struct ndr_pull *ndr, int ndr_flags, enum bkup_StreamAttribute *r)
      48             : {
      49             :         uint32_t v;
      50           0 :         NDR_CHECK(ndr_pull_enum_uint32(ndr, NDR_SCALARS, &v));
      51           0 :         *r = v;
      52           0 :         return NDR_ERR_SUCCESS;
      53             : }
      54             : 
      55           0 : _PUBLIC_ void ndr_print_bkup_StreamAttribute(struct ndr_print *ndr, const char *name, enum bkup_StreamAttribute r)
      56             : {
      57           0 :         const char *val = NULL;
      58             : 
      59           0 :         switch (r) {
      60           0 :                 case STREAM_ATTRIBUTE_NORMAL: val = "STREAM_ATTRIBUTE_NORMAL"; break;
      61           0 :                 case STREAM_ATTRIBUTE_SECURITY: val = "STREAM_ATTRIBUTE_SECURITY"; break;
      62           0 :                 case STREAM_ATTRIBUTE_SPARSE: val = "STREAM_ATTRIBUTE_SPARSE"; break;
      63             :         }
      64           0 :         ndr_print_enum(ndr, name, "ENUM", val, r);
      65           0 : }
      66             : 
      67           0 : static enum ndr_err_code ndr_push_bkup_StreamData(struct ndr_push *ndr, int ndr_flags, const union bkup_StreamData *r)
      68             : {
      69             :         uint32_t level;
      70           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
      71           0 :         if (ndr_flags & NDR_SCALARS) {
      72             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
      73           0 :                 NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
      74           0 :                 NDR_CHECK(ndr_push_union_align(ndr, 5));
      75           0 :                 switch (level) {
      76           0 :                         default: {
      77           0 :                                 NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->blob));
      78           0 :                         break; }
      79             : 
      80           0 :                         case STREAM_ID_SECURITY_DATA: {
      81             :                                 {
      82           0 :                                         uint32_t _flags_save_security_descriptor = ndr->flags;
      83           0 :                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
      84           0 :                                         NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS, &r->sd));
      85           0 :                                         ndr->flags = _flags_save_security_descriptor;
      86             :                                 }
      87           0 :                         break; }
      88             : 
      89           0 :                         case STREAM_ID_OBJECTID: {
      90           0 :                                 NDR_CHECK(ndr_push_fscc_FileObjectIdBuffer_2(ndr, NDR_SCALARS, &r->object));
      91           0 :                         break; }
      92             : 
      93             :                 }
      94           0 :         }
      95           0 :         if (ndr_flags & NDR_BUFFERS) {
      96           0 :                 if (!(ndr_flags & NDR_SCALARS)) {
      97             :                         /* We didn't get it above, and the token is not needed after this. */
      98           0 :                         NDR_CHECK(ndr_push_steal_switch_value(ndr, r, &level));
      99             :                 }
     100           0 :                 switch (level) {
     101           0 :                         default:
     102           0 :                         break;
     103             : 
     104           0 :                         case STREAM_ID_SECURITY_DATA:
     105             :                                 {
     106           0 :                                         uint32_t _flags_save_security_descriptor = ndr->flags;
     107           0 :                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
     108           0 :                                         NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_BUFFERS, &r->sd));
     109           0 :                                         ndr->flags = _flags_save_security_descriptor;
     110             :                                 }
     111           0 :                         break;
     112             : 
     113           0 :                         case STREAM_ID_OBJECTID:
     114           0 :                         break;
     115             : 
     116             :                 }
     117           0 :         }
     118           0 :         return NDR_ERR_SUCCESS;
     119             : }
     120             : 
     121           0 : static enum ndr_err_code ndr_pull_bkup_StreamData(struct ndr_pull *ndr, int ndr_flags, union bkup_StreamData *r)
     122             : {
     123             :         uint32_t level;
     124           0 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     125           0 :         if (ndr_flags & NDR_SCALARS) {
     126             :                 /* This token is not used again (except perhaps below in the NDR_BUFFERS case) */
     127           0 :                 NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     128           0 :                 NDR_CHECK(ndr_pull_union_align(ndr, 5));
     129           0 :                 switch (level) {
     130           0 :                         default: {
     131           0 :                                 NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->blob));
     132           0 :                         break; }
     133             : 
     134           0 :                         case STREAM_ID_SECURITY_DATA: {
     135             :                                 {
     136           0 :                                         uint32_t _flags_save_security_descriptor = ndr->flags;
     137           0 :                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
     138           0 :                                         NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS, &r->sd));
     139           0 :                                         ndr->flags = _flags_save_security_descriptor;
     140             :                                 }
     141           0 :                         break; }
     142             : 
     143           0 :                         case STREAM_ID_OBJECTID: {
     144           0 :                                 NDR_CHECK(ndr_pull_fscc_FileObjectIdBuffer_2(ndr, NDR_SCALARS, &r->object));
     145           0 :                         break; }
     146             : 
     147             :                 }
     148           0 :         }
     149           0 :         if (ndr_flags & NDR_BUFFERS) {
     150           0 :                 if (!(ndr_flags & NDR_SCALARS)) {
     151             :                         /* We didn't get it above, and the token is not needed after this. */
     152           0 :                         NDR_CHECK(ndr_pull_steal_switch_value(ndr, r, &level));
     153             :                 }
     154           0 :                 switch (level) {
     155           0 :                         default:
     156           0 :                         break;
     157             : 
     158           0 :                         case STREAM_ID_SECURITY_DATA:
     159             :                                 {
     160           0 :                                         uint32_t _flags_save_security_descriptor = ndr->flags;
     161           0 :                                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
     162           0 :                                         NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_BUFFERS, &r->sd));
     163           0 :                                         ndr->flags = _flags_save_security_descriptor;
     164             :                                 }
     165           0 :                         break;
     166             : 
     167           0 :                         case STREAM_ID_OBJECTID:
     168           0 :                         break;
     169             : 
     170             :                 }
     171           0 :         }
     172           0 :         return NDR_ERR_SUCCESS;
     173             : }
     174             : 
     175           0 : _PUBLIC_ void ndr_print_bkup_StreamData(struct ndr_print *ndr, const char *name, const union bkup_StreamData *r)
     176             : {
     177             :         uint32_t level;
     178           0 :         level = ndr_print_steal_switch_value(ndr, r);
     179           0 :         ndr_print_union(ndr, name, level, "bkup_StreamData");
     180           0 :         switch (level) {
     181           0 :                 default:
     182           0 :                         ndr_print_DATA_BLOB(ndr, "blob", r->blob);
     183           0 :                 break;
     184             : 
     185           0 :                 case STREAM_ID_SECURITY_DATA:
     186             :                         {
     187           0 :                                 uint32_t _flags_save_security_descriptor = ndr->flags;
     188           0 :                                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN2);
     189           0 :                                 ndr_print_security_descriptor(ndr, "sd", &r->sd);
     190           0 :                                 ndr->flags = _flags_save_security_descriptor;
     191             :                         }
     192           0 :                 break;
     193             : 
     194           0 :                 case STREAM_ID_OBJECTID:
     195           0 :                         ndr_print_fscc_FileObjectIdBuffer_2(ndr, "object", &r->object);
     196           0 :                 break;
     197             : 
     198             :         }
     199           0 : }
     200             : 
     201           0 : _PUBLIC_ enum ndr_err_code ndr_push_bkup_Win32StreamId(struct ndr_push *ndr, int ndr_flags, const struct bkup_Win32StreamId *r)
     202             : {
     203           0 :         NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
     204           0 :         if (ndr_flags & NDR_SCALARS) {
     205           0 :                 NDR_CHECK(ndr_push_align(ndr, 8));
     206           0 :                 NDR_CHECK(ndr_push_bkup_StreamId(ndr, NDR_SCALARS, r->id));
     207           0 :                 NDR_CHECK(ndr_push_bkup_StreamAttribute(ndr, NDR_SCALARS, r->attribute));
     208           0 :                 NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->size));
     209           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->stream_name_size));
     210             :                 {
     211           0 :                         uint32_t _flags_save_uint16 = ndr->flags;
     212           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM);
     213           0 :                         NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->stream_name, r->stream_name_size, sizeof(uint16_t), CH_UTF16));
     214           0 :                         ndr->flags = _flags_save_uint16;
     215             :                 }
     216             :                 {
     217           0 :                         uint32_t _flags_save_bkup_StreamData = ndr->flags;
     218           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     219             :                         {
     220             :                                 struct ndr_push *_ndr_data;
     221           0 :                                 NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_data, 0, r->size));
     222           0 :                                 NDR_CHECK(ndr_push_set_switch_value(_ndr_data, &r->data, r->id));
     223           0 :                                 NDR_CHECK(ndr_push_bkup_StreamData(_ndr_data, NDR_SCALARS|NDR_BUFFERS, &r->data));
     224           0 :                                 NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_data, 0, r->size));
     225             :                         }
     226           0 :                         ndr->flags = _flags_save_bkup_StreamData;
     227             :                 }
     228           0 :                 NDR_CHECK(ndr_push_trailer_align(ndr, 8));
     229             :         }
     230           0 :         if (ndr_flags & NDR_BUFFERS) {
     231             :                 {
     232           0 :                         uint32_t _flags_save_bkup_StreamData = ndr->flags;
     233           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     234           0 :                         ndr->flags = _flags_save_bkup_StreamData;
     235             :                 }
     236             :         }
     237           0 :         return NDR_ERR_SUCCESS;
     238             : }
     239             : 
     240           0 : _PUBLIC_ enum ndr_err_code ndr_pull_bkup_Win32StreamId(struct ndr_pull *ndr, int ndr_flags, struct bkup_Win32StreamId *r)
     241             : {
     242           0 :         uint32_t size_stream_name_0 = 0;
     243           0 :         NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
     244           0 :         if (ndr_flags & NDR_SCALARS) {
     245           0 :                 NDR_CHECK(ndr_pull_align(ndr, 8));
     246           0 :                 NDR_CHECK(ndr_pull_bkup_StreamId(ndr, NDR_SCALARS, &r->id));
     247           0 :                 NDR_CHECK(ndr_pull_bkup_StreamAttribute(ndr, NDR_SCALARS, &r->attribute));
     248           0 :                 NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->size));
     249           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->stream_name_size));
     250             :                 {
     251           0 :                         uint32_t _flags_save_uint16 = ndr->flags;
     252           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM);
     253           0 :                         size_stream_name_0 = r->stream_name_size;
     254           0 :                         NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->stream_name, size_stream_name_0, sizeof(uint16_t), CH_UTF16));
     255           0 :                         ndr->flags = _flags_save_uint16;
     256             :                 }
     257             :                 {
     258           0 :                         uint32_t _flags_save_bkup_StreamData = ndr->flags;
     259           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     260             :                         {
     261             :                                 struct ndr_pull *_ndr_data;
     262           0 :                                 NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_data, 0, r->size));
     263           0 :                                 NDR_CHECK(ndr_pull_set_switch_value(_ndr_data, &r->data, r->id));
     264           0 :                                 NDR_CHECK(ndr_pull_bkup_StreamData(_ndr_data, NDR_SCALARS|NDR_BUFFERS, &r->data));
     265           0 :                                 NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_data, 0, r->size));
     266             :                         }
     267           0 :                         ndr->flags = _flags_save_bkup_StreamData;
     268             :                 }
     269           0 :                 NDR_CHECK(ndr_pull_trailer_align(ndr, 8));
     270             :         }
     271           0 :         if (ndr_flags & NDR_BUFFERS) {
     272             :                 {
     273           0 :                         uint32_t _flags_save_bkup_StreamData = ndr->flags;
     274           0 :                         ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     275           0 :                         ndr->flags = _flags_save_bkup_StreamData;
     276             :                 }
     277             :         }
     278           0 :         return NDR_ERR_SUCCESS;
     279             : }
     280             : 
     281           0 : static void ndr_print_flags_bkup_Win32StreamId(struct ndr_print *ndr, const char *name, int unused, const struct bkup_Win32StreamId *r)
     282             : {
     283           0 :         ndr_print_bkup_Win32StreamId(ndr, name, r);
     284           0 : }
     285             : 
     286           0 : _PUBLIC_ void ndr_print_bkup_Win32StreamId(struct ndr_print *ndr, const char *name, const struct bkup_Win32StreamId *r)
     287             : {
     288           0 :         ndr_print_struct(ndr, name, "bkup_Win32StreamId");
     289           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     290           0 :         ndr->depth++;
     291           0 :         ndr_print_bkup_StreamId(ndr, "id", r->id);
     292           0 :         ndr_print_bkup_StreamAttribute(ndr, "attribute", r->attribute);
     293           0 :         ndr_print_hyper(ndr, "size", r->size);
     294           0 :         ndr_print_uint32(ndr, "stream_name_size", r->stream_name_size);
     295             :         {
     296           0 :                 uint32_t _flags_save_uint16 = ndr->flags;
     297           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NOTERM);
     298           0 :                 ndr_print_string(ndr, "stream_name", r->stream_name);
     299           0 :                 ndr->flags = _flags_save_uint16;
     300             :         }
     301             :         {
     302           0 :                 uint32_t _flags_save_bkup_StreamData = ndr->flags;
     303           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING);
     304           0 :                 ndr_print_set_switch_value(ndr, &r->data, r->id);
     305           0 :                 ndr_print_bkup_StreamData(ndr, "data", &r->data);
     306           0 :                 ndr->flags = _flags_save_bkup_StreamData;
     307             :         }
     308           0 :         ndr->depth--;
     309             : }
     310             : 
     311           0 : static void ndr_print_flags_bkup_NTBackupFile(struct ndr_print *ndr, const char *name, int unused, const struct bkup_NTBackupFile *r)
     312             : {
     313           0 :         ndr_print_bkup_NTBackupFile(ndr, name, r);
     314           0 : }
     315             : 
     316           0 : _PUBLIC_ void ndr_print_bkup_NTBackupFile(struct ndr_print *ndr, const char *name, const struct bkup_NTBackupFile *r)
     317             : {
     318             :         uint32_t cntr_streams_0;
     319           0 :         ndr_print_struct(ndr, name, "bkup_NTBackupFile");
     320           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     321             :         {
     322           0 :                 uint32_t _flags_save_STRUCT = ndr->flags;
     323           0 :                 ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
     324           0 :                 ndr->depth++;
     325           0 :                 ndr_print_uint32(ndr, "num_stream", r->num_stream);
     326           0 :                 ndr->print(ndr, "%s: ARRAY(%d)", "streams", (int)r->num_stream);
     327           0 :                 ndr->depth++;
     328           0 :                 for (cntr_streams_0 = 0; cntr_streams_0 < (r->num_stream); cntr_streams_0++) {
     329           0 :                         ndr_print_bkup_Win32StreamId(ndr, "streams", &r->streams[cntr_streams_0]);
     330             :                 }
     331           0 :                 ndr->depth--;
     332           0 :                 ndr->depth--;
     333           0 :                 ndr->flags = _flags_save_STRUCT;
     334             :         }
     335             : }
     336             : 
     337             : #ifndef SKIP_NDR_TABLE_bkupblobs
     338             : static const struct ndr_interface_public_struct bkupblobs_public_structs[] = {
     339             :         {
     340             :                 .name = "bkup_Win32StreamId",
     341             :                 .struct_size = sizeof(struct bkup_Win32StreamId ),
     342             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_bkup_Win32StreamId,
     343             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_bkup_Win32StreamId,
     344             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_bkup_Win32StreamId,
     345             :         },
     346             :         {
     347             :                 .name = "bkup_NTBackupFile",
     348             :                 .struct_size = sizeof(struct bkup_NTBackupFile ),
     349             :                 .ndr_push = (ndr_push_flags_fn_t) ndr_push_bkup_NTBackupFile,
     350             :                 .ndr_pull = (ndr_pull_flags_fn_t) ndr_pull_bkup_NTBackupFile,
     351             :                 .ndr_print = (ndr_print_function_t) ndr_print_flags_bkup_NTBackupFile,
     352             :         },
     353             :         { .name = NULL }
     354             : };
     355             : 
     356             : static const struct ndr_interface_call bkupblobs_calls[] = {
     357             :         { .name = NULL }
     358             : };
     359             : 
     360             : static const char * const bkupblobs_endpoint_strings[] = {
     361             :         "ncacn_np:[\\pipe\\bkupblobs]", 
     362             : };
     363             : 
     364             : static const struct ndr_interface_string_array bkupblobs_endpoints = {
     365             :         .count  = 1,
     366             :         .names  = bkupblobs_endpoint_strings
     367             : };
     368             : 
     369             : static const char * const bkupblobs_authservice_strings[] = {
     370             :         "host", 
     371             : };
     372             : 
     373             : static const struct ndr_interface_string_array bkupblobs_authservices = {
     374             :         .count  = 1,
     375             :         .names  = bkupblobs_authservice_strings
     376             : };
     377             : 
     378             : 
     379             : const struct ndr_interface_table ndr_table_bkupblobs = {
     380             :         .name           = "bkupblobs",
     381             :         .num_calls      = 0,
     382             :         .calls          = bkupblobs_calls,
     383             :         .num_public_structs     = 2,
     384             :         .public_structs         = bkupblobs_public_structs,
     385             :         .endpoints      = &bkupblobs_endpoints,
     386             :         .authservices   = &bkupblobs_authservices
     387             : };
     388             : 
     389             : #endif /* SKIP_NDR_TABLE_bkupblobs */

Generated by: LCOV version 1.13