Home
last modified time | relevance | path

Searched full:pdu (Results 1 – 25 of 129) sorted by relevance

123456

/freebsd/lib/libiscsiutil/
H A Dpdu.c44 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 Dlibiscsiutil.h61 struct pdu { struct
70 void (*pdu_receive_proxy)(struct pdu *);
71 void (*pdu_send_proxy)(struct pdu *);
125 keys_load_pdu(struct keys *keys, const struct pdu *pdu) in keys_load_pdu() argument
127 keys_load(keys, pdu->pdu_data, pdu->pdu_data_len); in keys_load_pdu()
131 keys_save_pdu(struct keys *keys, struct pdu *pdu) in keys_save_pdu() argument
133 keys_save(keys, &pdu->pdu_data, &pdu->pdu_data_len); in keys_save_pdu()
136 struct pdu *pdu_new(struct connection *ic);
137 struct pdu *pdu_new_response(struct pdu *request);
138 int pdu_ahs_length(const struct pdu *pdu);
[all …]
H A Dtext.c40 /* 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/contrib/bsnmp/lib/
H A Dsnmp.c199 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 Dsnmpagent.c169 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 Dbsnmplib.377 .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 Dsnmpcrypto.c89 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 Dsnmpclient.c79 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 Dbsnmpclient.388 .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.
331 initializes a PDU of type
333 It does not allocate space for the PDU itself.
336 adds bindings to the PDU and returns the (zero based) index of the first new
[all …]
H A Dbsnmpagent.372 .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/libnvmf/
H A Dnvmf_tcp.c149 nvmf_tcp_write_pdu(struct nvmf_tcp_qpair *qp, const void *pdu, size_t len) in nvmf_tcp_write_pdu() argument
154 cp = pdu; in nvmf_tcp_write_pdu()
223 nvmf_tcp_validate_pdu(struct nvmf_tcp_qpair *qp, struct nvmf_tcp_rxpdu *pdu, in nvmf_tcp_validate_pdu() argument
233 /* Determine how large of a PDU header to return for errors. */ in nvmf_tcp_validate_pdu()
234 ch = pdu->hdr; in nvmf_tcp_validate_pdu()
279 pdu->data_len = data_len; in nvmf_tcp_validate_pdu()
307 nvmf_tcp_read_pdu(struct nvmf_tcp_qpair *qp, struct nvmf_tcp_rxpdu *pdu) in nvmf_tcp_read_pdu() argument
313 memset(pdu, 0, sizeof(*pdu)); in nvmf_tcp_read_pdu()
325 pdu->hdr = &ch; in nvmf_tcp_read_pdu()
326 error = nvmf_tcp_validate_pdu(qp, pdu, sizeof(ch)); in nvmf_tcp_read_pdu()
[all …]
/freebsd/contrib/tcpdump/
H A Dprint-rpki-rtr.c33 * 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 Dtrap.c423 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 Dmain.c279 * 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 Dsnmpmod.3205 .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 Dservice.c53 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 …]
H A Dsearch.c54 sdp_pdu_t pdu; in sdp_search() member
158 /* Prepare SDP PDU header */ in sdp_search()
159 xpdu.pdu.pid = SDP_PDU_SERVICE_SEARCH_ATTRIBUTE_REQUEST; in sdp_search()
160 xpdu.pdu.tid = htons(ss->tid); in sdp_search()
161 xpdu.pdu.len = htons(req_cs - ss->req); in sdp_search()
165 iov[0].iov_len = sizeof(xpdu.pdu); in sdp_search()
197 xpdu.pdu.tid = ntohs(xpdu.pdu.tid); in sdp_search()
198 xpdu.pdu.len = ntohs(xpdu.pdu.len); in sdp_search()
201 if (xpdu.pdu.pid == SDP_PDU_ERROR_RESPONSE || in sdp_search()
202 xpdu.pdu.tid != ss->tid || in sdp_search()
[all …]
/freebsd/sys/dev/nvmf/
H A Dnvmf_tcp.c143 "Maximum size of data payload in a transmitted PDU");
305 nvmf_tcp_validate_pdu(struct nvmf_tcp_qpair *qp, struct nvmf_tcp_rxpdu *pdu) in nvmf_tcp_validate_pdu() argument
308 struct mbuf *m = pdu->m; in nvmf_tcp_validate_pdu()
315 /* Determine how large of a PDU header to return for errors. */ in nvmf_tcp_validate_pdu()
316 ch = pdu->hdr; in nvmf_tcp_validate_pdu()
345 pdu->data_digest_mismatch = false; in nvmf_tcp_validate_pdu()
352 pdu->data_digest_mismatch = true; in nvmf_tcp_validate_pdu()
356 pdu->data_len = data_len; in nvmf_tcp_validate_pdu()
361 nvmf_tcp_free_pdu(struct nvmf_tcp_rxpdu *pdu) in nvmf_tcp_free_pdu() argument
363 m_freem(pdu->m); in nvmf_tcp_free_pdu()
[all …]
H A Dnvmf_tcp.h24 * Validate common fields in a received PDU header. If an error is
28 * termination request PDU. If no error is detected, 0 is returned
59 /* Controllers only receive PDUs with a PDU direction of 0. */ in nvmf_tcp_validate_pdu_header()
61 printf("NVMe/TCP: Invalid PDU type %u\n", ch->pdu_type); in nvmf_tcp_validate_pdu_header()
71 printf("NVMe/TCP: Received Initialize Connection PDU\n"); in nvmf_tcp_validate_pdu_header()
78 * 7.4.7 Termination requests with invalid PDU lengths in nvmf_tcp_validate_pdu_header()
95 printf("NVMe/TCP: Invalid PDU type %u\n", ch->pdu_type); in nvmf_tcp_validate_pdu_header()
129 printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags); in nvmf_tcp_validate_pdu_header()
148 printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags); in nvmf_tcp_validate_pdu_header()
159 printf("NVMe/TCP: Invalid PDU header flags %#x\n", ch->flags); in nvmf_tcp_validate_pdu_header()
[all …]
/freebsd/usr.sbin/ctld/
H A Dlogin.c43 static void login_send_error(struct pdu *request,
47 login_set_nsg(struct pdu *response, int nsg) in login_set_nsg()
63 login_csg(const struct pdu *request) in login_csg()
73 login_set_csg(struct pdu *response, int csg) in login_set_csg()
87 static struct pdu *
90 struct pdu *request; in login_receive()
98 * The first PDU in session is special - if we receive any PDU in login_receive()
100 * without sending response ("A target receiving any PDU in login_receive()
102 * immediately terminate the connection on which the PDU in login_receive()
116 log_errx(1, "received Login PDU with unsupported \"C\" flag"); in login_receive()
[all …]
H A Ddiscovery.c44 static struct pdu *
47 struct pdu *request; in logout_receive()
58 log_debugx("received Logout PDU with invalid reason 0x%x; " in logout_receive()
61 log_errx(1, "received Logout PDU with decreasing CmdSN: " in logout_receive()
66 log_errx(1, "received Logout PDU with wrong ExpStatSN: " in logout_receive()
77 static struct pdu *
78 logout_new_response(struct pdu *request) in logout_new_response()
80 struct pdu *response; in logout_new_response()
214 struct pdu *request, *response; in discovery()
222 log_debugx("beginning discovery session; waiting for TextRequest PDU"); in discovery()
[all …]
/freebsd/usr.sbin/bluetooth/sdpd/
H A Dserver.c410 sdp_pdu_p pdu = (sdp_pdu_p) srv->req; in server_process_request() local
437 if (len >= sizeof(*pdu) && in server_process_request()
438 sizeof(*pdu) + (pdu->len = ntohs(pdu->len)) == len) { in server_process_request()
439 switch (pdu->pid) { in server_process_request()
472 switch (pdu->pid) { in server_process_request()
504 "pdu->pid=%d, pdu->tid=%d, error=%d", in server_process_request()
506 pdu->pid, ntohs(pdu->tid), error); in server_process_request()
509 "pdu->pid=%d, pdu->tid=%d, pdu->len=%d, len=%d, " \ in server_process_request()
512 pdu->pid, ntohs(pdu->tid), pdu->len, len, error); in server_process_request()
517 "socket, pdu->pid=%d, pdu->tid=%d, error=%d", in server_process_request()
[all …]
/freebsd/usr.sbin/bsnmpd/tools/bsnmptools/
H A Dbsnmpget.c79 (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 Discsi_common.h140 * 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 Discsid.c61 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 …]

123456