Lines Matching refs:socket
17 static bool read_bytes(const int socket, uint8_t *buffer, in read_bytes() argument
24 result = recv(socket, buffer + number_received, in read_bytes()
34 static bool read_data32(const int socket, uint32_t *data) in read_data32() argument
38 result = read_bytes(socket, (uint8_t *)data, sizeof(uint32_t)); in read_data32()
46 static bool read_multiple_bytes(const int socket, uint8_t *buffer, in read_multiple_bytes() argument
53 result = read_data32(socket, &length); in read_multiple_bytes()
70 return read_bytes(socket, buffer, length); in read_multiple_bytes()
73 static bool receive_platform_data(const int socket, in receive_platform_data() argument
83 result = read_data32(socket, &response); in receive_platform_data()
89 result = read_data32(socket, &transport_type); in receive_platform_data()
95 result = read_multiple_bytes(socket, receive_buffer, &bytes_received, in receive_platform_data()
105 static bool write_bytes(const int socket, const uint8_t *buffer, in write_bytes() argument
112 result = send(socket, buffer + number_sent, in write_bytes()
122 static bool write_data32(const int socket, uint32_t data) in write_data32() argument
125 return write_bytes(socket, (uint8_t *)&data, sizeof(uint32_t)); in write_data32()
128 static bool write_multiple_bytes(const int socket, const uint8_t *buffer, in write_multiple_bytes() argument
133 result = write_data32(socket, bytes_to_send); in write_multiple_bytes()
138 return write_bytes(socket, buffer, bytes_to_send); in write_multiple_bytes()
141 static bool send_platform_data(const int socket, in send_platform_data() argument
147 result = write_data32(socket, command); in send_platform_data()
152 result = write_data32(socket, transport_type); in send_platform_data()
157 return write_multiple_bytes(socket, send_buffer, bytes_to_send); in send_platform_data()
165 client_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); in spdm_socket_connect()
187 uint32_t spdm_socket_rsp(const int socket, uint32_t transport_type, in spdm_socket_rsp() argument
194 result = send_platform_data(socket, transport_type, in spdm_socket_rsp()
201 result = receive_platform_data(socket, transport_type, &command, in spdm_socket_rsp()
212 void spdm_socket_close(const int socket, uint32_t transport_type) in spdm_socket_close() argument
214 send_platform_data(socket, transport_type, in spdm_socket_close()