return "NB_IPX";
case EPM_PROTOCOL_HTTP:
- return talloc_asprintf(mem_ctx, "HTTP:%d", epm_floor->rhs.http.port);
+ return talloc_asprintf(mem_ctx, "HTTP:%"PRIu16, epm_floor->rhs.http.port);
case EPM_PROTOCOL_TCP:
- return talloc_asprintf(mem_ctx, "TCP:%d", epm_floor->rhs.tcp.port);
+ return talloc_asprintf(mem_ctx, "TCP:%"PRIu16, epm_floor->rhs.tcp.port);
case EPM_PROTOCOL_UDP:
- return talloc_asprintf(mem_ctx, "UDP:%d", epm_floor->rhs.udp.port);
+ return talloc_asprintf(mem_ctx, "UDP:%"PRIu16, epm_floor->rhs.udp.port);
default:
return talloc_asprintf(mem_ctx, "UNK(%02x):", epm_floor->lhs.protocol);
switch (epm_floor->lhs.protocol) {
case EPM_PROTOCOL_TCP:
if (epm_floor->rhs.tcp.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.tcp.port);
+ return talloc_asprintf(mem_ctx, "%"PRIu16, epm_floor->rhs.tcp.port);
case EPM_PROTOCOL_UDP:
if (epm_floor->rhs.udp.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.udp.port);
+ return talloc_asprintf(mem_ctx, "%"PRIu16, epm_floor->rhs.udp.port);
case EPM_PROTOCOL_HTTP:
if (epm_floor->rhs.http.port == 0) return NULL;
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.http.port);
+ return talloc_asprintf(mem_ctx, "%"PRIu16, epm_floor->rhs.http.port);
case EPM_PROTOCOL_IP:
return talloc_strdup(mem_ctx, epm_floor->rhs.ip.ipaddr);
return NULL;
case EPM_PROTOCOL_VINES_SPP:
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.vines_spp.port);
+ return talloc_asprintf(mem_ctx, "%"PRIu16, epm_floor->rhs.vines_spp.port);
case EPM_PROTOCOL_VINES_IPC:
- return talloc_asprintf(mem_ctx, "%d", epm_floor->rhs.vines_ipc.port);
+ return talloc_asprintf(mem_ctx, "%"PRIu16, epm_floor->rhs.vines_ipc.port);
case EPM_PROTOCOL_STREETTALK:
return talloc_strdup(mem_ctx, epm_floor->rhs.streettalk.streettalk);
}
if (max_pad_len < auth->auth_pad_length) {
DEBUG(1, (__location__ ": ERROR: pad length to large. "
- "max %u got %u\n",
- (unsigned)max_pad_len,
- (unsigned)auth->auth_pad_length));
+ "max %"PRIu32" got %"PRIu8"\n",
+ max_pad_len,
+ auth->auth_pad_length));
talloc_free(ndr);
ZERO_STRUCTP(auth);
return NT_STATUS_RPC_PROTOCOL_ERROR;
if (data_and_pad < auth->auth_pad_length) {
DBG_WARNING(__location__ ": ERROR: pad length too long. "
- "Calculated %u (pkt_trailer->length=%u - auth_length=%u) "
- "was less than auth_pad_length=%u\n",
- (unsigned)data_and_pad,
- (unsigned)pkt_trailer->length,
- (unsigned)auth_length,
- (unsigned)auth->auth_pad_length);
+ "Calculated %"PRIu16" (pkt_trailer->length=%zu - auth_length=%"PRIu16") "
+ "was less than auth_pad_length=%"PRIu8"\n",
+ data_and_pad,
+ pkt_trailer->length,
+ auth_length,
+ auth->auth_pad_length);
talloc_free(ndr);
ZERO_STRUCTP(auth);
return NT_STATUS_RPC_PROTOCOL_ERROR;
if (auth_data_only && data_and_pad > auth->auth_pad_length) {
DBG_WARNING(__location__ ": ERROR: auth_data_only pad length mismatch. "
- "Client sent a longer BIND packet than expected by %u bytes "
- "(pkt_trailer->length=%u - auth_length=%u) "
- "= %u auth_pad_length=%u\n",
- (unsigned)data_and_pad - (unsigned)auth->auth_pad_length,
- (unsigned)pkt_trailer->length,
- (unsigned)auth_length,
- (unsigned)data_and_pad,
- (unsigned)auth->auth_pad_length);
+ "Client sent a longer BIND packet than expected by %"PRIu16" bytes "
+ "(pkt_trailer->length=%zu - auth_length=%"PRIu16") "
+ "= %"PRIu16" auth_pad_length=%"PRIu8"\n",
+ data_and_pad - auth->auth_pad_length,
+ pkt_trailer->length,
+ auth_length,
+ data_and_pad,
+ auth->auth_pad_length);
talloc_free(ndr);
ZERO_STRUCTP(auth);
return NT_STATUS_RPC_PROTOCOL_ERROR;
if (auth_data_only && data_and_pad != auth->auth_pad_length) {
DBG_WARNING(__location__ ": ERROR: auth_data_only pad length mismatch. "
- "Calculated %u (pkt_trailer->length=%u - auth_length=%u) "
- "but auth_pad_length=%u\n",
- (unsigned)data_and_pad,
- (unsigned)pkt_trailer->length,
- (unsigned)auth_length,
- (unsigned)auth->auth_pad_length);
+ "Calculated %"PRIu16" (pkt_trailer->length=%zu - auth_length=%"PRIu16") "
+ "but auth_pad_length=%"PRIu8"\n",
+ data_and_pad,
+ pkt_trailer->length,
+ auth_length,
+ auth->auth_pad_length);
talloc_free(ndr);
ZERO_STRUCTP(auth);
return NT_STATUS_RPC_PROTOCOL_ERROR;
}
- DBG_DEBUG("auth_pad_length %u\n",
- (unsigned)auth->auth_pad_length);
+ DBG_DEBUG("auth_pad_length %"PRIu8"\n",
+ auth->auth_pad_length);
talloc_steal(mem_ctx, auth->credentials.data);
talloc_free(ndr);
char *name=NULL;
int ret;
bool saved;
- ret = asprintf(&name, "%s/%s-%u.%d.%s.%s",
+ ret = asprintf(&name, "%s/%s-%"PRIu32".%d.%s.%s",
packet_log_dir, interface_name, opnum, i,
(flags&NDR_IN)?"in":"out",
why);
uint8_t extra_flags = 0;
if (call->fault_code == DCERPC_FAULT_OP_RNG_ERROR) {
/* we got an unknown call */
- DEBUG(3,(__location__ ": Unknown RPC call %u on %s\n",
+ DEBUG(3,(__location__ ": Unknown RPC call %"PRIu16" on %s\n",
call->pkt.u.request.opnum,
call->context->iface->name));
dcesrv_save_call(call, "unknown");
if (pull->offset != pull->data_size) {
dcesrv_save_call(call, "extrabytes");
- DEBUG(3,("Warning: %d extra bytes in incoming RPC request\n",
+ DEBUG(3,("Warning: %"PRIu32" extra bytes in incoming RPC request\n",
pull->data_size - pull->offset));
}
*/
count = (uint32_t *)c;
- n = talloc_asprintf(c, "%s: %s[%llu]",
+ n = talloc_asprintf(c, "%s: %s[%"PRIu64"]",
function, pipes->pipes[i].name,
- (unsigned long long)idx);
+ idx);
saved_mem_ctx = ndr_pull->current_mem_ctx;
ndr_pull->current_mem_ctx = c;
st = talloc_zero_size(mem_ctx, f->struct_size);
if (!st) {
- printf("Unable to allocate %d bytes for %s structure\n",
- (int)f->struct_size,
+ printf("Unable to allocate %zu bytes for %s structure\n",
+ f->struct_size,
f->name);
TALLOC_FREE(mem_ctx);
exit(1);
v_st = talloc_zero_size(mem_ctx, f->struct_size);
if (!v_st) {
- printf("Unable to allocate %d bytes for %s validation "
+ printf("Unable to allocate %zu bytes for %s validation "
"structure\n",
- (int)f->struct_size,
+ f->struct_size,
f->name);
TALLOC_FREE(mem_ctx);
exit(1);
}
if (highest_ofs != ndr_pull->data_size) {
- printf("WARNING! %d unread bytes while parsing context file\n", ndr_pull->data_size - highest_ofs);
+ printf("WARNING! %"PRIu32" unread bytes while parsing context file\n", ndr_pull->data_size - highest_ofs);
}
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
}
if (sec_vt != NULL && sec_vt->count.count > 0) {
- printf("SEC_VT: consumed %d bytes\n",
- (int)(blob.length - ndr_pull->data_size));
+ printf("SEC_VT: consumed %zu bytes\n",
+ blob.length - ndr_pull->data_size);
if (dumpdata) {
ndrdump_data(blob.data + ndr_pull->data_size,
blob.length - ndr_pull->data_size,
}
if (dumpdata) {
- printf("%d bytes consumed\n", highest_ofs);
+ printf("%"PRIu32" bytes consumed\n", highest_ofs);
ndrdump_data(blob.data, blob.length, dumpdata);
}
}
if (highest_ofs != ndr_pull->data_size) {
- printf("WARNING! %d unread bytes\n", ndr_pull->data_size - highest_ofs);
+ printf("WARNING! %"PRIu32" unread bytes\n", ndr_pull->data_size - highest_ofs);
ndrdump_data(ndr_pull->data+highest_ofs,
ndr_pull->data_size - highest_ofs,
dumpdata);
v_blob = ndr_push_blob(ndr_v_push);
if (dumpdata) {
- printf("%ld bytes generated (validate)\n", (long)v_blob.length);
+ printf("%zu bytes generated (validate)\n", v_blob.length);
ndrdump_data(v_blob.data, v_blob.length, dumpdata);
}
}
if (highest_v_ofs != ndr_v_pull->data_size) {
- printf("WARNING! %d unread bytes in validation\n",
+ printf("WARNING! %"PRIu32" unread bytes in validation\n",
ndr_v_pull->data_size - highest_v_ofs);
ndrdump_data(ndr_v_pull->data + highest_v_ofs,
ndr_v_pull->data_size - highest_v_ofs,
flags, v_st);
if (blob.length != v_blob.length) {
- printf("WARNING! orig bytes:%llu validated pushed bytes:%llu\n",
- (unsigned long long)blob.length, (unsigned long long)v_blob.length);
+ printf("WARNING! orig bytes:%zu validated pushed bytes:%zu\n",
+ blob.length, v_blob.length);
}
if (highest_ofs != highest_v_ofs) {
- printf("WARNING! orig pulled bytes:%llu validated pulled bytes:%llu\n",
- (unsigned long long)highest_ofs, (unsigned long long)highest_v_ofs);
+ printf("WARNING! orig pulled bytes:%"PRIu32" validated pulled bytes:%"PRIu32"\n",
+ highest_ofs, highest_v_ofs);
}
differ = false;
}
}
if (differ) {
- printf("WARNING! orig and validated differ at byte 0x%02X (%u)\n", i, i);
- printf("WARNING! orig byte[0x%02X] = 0x%02X validated byte[0x%02X] = 0x%02X\n",
+ printf("WARNING! orig and validated differ at byte 0x%02"PRIX32" (%"PRIu32")\n", i, i);
+ printf("WARNING! orig byte[0x%02"PRIX32"] = 0x%02"PRIX8" validated byte[0x%02"PRIX32"] = 0x%02"PRIX8"\n",
i, byte_a, i, byte_b);
ndrdump_data_diff(blob.data, blob.length,
v_blob.data, v_blob.length,