@@ -453,42 +453,33 @@ Refer to spdm_server_init() in [spdm_responder.c](https://github.com/DMTF/spdm-e
453453
454454 libspdm_register_get_response_func (spdm_context, libspdm_get_response);
455455 ```
456- 3.2 This callbacks handle SPDM Vendor Defined Commands
457- ```C
458- libspdm_return_t libspdm_vendor_get_id_func(
459- void *spdm_context,
460- uint16_t *resp_standard_id,
461- uint8_t *resp_vendor_id_len,
462- void *resp_vendor_id)
463- {
464- // return responder vendor id
465- ...
466-
467- return LIBSPDM_STATUS_SUCCESS;
468- }
469-
470- vendor_response_get_id
471- libspdm_return_t libspdm_vendor_response_func(
472- void *spdm_context,
473- uint16_t req_standard_id,
474- uint8_t req_vendor_id_len,
475- const void *req_vendor_id,
476- uint16_t req_size,
477- const void *req_data,
478- uint16_t *resp_size,
479- void *resp_data)
480- {
481- // process request and create response
482- ...
483- // populate response header and payload
484- ...
485-
486- return LIBSPDM_STATUS_SUCCESS;
487- }
456+ 3.2 This callback handles SPDM Vendor Defined Commands
457+ ```C
458+ libspdm_return_t libspdm_vendor_response_func(
459+ void *spdm_context,
460+ const uint32_t *session_id,
461+ uint16_t req_standard_id,
462+ uint8_t req_vendor_id_len,
463+ const void *req_vendor_id,
464+ uint32_t req_size,
465+ const void *req_data,
466+ uint16_t *resp_standard_id,
467+ uint8_t *resp_vendor_id_len,
468+ void *resp_vendor_id,
469+ uint32_t *resp_size,
470+ void *resp_data)
471+ {
472+ // set response Vendor/Standard IDs
473+ *resp_standard_id = /* your standard id */;
474+ *resp_vendor_id_len = /* your vendor id length */;
475+ // write Vendor ID bytes into resp_vendor_id[0..*resp_vendor_id_len-1]
476+
477+ // write payload to resp_data and set *resp_size to payload size
478+ return LIBSPDM_STATUS_SUCCESS;
479+ }
488480
489- libspdm_register_vendor_get_id_callback_func(spdm_context, libspdm_vendor_get_id_func);
490- libspdm_register_vendor_callback_func(spdm_context, libspdm_vendor_response_func);
491- ```
481+ libspdm_register_vendor_callback_func(spdm_context, libspdm_vendor_response_func);
482+ ```
492483
4934844 . Free the memory of contexts within the SPDM context when all flow is over.
494485 This function does not free the SPDM context itself.
0 commit comments