| /freebsd/sys/sys/ |
| H A D | sbuf.h | 36 struct sbuf; 42 struct sbuf { struct 77 struct sbuf *sbuf_new(struct sbuf *, char *, int, int); argument 80 int sbuf_get_flags(struct sbuf *); 81 void sbuf_clear_flags(struct sbuf *, int); 82 void sbuf_set_flags(struct sbuf *, int); 83 void sbuf_clear(struct sbuf *); 84 int sbuf_setpos(struct sbuf *, ssize_t); 85 int sbuf_bcat(struct sbuf *, const void *, size_t); 86 int sbuf_bcpy(struct sbuf *, const void *, size_t); [all …]
|
| /freebsd/usr.sbin/nghook/ |
| H A D | main.c | 253 char ch, sbuf[100]; in WriteAscii() local 257 snprintf(sbuf, sizeof(sbuf), "%04x: ", count); in WriteAscii() 260 snprintf(sbuf + strlen(sbuf), in WriteAscii() 261 sizeof(sbuf) - strlen(sbuf), in WriteAscii() 264 snprintf(sbuf + strlen(sbuf), in WriteAscii() 265 sizeof(sbuf) - strlen(sbuf), " "); in WriteAscii() 266 snprintf(sbuf + strlen(sbuf), sizeof(sbuf) - strlen(sbuf), " "); in WriteAscii() 271 snprintf(sbuf + strlen(sbuf), in WriteAscii() 272 sizeof(sbuf) - strlen(sbuf), "%c", ch); in WriteAscii() 274 snprintf(sbuf + strlen(sbuf), in WriteAscii() [all …]
|
| /freebsd/tools/regression/netinet6/inet6_rth/ |
| H A D | test_subr.c | 58 char sbuf[LINESIZE]; in checkptr() local 60 memset((void *)sbuf, 0, LINESIZE); in checkptr() 66 len = snprintf(sbuf, LINESIZE, "ok"); in checkptr() 70 len = snprintf(sbuf, LINESIZE, "not ok"); in checkptr() 75 snprintf(sbuf + len, LINESIZE - len, " %d - %s (%s)", in checkptr() 77 printf(sbuf); in checkptr() 91 char sbuf[LINESIZE]; in checkstr() local 93 memset((void *)sbuf, 0, LINESIZE); in checkstr() 99 len = snprintf(sbuf, LINESIZE, "ok"); in checkstr() 103 len = snprintf(sbuf, LINESIZE, "not ok"); in checkstr() [all …]
|
| /freebsd/tests/sys/netinet/ |
| H A D | udp_io.c | 68 char sbuf[] = "Hello, peer!", rbuf[sizeof(sbuf)]; in ATF_TC_BODY() local 70 .iov_base = sbuf, in ATF_TC_BODY() 71 .iov_len = sizeof(sbuf), in ATF_TC_BODY() 82 ATF_REQUIRE(sendmsg(s[1], &msg, 0) == sizeof(sbuf)); in ATF_TC_BODY() 83 n = (arc4random() % (sizeof(sbuf) - 1)) + 1; in ATF_TC_BODY() 88 ATF_REQUIRE(strncmp(sbuf, rbuf, n) == 0); in ATF_TC_BODY() 103 char sbuf[] = "Hello, peer!", rbuf[sizeof(sbuf)]; in ATF_TC_BODY() local 105 .iov_base = sbuf, in ATF_TC_BODY() 106 .iov_len = sizeof(sbuf), in ATF_TC_BODY() 117 ATF_REQUIRE(sendmsg(s[1], &msg, 0) == sizeof(sbuf)); in ATF_TC_BODY() [all …]
|
| /freebsd/contrib/lib9p/sbuf/ |
| H A D | sbuf.h | 37 struct sbuf struct 45 struct sbuf *sbuf_new_auto(void); argument 46 int sbuf_cat(struct sbuf *s, const char *str); 47 int sbuf_printf(struct sbuf *s, const char *fmt, ...); 48 int sbuf_vprintf(struct sbuf *s, const char *fmt, va_list args); 49 int sbuf_done(struct sbuf *s); 50 void sbuf_delete(struct sbuf *s); 51 int sbuf_finish(struct sbuf *s); 52 char *sbuf_data(struct sbuf *s);
|
| H A D | sbuf.c | 41 struct sbuf * 44 struct sbuf *s; in sbuf_new_auto() 46 s = malloc(sizeof(struct sbuf)); in sbuf_new_auto() 55 sbuf_cat(struct sbuf *s, const char *str) in sbuf_cat() 73 sbuf_printf(struct sbuf *s, const char *fmt, ...) in sbuf_printf() 86 sbuf_vprintf(struct sbuf *s, const char *fmt, va_list args) in sbuf_vprintf() 109 sbuf_data(struct sbuf *s) in sbuf_data() 115 sbuf_finish(struct sbuf *s) in sbuf_finish() 123 sbuf_delete(struct sbuf *s) in sbuf_delete()
|
| /freebsd/crypto/openssl/test/ |
| H A D | sha_test.c | 20 unsigned char buf[EVP_MAX_MD_SIZE], *sbuf; in test_static_sha_common() local 24 sbuf = (*md)(in, in_len, buf); in test_static_sha_common() 25 if (!TEST_ptr(sbuf) in test_static_sha_common() 26 || !TEST_ptr_eq(sbuf, buf) in test_static_sha_common() 27 || !TEST_mem_eq(sbuf, length, out, length)) in test_static_sha_common() 29 sbuf = (*md)(in, in_len, NULL); in test_static_sha_common() 30 if (!TEST_ptr(sbuf) in test_static_sha_common() 31 || !TEST_ptr_ne(sbuf, buf) in test_static_sha_common() 32 || !TEST_mem_eq(sbuf, length, out, length)) in test_static_sha_common()
|
| /freebsd/sys/kern/ |
| H A D | subr_sbuf.c | 104 _assert_sbuf_integrity(const char *fun, struct sbuf *s) in _assert_sbuf_integrity() 123 _assert_sbuf_state(const char *fun, struct sbuf *s, int state) in _assert_sbuf_state() 166 sbuf_extend(struct sbuf *s, int addlen) in sbuf_extend() 192 struct sbuf * 193 sbuf_new(struct sbuf *s, char *buf, int length, int flags) in sbuf_new() 257 struct sbuf * 258 sbuf_uionew(struct sbuf *s, struct uio *uio, int *error) in sbuf_uionew() 289 sbuf_get_flags(struct sbuf *s) in sbuf_get_flags() 296 sbuf_clear_flags(struct sbuf *s, int flags) in sbuf_clear_flags() 303 sbuf_set_flags(struct sbuf *s, int flags) in sbuf_set_flags() [all …]
|
| /freebsd/tools/regression/geom/MdLoad/ |
| H A D | MdLoad.c | 64 struct sbuf *sbuf; member 103 sbuf_clear(sc->sbuf); in startElement() 118 sbuf_clear(sc->sbuf); in endElement() 121 sbuf_finish(sc->sbuf); in endElement() 123 sc->sectorsize = strtoul(sbuf_data(sc->sbuf), &p, 0); in endElement() 127 o = strtoull(sbuf_data(sc->sbuf), &p, 0); in endElement() 133 sc->fwsectors = strtoul(sbuf_data(sc->sbuf), &p, 0); in endElement() 137 sc->fwheads = strtoul(sbuf_data(sc->sbuf), &p, 0); in endElement() 141 sc->fwcylinders = strtoul(sbuf_data(sc->sbuf), &p, 0); in endElement() 145 sc->sp->offset= strtoull(sbuf_data(sc->sbuf), &p, 0); in endElement() [all …]
|
| /freebsd/sys/dev/mlx5/mlx5_core/ |
| H A D | mlx5_diag_cnt.c | 152 decode_cnt_buffer(u32 num_of_samples, u8 *out, struct sbuf *sbuf) in decode_cnt_buffer() argument 164 sbuf_printf(sbuf, in decode_cnt_buffer() 208 struct sbuf sbuf; in mlx5_sysctl_dump_get() local 221 sbuf_new_for_sysctl(&sbuf, NULL, 65536, req); in mlx5_sysctl_dump_get() 226 sbuf_printf(&sbuf, "\nCould not query counters: %d\n", err); in mlx5_sysctl_dump_get() 228 sbuf_printf(&sbuf, "\n"); in mlx5_sysctl_dump_get() 230 diag_cnt->num_cnt_id, out, &sbuf); in mlx5_sysctl_dump_get() 234 sbuf_printf(&sbuf, "\nDump was not set.\n"); in mlx5_sysctl_dump_get() 237 err = sbuf_finish(&sbuf); in mlx5_sysctl_dump_get() 239 sbuf_delete(&sbuf); in mlx5_sysctl_dump_get() [all …]
|
| /freebsd/sys/geom/ |
| H A D | geom_dump.c | 50 g_confdot_consumer(struct sbuf *sb, struct g_consumer *cp) in g_confdot_consumer() 60 g_confdot_provider(struct sbuf *sb, struct g_provider *pp) in g_confdot_provider() 69 g_confdot_geom(struct sbuf *sb, struct g_geom *gp) in g_confdot_geom() 88 g_confdot_class(struct sbuf *sb, struct g_class *mp) in g_confdot_class() 100 struct sbuf *sb; in g_confdot() 113 g_conftxt_geom(struct sbuf *sb, struct g_geom *gp, int level) in g_conftxt_geom() 132 g_conftxt_class(struct sbuf *sb, struct g_class *mp) in g_conftxt_class() 144 struct sbuf *sb; in g_conftxt() 157 g_conf_cat_escaped(struct sbuf *sb, const char *buf) in g_conf_cat_escaped() 173 g_conf_printf_escaped(struct sbuf *sb, const char *fmt, ...) in g_conf_printf_escaped() [all …]
|
| /freebsd/sys/cam/nvme/ |
| H A D | nvme_all.h | 41 struct sbuf; 42 …rint_ident(const struct nvme_controller_data *, const struct nvme_namespace_data *, struct sbuf *); 44 const struct nvme_namespace_data *, struct sbuf *); 45 void nvme_cmd_sbuf(const struct nvme_command *, struct sbuf *sb); 46 int nvme_command_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb); 48 int nvme_status_sbuf(struct ccb_nvmeio *nvmeio, struct sbuf *sb);
|
| /freebsd/sys/dev/thunderbolt/ |
| H A D | tb_debug.c | 208 struct sbuf *sbuf; in tb_debug_sysctl() local 222 sbuf = sbuf_new_for_sysctl(NULL, NULL, 128, req); in tb_debug_sysctl() 227 sbuf_printf(sbuf, "%#x", *debug); in tb_debug_sysctl() 233 sbuf_printf(sbuf, ",%s", string->name); in tb_debug_sysctl() 236 error = sbuf_finish(sbuf); in tb_debug_sysctl() 237 sbuf_delete(sbuf); in tb_debug_sysctl() 253 sbuf_printf(sbuf, "debugging unavailable"); in tb_debug_sysctl() 254 error = sbuf_finish(sbuf); in tb_debug_sysctl() 255 sbuf_delete(sbuf); in tb_debug_sysctl()
|
| /freebsd/contrib/ntp/libntp/ |
| H A D | findconfig.c | 21 struct stat sbuf; in FindConfig() local 26 if (stat(result, &sbuf) == 0) { in FindConfig() 27 if (S_ISDIR(sbuf.st_mode)) { in FindConfig() 32 if (stat(result, &sbuf) == 0) { in FindConfig() 43 if (stat(result, &sbuf) == 0) { in FindConfig() 49 if (stat(result, &sbuf) == 0) { in FindConfig()
|
| /freebsd/sys/dev/qat/qat_common/ |
| H A D | adf_fw_counters.c | 127 struct sbuf *sbuf = NULL; in adf_read_fw_counters() local 138 sbuf = sbuf_new(NULL, cbuf, ADF_FW_COUNTERS_BUF_SZ, SBUF_FIXEDLEN); in adf_read_fw_counters() 139 if (sbuf == NULL) { in adf_read_fw_counters() 146 sbuf_delete(sbuf); in adf_read_fw_counters() 151 sbuf_printf(sbuf, in adf_read_fw_counters() 154 sbuf, in adf_read_fw_counters() 156 sbuf_printf(sbuf, in adf_read_fw_counters() 164 sbuf_printf(sbuf, "%s\n", ptr->name); in adf_read_fw_counters() 171 sbuf_printf(sbuf, "%s:%s\n", count->key, count->val); in adf_read_fw_counters() 175 sbuf_finish(sbuf); in adf_read_fw_counters() [all …]
|
| /freebsd/sys/dev/random/ |
| H A D | random_harvestq.c | 626 struct sbuf sbuf; in random_print_harvestmask() local 633 sbuf_new_for_sysctl(&sbuf, NULL, 128, req); in random_print_harvestmask() 639 sbuf_cat(&sbuf, present ? "1" : "0"); in random_print_harvestmask() 641 error = sbuf_finish(&sbuf); in random_print_harvestmask() 642 sbuf_delete(&sbuf); in random_print_harvestmask() 687 struct sbuf sbuf; in random_print_harvestmask_symbolic() local 696 sbuf_new_for_sysctl(&sbuf, NULL, 128, req); in random_print_harvestmask_symbolic() 705 sbuf_cat(&sbuf, ","); in random_print_harvestmask_symbolic() 706 sbuf_cat(&sbuf, !present ? "[" : ""); in random_print_harvestmask_symbolic() 707 sbuf_cat(&sbuf, random_source_descr[i]); in random_print_harvestmask_symbolic() [all …]
|
| /freebsd/sys/dev/etherswitch/arswitch/ |
| H A D | arswitch_8327.c | 324 char sbuf[128]; in ar8327_fetch_pdata_port() local 328 snprintf(sbuf, 128, "port.%d.force_link", port); in ar8327_fetch_pdata_port() 331 sbuf, &val); in ar8327_fetch_pdata_port() 337 snprintf(sbuf, 128, "port.%d.speed", port); in ar8327_fetch_pdata_port() 340 sbuf, &val) == 0) { in ar8327_fetch_pdata_port() 361 snprintf(sbuf, 128, "port.%d.duplex", port); in ar8327_fetch_pdata_port() 364 sbuf, &val) == 0) in ar8327_fetch_pdata_port() 367 snprintf(sbuf, 128, "port.%d.txpause", port); in ar8327_fetch_pdata_port() 370 sbuf, &val) == 0) in ar8327_fetch_pdata_port() 373 snprintf(sbuf, 128, "port.%d.rxpause", port); in ar8327_fetch_pdata_port() [all …]
|
| /freebsd/sys/dev/ice/ |
| H A D | ice_lib.c | 84 static void ice_nvm_version_str(struct ice_hw *hw, struct sbuf *buf); 86 static void ice_active_pkg_version_str(struct ice_hw *hw, struct sbuf *buf); 87 static void ice_os_pkg_version_str(struct ice_hw *hw, struct sbuf *buf); 173 static void ice_sbuf_print_ets_cfg(struct sbuf *sbuf, const char *name, 186 struct sbuf *sbuf, u16 cluster_id); 188 struct sbuf *sbuf); 2445 ice_os_pkg_version_str(struct ice_hw *hw, struct sbuf *buf) in ice_os_pkg_version_str() 2480 ice_active_pkg_version_str(struct ice_hw *hw, struct sbuf *buf) in ice_active_pkg_version_str() 2519 ice_nvm_version_str(struct ice_hw *hw, struct sbuf *buf) in ice_nvm_version_str() 2553 struct sbuf *sbuf; in ice_print_nvm_version() local [all …]
|
| /freebsd/sys/dev/bnxt/bnxt_re/ |
| H A D | qplib_sp.c | 87 struct bnxt_qplib_rcfw_sbuf sbuf; in bnxt_qplib_get_dev_attr() local 102 sbuf.size = sizeof(*sb); in bnxt_qplib_get_dev_attr() 103 sbuf.sb = dma_zalloc_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_get_dev_attr() 104 &sbuf.dma_addr, GFP_KERNEL); in bnxt_qplib_get_dev_attr() 105 if (!sbuf.sb) in bnxt_qplib_get_dev_attr() 108 sb = sbuf.sb; in bnxt_qplib_get_dev_attr() 109 req.resp_size = sbuf.size / BNXT_QPLIB_CMDQE_UNITS; in bnxt_qplib_get_dev_attr() 110 bnxt_qplib_fill_cmdqmsg(&msg, &req, &resp, &sbuf, sizeof(req), in bnxt_qplib_get_dev_attr() 205 dma_free_coherent(&rcfw->pdev->dev, sbuf.size, in bnxt_qplib_get_dev_attr() 206 sbuf.sb, sbuf.dma_addr); in bnxt_qplib_get_dev_attr() [all …]
|
| /freebsd/lib/libmt/ |
| H A D | mtlib.h | 67 struct sbuf *cur_sb[32]; 90 void mt_status_tree_sbuf(struct sbuf *sb, struct mt_status_entry *entry, 91 int indent, void (*sbuf_func)(struct sbuf *sb, 102 void mt_entry_sbuf(struct sbuf *sb, struct mt_status_entry *entry, char *fmt); 105 void mt_param_parent_sbuf(struct sbuf *sb, struct mt_status_entry *entry, 107 void mt_param_entry_sbuf(struct sbuf *sb, struct mt_status_entry *entry,
|
| /freebsd/contrib/lib9p/ |
| H A D | utils.c | 63 const struct descbits *, struct sbuf *); 64 static void l9p_describe_fid(const char *, uint32_t, struct sbuf *); 65 static void l9p_describe_mode(const char *, uint32_t, struct sbuf *); 66 static void l9p_describe_name(const char *, char *, struct sbuf *); 67 static void l9p_describe_perm(const char *, uint32_t, struct sbuf *); 68 static void l9p_describe_lperm(const char *, uint32_t, struct sbuf *); 69 static void l9p_describe_qid(const char *, struct l9p_qid *, struct sbuf *); 71 enum l9p_version, struct sbuf *); 73 struct sbuf *); 74 static void l9p_describe_time(struct sbuf *, const char *, uint64_t, uint64_t); [all …]
|
| /freebsd/contrib/wireguard-tools/ |
| H A D | ipc-uapi-unix.h | 22 struct stat sbuf; in userspace_interface_file() local 33 ret = stat(addr.sun_path, &sbuf); in userspace_interface_file() 37 if (!S_ISSOCK(sbuf.st_mode)) in userspace_interface_file() 66 struct stat sbuf; in userspace_has_wireguard_interface() local 74 if (stat(addr.sun_path, &sbuf) < 0) in userspace_has_wireguard_interface() 76 if (!S_ISSOCK(sbuf.st_mode)) in userspace_has_wireguard_interface()
|
| /freebsd/crypto/heimdal/lib/roken/ |
| H A D | iruserok.c | 221 struct stat sbuf; in iruserok() local 262 if (lstat(pbuf, &sbuf) < 0) in iruserok() 264 else if (!S_ISREG(sbuf.st_mode)) in iruserok() 266 else if (fstat(fileno(hostf), &sbuf) < 0) in iruserok() 268 else if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid) in iruserok() 270 else if (sbuf.st_mode & (S_IWGRP|S_IWOTH)) in iruserok()
|
| /freebsd/sys/compat/linuxkpi/common/src/ |
| H A D | linux_seq_file.c | 46 struct sbuf *sbuf; in seq_read() local 51 sbuf = m->buf; in seq_read() 52 sbuf_clear(sbuf); in seq_read() 59 rc = sbuf_finish(sbuf); in seq_read() 63 return (simple_read_from_buffer(ubuf, size, ppos, sbuf_data(sbuf), in seq_read() 64 sbuf_len(sbuf))); in seq_read() 230 struct sbuf *s; in seq_release()
|
| /freebsd/crypto/openssl/providers/implementations/kem/ |
| H A D | mlx_kem.c | 115 uint8_t *sbuf; in mlx_kem_encapsulate() local 169 sbuf = shsec + ml_kem_slot * key->xinfo->shsec_bytes; in mlx_kem_encapsulate() 173 || EVP_PKEY_encapsulate(ctx, cbuf, &encap_clen, sbuf, &encap_slen) <= 0) in mlx_kem_encapsulate() 223 sbuf = shsec + (1 - ml_kem_slot) * ML_KEM_SHARED_SECRET_BYTES; in mlx_kem_encapsulate() 228 || EVP_PKEY_derive(ctx, sbuf, &encap_slen) <= 0) in mlx_kem_encapsulate() 251 uint8_t *sbuf; in mlx_kem_decapsulate() local 290 sbuf = shsec + ml_kem_slot * key->xinfo->shsec_bytes; in mlx_kem_decapsulate() 294 || EVP_PKEY_decapsulate(ctx, sbuf, &decap_slen, cbuf, decap_clen) <= 0) in mlx_kem_decapsulate() 308 sbuf = shsec + (1 - ml_kem_slot) * ML_KEM_SHARED_SECRET_BYTES; in mlx_kem_decapsulate() 316 || EVP_PKEY_derive(ctx, sbuf, &decap_slen) <= 0) in mlx_kem_decapsulate()
|