Home
last modified time | relevance | path

Searched refs:hdr (Results 1 – 25 of 978) sorted by relevance

12345678910>>...40

/freebsd/contrib/wpa/src/tls/
H A Dtlsv1_client_ocsp.c116 struct asn1_hdr hdr; in tls_process_ocsp_single_response() local
141 if (asn1_get_next(resp, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in tls_process_ocsp_single_response()
142 asn1_unexpected(&hdr, "OCSP: Expected SEQUENCE (CertID)"); in tls_process_ocsp_single_response()
145 pos = hdr.payload; in tls_process_ocsp_single_response()
146 end = hdr.payload + hdr.length; in tls_process_ocsp_single_response()
161 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in tls_process_ocsp_single_response()
162 !asn1_is_octetstring(&hdr)) { in tls_process_ocsp_single_response()
163 asn1_unexpected(&hdr, in tls_process_ocsp_single_response()
167 name_hash = hdr.payload; in tls_process_ocsp_single_response()
168 name_hash_len = hdr.length; in tls_process_ocsp_single_response()
[all …]
H A Dtlsv1_cred.c446 struct asn1_hdr hdr; in pkcs12_certbag() local
458 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs12_certbag()
459 asn1_unexpected(&hdr, "PKCS #12: Expected SEQUENCE (CertBag)"); in pkcs12_certbag()
463 pos = hdr.payload; in pkcs12_certbag()
464 end = hdr.payload + hdr.length; in pkcs12_certbag()
481 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in pkcs12_certbag()
482 !asn1_is_cs_tag(&hdr, 0)) { in pkcs12_certbag()
483 asn1_unexpected(&hdr, in pkcs12_certbag()
488 if (asn1_get_next(hdr.payload, hdr.length, &hdr) < 0 || in pkcs12_certbag()
489 !asn1_is_octetstring(&hdr)) { in pkcs12_certbag()
[all …]
H A Dasn1.h62 int asn1_get_next(const u8 *buf, size_t len, struct asn1_hdr *hdr);
63 void asn1_print_hdr(const struct asn1_hdr *hdr, const char *title);
64 void asn1_unexpected(const struct asn1_hdr *hdr, const char *title);
72 int asn1_get_sequence(const u8 *buf, size_t len, struct asn1_hdr *hdr,
88 static inline bool asn1_is_oid(const struct asn1_hdr *hdr) in asn1_is_oid() argument
90 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_oid()
91 hdr->tag == ASN1_TAG_OID; in asn1_is_oid()
94 static inline bool asn1_is_boolean(const struct asn1_hdr *hdr) in asn1_is_boolean() argument
96 return hdr->class == ASN1_CLASS_UNIVERSAL && in asn1_is_boolean()
97 hdr->tag == ASN1_TAG_BOOLEAN; in asn1_is_boolean()
[all …]
H A Dasn1.c106 static int asn1_valid_der_boolean(struct asn1_hdr *hdr) in asn1_valid_der_boolean() argument
109 if (hdr->length != 1) { in asn1_valid_der_boolean()
111 hdr->length); in asn1_valid_der_boolean()
115 if (hdr->payload[0] != 0 && hdr->payload[0] != 0xff) { in asn1_valid_der_boolean()
118 hdr->payload[0]); in asn1_valid_der_boolean()
126 static int asn1_valid_der(struct asn1_hdr *hdr) in asn1_valid_der() argument
128 if (hdr->class != ASN1_CLASS_UNIVERSAL) in asn1_valid_der()
130 if (hdr->tag == ASN1_TAG_BOOLEAN && !asn1_valid_der_boolean(hdr)) in asn1_valid_der()
132 if (hdr->tag == ASN1_TAG_NULL && hdr->length != 0) in asn1_valid_der()
136 if (hdr->constructed && in asn1_valid_der()
[all …]
H A Dx509v3.c185 struct asn1_hdr hdr; in x509_parse_algorithm_identifier() local
195 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in x509_parse_algorithm_identifier()
196 asn1_unexpected(&hdr, in x509_parse_algorithm_identifier()
200 if (hdr.length > buf + len - hdr.payload) in x509_parse_algorithm_identifier()
202 pos = hdr.payload; in x509_parse_algorithm_identifier()
203 end = pos + hdr.length; in x509_parse_algorithm_identifier()
220 struct asn1_hdr hdr; in x509_parse_public_key() local
233 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in x509_parse_public_key()
234 !asn1_is_sequence(&hdr)) { in x509_parse_public_key()
235 asn1_unexpected(&hdr, in x509_parse_public_key()
[all …]
H A Dpkcs8.c21 struct asn1_hdr hdr; in pkcs8_key_import() local
30 if (asn1_get_next(buf, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs8_key_import()
31 asn1_unexpected(&hdr, in pkcs8_key_import()
35 pos = hdr.payload; in pkcs8_key_import()
36 end = pos + hdr.length; in pkcs8_key_import()
39 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !asn1_is_integer(&hdr)) { in pkcs8_key_import()
40 asn1_unexpected(&hdr, "PKCS #8: Expected INTEGER"); in pkcs8_key_import()
48 if (bignum_set_unsigned_bin(zero, hdr.payload, hdr.length) < 0) { in pkcs8_key_import()
53 pos = hdr.payload + hdr.length; in pkcs8_key_import()
66 if (asn1_get_next(pos, len, &hdr) < 0 || !asn1_is_sequence(&hdr)) { in pkcs8_key_import()
[all …]
H A Dpkcs5.c93 struct asn1_hdr hdr; in pkcs5_get_params_pbes2() local
109 if (asn1_get_next(pos, enc_alg_end - pos, &hdr) < 0 || in pkcs5_get_params_pbes2()
110 !asn1_is_sequence(&hdr)) { in pkcs5_get_params_pbes2()
111 asn1_unexpected(&hdr, in pkcs5_get_params_pbes2()
115 pos = hdr.payload; in pkcs5_get_params_pbes2()
116 end = hdr.payload + hdr.length; in pkcs5_get_params_pbes2()
118 if (asn1_get_next(pos, end - pos, &hdr) < 0 || in pkcs5_get_params_pbes2()
119 !asn1_is_sequence(&hdr)) { in pkcs5_get_params_pbes2()
120 asn1_unexpected(&hdr, in pkcs5_get_params_pbes2()
125 pos = hdr.payload; in pkcs5_get_params_pbes2()
[all …]
/freebsd/lib/libkvm/
H A Dkvm_minidump_powerpc64.c67 struct minidumphdr *hdr; in _powerpc64_minidump_initvtop() local
77 hdr = &vmst->hdr; in _powerpc64_minidump_initvtop()
81 if (pread(kd->pmfd, hdr, sizeof(*hdr), 0) != sizeof(*hdr)) { in _powerpc64_minidump_initvtop()
86 if (strncmp(MINIDUMP_MAGIC, hdr->magic, sizeof(hdr->magic)) != 0) { in _powerpc64_minidump_initvtop()
91 hdr->version = be32toh(hdr->version); in _powerpc64_minidump_initvtop()
92 if (hdr->version != MINIDUMP_VERSION && hdr->version != 1) { in _powerpc64_minidump_initvtop()
94 "Expected %d got %d", MINIDUMP_VERSION, hdr->version); in _powerpc64_minidump_initvtop()
98 hdr->msgbufsize = be32toh(hdr->msgbufsize); in _powerpc64_minidump_initvtop()
99 hdr->bitmapsize = be32toh(hdr->bitmapsize); in _powerpc64_minidump_initvtop()
100 hdr->pmapsize = be32toh(hdr->pmapsize); in _powerpc64_minidump_initvtop()
[all …]
H A Dkvm_minidump_aarch64.c52 struct minidumphdr hdr; member
94 if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) != in _aarch64_minidump_initvtop()
95 sizeof(vmst->hdr)) { in _aarch64_minidump_initvtop()
99 if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, in _aarch64_minidump_initvtop()
100 sizeof(vmst->hdr.magic)) != 0) { in _aarch64_minidump_initvtop()
105 vmst->hdr.version = le32toh(vmst->hdr.version); in _aarch64_minidump_initvtop()
106 if (vmst->hdr.version > MINIDUMP_VERSION || vmst->hdr.version < 1) { in _aarch64_minidump_initvtop()
108 "Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); in _aarch64_minidump_initvtop()
111 vmst->hdr.msgbufsize = le32toh(vmst->hdr.msgbufsize); in _aarch64_minidump_initvtop()
112 vmst->hdr.bitmapsize = le32toh(vmst->hdr.bitmapsize); in _aarch64_minidump_initvtop()
[all …]
H A Dkvm_minidump_riscv.c52 struct minidumphdr hdr; member
92 if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) != in _riscv_minidump_initvtop()
93 sizeof(vmst->hdr)) { in _riscv_minidump_initvtop()
97 if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, in _riscv_minidump_initvtop()
98 sizeof(vmst->hdr.magic)) != 0) { in _riscv_minidump_initvtop()
103 vmst->hdr.version = le32toh(vmst->hdr.version); in _riscv_minidump_initvtop()
104 if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) { in _riscv_minidump_initvtop()
106 "Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); in _riscv_minidump_initvtop()
109 vmst->hdr.msgbufsize = le32toh(vmst->hdr.msgbufsize); in _riscv_minidump_initvtop()
110 vmst->hdr.bitmapsize = le32toh(vmst->hdr.bitmapsize); in _riscv_minidump_initvtop()
[all …]
H A Dkvm_minidump_arm.c54 struct minidumphdr hdr; member
97 if (pread(kd->pmfd, &vmst->hdr, in _arm_minidump_initvtop()
98 sizeof(vmst->hdr), 0) != sizeof(vmst->hdr)) { in _arm_minidump_initvtop()
103 if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, in _arm_minidump_initvtop()
104 sizeof(vmst->hdr.magic)) != 0) { in _arm_minidump_initvtop()
108 vmst->hdr.version = _kvm32toh(kd, vmst->hdr.version); in _arm_minidump_initvtop()
109 if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) { in _arm_minidump_initvtop()
111 "Expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); in _arm_minidump_initvtop()
114 vmst->hdr.msgbufsize = _kvm32toh(kd, vmst->hdr.msgbufsize); in _arm_minidump_initvtop()
115 vmst->hdr.bitmapsize = _kvm32toh(kd, vmst->hdr.bitmapsize); in _arm_minidump_initvtop()
[all …]
H A Dkvm_minidump_amd64.c50 #define VM_IS_V1(vm) (vm->hdr.version == 1)
55 struct minidumphdr hdr; member
132 if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) != in _amd64_minidump_initvtop()
133 sizeof(vmst->hdr)) { in _amd64_minidump_initvtop()
137 if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, sizeof(vmst->hdr.magic)) != 0) { in _amd64_minidump_initvtop()
146 vmst->hdr.version = le32toh(vmst->hdr.version); in _amd64_minidump_initvtop()
147 if (vmst->hdr.version > MINIDUMP_VERSION || vmst->hdr.version < 1) { in _amd64_minidump_initvtop()
149 MINIDUMP_VERSION, vmst->hdr.version); in _amd64_minidump_initvtop()
152 vmst->hdr.msgbufsize = le32toh(vmst->hdr.msgbufsize); in _amd64_minidump_initvtop()
153 vmst->hdr.bitmapsize = le32toh(vmst->hdr.bitmapsize); in _amd64_minidump_initvtop()
[all …]
H A Dkvm_minidump_i386.c52 struct minidumphdr hdr; member
100 if (pread(kd->pmfd, &vmst->hdr, sizeof(vmst->hdr), 0) != in _i386_minidump_initvtop()
101 sizeof(vmst->hdr)) { in _i386_minidump_initvtop()
105 if (strncmp(MINIDUMP_MAGIC, vmst->hdr.magic, sizeof(vmst->hdr.magic)) != 0) { in _i386_minidump_initvtop()
109 vmst->hdr.version = le32toh(vmst->hdr.version); in _i386_minidump_initvtop()
110 if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) { in _i386_minidump_initvtop()
112 MINIDUMP_VERSION, vmst->hdr.version); in _i386_minidump_initvtop()
115 vmst->hdr.msgbufsize = le32toh(vmst->hdr.msgbufsize); in _i386_minidump_initvtop()
116 vmst->hdr.bitmapsize = le32toh(vmst->hdr.bitmapsize); in _i386_minidump_initvtop()
117 vmst->hdr.ptesize = le32toh(vmst->hdr.ptesize); in _i386_minidump_initvtop()
[all …]
/freebsd/crypto/openssl/crypto/cmp/
H A Dcmp_hdr.c23 int ossl_cmp_hdr_set_pvno(OSSL_CMP_PKIHEADER *hdr, int pvno) in ossl_cmp_hdr_set_pvno() argument
25 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_set_pvno()
27 return ASN1_INTEGER_set(hdr->pvno, pvno); in ossl_cmp_hdr_set_pvno()
30 int ossl_cmp_hdr_get_pvno(const OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_get_pvno() argument
34 if (!ossl_assert(hdr != NULL)) in ossl_cmp_hdr_get_pvno()
36 if (!ASN1_INTEGER_get_int64(&pvno, hdr->pvno) || pvno < 0 || pvno > INT_MAX) in ossl_cmp_hdr_get_pvno()
41 int ossl_cmp_hdr_get_protection_nid(const OSSL_CMP_PKIHEADER *hdr) in ossl_cmp_hdr_get_protection_nid() argument
43 if (!ossl_assert(hdr != NULL) in ossl_cmp_hdr_get_protection_nid()
44 || hdr->protectionAlg == NULL) in ossl_cmp_hdr_get_protection_nid()
46 return OBJ_obj2nid(hdr->protectionAlg->algorithm); in ossl_cmp_hdr_get_protection_nid()
[all …]
/freebsd/sys/contrib/openzfs/module/zfs/
H A Darc.c700 #define HDR_IN_HASH_TABLE(hdr) ((hdr)->b_flags & ARC_FLAG_IN_HASH_TABLE) argument
701 #define HDR_IO_IN_PROGRESS(hdr) ((hdr)->b_flags & ARC_FLAG_IO_IN_PROGRESS) argument
702 #define HDR_IO_ERROR(hdr) ((hdr)->b_flags & ARC_FLAG_IO_ERROR) argument
703 #define HDR_PREFETCH(hdr) ((hdr)->b_flags & ARC_FLAG_PREFETCH) argument
704 #define HDR_PRESCIENT_PREFETCH(hdr) \ argument
705 ((hdr)->b_flags & ARC_FLAG_PRESCIENT_PREFETCH)
706 #define HDR_COMPRESSION_ENABLED(hdr) \ argument
707 ((hdr)->b_flags & ARC_FLAG_COMPRESSED_ARC)
709 #define HDR_L2CACHE(hdr) ((hdr)->b_flags & ARC_FLAG_L2CACHE) argument
710 #define HDR_UNCACHED(hdr) ((hdr)->b_flags & ARC_FLAG_UNCACHED) argument
[all …]
/freebsd/sys/compat/linux/
H A Dlinux_netlink.c76 rtnl_neigh_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) in rtnl_neigh_from_linux() argument
78 struct ndmsg *ndm = (struct ndmsg *)(hdr + 1); in rtnl_neigh_from_linux()
81 if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + sizeof(struct ndmsg)) in rtnl_neigh_from_linux()
92 rtnl_ifaddr_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) in rtnl_ifaddr_from_linux() argument
94 struct ifaddrmsg *ifam = (struct ifaddrmsg *)(hdr + 1); in rtnl_ifaddr_from_linux()
97 if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + in rtnl_ifaddr_from_linux()
112 rtnl_route_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) in rtnl_route_from_linux() argument
115 struct rtmsg *rtm = (struct rtmsg *)(hdr + 1); in rtnl_route_from_linux()
120 if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + sizeof(struct rtmsg)) in rtnl_route_from_linux()
129 attrs_len = hdr->nlmsg_len - sizeof(struct nlmsghdr); in rtnl_route_from_linux()
[all …]
/freebsd/tools/tools/ath/athalq/
H A Dmain.c49 struct if_ath_alq_init_state hdr; variable
52 ath_alq_print_hdr(struct if_ath_alq_init_state *hdr) in ath_alq_print_hdr() argument
55 be32toh(hdr->sc_mac_version), in ath_alq_print_hdr()
56 be32toh(hdr->sc_mac_revision), in ath_alq_print_hdr()
57 be32toh(hdr->sc_phy_rev), in ath_alq_print_hdr()
58 be32toh(hdr->sc_hal_magic)); in ath_alq_print_hdr()
70 (unsigned int) be32toh(a->hdr.tstamp_sec), in ath_alq_print_intr_status()
71 (unsigned int) be32toh(a->hdr.tstamp_usec), in ath_alq_print_intr_status()
72 (unsigned long long) be64toh(a->hdr.threadid), in ath_alq_print_intr_status()
81 (unsigned int) be32toh(a->hdr.tstamp_sec), in ath_alq_print_beacon_miss()
[all …]
/freebsd/stand/libsa/
H A Dgpt.c52 gptupdate(const char *which, struct dsk *dskp, struct gpt_hdr *hdr, in gptupdate() argument
66 entries_per_sec = DEV_BSIZE / hdr->hdr_entsz; in gptupdate()
70 slba += hdr->hdr_lba_table; in gptupdate()
76 hdr->hdr_crc_table = crc32(0, Z_NULL, 0); in gptupdate()
77 hdr->hdr_crc_table = crc32(hdr->hdr_crc_table, (const Bytef *)table, in gptupdate()
78 hdr->hdr_entries * hdr->hdr_entsz); in gptupdate()
79 hdr->hdr_crc_self = crc32(0, Z_NULL, 0); in gptupdate()
80 hdr->hdr_crc_self = crc32(hdr->hdr_crc_self, (const Bytef *)hdr, in gptupdate()
81 hdr->hdr_size); in gptupdate()
83 bcopy(hdr, secbuf, hdr->hdr_size); in gptupdate()
[all …]
/freebsd/contrib/wpa/src/common/
H A Ddpp_backup.c538 struct asn1_hdr hdr; in dpp_parse_recipient_infos() local
559 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in dpp_parse_recipient_infos()
560 !asn1_is_cs_tag(&hdr, 3)) { in dpp_parse_recipient_infos()
561 asn1_unexpected(&hdr, "DPP: Expected CHOICE [3] (pwri)"); in dpp_parse_recipient_infos()
565 hdr.payload, hdr.length); in dpp_parse_recipient_infos()
566 pos = hdr.payload; in dpp_parse_recipient_infos()
567 end = pos + hdr.length; in dpp_parse_recipient_infos()
580 if (asn1_get_sequence(pos, end - pos, &hdr, &end) < 0) in dpp_parse_recipient_infos()
582 pos = hdr.payload; in dpp_parse_recipient_infos()
594 if (asn1_get_next(pos, end - pos, &hdr) < 0 || !hdr.constructed || in dpp_parse_recipient_infos()
[all …]
/freebsd/sys/dev/ksyms/
H A Dksyms.c270 struct ksyms_hdr *hdr; in ksyms_snapshot() local
273 hdr = malloc(sizeof(*hdr), M_KSYMS, M_WAITOK | M_ZERO); in ksyms_snapshot()
278 hdr->kh_ehdr.e_ident[EI_PAD] = 0; in ksyms_snapshot()
279 hdr->kh_ehdr.e_ident[EI_MAG0] = ELFMAG0; in ksyms_snapshot()
280 hdr->kh_ehdr.e_ident[EI_MAG1] = ELFMAG1; in ksyms_snapshot()
281 hdr->kh_ehdr.e_ident[EI_MAG2] = ELFMAG2; in ksyms_snapshot()
282 hdr->kh_ehdr.e_ident[EI_MAG3] = ELFMAG3; in ksyms_snapshot()
283 hdr->kh_ehdr.e_ident[EI_DATA] = ELF_DATA; in ksyms_snapshot()
284 hdr->kh_ehdr.e_ident[EI_OSABI] = ELFOSABI_FREEBSD; in ksyms_snapshot()
285 hdr->kh_ehdr.e_ident[EI_CLASS] = ELF_CLASS; in ksyms_snapshot()
[all …]
/freebsd/tools/tools/intel-ucode-split/
H A Dintel-ucode-split.c78 dump_header(const struct microcode_update_header *hdr) in dump_header() argument
84 sig_str = format_signature(hdr->processor_signature); in dump_header()
85 printf("header version\t0x%x\n", hdr->header_version); in dump_header()
86 printf("revision\t0x%x\n", hdr->update_revision); in dump_header()
87 printf("date\t\t0x%x\t%04x-%02x-%02x\n", hdr->date, in dump_header()
88 hdr->date & 0xffff, (hdr->date & 0xff000000) >> 24, in dump_header()
89 (hdr->date & 0xff0000) >> 16); in dump_header()
90 printf("signature\t0x%x\t\t%s\n", hdr->processor_signature, sig_str); in dump_header()
91 printf("checksum\t0x%x\n", hdr->checksum); in dump_header()
92 printf("loader revision\t0x%x\n", hdr->loader_revision); in dump_header()
[all …]
/freebsd/sys/netgraph/bluetooth/l2cap/
H A Dng_l2cap_cmds.h55 ng_l2cap_cmd_hdr_t hdr; \
65 c->hdr.code = NG_L2CAP_CMD_REJ; \
66 c->hdr.ident = (_ident); \
67 c->hdr.length = sizeof(c->param); \
73 c->hdr.length += sizeof(c->data.mtu); \
77 c->hdr.length += sizeof(c->data.cid); \
80 (_m)->m_pkthdr.len = (_m)->m_len = sizeof(c->hdr) + \
81 c->hdr.length; \
83 c->hdr.length = htole16(c->hdr.length); \
90 ng_l2cap_cmd_hdr_t hdr; \
[all …]
/freebsd/contrib/libpcap/
H A Dpcap-util.c49 swap_pflog_header(const struct pcap_pkthdr *hdr, u_char *buf) in swap_pflog_header() argument
51 u_int caplen = hdr->caplen; in swap_pflog_header()
52 u_int length = hdr->len; in swap_pflog_header()
188 swap_linux_sll_socketcan_header(const struct pcap_pkthdr *hdr, u_char *buf) in swap_linux_sll_socketcan_header() argument
190 u_int caplen = hdr->caplen; in swap_linux_sll_socketcan_header()
191 u_int length = hdr->len; in swap_linux_sll_socketcan_header()
213 swap_linux_sll2_socketcan_header(const struct pcap_pkthdr *hdr, u_char *buf) in swap_linux_sll2_socketcan_header() argument
215 u_int caplen = hdr->caplen; in swap_linux_sll2_socketcan_header()
216 u_int length = hdr->len; in swap_linux_sll2_socketcan_header()
244 swap_linux_usb_header(const struct pcap_pkthdr *hdr, u_char *buf, in swap_linux_usb_header() argument
[all …]
H A Dsf-pcap.c177 static int pcap_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **datap);
223 struct pcap_file_header hdr; in pcap_check_header() local
255 hdr.magic = magic_int; in pcap_check_header()
256 amt_read = fread(((char *)&hdr) + sizeof hdr.magic, 1, in pcap_check_header()
257 sizeof(hdr) - sizeof(hdr.magic), fp); in pcap_check_header()
258 if (amt_read != sizeof(hdr) - sizeof(hdr.magic)) { in pcap_check_header()
265 sizeof(hdr), amt_read); in pcap_check_header()
275 hdr.version_major = SWAPSHORT(hdr.version_major); in pcap_check_header()
276 hdr.version_minor = SWAPSHORT(hdr.version_minor); in pcap_check_header()
277 hdr.thiszone = SWAPLONG(hdr.thiszone); in pcap_check_header()
[all …]
/freebsd/sys/dev/netmap/
H A Dnetmap_legacy.c61 nmreq_register_from_legacy(struct nmreq *nmr, struct nmreq_header *hdr, in nmreq_register_from_legacy() argument
97 if (strlen(hdr->nr_name) + strlen(suffix) in nmreq_register_from_legacy()
98 >= sizeof(hdr->nr_name)) { in nmreq_register_from_legacy()
102 strlcat(hdr->nr_name, suffix, sizeof(hdr->nr_name)); in nmreq_register_from_legacy()
124 struct nmreq_header *hdr = nm_os_malloc(sizeof(*hdr)); in nmreq_from_legacy() local
126 if (hdr == NULL) { in nmreq_from_legacy()
136 hdr->nr_version = NETMAP_API; /* new API */ in nmreq_from_legacy()
137 strlcpy(hdr->nr_name, nmr->nr_name, sizeof(nmr->nr_name)); in nmreq_from_legacy()
138 hdr->nr_options = (uintptr_t)NULL; in nmreq_from_legacy()
139 hdr->nr_body = (uintptr_t)NULL; in nmreq_from_legacy()
[all …]

12345678910>>...40