/libmctp-latest/ |
D | core.c | 121 void mctp_pktbuf_free(struct mctp_pktbuf *pkt) in mctp_pktbuf_free() argument 123 __mctp_free(pkt); in mctp_pktbuf_free() 126 struct mctp_hdr *mctp_pktbuf_hdr(struct mctp_pktbuf *pkt) in mctp_pktbuf_hdr() argument 128 return (struct mctp_hdr *)(pkt->data + pkt->mctp_hdr_off); in mctp_pktbuf_hdr() 131 void *mctp_pktbuf_data(struct mctp_pktbuf *pkt) in mctp_pktbuf_data() argument 133 return pkt->data + pkt->mctp_hdr_off + sizeof(struct mctp_hdr); in mctp_pktbuf_data() 136 size_t mctp_pktbuf_size(struct mctp_pktbuf *pkt) in mctp_pktbuf_size() argument 138 return pkt->end - pkt->start; in mctp_pktbuf_size() 141 void *mctp_pktbuf_alloc_start(struct mctp_pktbuf *pkt, size_t size) in mctp_pktbuf_alloc_start() argument 143 assert(size <= pkt->start); in mctp_pktbuf_alloc_start() [all …]
|
D | serial.c | 113 static size_t mctp_serial_pkt_escape(struct mctp_pktbuf *pkt, uint8_t *buf) in mctp_serial_pkt_escape() argument 119 total_len = pkt->end - pkt->mctp_hdr_off; in mctp_serial_pkt_escape() 121 p = (void *)mctp_pktbuf_hdr(pkt); in mctp_serial_pkt_escape() 139 struct mctp_pktbuf *pkt) in mctp_binding_serial_tx() argument 150 len = mctp_pktbuf_size(pkt); in mctp_binding_serial_tx() 159 fcs = crc_16_ccitt(fcs, (const uint8_t *)mctp_pktbuf_hdr(pkt), len); in mctp_binding_serial_tx() 163 len = mctp_serial_pkt_escape(pkt, NULL); in mctp_binding_serial_tx() 167 mctp_serial_pkt_escape(pkt, buf); in mctp_binding_serial_tx() 189 struct mctp_pktbuf *pkt = serial->rx_pkt; in mctp_serial_finish_packet() local 190 assert(pkt); in mctp_serial_finish_packet() [all …]
|
D | libmctp.h | 62 void mctp_pktbuf_free(struct mctp_pktbuf *pkt); 63 struct mctp_hdr *mctp_pktbuf_hdr(struct mctp_pktbuf *pkt); 64 void *mctp_pktbuf_data(struct mctp_pktbuf *pkt); 65 size_t mctp_pktbuf_size(struct mctp_pktbuf *pkt); 66 void *mctp_pktbuf_alloc_start(struct mctp_pktbuf *pkt, size_t size); 67 void *mctp_pktbuf_alloc_end(struct mctp_pktbuf *pkt, size_t size); 68 int mctp_pktbuf_push(struct mctp_pktbuf *pkt, void *data, size_t len); 69 void *mctp_pktbuf_pop(struct mctp_pktbuf *pkt, size_t len); 77 typedef void (*mctp_capture_fn)(struct mctp_pktbuf *pkt, bool outgoing, 130 int (*tx)(struct mctp_binding *binding, struct mctp_pktbuf *pkt); [all …]
|
D | astlpc.c | 117 void (*pktbuf_protect)(struct mctp_pktbuf *pkt); 118 bool (*pktbuf_validate)(struct mctp_pktbuf *pkt); 191 void astlpc_pktbuf_protect_v1(struct mctp_pktbuf *pkt) in astlpc_pktbuf_protect_v1() argument 193 (void)pkt; in astlpc_pktbuf_protect_v1() 196 bool astlpc_pktbuf_validate_v1(struct mctp_pktbuf *pkt) in astlpc_pktbuf_validate_v1() argument 198 (void)pkt; in astlpc_pktbuf_validate_v1() 216 void astlpc_pktbuf_protect_v3(struct mctp_pktbuf *pkt) in astlpc_pktbuf_protect_v3() argument 220 code = htobe32(crc32(mctp_pktbuf_hdr(pkt), mctp_pktbuf_size(pkt))); in astlpc_pktbuf_protect_v3() 222 mctp_pktbuf_push(pkt, &code, 4); in astlpc_pktbuf_protect_v3() 225 bool astlpc_pktbuf_validate_v3(struct mctp_pktbuf *pkt) in astlpc_pktbuf_validate_v3() argument [all …]
|
/libmctp-latest/tests/ |
D | test_bridge.c | 30 struct mctp_pktbuf *pkt) in mctp_binding_bridge_tx() argument 36 assert(mctp_pktbuf_size(pkt) == sizeof(struct mctp_hdr) + 1); in mctp_binding_bridge_tx() 37 binding->last_pkt_data = *(uint8_t *)mctp_pktbuf_data(pkt); in mctp_binding_bridge_tx() 45 struct mctp_pktbuf *pkt; in mctp_binding_bridge_rx() local 49 pkt = mctp_pktbuf_alloc(&binding->binding, sizeof(struct mctp_hdr) + 1); in mctp_binding_bridge_rx() 50 assert(pkt); in mctp_binding_bridge_rx() 52 hdr = mctp_pktbuf_hdr(pkt); in mctp_binding_bridge_rx() 59 buf = mctp_pktbuf_data(pkt); in mctp_binding_bridge_rx() 63 mctp_bus_rx(&binding->binding, pkt); in mctp_binding_bridge_rx()
|
D | test-utils.c | 20 struct mctp_pktbuf *pkt __attribute__((unused))) in mctp_binding_test_tx() argument 49 struct mctp_pktbuf *pkt; in mctp_binding_test_rx_raw() local 51 pkt = mctp_pktbuf_alloc(&test->binding, len); in mctp_binding_test_rx_raw() 52 assert(pkt); in mctp_binding_test_rx_raw() 53 memcpy(mctp_pktbuf_hdr(pkt), buf, len); in mctp_binding_test_rx_raw() 54 mctp_bus_rx(&test->binding, pkt); in mctp_binding_test_rx_raw()
|
D | test_eid.c | 36 static void create_packet(struct mctp_hdr *pkt, mctp_eid_t src, mctp_eid_t dest) in create_packet() argument 38 memset(pkt, 0, sizeof(*pkt)); in create_packet() 39 pkt->src = src; in create_packet() 40 pkt->dest = dest; in create_packet() 41 pkt->flags_seq_tag = MCTP_HDR_FLAG_SOM | MCTP_HDR_FLAG_EOM; in create_packet()
|
D | test_cmds.c | 50 struct mctp_pktbuf *pkt = mctp_pktbuf_alloc(b, len); in rcv_ctrl_msg() local 51 memcpy(mctp_pktbuf_hdr(pkt), buf, len); in rcv_ctrl_msg() 52 mctp_bus_rx(b, pkt); in rcv_ctrl_msg()
|
/libmctp-latest/utils/ |
D | mctp-capture.c | 55 void capture_binding(struct mctp_pktbuf *pkt, bool outgoing, void *user) in capture_binding() argument 67 size = sizeof(struct sll2_header) + mctp_pktbuf_size(pkt); in capture_binding() 84 memcpy(pktbuf + sizeof(struct sll2_header), mctp_pktbuf_hdr(pkt), in capture_binding() 85 mctp_pktbuf_size(pkt)); in capture_binding()
|
D | mctp-capture.h | 33 void capture_binding(struct mctp_pktbuf *pkt, bool outgoing, void *user); 56 static inline void capture_binding(struct mctp_pktbuf *pkt __unused, in capture_binding()
|