LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - ndr_initshutdown.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 0 195 0.0 %
Date: 2021-09-23 10:06:22 Functions: 0 9 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_initshutdown.h"
       5             : 
       6             : #include "librpc/gen_ndr/ndr_lsa.h"
       7           0 : static enum ndr_err_code ndr_push_initshutdown_Init(struct ndr_push *ndr, int flags, const struct initshutdown_Init *r)
       8             : {
       9           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
      10           0 :         if (flags & NDR_IN) {
      11           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname));
      12           0 :                 if (r->in.hostname) {
      13           0 :                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname));
      14             :                 }
      15           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message));
      16           0 :                 if (r->in.message) {
      17           0 :                         NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
      18             :                 }
      19           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
      20           0 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
      21           0 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot));
      22             :         }
      23           0 :         if (flags & NDR_OUT) {
      24           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
      25             :         }
      26           0 :         return NDR_ERR_SUCCESS;
      27             : }
      28             : 
      29           0 : static enum ndr_err_code ndr_pull_initshutdown_Init(struct ndr_pull *ndr, int flags, struct initshutdown_Init *r)
      30             : {
      31             :         uint32_t _ptr_hostname;
      32             :         uint32_t _ptr_message;
      33           0 :         TALLOC_CTX *_mem_save_hostname_0 = NULL;
      34           0 :         TALLOC_CTX *_mem_save_message_0 = NULL;
      35           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
      36           0 :         if (flags & NDR_IN) {
      37           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname));
      38           0 :                 if (_ptr_hostname) {
      39           0 :                         NDR_PULL_ALLOC(ndr, r->in.hostname);
      40             :                 } else {
      41           0 :                         r->in.hostname = NULL;
      42             :                 }
      43           0 :                 if (r->in.hostname) {
      44           0 :                         _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr);
      45           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0);
      46           0 :                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname));
      47           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0);
      48             :                 }
      49           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message));
      50           0 :                 if (_ptr_message) {
      51           0 :                         NDR_PULL_ALLOC(ndr, r->in.message);
      52             :                 } else {
      53           0 :                         r->in.message = NULL;
      54             :                 }
      55           0 :                 if (r->in.message) {
      56           0 :                         _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr);
      57           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0);
      58           0 :                         NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
      59           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0);
      60             :                 }
      61           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
      62           0 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps));
      63           0 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot));
      64             :         }
      65           0 :         if (flags & NDR_OUT) {
      66             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
      67             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
      68           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
      69             :         }
      70           0 :         return NDR_ERR_SUCCESS;
      71             : }
      72             : 
      73           0 : _PUBLIC_ void ndr_print_initshutdown_Init(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Init *r)
      74             : {
      75           0 :         ndr_print_struct(ndr, name, "initshutdown_Init");
      76           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
      77           0 :         ndr->depth++;
      78           0 :         if (flags & NDR_SET_VALUES) {
      79           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
      80             :         }
      81           0 :         if (flags & NDR_IN) {
      82           0 :                 ndr_print_struct(ndr, "in", "initshutdown_Init");
      83           0 :                 ndr->depth++;
      84           0 :                 ndr_print_ptr(ndr, "hostname", r->in.hostname);
      85           0 :                 ndr->depth++;
      86           0 :                 if (r->in.hostname) {
      87           0 :                         ndr_print_uint16(ndr, "hostname", *r->in.hostname);
      88             :                 }
      89           0 :                 ndr->depth--;
      90           0 :                 ndr_print_ptr(ndr, "message", r->in.message);
      91           0 :                 ndr->depth++;
      92           0 :                 if (r->in.message) {
      93           0 :                         ndr_print_lsa_StringLarge(ndr, "message", r->in.message);
      94             :                 }
      95           0 :                 ndr->depth--;
      96           0 :                 ndr_print_uint32(ndr, "timeout", r->in.timeout);
      97           0 :                 ndr_print_uint8(ndr, "force_apps", r->in.force_apps);
      98           0 :                 ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot);
      99           0 :                 ndr->depth--;
     100             :         }
     101           0 :         if (flags & NDR_OUT) {
     102           0 :                 ndr_print_struct(ndr, "out", "initshutdown_Init");
     103           0 :                 ndr->depth++;
     104           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
     105           0 :                 ndr->depth--;
     106             :         }
     107           0 :         ndr->depth--;
     108             : }
     109             : 
     110           0 : static enum ndr_err_code ndr_push_initshutdown_Abort(struct ndr_push *ndr, int flags, const struct initshutdown_Abort *r)
     111             : {
     112           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
     113           0 :         if (flags & NDR_IN) {
     114           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.server));
     115           0 :                 if (r->in.server) {
     116           0 :                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.server));
     117             :                 }
     118             :         }
     119           0 :         if (flags & NDR_OUT) {
     120           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
     121             :         }
     122           0 :         return NDR_ERR_SUCCESS;
     123             : }
     124             : 
     125           0 : static enum ndr_err_code ndr_pull_initshutdown_Abort(struct ndr_pull *ndr, int flags, struct initshutdown_Abort *r)
     126             : {
     127             :         uint32_t _ptr_server;
     128           0 :         TALLOC_CTX *_mem_save_server_0 = NULL;
     129           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
     130           0 :         if (flags & NDR_IN) {
     131           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server));
     132           0 :                 if (_ptr_server) {
     133           0 :                         NDR_PULL_ALLOC(ndr, r->in.server);
     134             :                 } else {
     135           0 :                         r->in.server = NULL;
     136             :                 }
     137           0 :                 if (r->in.server) {
     138           0 :                         _mem_save_server_0 = NDR_PULL_GET_MEM_CTX(ndr);
     139           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.server, 0);
     140           0 :                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.server));
     141           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_0, 0);
     142             :                 }
     143             :         }
     144           0 :         if (flags & NDR_OUT) {
     145             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
     146             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
     147           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
     148             :         }
     149           0 :         return NDR_ERR_SUCCESS;
     150             : }
     151             : 
     152           0 : _PUBLIC_ void ndr_print_initshutdown_Abort(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_Abort *r)
     153             : {
     154           0 :         ndr_print_struct(ndr, name, "initshutdown_Abort");
     155           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     156           0 :         ndr->depth++;
     157           0 :         if (flags & NDR_SET_VALUES) {
     158           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
     159             :         }
     160           0 :         if (flags & NDR_IN) {
     161           0 :                 ndr_print_struct(ndr, "in", "initshutdown_Abort");
     162           0 :                 ndr->depth++;
     163           0 :                 ndr_print_ptr(ndr, "server", r->in.server);
     164           0 :                 ndr->depth++;
     165           0 :                 if (r->in.server) {
     166           0 :                         ndr_print_uint16(ndr, "server", *r->in.server);
     167             :                 }
     168           0 :                 ndr->depth--;
     169           0 :                 ndr->depth--;
     170             :         }
     171           0 :         if (flags & NDR_OUT) {
     172           0 :                 ndr_print_struct(ndr, "out", "initshutdown_Abort");
     173           0 :                 ndr->depth++;
     174           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
     175           0 :                 ndr->depth--;
     176             :         }
     177           0 :         ndr->depth--;
     178             : }
     179             : 
     180           0 : static enum ndr_err_code ndr_push_initshutdown_InitEx(struct ndr_push *ndr, int flags, const struct initshutdown_InitEx *r)
     181             : {
     182           0 :         NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);
     183           0 :         if (flags & NDR_IN) {
     184           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.hostname));
     185           0 :                 if (r->in.hostname) {
     186           0 :                         NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, *r->in.hostname));
     187             :                 }
     188           0 :                 NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.message));
     189           0 :                 if (r->in.message) {
     190           0 :                         NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
     191             :                 }
     192           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.timeout));
     193           0 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.force_apps));
     194           0 :                 NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->in.do_reboot));
     195           0 :                 NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.reason));
     196             :         }
     197           0 :         if (flags & NDR_OUT) {
     198           0 :                 NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
     199             :         }
     200           0 :         return NDR_ERR_SUCCESS;
     201             : }
     202             : 
     203           0 : static enum ndr_err_code ndr_pull_initshutdown_InitEx(struct ndr_pull *ndr, int flags, struct initshutdown_InitEx *r)
     204             : {
     205             :         uint32_t _ptr_hostname;
     206             :         uint32_t _ptr_message;
     207           0 :         TALLOC_CTX *_mem_save_hostname_0 = NULL;
     208           0 :         TALLOC_CTX *_mem_save_message_0 = NULL;
     209           0 :         NDR_PULL_CHECK_FN_FLAGS(ndr, flags);
     210           0 :         if (flags & NDR_IN) {
     211           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hostname));
     212           0 :                 if (_ptr_hostname) {
     213           0 :                         NDR_PULL_ALLOC(ndr, r->in.hostname);
     214             :                 } else {
     215           0 :                         r->in.hostname = NULL;
     216             :                 }
     217           0 :                 if (r->in.hostname) {
     218           0 :                         _mem_save_hostname_0 = NDR_PULL_GET_MEM_CTX(ndr);
     219           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.hostname, 0);
     220           0 :                         NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, r->in.hostname));
     221           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hostname_0, 0);
     222             :                 }
     223           0 :                 NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_message));
     224           0 :                 if (_ptr_message) {
     225           0 :                         NDR_PULL_ALLOC(ndr, r->in.message);
     226             :                 } else {
     227           0 :                         r->in.message = NULL;
     228             :                 }
     229           0 :                 if (r->in.message) {
     230           0 :                         _mem_save_message_0 = NDR_PULL_GET_MEM_CTX(ndr);
     231           0 :                         NDR_PULL_SET_MEM_CTX(ndr, r->in.message, 0);
     232           0 :                         NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.message));
     233           0 :                         NDR_PULL_SET_MEM_CTX(ndr, _mem_save_message_0, 0);
     234             :                 }
     235           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.timeout));
     236           0 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.force_apps));
     237           0 :                 NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->in.do_reboot));
     238           0 :                 NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.reason));
     239             :         }
     240           0 :         if (flags & NDR_OUT) {
     241             : #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
     242             : #endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
     243           0 :                 NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
     244             :         }
     245           0 :         return NDR_ERR_SUCCESS;
     246             : }
     247             : 
     248           0 : _PUBLIC_ void ndr_print_initshutdown_InitEx(struct ndr_print *ndr, const char *name, int flags, const struct initshutdown_InitEx *r)
     249             : {
     250           0 :         ndr_print_struct(ndr, name, "initshutdown_InitEx");
     251           0 :         if (r == NULL) { ndr_print_null(ndr); return; }
     252           0 :         ndr->depth++;
     253           0 :         if (flags & NDR_SET_VALUES) {
     254           0 :                 ndr->flags |= LIBNDR_PRINT_SET_VALUES;
     255             :         }
     256           0 :         if (flags & NDR_IN) {
     257           0 :                 ndr_print_struct(ndr, "in", "initshutdown_InitEx");
     258           0 :                 ndr->depth++;
     259           0 :                 ndr_print_ptr(ndr, "hostname", r->in.hostname);
     260           0 :                 ndr->depth++;
     261           0 :                 if (r->in.hostname) {
     262           0 :                         ndr_print_uint16(ndr, "hostname", *r->in.hostname);
     263             :                 }
     264           0 :                 ndr->depth--;
     265           0 :                 ndr_print_ptr(ndr, "message", r->in.message);
     266           0 :                 ndr->depth++;
     267           0 :                 if (r->in.message) {
     268           0 :                         ndr_print_lsa_StringLarge(ndr, "message", r->in.message);
     269             :                 }
     270           0 :                 ndr->depth--;
     271           0 :                 ndr_print_uint32(ndr, "timeout", r->in.timeout);
     272           0 :                 ndr_print_uint8(ndr, "force_apps", r->in.force_apps);
     273           0 :                 ndr_print_uint8(ndr, "do_reboot", r->in.do_reboot);
     274           0 :                 ndr_print_uint32(ndr, "reason", r->in.reason);
     275           0 :                 ndr->depth--;
     276             :         }
     277           0 :         if (flags & NDR_OUT) {
     278           0 :                 ndr_print_struct(ndr, "out", "initshutdown_InitEx");
     279           0 :                 ndr->depth++;
     280           0 :                 ndr_print_WERROR(ndr, "result", r->out.result);
     281           0 :                 ndr->depth--;
     282             :         }
     283           0 :         ndr->depth--;
     284             : }
     285             : 
     286             : #ifndef SKIP_NDR_TABLE_initshutdown
     287             : static const struct ndr_interface_public_struct initshutdown_public_structs[] = {
     288             :         { .name = NULL }
     289             : };
     290             : 
     291             : static const struct ndr_interface_call initshutdown_calls[] = {
     292             :         {
     293             :                 "initshutdown_Init",
     294             :                 sizeof(struct initshutdown_Init),
     295             :                 (ndr_push_flags_fn_t) ndr_push_initshutdown_Init,
     296             :                 (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Init,
     297             :                 (ndr_print_function_t) ndr_print_initshutdown_Init,
     298             :                 { 0, NULL },
     299             :                 { 0, NULL },
     300             :         },
     301             :         {
     302             :                 "initshutdown_Abort",
     303             :                 sizeof(struct initshutdown_Abort),
     304             :                 (ndr_push_flags_fn_t) ndr_push_initshutdown_Abort,
     305             :                 (ndr_pull_flags_fn_t) ndr_pull_initshutdown_Abort,
     306             :                 (ndr_print_function_t) ndr_print_initshutdown_Abort,
     307             :                 { 0, NULL },
     308             :                 { 0, NULL },
     309             :         },
     310             :         {
     311             :                 "initshutdown_InitEx",
     312             :                 sizeof(struct initshutdown_InitEx),
     313             :                 (ndr_push_flags_fn_t) ndr_push_initshutdown_InitEx,
     314             :                 (ndr_pull_flags_fn_t) ndr_pull_initshutdown_InitEx,
     315             :                 (ndr_print_function_t) ndr_print_initshutdown_InitEx,
     316             :                 { 0, NULL },
     317             :                 { 0, NULL },
     318             :         },
     319             :         { .name = NULL }
     320             : };
     321             : 
     322             : static const char * const initshutdown_endpoint_strings[] = {
     323             :         "ncacn_np:[\\pipe\\InitShutdown]", 
     324             : };
     325             : 
     326             : static const struct ndr_interface_string_array initshutdown_endpoints = {
     327             :         .count  = 1,
     328             :         .names  = initshutdown_endpoint_strings
     329             : };
     330             : 
     331             : static const char * const initshutdown_authservice_strings[] = {
     332             :         "host", 
     333             : };
     334             : 
     335             : static const struct ndr_interface_string_array initshutdown_authservices = {
     336             :         .count  = 1,
     337             :         .names  = initshutdown_authservice_strings
     338             : };
     339             : 
     340             : 
     341             : const struct ndr_interface_table ndr_table_initshutdown = {
     342             :         .name           = "initshutdown",
     343             :         .syntax_id      = {
     344             :                 {0x894de0c0,0x0d55,0x11d3,{0xa3,0x22},{0x00,0xc0,0x4f,0xa3,0x21,0xa1}},
     345             :                 NDR_INITSHUTDOWN_VERSION
     346             :         },
     347             :         .helpstring     = NDR_INITSHUTDOWN_HELPSTRING,
     348             :         .num_calls      = 3,
     349             :         .calls          = initshutdown_calls,
     350             :         .num_public_structs     = 0,
     351             :         .public_structs         = initshutdown_public_structs,
     352             :         .endpoints      = &initshutdown_endpoints,
     353             :         .authservices   = &initshutdown_authservices
     354             : };
     355             : 
     356             : #endif /* SKIP_NDR_TABLE_initshutdown */

Generated by: LCOV version 1.13