diff options
-rw-r--r-- | librpc/gen_ndr/ndr_rap.c | 406 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_rap.h | 9 | ||||
-rw-r--r-- | librpc/gen_ndr/rap.h | 54 |
3 files changed, 468 insertions, 1 deletions
diff --git a/librpc/gen_ndr/ndr_rap.c b/librpc/gen_ndr/ndr_rap.c index a0e3c1fef0..3bd7a7687a 100644 --- a/librpc/gen_ndr/ndr_rap.c +++ b/librpc/gen_ndr/ndr_rap.c @@ -3130,6 +3130,349 @@ _PUBLIC_ void ndr_print_rap_printq_info(struct ndr_print *ndr, const char *name, } } +static enum ndr_err_code ndr_push_rap_JobInfoParamNum(struct ndr_push *ndr, int ndr_flags, enum rap_JobInfoParamNum r) +{ + NDR_CHECK(ndr_push_enum_uint1632(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_rap_JobInfoParamNum(struct ndr_pull *ndr, int ndr_flags, enum rap_JobInfoParamNum *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_enum_uint1632(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_rap_JobInfoParamNum(struct ndr_print *ndr, const char *name, enum rap_JobInfoParamNum r) +{ + const char *val = NULL; + + switch (r) { + case RAP_PARAM_JOBNUM: val = "RAP_PARAM_JOBNUM"; break; + case RAP_PARAM_USERNAME: val = "RAP_PARAM_USERNAME"; break; + case RAP_PARAM_NOTIFYNAME: val = "RAP_PARAM_NOTIFYNAME"; break; + case RAP_PARAM_DATATYPE: val = "RAP_PARAM_DATATYPE"; break; + case RAP_PARAM_PARAMETERS_STRING: val = "RAP_PARAM_PARAMETERS_STRING"; break; + case RAP_PARAM_JOBPOSITION: val = "RAP_PARAM_JOBPOSITION"; break; + case RAP_PARAM_JOBSTATUS: val = "RAP_PARAM_JOBSTATUS"; break; + case RAP_PARAM_JOBSTATUSSTR: val = "RAP_PARAM_JOBSTATUSSTR"; break; + case RAP_PARAM_TIMESUBMITTED: val = "RAP_PARAM_TIMESUBMITTED"; break; + case RAP_PARAM_JOBSIZE: val = "RAP_PARAM_JOBSIZE"; break; + case RAP_PARAM_JOBCOMMENT: val = "RAP_PARAM_JOBCOMMENT"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_rap_JobInfoParam(struct ndr_push *ndr, int ndr_flags, const union rap_JobInfoParam *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_union_align(ndr, 4)); + switch (level) { + case RAP_PARAM_JOBNUM: { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->value)); + break; } + + case RAP_PARAM_USERNAME: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_NOTIFYNAME: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_DATATYPE: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_PARAMETERS_STRING: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_JOBPOSITION: { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->value)); + break; } + + case RAP_PARAM_JOBSTATUS: { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->value)); + break; } + + case RAP_PARAM_JOBSTATUSSTR: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_TIMESUBMITTED: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->value4)); + break; } + + case RAP_PARAM_JOBSIZE: { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->value4)); + break; } + + case RAP_PARAM_JOBCOMMENT: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->string)); + ndr->flags = _flags_save_string; + } + break; } + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__); + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case RAP_PARAM_JOBNUM: + break; + + case RAP_PARAM_USERNAME: + break; + + case RAP_PARAM_NOTIFYNAME: + break; + + case RAP_PARAM_DATATYPE: + break; + + case RAP_PARAM_PARAMETERS_STRING: + break; + + case RAP_PARAM_JOBPOSITION: + break; + + case RAP_PARAM_JOBSTATUS: + break; + + case RAP_PARAM_JOBSTATUSSTR: + break; + + case RAP_PARAM_TIMESUBMITTED: + break; + + case RAP_PARAM_JOBSIZE: + break; + + case RAP_PARAM_JOBCOMMENT: + break; + + default: + return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_rap_JobInfoParam(struct ndr_pull *ndr, int ndr_flags, union rap_JobInfoParam *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_union_align(ndr, 4)); + switch (level) { + case RAP_PARAM_JOBNUM: { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->value)); + break; } + + case RAP_PARAM_USERNAME: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_NOTIFYNAME: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_DATATYPE: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_PARAMETERS_STRING: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_JOBPOSITION: { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->value)); + break; } + + case RAP_PARAM_JOBSTATUS: { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->value)); + break; } + + case RAP_PARAM_JOBSTATUSSTR: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string)); + ndr->flags = _flags_save_string; + } + break; } + + case RAP_PARAM_TIMESUBMITTED: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value4)); + break; } + + case RAP_PARAM_JOBSIZE: { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value4)); + break; } + + case RAP_PARAM_JOBCOMMENT: { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->string)); + ndr->flags = _flags_save_string; + } + break; } + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__); + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case RAP_PARAM_JOBNUM: + break; + + case RAP_PARAM_USERNAME: + break; + + case RAP_PARAM_NOTIFYNAME: + break; + + case RAP_PARAM_DATATYPE: + break; + + case RAP_PARAM_PARAMETERS_STRING: + break; + + case RAP_PARAM_JOBPOSITION: + break; + + case RAP_PARAM_JOBSTATUS: + break; + + case RAP_PARAM_JOBSTATUSSTR: + break; + + case RAP_PARAM_TIMESUBMITTED: + break; + + case RAP_PARAM_JOBSIZE: + break; + + case RAP_PARAM_JOBCOMMENT: + break; + + default: + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u at %s", level, __location__); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_rap_JobInfoParam(struct ndr_print *ndr, const char *name, const union rap_JobInfoParam *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "rap_JobInfoParam"); + switch (level) { + case RAP_PARAM_JOBNUM: + ndr_print_uint16(ndr, "value", r->value); + break; + + case RAP_PARAM_USERNAME: + ndr_print_string(ndr, "string", r->string); + break; + + case RAP_PARAM_NOTIFYNAME: + ndr_print_string(ndr, "string", r->string); + break; + + case RAP_PARAM_DATATYPE: + ndr_print_string(ndr, "string", r->string); + break; + + case RAP_PARAM_PARAMETERS_STRING: + ndr_print_string(ndr, "string", r->string); + break; + + case RAP_PARAM_JOBPOSITION: + ndr_print_uint16(ndr, "value", r->value); + break; + + case RAP_PARAM_JOBSTATUS: + ndr_print_uint16(ndr, "value", r->value); + break; + + case RAP_PARAM_JOBSTATUSSTR: + ndr_print_string(ndr, "string", r->string); + break; + + case RAP_PARAM_TIMESUBMITTED: + ndr_print_uint32(ndr, "value4", r->value4); + break; + + case RAP_PARAM_JOBSIZE: + ndr_print_uint32(ndr, "value4", r->value4); + break; + + case RAP_PARAM_JOBCOMMENT: + ndr_print_string(ndr, "string", r->string); + break; + + default: + ndr_print_bad_level(ndr, name, level); + } +} + _PUBLIC_ enum ndr_err_code ndr_push_rap_NetShareEnum(struct ndr_push *ndr, int flags, const struct rap_NetShareEnum *r) { if (flags & NDR_IN) { @@ -4040,3 +4383,66 @@ _PUBLIC_ void ndr_print_rap_NetPrintJobGetInfo(struct ndr_print *ndr, const char ndr->depth--; } +_PUBLIC_ enum ndr_err_code ndr_push_rap_NetPrintJobSetInfo(struct ndr_push *ndr, int flags, const struct rap_NetPrintJobSetInfo *r) +{ + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.JobID)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->in.bufsize)); + NDR_CHECK(ndr_push_rap_JobInfoParamNum(ndr, NDR_SCALARS, r->in.ParamNum)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->in.Param, r->in.ParamNum)); + NDR_CHECK(ndr_push_rap_JobInfoParam(ndr, NDR_SCALARS, &r->in.Param)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_rap_status(ndr, NDR_SCALARS, r->out.status)); + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.convert)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_rap_NetPrintJobSetInfo(struct ndr_pull *ndr, int flags, struct rap_NetPrintJobSetInfo *r) +{ + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.JobID)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->in.bufsize)); + NDR_CHECK(ndr_pull_rap_JobInfoParamNum(ndr, NDR_SCALARS, &r->in.ParamNum)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->in.Param, r->in.ParamNum)); + NDR_CHECK(ndr_pull_rap_JobInfoParam(ndr, NDR_SCALARS, &r->in.Param)); + } + if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_rap_status(ndr, NDR_SCALARS, &r->out.status)); + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.convert)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_rap_NetPrintJobSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintJobSetInfo *r) +{ + ndr_print_struct(ndr, name, "rap_NetPrintJobSetInfo"); + ndr->depth++; + if (flags & NDR_SET_VALUES) { + ndr->flags |= LIBNDR_PRINT_SET_VALUES; + } + if (flags & NDR_IN) { + ndr_print_struct(ndr, "in", "rap_NetPrintJobSetInfo"); + ndr->depth++; + ndr_print_uint16(ndr, "JobID", r->in.JobID); + ndr_print_uint16(ndr, "level", r->in.level); + ndr_print_uint16(ndr, "bufsize", r->in.bufsize); + ndr_print_rap_JobInfoParamNum(ndr, "ParamNum", r->in.ParamNum); + ndr_print_set_switch_value(ndr, &r->in.Param, r->in.ParamNum); + ndr_print_rap_JobInfoParam(ndr, "Param", &r->in.Param); + ndr->depth--; + } + if (flags & NDR_OUT) { + ndr_print_struct(ndr, "out", "rap_NetPrintJobSetInfo"); + ndr->depth++; + ndr_print_rap_status(ndr, "status", r->out.status); + ndr_print_uint16(ndr, "convert", r->out.convert); + ndr->depth--; + } + ndr->depth--; +} diff --git a/librpc/gen_ndr/ndr_rap.h b/librpc/gen_ndr/ndr_rap.h index 6ccaf762a7..64f1029387 100644 --- a/librpc/gen_ndr/ndr_rap.h +++ b/librpc/gen_ndr/ndr_rap.h @@ -33,7 +33,9 @@ #define NDR_RAP_NETPRINTJOBGETINFO (0x0c) -#define NDR_RAP_CALL_COUNT (13) +#define NDR_RAP_NETPRINTJOBSETINFO (0x0d) + +#define NDR_RAP_CALL_COUNT (14) enum ndr_err_code ndr_push_rap_status(struct ndr_push *ndr, int ndr_flags, enum rap_status r); enum ndr_err_code ndr_pull_rap_status(struct ndr_pull *ndr, int ndr_flags, enum rap_status *r); void ndr_print_rap_status(struct ndr_print *ndr, const char *name, enum rap_status r); @@ -68,6 +70,8 @@ void ndr_print_rap_PrintQueue5(struct ndr_print *ndr, const char *name, const st enum ndr_err_code ndr_push_rap_printq_info(struct ndr_push *ndr, int ndr_flags, const union rap_printq_info *r); enum ndr_err_code ndr_pull_rap_printq_info(struct ndr_pull *ndr, int ndr_flags, union rap_printq_info *r); void ndr_print_rap_printq_info(struct ndr_print *ndr, const char *name, const union rap_printq_info *r); +void ndr_print_rap_JobInfoParamNum(struct ndr_print *ndr, const char *name, enum rap_JobInfoParamNum r); +void ndr_print_rap_JobInfoParam(struct ndr_print *ndr, const char *name, const union rap_JobInfoParam *r); enum ndr_err_code ndr_push_rap_NetShareEnum(struct ndr_push *ndr, int flags, const struct rap_NetShareEnum *r); enum ndr_err_code ndr_pull_rap_NetShareEnum(struct ndr_pull *ndr, int flags, struct rap_NetShareEnum *r); void ndr_print_rap_NetShareEnum(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetShareEnum *r); @@ -107,4 +111,7 @@ void ndr_print_rap_NetPrintJobEnum(struct ndr_print *ndr, const char *name, int enum ndr_err_code ndr_push_rap_NetPrintJobGetInfo(struct ndr_push *ndr, int flags, const struct rap_NetPrintJobGetInfo *r); enum ndr_err_code ndr_pull_rap_NetPrintJobGetInfo(struct ndr_pull *ndr, int flags, struct rap_NetPrintJobGetInfo *r); void ndr_print_rap_NetPrintJobGetInfo(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintJobGetInfo *r); +enum ndr_err_code ndr_push_rap_NetPrintJobSetInfo(struct ndr_push *ndr, int flags, const struct rap_NetPrintJobSetInfo *r); +enum ndr_err_code ndr_pull_rap_NetPrintJobSetInfo(struct ndr_pull *ndr, int flags, struct rap_NetPrintJobSetInfo *r); +void ndr_print_rap_NetPrintJobSetInfo(struct ndr_print *ndr, const char *name, int flags, const struct rap_NetPrintJobSetInfo *r); #endif /* _HEADER_NDR_rap */ diff --git a/librpc/gen_ndr/rap.h b/librpc/gen_ndr/rap.h index 3d93b4ee1b..29a1704050 100644 --- a/librpc/gen_ndr/rap.h +++ b/librpc/gen_ndr/rap.h @@ -610,6 +610,43 @@ union rap_printq_info { struct rap_PrintQueue5 info5;/* [case(5)] */ }/* [public,nodiscriminant] */; +enum rap_JobInfoParamNum +#ifndef USE_UINT_ENUMS + { + RAP_PARAM_JOBNUM=(int)(0x0001), + RAP_PARAM_USERNAME=(int)(0x0002), + RAP_PARAM_NOTIFYNAME=(int)(0x0003), + RAP_PARAM_DATATYPE=(int)(0x0004), + RAP_PARAM_PARAMETERS_STRING=(int)(0x0005), + RAP_PARAM_JOBPOSITION=(int)(0x0006), + RAP_PARAM_JOBSTATUS=(int)(0x0007), + RAP_PARAM_JOBSTATUSSTR=(int)(0x0008), + RAP_PARAM_TIMESUBMITTED=(int)(0x0009), + RAP_PARAM_JOBSIZE=(int)(0x000a), + RAP_PARAM_JOBCOMMENT=(int)(0x000b) +} +#else + { __donnot_use_enum_rap_JobInfoParamNum=0x7FFFFFFF} +#define RAP_PARAM_JOBNUM ( 0x0001 ) +#define RAP_PARAM_USERNAME ( 0x0002 ) +#define RAP_PARAM_NOTIFYNAME ( 0x0003 ) +#define RAP_PARAM_DATATYPE ( 0x0004 ) +#define RAP_PARAM_PARAMETERS_STRING ( 0x0005 ) +#define RAP_PARAM_JOBPOSITION ( 0x0006 ) +#define RAP_PARAM_JOBSTATUS ( 0x0007 ) +#define RAP_PARAM_JOBSTATUSSTR ( 0x0008 ) +#define RAP_PARAM_TIMESUBMITTED ( 0x0009 ) +#define RAP_PARAM_JOBSIZE ( 0x000a ) +#define RAP_PARAM_JOBCOMMENT ( 0x000b ) +#endif +; + +union rap_JobInfoParam { + uint16_t value;/* [case(RAP_PARAM_JOBNUM)] */ + const char * string;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM),case(RAP_PARAM_USERNAME)] */ + uint32_t value4;/* [case(RAP_PARAM_TIMESUBMITTED)] */ +}/* [nodiscriminant] */; + struct rap_NetShareEnum { struct { @@ -809,4 +846,21 @@ struct rap_NetPrintJobGetInfo { }; + +struct rap_NetPrintJobSetInfo { + struct { + uint16_t JobID; + uint16_t level; + uint16_t bufsize; + enum rap_JobInfoParamNum ParamNum; + union rap_JobInfoParam Param;/* [switch_is(ParamNum)] */ + } in; + + struct { + enum rap_status status; + uint16_t convert; + } out; + +}; + #endif /* _HEADER_rap */ |