Skip to content

Commit f072069

Browse files
committed
Fix : vendor_response_get_id should not exist
Signed-off-by: Shital Jumbad <[email protected]>
1 parent 8ccc0f3 commit f072069

File tree

9 files changed

+1190
-1265
lines changed

9 files changed

+1190
-1265
lines changed

doc/user_guide.md

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -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

493484
4. Free the memory of contexts within the SPDM context when all flow is over.
494485
This function does not free the SPDM context itself.

include/internal/libspdm_common_lib.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ typedef struct {
676676

677677
#if LIBSPDM_ENABLE_VENDOR_DEFINED_MESSAGES
678678
libspdm_vendor_response_callback_func vendor_response_callback;
679-
libspdm_vendor_get_id_callback_func vendor_response_get_id;
680679
#endif /* LIBSPDM_ENABLE_VENDOR_DEFINED_MESSAGES */
681680

682681
#if LIBSPDM_EVENT_RECIPIENT_SUPPORT

0 commit comments

Comments
 (0)