| /freebsd/contrib/bsnmp/lib/ |
| H A D | snmp.c | 199 snmp_parse_pdus_hdr(struct asn_buf *b, struct snmp_pdu *pdu, asn_len_t *lenp) in snmp_parse_pdus_hdr() argument 201 if (pdu->type == SNMP_PDU_TRAP) { in snmp_parse_pdus_hdr() 202 if (asn_get_objid(b, &pdu->enterprise) != ASN_ERR_OK) { in snmp_parse_pdus_hdr() 206 if (asn_get_ipaddress(b, pdu->agent_addr) != ASN_ERR_OK) { in snmp_parse_pdus_hdr() 210 if (asn_get_integer(b, &pdu->generic_trap) != ASN_ERR_OK) { in snmp_parse_pdus_hdr() 214 if (asn_get_integer(b, &pdu->specific_trap) != ASN_ERR_OK) { in snmp_parse_pdus_hdr() 218 if (asn_get_timeticks(b, &pdu->time_stamp) != ASN_ERR_OK) { in snmp_parse_pdus_hdr() 223 if (asn_get_integer(b, &pdu->request_id) != ASN_ERR_OK) { in snmp_parse_pdus_hdr() 227 if (asn_get_integer(b, &pdu->error_status) != ASN_ERR_OK) { in snmp_parse_pdus_hdr() 231 if (asn_get_integer(b, &pdu->error_index) != ASN_ERR_OK) { in snmp_parse_pdus_hdr() [all …]
|
| H A D | snmpagent.c | 169 snmp_pdu_create_response(const struct snmp_pdu *pdu, struct snmp_pdu *resp) in snmp_pdu_create_response() argument 172 strcpy(resp->community, pdu->community); in snmp_pdu_create_response() 173 resp->version = pdu->version; in snmp_pdu_create_response() 174 if (pdu->flags & SNMP_MSG_AUTODISCOVER) in snmp_pdu_create_response() 178 resp->request_id = pdu->request_id; in snmp_pdu_create_response() 179 resp->version = pdu->version; in snmp_pdu_create_response() 184 memcpy(&resp->engine, &pdu->engine, sizeof(pdu->engine)); in snmp_pdu_create_response() 185 memcpy(&resp->user, &pdu->user, sizeof(pdu->user)); in snmp_pdu_create_response() 187 resp->identifier = pdu->identifier; in snmp_pdu_create_response() 188 resp->security_model = pdu->security_model; in snmp_pdu_create_response() [all …]
|
| H A D | bsnmplib.3 | 77 .Fn snmp_pdu_decode "struct asn_buf *buf" "struct snmp_pdu *pdu" "int32_t *ip" 79 .Fn snmp_pdu_encode "struct snmp_pdu *pdu" "struct asn_buf *buf" 81 .Fn snmp_pdu_decode_header "struct snmp_pdu *pdu" "struct asn_buf *buf" 83 .Fn snmp_pdu_decode_scoped "struct asn_buf *buf" "struct snmp_pdu *pdu" "int32_t *ip" 85 .Fn snmp_pdu_decode_secmode "struct asn_buf *buf" "struct snmp_pdu *pdu" 87 .Fn snmp_pdu_init_secparams "struct snmp_pdu *pdu" 89 .Fn snmp_pdu_dump "const struct snmp_pdu *pdu" 124 This structure represents one variable binding from an SNMP PDU. 248 /* SNMPv3 PDU header fields */ 291 This structure contains a decoded SNMP PDU. [all …]
|
| H A D | snmpcrypto.c | 89 snmp_pdu_calc_digest(const struct snmp_pdu *pdu, uint8_t *digest) in snmp_pdu_calc_digest() argument 101 err = snmp_digest_init(&pdu->user, ctx, &dtype, &keylen); in snmp_pdu_calc_digest() 109 memset(pdu->digest_ptr, 0, sizeof(pdu->msg_digest)); in snmp_pdu_calc_digest() 110 memcpy(extkey, pdu->user.auth_key, keylen); in snmp_pdu_calc_digest() 119 EVP_DigestUpdate(ctx, pdu->outer_ptr, pdu->outer_len) != 1 || in snmp_pdu_calc_digest() 145 snmp_pdu_cipher_init(const struct snmp_pdu *pdu, int32_t len, in snmp_pdu_cipher_init() argument 151 if (pdu->user.priv_proto == SNMP_PRIV_DES) { in snmp_pdu_cipher_init() 155 memcpy(piv, pdu->msg_salt, sizeof(pdu->msg_salt)); in snmp_pdu_cipher_init() 157 piv[i] = piv[i] ^ pdu->user.priv_key[8 + i]; in snmp_pdu_cipher_init() 158 } else if (pdu->user.priv_proto == SNMP_PRIV_AES) { in snmp_pdu_cipher_init() [all …]
|
| H A D | snmpclient.c | 79 struct snmp_pdu *pdu; member 124 struct snmp_pdu pdu; member 443 * Initialize the first PDU to send 446 table_init_pdu(const struct snmp_table *descr, struct snmp_pdu *pdu) in table_init_pdu() argument 449 snmp_pdu_create(pdu, SNMP_PDU_GETNEXT); in table_init_pdu() 451 snmp_pdu_create(pdu, SNMP_PDU_GETBULK); in table_init_pdu() 452 pdu->error_index = 10; in table_init_pdu() 455 pdu->bindings[pdu->nbindings].syntax = SNMP_SYNTAX_NULL; in table_init_pdu() 456 pdu->bindings[pdu->nbindings].var = descr->last_change; in table_init_pdu() 457 pdu->nbindings++; in table_init_pdu() [all …]
|
| H A D | bsnmpclient.3 | 88 .Fn snmp_pdu_create "struct snmp_pdu *pdu" "u_int op" 90 .Fn snmp_add_binding "struct snmp_pdu *pdu" "..." 94 .Fn snmp_pdu_send "struct snmp_pdu *pdu" "snmp_send_cb_f func" "void *uarg" 217 each transmitted PDU. 239 Number of times a request PDU is to be resent. 251 This is the size of the maximum PDU that can be received. 258 The request id of the next PDU to send. 342 initializes a PDU of type 344 It does not allocate space for the PDU itself. 347 adds bindings to the PDU and returns the (zero based) index of the first new [all …]
|
| H A D | bsnmpagent.3 | 72 .Fn snmp_get "struct snmp_pdu *pdu" "struct asn_buf *resp_b" "struct snmp_pdu *resp" "void *data" 74 .Fn snmp_getnext "struct snmp_pdu *pdu" "struct asn_buf *resp_b" "struct snmp_pdu *resp" "void *dat… 76 .Fn snmp_getbulk "struct snmp_pdu *pdu" "struct asn_buf *resp_b" "struct snmp_pdu *resp" "void *dat… 78 .Fn snmp_set "struct snmp_pdu *pdu" "struct asn_buf *resp_b" "struct snmp_pdu *resp" "void *data" 80 .Fn snmp_make_errresp "const struct snmp_pdu *pdu" "struct asn_buf *req_b" "struct asn_buf *resp_b" 182 PDU was a version 1 PDU, the error code is mapped automatically. 283 For all three functions the response PDU is constructed and encoded 285 If everything is ok, the response PDU is returned in 291 to free the response PDU in this case. 295 Operation successful, response PDU may be sent. [all …]
|
| /freebsd/lib/libiscsiutil/ |
| H A D | pdu.c | 44 pdu_ahs_length(const struct pdu *pdu) in pdu_ahs_length() argument 47 return (pdu->pdu_bhs->bhs_total_ahs_len * 4); in pdu_ahs_length() 51 pdu_data_segment_length(const struct pdu *pdu) in pdu_data_segment_length() argument 55 len += pdu->pdu_bhs->bhs_data_segment_len[0]; in pdu_data_segment_length() 57 len += pdu->pdu_bhs->bhs_data_segment_len[1]; in pdu_data_segment_length() 59 len += pdu->pdu_bhs->bhs_data_segment_len[2]; in pdu_data_segment_length() 65 pdu_set_data_segment_length(struct pdu *pdu, uint32_t len) in pdu_set_data_segment_length() argument 68 pdu->pdu_bhs->bhs_data_segment_len[2] = len; in pdu_set_data_segment_length() 69 pdu->pdu_bhs->bhs_data_segment_len[1] = len >> 8; in pdu_set_data_segment_length() 70 pdu->pdu_bhs->bhs_data_segment_len[0] = len >> 16; in pdu_set_data_segment_length() [all …]
|
| H A D | libiscsiutil.h | 61 struct pdu { struct 70 void (*pdu_receive_proxy)(struct pdu *); 71 void (*pdu_send_proxy)(struct pdu *); 127 keys_load_pdu(struct keys *keys, const struct pdu *pdu) in keys_load_pdu() argument 129 keys_load(keys, pdu->pdu_data, pdu->pdu_data_len); in keys_load_pdu() 133 keys_save_pdu(struct keys *keys, struct pdu *pdu) in keys_save_pdu() argument 135 keys_save(keys, &pdu->pdu_data, &pdu->pdu_data_len); in keys_save_pdu() 138 struct pdu *pdu_new(struct connection *ic); 139 struct pdu *pdu_new_response(struct pdu *request); 140 int pdu_ahs_length(const struct pdu *pdu); [all …]
|
| H A D | text.c | 40 /* Construct a new TextRequest PDU. */ 41 static struct pdu * 44 struct pdu *request; in text_new_request() 61 /* Receive a TextRequest PDU from a connection. */ 62 static struct pdu * 65 struct pdu *request; in text_receive_request() 81 log_errx(1, "received TextRequest PDU with invalid " in text_receive_request() 84 log_errx(1, "received TextRequest PDU with decreasing CmdSN: " in text_receive_request() 94 /* Construct a new TextResponse PDU in reply to a request. */ 95 static struct pdu * [all …]
|
| /freebsd/lib/libnvmf/ |
| H A D | nvmf_tcp.c | 151 nvmf_tcp_write_pdu(struct nvmf_tcp_qpair *qp, const void *pdu, size_t len) in nvmf_tcp_write_pdu() argument 156 cp = pdu; in nvmf_tcp_write_pdu() 225 nvmf_tcp_validate_pdu(struct nvmf_tcp_qpair *qp, struct nvmf_tcp_rxpdu *pdu, in nvmf_tcp_validate_pdu() argument 235 /* Determine how large of a PDU header to return for errors. */ in nvmf_tcp_validate_pdu() 236 ch = pdu->hdr; in nvmf_tcp_validate_pdu() 281 pdu->data_len = data_len; in nvmf_tcp_validate_pdu() 309 nvmf_tcp_read_pdu(struct nvmf_tcp_qpair *qp, struct nvmf_tcp_rxpdu *pdu) in nvmf_tcp_read_pdu() argument 315 memset(pdu, 0, sizeof(*pdu)); in nvmf_tcp_read_pdu() 327 pdu->hdr = &ch; in nvmf_tcp_read_pdu() 328 error = nvmf_tcp_validate_pdu(qp, pdu, sizeof(ch)); in nvmf_tcp_read_pdu() [all …]
|
| /freebsd/contrib/tcpdump/ |
| H A D | print-rpki-rtr.c | 33 * RPKI/Router PDU header 35 * Here's what the PDU header looks like. 40 nd_uint8_t pdu_type; /* PDU type */ 49 * IPv4 Prefix PDU. 62 * IPv6 Prefix PDU. 75 * Error report PDU. 79 nd_uint32_t encapsulated_pdu_length; /* Encapsulated PDU length */ 80 /* Copy of Erroneous PDU (variable, optional) */ 86 * PDU type codes 117 { 5, "Unsupported PDU Type" }, [all …]
|
| /freebsd/contrib/bsnmp/snmpd/ |
| H A D | trap.c | 423 snmp_create_v1_trap(struct snmp_pdu *pdu, char *com, in snmp_create_v1_trap() argument 426 memset(pdu, 0, sizeof(*pdu)); in snmp_create_v1_trap() 427 strlcpy(pdu->community, com, sizeof(pdu->community)); in snmp_create_v1_trap() 429 pdu->version = SNMP_V1; in snmp_create_v1_trap() 430 pdu->type = SNMP_PDU_TRAP; in snmp_create_v1_trap() 431 pdu->enterprise = systemg.object_id; in snmp_create_v1_trap() 432 memcpy(pdu->agent_addr, snmpd.trap1addr, 4); in snmp_create_v1_trap() 433 pdu->generic_trap = trap_oid->subs[trap_oid->len - 1] - 1; in snmp_create_v1_trap() 434 pdu->specific_trap = 0; in snmp_create_v1_trap() 435 pdu->time_stamp = get_ticks() - start_tick; in snmp_create_v1_trap() [all …]
|
| H A D | main.c | 279 * Prepare a PDU for output 282 snmp_output(struct snmp_pdu *pdu, u_char *sndbuf, size_t *sndlen, in snmp_output() argument 291 if ((code = snmp_pdu_encode(pdu, &resp_b)) != SNMP_CODE_OK) { in snmp_output() 297 snmp_pdu_dump(pdu); in snmp_output() 303 * Check USM PDU header credentials against local SNMP Engine & users. 306 snmp_pdu_auth_user(struct snmp_pdu *pdu) in snmp_pdu_auth_user() argument 311 if (pdu->engine.engine_len == 0 && strlen(pdu->user.sec_name) == 0) { in snmp_pdu_auth_user() 312 pdu->engine.engine_len = snmpd_engine.engine_len; in snmp_pdu_auth_user() 313 memcpy(pdu->engine.engine_id, snmpd_engine.engine_id, in snmp_pdu_auth_user() 316 pdu->engine.engine_boots = snmpd_engine.engine_boots; in snmp_pdu_auth_user() [all …]
|
| H A D | snmpmod.3 | 205 .Fa "struct snmp_pdu *pdu" "int32_t *ip" "size_t *pdulen" 209 .Fa "struct snmp_pdu *pdu" "const u_char *rcvbuf" 215 .Fa "struct snmp_pdu *pdu" "u_char *sndbuf" "size_t *sndlen" 221 .Fa "struct snmp_pdu *pdu" "const struct sockaddr *addr" "socklen_t addrlen" 226 .Fn snmp_pdu_auth_access "struct snmp_pdu *pdu" "int32_t *ip" 426 If the daemon receives a PDU and that PDU has a community string whose 431 than this function is called to handle the PDU. 552 the current PDU processing was started. 602 in the incoming PDU. 606 transport proxying (a PDU received on one communication link is proxied to [all …]
|
| /freebsd/lib/libsdp/ |
| H A D | service.c | 53 sdp_pdu_t pdu; in sdp_register_service() local 63 if (sizeof(pdu)+sizeof(uuid)+sizeof(*bdaddr)+datalen > SDP_LOCAL_MTU) { in sdp_register_service() 68 pdu.pid = SDP_PDU_SERVICE_REGISTER_REQUEST; in sdp_register_service() 69 pdu.tid = htons(++ss->tid); in sdp_register_service() 70 pdu.len = htons(sizeof(uuid) + sizeof(*bdaddr) + datalen); in sdp_register_service() 74 iov[0].iov_base = (void *) &pdu; in sdp_register_service() 75 iov[0].iov_len = sizeof(pdu); in sdp_register_service() 98 if (len != sizeof(pdu) + sizeof(uint16_t) + sizeof(uint32_t)) { in sdp_register_service() 118 sdp_pdu_t pdu; in sdp_unregister_service() local 127 if (sizeof(pdu) + sizeof(handle) > SDP_LOCAL_MTU) { in sdp_unregister_service() [all …]
|
| /freebsd/sys/dev/virtio/scmi/ |
| H A D | virtio_scmi.c | 266 struct vtscmi_pdu *pdu; in vtscmi_alloc_queues() local 277 q->pdus = mallocarray(q->vq_sz, sizeof(*pdu), M_DEVBUF, in vtscmi_alloc_queues() 281 for (i = 0, pdu = q->pdus; i < q->vq_sz; i++, pdu++) { in vtscmi_alloc_queues() 282 pdu->chan = idx; in vtscmi_alloc_queues() 284 sglist_init(&pdu->sg, in vtscmi_alloc_queues() 285 idx == VIRTIO_SCMI_CHAN_A2P ? 2 : 1, pdu->segs); in vtscmi_alloc_queues() 286 SLIST_INSERT_HEAD(&q->p_head, pdu, next); in vtscmi_alloc_queues() 329 struct vtscmi_pdu *pdu; in vtscmi_vq_intr() local 333 pdu = virtqueue_dequeue(q->vq, &rx_len); in vtscmi_vq_intr() 335 if (!pdu) in vtscmi_vq_intr() [all …]
|
| /freebsd/sys/dev/nvmf/ |
| H A D | nvmf_tcp.c | 144 "Maximum size of data payload in a transmitted PDU"); 306 nvmf_tcp_validate_pdu(struct nvmf_tcp_qpair *qp, struct nvmf_tcp_rxpdu *pdu) in nvmf_tcp_validate_pdu() argument 309 struct mbuf *m = pdu->m; in nvmf_tcp_validate_pdu() 316 /* Determine how large of a PDU header to return for errors. */ in nvmf_tcp_validate_pdu() 317 ch = pdu->hdr; in nvmf_tcp_validate_pdu() 346 pdu->data_digest_mismatch = false; in nvmf_tcp_validate_pdu() 353 pdu->data_digest_mismatch = true; in nvmf_tcp_validate_pdu() 357 pdu->data_len = data_len; in nvmf_tcp_validate_pdu() 362 nvmf_tcp_free_pdu(struct nvmf_tcp_rxpdu *pdu) in nvmf_tcp_free_pdu() argument 364 m_freem(pdu->m); in nvmf_tcp_free_pdu() [all …]
|
| H A D | nvmf_tcp.h | 23 * Validate common fields in a received PDU header. If an error is 27 * termination request PDU. If no error is detected, 0 is returned 58 /* Controllers only receive PDUs with a PDU direction of 0. */ in nvmf_tcp_validate_pdu_header() 60 printf("NVMe/TCP: Invalid PDU type %u\n", ch->pdu_type); in nvmf_tcp_validate_pdu_header() 70 printf("NVMe/TCP: Received Initialize Connection PDU\n"); in nvmf_tcp_validate_pdu_header() 77 * 7.4.7 Termination requests with invalid PDU lengths in nvmf_tcp_validate_pdu_header() 94 printf("NVMe/TCP: Invalid PDU type %u\n", ch->pdu_type); in nvmf_tcp_validate_pdu_header() 128 printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags); in nvmf_tcp_validate_pdu_header() 147 printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags); in nvmf_tcp_validate_pdu_header() 158 printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags); in nvmf_tcp_validate_pdu_header() [all …]
|
| /freebsd/usr.sbin/ctld/ |
| H A D | login.cc | 50 static void login_send_error(struct pdu *request, 106 login_set_nsg(struct pdu *response, int nsg) in login_set_nsg() 122 login_csg(const struct pdu *request) in login_csg() 132 login_set_csg(struct pdu *response, int csg) in login_set_csg() 146 static struct pdu * 149 struct pdu *request; in login_receive() 157 * The first PDU in session is special - if we receive any PDU in login_receive() 159 * without sending response ("A target receiving any PDU in login_receive() 161 * immediately terminate the connection on which the PDU in login_receive() 175 log_errx(1, "received Login PDU with unsupported \"C\" flag"); in login_receive() [all …]
|
| H A D | discovery.cc | 45 static struct pdu * 48 struct pdu *request; in logout_receive() 59 log_debugx("received Logout PDU with invalid reason 0x%x; " in logout_receive() 62 log_errx(1, "received Logout PDU with decreasing CmdSN: " in logout_receive() 67 log_errx(1, "received Logout PDU with wrong ExpStatSN: " in logout_receive() 78 static struct pdu * 79 logout_new_response(struct pdu *request) in logout_new_response() 81 struct pdu *response; in logout_new_response() 217 struct pdu *request, *response; in discovery() 225 log_debugx("beginning discovery session; waiting for TextRequest PDU"); in discovery() [all …]
|
| /freebsd/usr.sbin/bluetooth/sdpd/ |
| H A D | server.c | 408 sdp_pdu_p pdu = (sdp_pdu_p) srv->req; in server_process_request() local 435 if (len >= sizeof(*pdu) && in server_process_request() 436 sizeof(*pdu) + (pdu->len = ntohs(pdu->len)) == len) { in server_process_request() 437 switch (pdu->pid) { in server_process_request() 470 switch (pdu->pid) { in server_process_request() 502 "pdu->pid=%d, pdu->tid=%d, error=%d", in server_process_request() 504 pdu->pid, ntohs(pdu->tid), error); in server_process_request() 507 "pdu->pid=%d, pdu->tid=%d, pdu->len=%d, len=%d, " \ in server_process_request() 510 pdu->pid, ntohs(pdu->tid), pdu->len, len, error); in server_process_request() 515 "socket, pdu->pid=%d, pdu->tid=%d, error=%d", in server_process_request() [all …]
|
| /freebsd/usr.sbin/bsnmpd/tools/bsnmptools/ |
| H A D | bsnmpget.c | 79 (program == BSNMPGET || program == BSNMPWALK) ? "[-p pdu] " : "", in usage() 136 warnx("PDU type '%s' not supported.", opt_arg); in parse_pdu_type() 322 snmptool_add_vbind(struct snmp_pdu *pdu, struct snmp_object *obj) in snmptool_add_vbind() argument 327 asn_append_oid(&(pdu->bindings[pdu->nbindings].var), &(obj->val.var)); in snmptool_add_vbind() 328 pdu->nbindings++; in snmptool_add_vbind() 330 return (pdu->nbindings); in snmptool_add_vbind() 337 snmpget_verify_vbind(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu, in snmpget_verify_vbind() argument 340 if (pdu->version == SNMP_V1 && obj->val.syntax == in snmpget_verify_vbind() 342 warnx("64-bit counters are not supported in SNMPv1 PDU"); in snmpget_verify_vbind() 346 if (ISSET_NUMERIC(snmptoolctx) || pdu->type == SNMP_PDU_GETNEXT || in snmpget_verify_vbind() [all …]
|
| /freebsd/sys/dev/qlnx/qlnxe/ |
| H A D | iscsi_common.h | 140 * iSCSI Login Response PDU header 219 __le16 r2t_sn /* r2t pdu sequence number */; 243 …__le32 exp_r2t_sn /* Initiator mode - Expected R2T PDU index in sequence. [variable, initialized 0… 245 union iscsi_seq_num seq_num /* PDU index in sequence */; 272 * iSCSI Common PDU header 284 #define ISCSI_COMMON_HDR_RSRV_MASK 0x1 /* first bit of iSCSI PDU header */ 291 struct regpair lun_reserved /* Bytes 8..15 : LUN (if PDU contains a LUN field) or reserved */; 293 __le32 ttt /* bytes 20 to 23 - common ttt to various PDU headers */; 294 …__le32 cmdstat_sn /* bytes 24 to 27 - common cmd_sn (initiator) or stat_sn (target) to various PDU… 295 … bytes 28 to 31 - common expected stat_sn (initiator) or cmd_sn (target) to various PDU headers */; [all …]
|
| /freebsd/usr.sbin/iscsid/ |
| H A D | iscsid.c | 61 static void pdu_receive_proxy(struct pdu *pdu); 62 static void pdu_send_proxy(struct pdu *pdu); 89 pdu_receive_proxy(struct pdu *pdu) in pdu_receive_proxy() argument 96 conn = (struct iscsid_connection *)pdu->pdu_connection; in pdu_receive_proxy() 99 pdu->pdu_data = malloc(conn->conn.conn_max_recv_data_segment_length); in pdu_receive_proxy() 100 if (pdu->pdu_data == NULL) in pdu_receive_proxy() 105 idr.idr_bhs = pdu->pdu_bhs; in pdu_receive_proxy() 107 idr.idr_data_segment = pdu->pdu_data; in pdu_receive_proxy() 113 len = pdu_ahs_length(pdu); in pdu_receive_proxy() 117 len = pdu_data_segment_length(pdu); in pdu_receive_proxy() [all …]
|