| /netbsd/src/usr.sbin/sdpd/ |
| D | compat.c | 57 dun_profile(sdp_data_t *buf, void *arg, ssize_t len) in dun_profile() argument 60 uint8_t *first = buf->next; in dun_profile() 67 sdp_put_uint16(buf, SDP_ATTR_SERVICE_RECORD_HANDLE); in dun_profile() 68 sdp_put_uint32(buf, 0x00000000); in dun_profile() 70 sdp_put_uint16(buf, SDP_ATTR_SERVICE_CLASS_ID_LIST); in dun_profile() 71 sdp_put_seq(buf, 3); in dun_profile() 72 sdp_put_uuid16(buf, SDP_SERVICE_CLASS_DIALUP_NETWORKING); in dun_profile() 74 sdp_put_uint16(buf, SDP_ATTR_PROTOCOL_DESCRIPTOR_LIST); in dun_profile() 75 sdp_put_seq(buf, 12); in dun_profile() 76 sdp_put_seq(buf, 3); in dun_profile() [all …]
|
| /netbsd/src/sys/arch/ia64/unwind/ |
| D | decode.c | 19 unwind_decode_ule128(char *buf, unsigned long *val) in unwind_decode_ule128() argument 25 val[0] += ((buf[i] & 0x7f) << (i * 7)); in unwind_decode_ule128() 27 }while((0x80 & buf[i++]) && (i < 9)); in unwind_decode_ule128() 34 buf+= i; in unwind_decode_ule128() 35 return buf; in unwind_decode_ule128() 40 unwind_decode_R1(char *buf, union unwind_desc *uwd) in unwind_decode_R1() argument 43 if(!IS_R1(buf[0])) return NULL; in unwind_decode_R1() 44 uwd->R1.r = ((buf[0] & 0x20) == 0x20); in unwind_decode_R1() 45 uwd->R1.rlen = (buf[0] & 0x1f); in unwind_decode_R1() 46 buf++; in unwind_decode_R1() [all …]
|
| /netbsd/src/crypto/external/bsd/openssh/dist/ |
| D | sshbuf.c | 35 buf->size, buf->alloc, buf->off, buf->max_size); \ 55 sshbuf_check_sanity(const struct sshbuf *buf) in sshbuf_check_sanity() argument 58 if (__predict_false(buf == NULL || in sshbuf_check_sanity() 59 (!buf->readonly && buf->d != buf->cd) || in sshbuf_check_sanity() 60 buf->parent == buf || in sshbuf_check_sanity() 61 buf->refcount < 1 || buf->refcount > SSHBUF_REFS_MAX || in sshbuf_check_sanity() 62 buf->cd == NULL || in sshbuf_check_sanity() 63 buf->max_size > SSHBUF_SIZE_MAX || in sshbuf_check_sanity() 64 buf->alloc > buf->max_size || in sshbuf_check_sanity() 65 buf->size > buf->alloc || in sshbuf_check_sanity() [all …]
|
| /netbsd/src/tests/lib/libc/locale/ |
| D | t_c8rtomb.c | 62 static char buf[7*MB_LEN_MAX + 1]; variable 87 memset(buf, 0xcc, sizeof(buf)); in ATF_TC_BODY() 88 ATF_CHECK_EQ_MSG((n = c8rtomb(buf, 0, &s)), 1, "n=%zu", n); in ATF_TC_BODY() 89 ATF_CHECK_MSG(((unsigned char)buf[0] == 0 && in ATF_TC_BODY() 90 (unsigned char)buf[1] == 0xcc), in ATF_TC_BODY() 91 "buf=[%02x %02x]", buf[0], buf[1]); in ATF_TC_BODY() 99 memset(buf, 0xcc, sizeof(buf)); in ATF_TC_BODY() 100 ATF_CHECK_EQ_MSG((n = c8rtomb(buf, 'A', &s)), 1, "n=%zu", n); in ATF_TC_BODY() 101 ATF_CHECK_MSG(((unsigned char)buf[0] == 'A' && in ATF_TC_BODY() 102 (unsigned char)buf[1] == 0xcc), in ATF_TC_BODY() [all …]
|
| D | t_c16rtomb.c | 62 static char buf[7*MB_LEN_MAX + 1]; variable 80 memset(buf, 0xcc, sizeof(buf)); in ATF_TC_BODY() 81 ATF_CHECK_EQ_MSG((n = c16rtomb(buf, 0, &s)), 1, "n=%zu", n); in ATF_TC_BODY() 82 ATF_CHECK_MSG(((unsigned char)buf[0] == 0 && in ATF_TC_BODY() 83 (unsigned char)buf[1] == 0xcc), in ATF_TC_BODY() 84 "buf=[%02x %02x]", buf[0], buf[1]); in ATF_TC_BODY() 92 memset(buf, 0xcc, sizeof(buf)); in ATF_TC_BODY() 93 ATF_CHECK_EQ_MSG((n = c16rtomb(buf, L'A', &s)), 1, "n=%zu", n); in ATF_TC_BODY() 94 ATF_CHECK_MSG(((unsigned char)buf[0] == 'A' && in ATF_TC_BODY() 95 (unsigned char)buf[1] == 0xcc), in ATF_TC_BODY() [all …]
|
| /netbsd/src/sys/dev/i2c/ |
| D | nxt2k.c | 110 uint8_t attr, len2, buf; in nxt2k_writereg() local 123 buf = 0x80; in nxt2k_writereg() 127 nxt2k_writedata(nxt, 0x21, &buf, 1); in nxt2k_writereg() 129 nxt2k_readdata(nxt, 0x21, &buf, 1); in nxt2k_writereg() 131 if (buf == 0) in nxt2k_writereg() 140 uint8_t buf, len2, attr; in nxt2k_readreg() local 155 buf = 0x80; in nxt2k_readreg() 156 nxt2k_writedata(nxt, 0x21, &buf, 1); in nxt2k_readreg() 181 uint8_t stopval, buf; in nxt2k_mc_stop() local 186 buf = 0x80; in nxt2k_mc_stop() [all …]
|
| /netbsd/src/external/bsd/tmux/dist/compat/ |
| D | imsg-buffer.c | 56 struct ibuf *buf; in ibuf_open() local 62 if ((buf = calloc(1, sizeof(struct ibuf))) == NULL) in ibuf_open() 64 if ((buf->buf = calloc(len, 1)) == NULL) { in ibuf_open() 65 free(buf); in ibuf_open() 68 buf->size = buf->max = len; in ibuf_open() 69 buf->fd = -1; in ibuf_open() 71 return (buf); in ibuf_open() 77 struct ibuf *buf; in ibuf_dynamic() local 84 if ((buf = calloc(1, sizeof(struct ibuf))) == NULL) in ibuf_dynamic() 87 if ((buf->buf = calloc(len, 1)) == NULL) { in ibuf_dynamic() [all …]
|
| /netbsd/src/external/bsd/wpa/dist/src/p2p/ |
| D | p2p_build.c | 19 void p2p_buf_add_action_hdr(struct wpabuf *buf, u8 subtype, u8 dialog_token) in p2p_buf_add_action_hdr() argument 21 wpabuf_put_u8(buf, WLAN_ACTION_VENDOR_SPECIFIC); in p2p_buf_add_action_hdr() 22 wpabuf_put_be32(buf, P2P_IE_VENDOR_TYPE); in p2p_buf_add_action_hdr() 24 wpabuf_put_u8(buf, subtype); /* OUI Subtype */ in p2p_buf_add_action_hdr() 25 wpabuf_put_u8(buf, dialog_token); in p2p_buf_add_action_hdr() 30 void p2p_buf_add_public_action_hdr(struct wpabuf *buf, u8 subtype, in p2p_buf_add_public_action_hdr() argument 33 wpabuf_put_u8(buf, WLAN_ACTION_PUBLIC); in p2p_buf_add_public_action_hdr() 34 wpabuf_put_u8(buf, WLAN_PA_VENDOR_SPECIFIC); in p2p_buf_add_public_action_hdr() 35 wpabuf_put_be32(buf, P2P_IE_VENDOR_TYPE); in p2p_buf_add_public_action_hdr() 37 wpabuf_put_u8(buf, subtype); /* OUI Subtype */ in p2p_buf_add_public_action_hdr() [all …]
|
| /netbsd/src/external/gpl3/gdb/dist/libiberty/ |
| D | simple-object-common.h | 189 simple_object_fetch_big_16 (const unsigned char *buf) in simple_object_fetch_big_16() argument 191 return ((unsigned short) buf[0] << 8) | (unsigned short) buf[1]; in simple_object_fetch_big_16() 197 simple_object_fetch_little_16 (const unsigned char *buf) in simple_object_fetch_little_16() argument 199 return ((unsigned short) buf[1] << 8) | (unsigned short) buf[0]; in simple_object_fetch_little_16() 205 simple_object_fetch_big_32 (const unsigned char *buf) in simple_object_fetch_big_32() argument 207 return (((unsigned int) buf[0] << 24) in simple_object_fetch_big_32() 208 | ((unsigned int) buf[1] << 16) in simple_object_fetch_big_32() 209 | ((unsigned int) buf[2] << 8) in simple_object_fetch_big_32() 210 | (unsigned int) buf[3]); in simple_object_fetch_big_32() 216 simple_object_fetch_little_32 (const unsigned char *buf) in simple_object_fetch_little_32() argument [all …]
|
| /netbsd/src/external/gpl3/binutils/dist/libiberty/ |
| D | simple-object-common.h | 189 simple_object_fetch_big_16 (const unsigned char *buf) in simple_object_fetch_big_16() argument 191 return ((unsigned short) buf[0] << 8) | (unsigned short) buf[1]; in simple_object_fetch_big_16() 197 simple_object_fetch_little_16 (const unsigned char *buf) in simple_object_fetch_little_16() argument 199 return ((unsigned short) buf[1] << 8) | (unsigned short) buf[0]; in simple_object_fetch_little_16() 205 simple_object_fetch_big_32 (const unsigned char *buf) in simple_object_fetch_big_32() argument 207 return (((unsigned int) buf[0] << 24) in simple_object_fetch_big_32() 208 | ((unsigned int) buf[1] << 16) in simple_object_fetch_big_32() 209 | ((unsigned int) buf[2] << 8) in simple_object_fetch_big_32() 210 | (unsigned int) buf[3]); in simple_object_fetch_big_32() 216 simple_object_fetch_little_32 (const unsigned char *buf) in simple_object_fetch_little_32() argument [all …]
|
| /netbsd/src/external/gpl3/gcc/dist/libiberty/ |
| D | simple-object-common.h | 189 simple_object_fetch_big_16 (const unsigned char *buf) in simple_object_fetch_big_16() argument 191 return ((unsigned short) buf[0] << 8) | (unsigned short) buf[1]; in simple_object_fetch_big_16() 197 simple_object_fetch_little_16 (const unsigned char *buf) in simple_object_fetch_little_16() argument 199 return ((unsigned short) buf[1] << 8) | (unsigned short) buf[0]; in simple_object_fetch_little_16() 205 simple_object_fetch_big_32 (const unsigned char *buf) in simple_object_fetch_big_32() argument 207 return (((unsigned int) buf[0] << 24) in simple_object_fetch_big_32() 208 | ((unsigned int) buf[1] << 16) in simple_object_fetch_big_32() 209 | ((unsigned int) buf[2] << 8) in simple_object_fetch_big_32() 210 | (unsigned int) buf[3]); in simple_object_fetch_big_32() 216 simple_object_fetch_little_32 (const unsigned char *buf) in simple_object_fetch_little_32() argument [all …]
|
| /netbsd/src/external/bsd/wpa/dist/src/utils/ |
| D | wpabuf.c | 22 static struct wpabuf_trace * wpabuf_get_trace(const struct wpabuf *buf) in wpabuf_get_trace() argument 25 ((const u8 *) buf - sizeof(struct wpabuf_trace)); in wpabuf_get_trace() 30 static void wpabuf_overflow(const struct wpabuf *buf, size_t len) in wpabuf_overflow() argument 33 struct wpabuf_trace *trace = wpabuf_get_trace(buf); in wpabuf_overflow() 40 buf, (unsigned long) buf->size, (unsigned long) buf->used, in wpabuf_overflow() 49 struct wpabuf *buf = *_buf; in wpabuf_resize() local 54 if (buf == NULL) { in wpabuf_resize() 60 trace = wpabuf_get_trace(buf); in wpabuf_resize() 69 if (buf->used + add_len > buf->size) { in wpabuf_resize() 71 if (buf->flags & WPABUF_FLAG_EXT_DATA) { in wpabuf_resize() [all …]
|
| D | wpabuf.h | 23 u8 *buf; /* pointer to the head of the buffer */ member 29 int wpabuf_resize(struct wpabuf **buf, size_t add_len); 34 void wpabuf_free(struct wpabuf *buf); 35 void wpabuf_clear_free(struct wpabuf *buf); 36 void * wpabuf_put(struct wpabuf *buf, size_t len); 38 struct wpabuf * wpabuf_zeropad(struct wpabuf *buf, size_t len); 39 void wpabuf_printf(struct wpabuf *buf, char *fmt, ...) PRINTF_FORMAT(2, 3); 40 struct wpabuf * wpabuf_parse_bin(const char *buf); 48 static inline size_t wpabuf_size(const struct wpabuf *buf) in wpabuf_size() argument 50 return buf->size; in wpabuf_size() [all …]
|
| /netbsd/src/external/gpl3/binutils/dist/opcodes/ |
| D | z80-dis.c | 80 mach_inst (struct buffer *buf, const struct tab_elt *p) in mach_inst() argument 82 return !p->inss || (p->inss & buf->inss); in mach_inst() 86 fetch_data (struct buffer *buf, disassemble_info * info, int n) in fetch_data() argument 90 if (buf->n_fetch + n > (int)sizeof (buf->data)) in fetch_data() 93 r = info->read_memory_func (buf->base + buf->n_fetch, in fetch_data() 94 (unsigned char*) buf->data + buf->n_fetch, in fetch_data() 97 buf->n_fetch += n; in fetch_data() 99 info->memory_error_func (r, buf->base + buf->n_fetch, info); in fetch_data() 104 prt (struct buffer *buf, disassemble_info * info, const char *txt) in prt() argument 107 buf->n_used = buf->n_fetch; in prt() [all …]
|
| /netbsd/src/external/gpl3/gdb/dist/opcodes/ |
| D | z80-dis.c | 80 mach_inst (struct buffer *buf, const struct tab_elt *p) in mach_inst() argument 82 return !p->inss || (p->inss & buf->inss); in mach_inst() 86 fetch_data (struct buffer *buf, disassemble_info * info, int n) in fetch_data() argument 90 if (buf->n_fetch + n > (int)sizeof (buf->data)) in fetch_data() 93 r = info->read_memory_func (buf->base + buf->n_fetch, in fetch_data() 94 (unsigned char*) buf->data + buf->n_fetch, in fetch_data() 97 buf->n_fetch += n; in fetch_data() 99 info->memory_error_func (r, buf->base + buf->n_fetch, info); in fetch_data() 104 prt (struct buffer *buf, disassemble_info * info, const char *txt) in prt() argument 107 buf->n_used = buf->n_fetch; in prt() [all …]
|
| /netbsd/src/sys/arch/alpha/stand/standtest/ |
| D | test.c | 42 void (*fn)(const char *buf); 48 const char *advance_past_space(const char *buf); 49 const char *cvt_number(const char *buf, u_int64_t *nump); 50 int dispatch_cmd(const char *buf, const struct cmdtab *cmds); 59 void toplevel_dpb(const char *buf); 60 void toplevel_dpl(const char *buf); 61 void toplevel_dpq(const char *buf); 62 void toplevel_dpw(const char *buf); 63 void toplevel_dvb(const char *buf); 64 void toplevel_dvl(const char *buf); [all …]
|
| /netbsd/src/usr.bin/xlint/common/ |
| D | tyname.c | 101 buf_init(buffer *buf) in buf_init() argument 103 buf->len = 0; in buf_init() 104 buf->cap = 128; in buf_init() 105 buf->data = xmalloc(buf->cap); in buf_init() 106 buf->data[0] = '\0'; in buf_init() 110 buf_done(buffer *buf) in buf_done() argument 112 free(buf->data); in buf_done() 116 buf_add_mem(buffer *buf, const char *s, size_t n) in buf_add_mem() argument 118 while (buf->len + n + 1 >= buf->cap) { in buf_add_mem() 119 buf->cap *= 2; in buf_add_mem() [all …]
|
| /netbsd/src/external/bsd/wpa/dist/src/ap/ |
| D | gas_serv.c | 25 static void gas_serv_write_dpp_adv_proto(struct wpabuf *buf) in gas_serv_write_dpp_adv_proto() argument 27 wpabuf_put_u8(buf, WLAN_EID_ADV_PROTO); in gas_serv_write_dpp_adv_proto() 28 wpabuf_put_u8(buf, 8); /* Length */ in gas_serv_write_dpp_adv_proto() 29 wpabuf_put_u8(buf, 0x7f); in gas_serv_write_dpp_adv_proto() 30 wpabuf_put_u8(buf, WLAN_EID_VENDOR_SPECIFIC); in gas_serv_write_dpp_adv_proto() 31 wpabuf_put_u8(buf, 5); in gas_serv_write_dpp_adv_proto() 32 wpabuf_put_be24(buf, OUI_WFA); in gas_serv_write_dpp_adv_proto() 33 wpabuf_put_u8(buf, DPP_OUI_TYPE); in gas_serv_write_dpp_adv_proto() 34 wpabuf_put_u8(buf, 0x01); in gas_serv_write_dpp_adv_proto() 162 struct wpabuf *buf) in anqp_add_hs_capab_list() argument [all …]
|
| /netbsd/src/external/bsd/wpa/dist/src/common/ |
| D | gas.c | 20 struct wpabuf *buf; in gas_build_req() local 22 buf = wpabuf_alloc(100 + size); in gas_build_req() 23 if (buf == NULL) in gas_build_req() 26 wpabuf_put_u8(buf, WLAN_ACTION_PUBLIC); in gas_build_req() 27 wpabuf_put_u8(buf, action); in gas_build_req() 28 wpabuf_put_u8(buf, dialog_token); in gas_build_req() 30 return buf; in gas_build_req() 51 struct wpabuf *buf; in gas_build_resp() local 53 buf = wpabuf_alloc(100 + size); in gas_build_resp() 54 if (buf == NULL) in gas_build_resp() [all …]
|
| /netbsd/src/usr.bin/make/ |
| D | buf.c | 82 Buf_Expand(Buffer *buf) in Buf_Expand() argument 84 buf->cap += buf->cap > 16 ? buf->cap : 16; in Buf_Expand() 85 buf->data = bmake_realloc(buf->data, buf->cap); in Buf_Expand() 90 Buf_AddBytes(Buffer *buf, const char *bytes, size_t bytes_len) in Buf_AddBytes() argument 92 size_t old_len = buf->len; in Buf_AddBytes() 95 if (old_len + bytes_len >= buf->cap) { in Buf_AddBytes() 97 buf->cap += buf->cap > minIncr ? buf->cap : minIncr; in Buf_AddBytes() 98 buf->data = bmake_realloc(buf->data, buf->cap); in Buf_AddBytes() 101 end = buf->data + old_len; in Buf_AddBytes() 102 buf->len = old_len + bytes_len; in Buf_AddBytes() [all …]
|
| /netbsd/src/external/bsd/tcpdump/dist/ |
| D | smbutil.c | 187 const u_char *buf, u_int ofs, const u_char *maxbuf) in name_ptr() argument 192 p = buf + ofs; in name_ptr() 210 p = buf + l; in name_ptr() 226 const u_char *buf, u_int ofs, const u_char *maxbuf, char *name) in name_extract() argument 228 const u_char *p = name_ptr(ndo, buf, ofs, maxbuf); in name_extract() 265 const u_char *buf, u_int len) in print_asc() argument 269 fn_print_char(ndo, GET_U_1(buf + i)); in print_asc() 290 smb_data_print(netdissect_options *ndo, const u_char *buf, u_int len) in smb_data_print() argument 298 ND_PRINT("%02X ", GET_U_1(buf + i) & 0xff); in smb_data_print() 303 print_asc(ndo, buf + i - 16, 8); in smb_data_print() [all …]
|
| /netbsd/src/sys/arch/sh3/sh3/ |
| D | db_disasm.c | 176 get_opcode(const uint16_t *pc, char *buf, size_t len) in get_opcode() argument 181 strlcpy(buf, "????", len); in get_opcode() 187 (*f[n0][n3])(pc, buf, len); in get_opcode() 192 f_02(const uint16_t *pc, char *buf, size_t len) in f_02() argument 205 snprintf(buf, len, "stc sr, r%d", rn); in f_02() 209 snprintf(buf, len, "stc gbr, r%d", rn); in f_02() 213 snprintf(buf, len, "stc vbr, r%d", rn); in f_02() 217 snprintf(buf, len, "stc ssr, r%d", rn); in f_02() 226 snprintf(buf, len, "stc spc, r%d", rn); in f_02() 232 snprintf(buf, len, "stc r%d_bank, r%d", md, rn); in f_02() [all …]
|
| /netbsd/src/external/bsd/ntp/dist/sntp/libevent/test/ |
| D | regress_buffer.c | 73 evbuffer_validate_(struct evbuffer *buf) in evbuffer_validate_() argument 79 if (buf->first == NULL) { in evbuffer_validate_() 80 tt_assert(buf->last == NULL); in evbuffer_validate_() 81 tt_assert(buf->total_len == 0); in evbuffer_validate_() 84 chain = buf->first; in evbuffer_validate_() 86 tt_assert(buf->last_with_datap); in evbuffer_validate_() 87 if (buf->last_with_datap == &buf->first) in evbuffer_validate_() 91 if (&chain->next == buf->last_with_datap) in evbuffer_validate_() 95 tt_assert(buf->last == chain); in evbuffer_validate_() 101 if (buf->first) in evbuffer_validate_() [all …]
|
| /netbsd/src/external/bsd/libevent/dist/test/ |
| D | regress_buffer.c | 75 evbuffer_validate_(struct evbuffer *buf) in evbuffer_validate_() argument 81 if (buf->first == NULL) { in evbuffer_validate_() 82 tt_assert(buf->last == NULL); in evbuffer_validate_() 83 tt_assert(buf->total_len == 0); in evbuffer_validate_() 86 chain = buf->first; in evbuffer_validate_() 88 tt_assert(buf->last_with_datap); in evbuffer_validate_() 89 if (buf->last_with_datap == &buf->first) in evbuffer_validate_() 93 if (&chain->next == buf->last_with_datap) in evbuffer_validate_() 97 tt_assert(buf->last == chain); in evbuffer_validate_() 103 if (buf->first) in evbuffer_validate_() [all …]
|
| /netbsd/src/tests/usr.bin/xlint/lint1/ |
| D | msg_361.c | 21 char buf[64]; in old_style_number_base() local 24 snprintb(buf, sizeof(buf), "", 0); in old_style_number_base() 26 snprintb(buf, sizeof(buf), "\002", 0); in old_style_number_base() 27 snprintb(buf, sizeof(buf), "\010", 0); in old_style_number_base() 28 snprintb(buf, sizeof(buf), "\n", 0); in old_style_number_base() 29 snprintb(buf, sizeof(buf), "\020", 0); in old_style_number_base() 31 snprintb(buf, sizeof(buf), "" "\014" "", 0); in old_style_number_base() 32 snprintb(buf, sizeof(buf), "" "\020" "", 0); in old_style_number_base() 38 char buf[64]; in new_style_number_base() local 41 snprintb(buf, sizeof(buf), "\177", 0); in new_style_number_base() [all …]
|