msgbuf: Rework error handling to improve soundness
Design the implementation to uphold the invariant that a non-negative
remaining value implies the cursor pointer is valid, and that under
other conditions error values must be observed by the msgbuf user. The
former is tested with assertions in the implementation. The latter is
enforced by construction.
With this change, all msgbuf instances for which
pldm_msgbuf_init_errno() succeeds must be either completed or discarded
by calls to the pldm_msgbuf_complete*() or pldm_msgbuf_discard() APIs
respectively.
We then build on the properties that:
- pldm_msgbuf_init_errno() is marked with the warn_unused_result
function attribute
- pldm_msgbuf_init_errno() returns errors for invalid buffer
configurations
- The complete and discard APIs are marked with the warn_unused_result
function attribute
- The complete APIs test for negative remaining values and return an
error if encountered.
- The discard API propagates the provided error code
Together these provide the foundation to ensure that buffer access
errors are (eventually) detected.
A msgbuf object is always in one of the uninitialized, valid, invalid,
or completed states. The states are defined as follows:
- Uninitialized: Undefined values for remaining and cursor
- Valid: cursor points to a valid object, remaining is both non-negative
and describes a range contained within the object pointed to
by cursor
- Invalid: The value of remaining is negative. The value of cursor is
unspecified.
- Completed: the value of remaining is INTMAX_MIN and cursor is NULL
msgbuf instances must always be in the completed state by the time
their storage is reclaimed. To enforce this, PLDM_MSGBUF_DEFINE_P()
is introduced both to simplify definition of related variables, and
to exploit the compiler's 'cleanup' attribute. The cleanup function
associated with the msgbuf object asserts that the referenced object is
in the completed state.
From there, update the implementations of the msgbuf APIs such that
exceeding implementation type limits forces the msgbuf object to the
invalid state (in addition to returning an error value) to relieve the
caller from testing the result of all API invocations.
Change-Id: I4d78ddc5f567d4148f2f6d8f3e7570e97c316bbb
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1a72a5d..99dd335 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -66,6 +66,9 @@
- Register allocation changed for the following APIs:
- `encode_get_downstream_firmware_parameters_req()`
+ - `encode_get_state_effecter_states_resp()`
+ - `encode_oem_meta_file_io_read_resp()`
+ - `encode_query_downstream_identifiers_req()`
### Deprecated
diff --git a/abi/x86_64/gcc.dump b/abi/x86_64/gcc.dump
index 1c7bc85..4aa6e07 100644
--- a/abi/x86_64/gcc.dump
+++ b/abi/x86_64/gcc.dump
@@ -2664,7 +2664,7 @@
'Return' => '164',
'ShortName' => 'pldm_bios_table_string_entry_encode_length'
},
- '42541' => {
+ '43151' => {
'Header' => 'firmware_update.h',
'Line' => '2039',
'Param' => {
@@ -2682,11 +2682,11 @@
},
'3' => {
'name' => 'non_functioning_component_indication',
- 'type' => '42723'
+ 'type' => '43333'
},
'4' => {
'name' => 'non_functioning_component_bitmap',
- 'type' => '42728'
+ 'type' => '43338'
}
},
'Reg' => {
@@ -2697,7 +2697,7 @@
'Return' => '100',
'ShortName' => 'decode_cancel_update_resp'
},
- '42738' => {
+ '43348' => {
'Header' => 'firmware_update.h',
'Line' => '2022',
'Param' => {
@@ -2717,7 +2717,7 @@
'Return' => '100',
'ShortName' => 'encode_cancel_update_req'
},
- '42909' => {
+ '43519' => {
'Header' => 'firmware_update.h',
'Line' => '2007',
'Param' => {
@@ -2742,7 +2742,7 @@
'Return' => '100',
'ShortName' => 'decode_cancel_update_component_resp'
},
- '42985' => {
+ '43595' => {
'Header' => 'firmware_update.h',
'Line' => '1995',
'Param' => {
@@ -2762,7 +2762,7 @@
'Return' => '100',
'ShortName' => 'encode_cancel_update_component_req'
},
- '44645' => {
+ '46447' => {
'Header' => 'firmware_update.h',
'Line' => '1962',
'Param' => {
@@ -2808,7 +2808,7 @@
'9' => {
'name' => 'update_option_flags_enabled',
'offset' => '24',
- 'type' => '44972'
+ 'type' => '46774'
}
},
'Reg' => {
@@ -2820,7 +2820,7 @@
'Return' => '100',
'ShortName' => 'decode_get_status_resp'
},
- '44982' => {
+ '46784' => {
'Header' => 'firmware_update.h',
'Line' => '1942',
'Param' => {
@@ -2840,7 +2840,7 @@
'Return' => '100',
'ShortName' => 'encode_get_status_req'
},
- '45874' => {
+ '48172' => {
'Header' => 'firmware_update.h',
'Line' => '1910',
'Param' => {
@@ -2869,7 +2869,7 @@
'Return' => '100',
'ShortName' => 'decode_activate_firmware_resp'
},
- '46000' => {
+ '48298' => {
'Header' => 'firmware_update.h',
'Line' => '1885',
'Param' => {
@@ -2893,7 +2893,7 @@
'Return' => '100',
'ShortName' => 'encode_activate_firmware_req'
},
- '46612' => {
+ '49335' => {
'Header' => 'firmware_update.h',
'Line' => '1870',
'Param' => {
@@ -2917,7 +2917,7 @@
'Return' => '100',
'ShortName' => 'encode_apply_complete_resp'
},
- '47523' => {
+ '50742' => {
'Header' => 'firmware_update.h',
'Line' => '1838',
'Param' => {
@@ -2935,7 +2935,7 @@
},
'3' => {
'name' => 'comp_activation_methods_modification',
- 'type' => '47633'
+ 'type' => '50852'
}
},
'Reg' => {
@@ -2947,7 +2947,7 @@
'Return' => '100',
'ShortName' => 'decode_apply_complete_req'
},
- '47643' => {
+ '50862' => {
'Header' => 'firmware_update.h',
'Line' => '1825',
'Param' => {
@@ -2971,7 +2971,7 @@
'Return' => '100',
'ShortName' => 'encode_verify_complete_resp'
},
- '48415' => {
+ '52004' => {
'Header' => 'firmware_update.h',
'Line' => '1796',
'Param' => {
@@ -2996,7 +2996,7 @@
'Return' => '100',
'ShortName' => 'decode_verify_complete_req'
},
- '48491' => {
+ '52080' => {
'Header' => 'firmware_update.h',
'Line' => '1785',
'Param' => {
@@ -3020,7 +3020,7 @@
'Return' => '100',
'ShortName' => 'encode_transfer_complete_resp'
},
- '49263' => {
+ '53222' => {
'Header' => 'firmware_update.h',
'Line' => '1755',
'Param' => {
@@ -3045,7 +3045,7 @@
'Return' => '100',
'ShortName' => 'decode_transfer_complete_req'
},
- '49339' => {
+ '53298' => {
'Header' => 'firmware_update.h',
'Line' => '1742',
'Param' => {
@@ -3072,7 +3072,7 @@
'Return' => '100',
'ShortName' => 'encode_request_firmware_data_resp'
},
- '50264' => {
+ '54713' => {
'Header' => 'firmware_update.h',
'Line' => '1703',
'Param' => {
@@ -3102,7 +3102,7 @@
'Return' => '100',
'ShortName' => 'decode_request_firmware_data_req'
},
- '51503' => {
+ '56790' => {
'Header' => 'firmware_update.h',
'Line' => '1670',
'Param' => {
@@ -3128,7 +3128,7 @@
},
'5' => {
'name' => 'update_option_flags_enabled',
- 'type' => '44972'
+ 'type' => '46774'
},
'6' => {
'name' => 'time_before_req_fw_data',
@@ -3145,7 +3145,7 @@
'Return' => '100',
'ShortName' => 'decode_update_component_resp'
},
- '53756' => {
+ '60727' => {
'Header' => 'firmware_update.h',
'Line' => '1634',
'Param' => {
@@ -3191,7 +3191,7 @@
'9' => {
'name' => 'comp_ver_str',
'offset' => '24',
- 'type' => '54224'
+ 'type' => '61195'
},
'10' => {
'name' => 'msg',
@@ -3207,7 +3207,7 @@
'Return' => '100',
'ShortName' => 'encode_update_component_req'
},
- '55069' => {
+ '62658' => {
'Header' => 'firmware_update.h',
'Line' => '1591',
'Param' => {
@@ -3240,7 +3240,7 @@
'Return' => '100',
'ShortName' => 'decode_pass_component_table_resp'
},
- '57087' => {
+ '66143' => {
'Header' => 'firmware_update.h',
'Line' => '1561',
'Param' => {
@@ -3281,7 +3281,7 @@
'8' => {
'name' => 'comp_ver_str',
'offset' => '16',
- 'type' => '54224'
+ 'type' => '61195'
},
'9' => {
'name' => 'msg',
@@ -3297,7 +3297,7 @@
'Return' => '100',
'ShortName' => 'encode_pass_component_table_req'
},
- '58416' => {
+ '68085' => {
'Header' => 'firmware_update.h',
'Line' => '1520',
'Param' => {
@@ -3331,7 +3331,7 @@
'Return' => '100',
'ShortName' => 'decode_request_update_resp'
},
- '60248' => {
+ '71200' => {
'Header' => 'firmware_update.h',
'Line' => '1487',
'Param' => {
@@ -3367,7 +3367,7 @@
'7' => {
'name' => 'comp_img_set_ver_str',
'offset' => '8',
- 'type' => '54224'
+ 'type' => '61195'
},
'8' => {
'name' => 'msg',
@@ -3383,23 +3383,23 @@
'Return' => '100',
'ShortName' => 'encode_request_update_req'
},
- '60691' => {
+ '71643' => {
'Header' => 'firmware_update.h',
'Line' => '1397',
'Param' => {
'0' => {
'name' => 'iter',
- 'type' => '63257'
+ 'type' => '76477'
},
'1' => {
'name' => 'entry',
- 'type' => '63262'
+ 'type' => '76482'
}
},
'Return' => '100',
'ShortName' => 'decode_pldm_downstream_device_parameters_entry_from_iter'
},
- '63267' => {
+ '76487' => {
'Header' => 'firmware_update.h',
'Line' => '1368',
'Param' => {
@@ -3413,17 +3413,17 @@
},
'2' => {
'name' => 'resp_data',
- 'type' => '64622'
+ 'type' => '79166'
},
'3' => {
'name' => 'iter',
- 'type' => '63257'
+ 'type' => '76477'
}
},
'Return' => '100',
'ShortName' => 'decode_get_downstream_firmware_parameters_resp'
},
- '64627' => {
+ '79171' => {
'Header' => 'firmware_update.h',
'Line' => '1342',
'Param' => {
@@ -3433,7 +3433,7 @@
},
'1' => {
'name' => 'params_req',
- 'type' => '65310'
+ 'type' => '80298'
},
'2' => {
'name' => 'msg',
@@ -3445,28 +3445,28 @@
}
},
'Reg' => {
- '2' => 'r12'
+ '2' => 'r14'
},
'Return' => '100',
'ShortName' => 'encode_get_downstream_firmware_parameters_req'
},
- '65315' => {
+ '80303' => {
'Header' => 'firmware_update.h',
'Line' => '650',
'Param' => {
'0' => {
'name' => 'iter',
- 'type' => '66066'
+ 'type' => '81478'
},
'1' => {
'name' => 'dev',
- 'type' => '66071'
+ 'type' => '81483'
}
},
'Return' => '100',
'ShortName' => 'decode_pldm_downstream_device_from_iter'
},
- '66076' => {
+ '81488' => {
'Header' => 'firmware_update.h',
'Line' => '1321',
'Param' => {
@@ -3480,17 +3480,17 @@
},
'2' => {
'name' => 'resp_data',
- 'type' => '67444'
+ 'type' => '84181'
},
'3' => {
'name' => 'iter',
- 'type' => '66066'
+ 'type' => '81478'
}
},
'Return' => '100',
'ShortName' => 'decode_query_downstream_identifiers_resp'
},
- '67449' => {
+ '84186' => {
'Header' => 'firmware_update.h',
'Line' => '1304',
'Param' => {
@@ -3500,7 +3500,7 @@
},
'1' => {
'name' => 'params_req',
- 'type' => '68132'
+ 'type' => '85313'
},
'2' => {
'name' => 'msg',
@@ -3512,12 +3512,12 @@
}
},
'Reg' => {
- '2' => 'r12'
+ '2' => 'r14'
},
'Return' => '100',
'ShortName' => 'encode_query_downstream_identifiers_req'
},
- '68137' => {
+ '85318' => {
'Header' => 'firmware_update.h',
'Line' => '1285',
'Param' => {
@@ -3531,7 +3531,7 @@
},
'2' => {
'name' => 'resp_data',
- 'type' => '69436'
+ 'type' => '87914'
}
},
'Reg' => {
@@ -3540,7 +3540,7 @@
'Return' => '100',
'ShortName' => 'decode_query_downstream_devices_resp'
},
- '69441' => {
+ '87919' => {
'Header' => 'firmware_update.h',
'Line' => '1269',
'Param' => {
@@ -3560,7 +3560,7 @@
'Return' => '100',
'ShortName' => 'encode_query_downstream_devices_req'
},
- '69561' => {
+ '88039' => {
'Header' => 'firmware_update.h',
'Line' => '1223',
'Param' => {
@@ -3574,7 +3574,7 @@
},
'2' => {
'name' => 'component_data',
- 'type' => '69883'
+ 'type' => '88361'
},
'3' => {
'name' => 'active_comp_ver_str',
@@ -3594,7 +3594,7 @@
'Return' => '100',
'ShortName' => 'decode_get_firmware_parameters_resp_comp_entry'
},
- '74683' => {
+ '96799' => {
'Header' => 'firmware_update.h',
'Line' => '1204',
'Param' => {
@@ -3608,7 +3608,7 @@
},
'2' => {
'name' => 'resp_data',
- 'type' => '74903'
+ 'type' => '97019'
},
'3' => {
'name' => 'active_comp_image_set_ver_str',
@@ -3634,7 +3634,7 @@
'Return' => '100',
'ShortName' => 'decode_get_firmware_parameters_resp'
},
- '74908' => {
+ '97024' => {
'Header' => 'firmware_update.h',
'Line' => '1187',
'Param' => {
@@ -3659,7 +3659,7 @@
'Return' => '100',
'ShortName' => 'encode_get_firmware_parameters_req'
},
- '76603' => {
+ '99835' => {
'Header' => 'firmware_update.h',
'Line' => '1169',
'Param' => {
@@ -3685,7 +3685,7 @@
},
'5' => {
'name' => 'descriptor_data',
- 'type' => '76759'
+ 'type' => '99991'
}
},
'Reg' => {
@@ -3697,7 +3697,7 @@
'Return' => '100',
'ShortName' => 'decode_query_device_identifiers_resp'
},
- '76769' => {
+ '100001' => {
'Header' => 'firmware_update.h',
'Line' => '1135',
'Param' => {
@@ -3722,7 +3722,7 @@
'Return' => '100',
'ShortName' => 'encode_query_device_identifiers_req'
},
- '76909' => {
+ '100141' => {
'Header' => 'firmware_update.h',
'Line' => '1119',
'Param' => {
@@ -3736,7 +3736,7 @@
},
'2' => {
'name' => 'pldm_comp_image_info',
- 'type' => '77101'
+ 'type' => '100333'
},
'3' => {
'name' => 'comp_version_str',
@@ -3746,7 +3746,7 @@
'Return' => '100',
'ShortName' => 'decode_pldm_comp_image_info'
},
- '77254' => {
+ '100486' => {
'Header' => 'firmware_update.h',
'Line' => '1104',
'Param' => {
@@ -3774,7 +3774,7 @@
'Return' => '100',
'ShortName' => 'decode_vendor_defined_descriptor_value'
},
- '77656' => {
+ '100888' => {
'Header' => 'firmware_update.h',
'Line' => '1088',
'Param' => {
@@ -3798,23 +3798,23 @@
'Return' => '100',
'ShortName' => 'decode_descriptor_type_length_value'
},
- '78021' => {
+ '101253' => {
'Header' => 'firmware_update.h',
'Line' => '739',
'Param' => {
'0' => {
'name' => 'iter',
- 'type' => '78952'
+ 'type' => '102825'
},
'1' => {
'name' => 'desc',
- 'type' => '78957'
+ 'type' => '102830'
}
},
'Return' => '100',
'ShortName' => 'decode_pldm_descriptor_from_iter'
},
- '78962' => {
+ '102835' => {
'Header' => 'firmware_update.h',
'Line' => '1069',
'Param' => {
@@ -3832,7 +3832,7 @@
},
'3' => {
'name' => 'fw_device_id_record',
- 'type' => '79242'
+ 'type' => '103115'
},
'4' => {
'name' => 'applicable_components',
@@ -3856,7 +3856,7 @@
'Return' => '100',
'ShortName' => 'decode_firmware_device_id_record'
},
- '79505' => {
+ '103378' => {
'Header' => 'firmware_update.h',
'Line' => '1048',
'Param' => {
@@ -3870,7 +3870,7 @@
},
'2' => {
'name' => 'package_header_info',
- 'type' => '79697'
+ 'type' => '103570'
},
'3' => {
'name' => 'package_version_str',
@@ -3880,7 +3880,7 @@
'Return' => '100',
'ShortName' => 'decode_pldm_package_header_info'
},
- '83567' => {
+ '107887' => {
'Header' => 'fru.h',
'Line' => '502',
'Param' => {
@@ -3908,7 +3908,7 @@
'Return' => '100',
'ShortName' => 'encode_set_fru_record_table_resp'
},
- '83807' => {
+ '108127' => {
'Header' => 'fru.h',
'Line' => '487',
'Param' => {
@@ -3942,7 +3942,7 @@
'Return' => '100',
'ShortName' => 'decode_set_fru_record_table_req'
},
- '83974' => {
+ '108294' => {
'Header' => 'fru.h',
'Line' => '360',
'Param' => {
@@ -3979,7 +3979,7 @@
'Return' => '100',
'ShortName' => 'decode_get_fru_record_table_resp'
},
- '84204' => {
+ '108524' => {
'Header' => 'fru.h',
'Line' => '387',
'Param' => {
@@ -4026,7 +4026,7 @@
'Return' => '100',
'ShortName' => 'decode_get_fru_record_table_resp_safe'
},
- '84525' => {
+ '108845' => {
'Header' => 'fru.h',
'Line' => '339',
'Param' => {
@@ -4054,7 +4054,7 @@
'Return' => '100',
'ShortName' => 'encode_get_fru_record_table_req'
},
- '84760' => {
+ '109080' => {
'Header' => 'fru.h',
'Line' => '451',
'Param' => {
@@ -4093,7 +4093,7 @@
'Return' => '100',
'ShortName' => 'decode_get_fru_record_by_option_resp'
},
- '84927' => {
+ '109247' => {
'Header' => 'fru.h',
'Line' => '313',
'Param' => {
@@ -4138,7 +4138,7 @@
'Return' => '100',
'ShortName' => 'encode_get_fru_record_by_option_resp'
},
- '85318' => {
+ '109638' => {
'Header' => 'fru.h',
'Line' => '292',
'Param' => {
@@ -4187,7 +4187,7 @@
'Return' => '100',
'ShortName' => 'decode_get_fru_record_by_option_req'
},
- '85520' => {
+ '109840' => {
'Header' => 'fru.h',
'Line' => '433',
'Param' => {
@@ -4234,7 +4234,7 @@
'Return' => '100',
'ShortName' => 'encode_get_fru_record_by_option_req'
},
- '85817' => {
+ '110137' => {
'Header' => 'fru.h',
'Line' => '468',
'Param' => {
@@ -4271,7 +4271,7 @@
'Return' => '100',
'ShortName' => 'get_fru_record_by_option'
},
- '86477' => {
+ '110797' => {
'Header' => 'fru.h',
'Line' => '409',
'Param' => {
@@ -4324,7 +4324,7 @@
'Return' => '100',
'ShortName' => 'encode_fru_record'
},
- '86799' => {
+ '111119' => {
'Header' => 'fru.h',
'Line' => '269',
'Param' => {
@@ -4352,7 +4352,7 @@
'Return' => '100',
'ShortName' => 'encode_get_fru_record_table_resp'
},
- '87021' => {
+ '111341' => {
'Header' => 'fru.h',
'Line' => '251',
'Param' => {
@@ -4382,7 +4382,7 @@
'Return' => '100',
'ShortName' => 'decode_get_fru_record_table_req'
},
- '87125' => {
+ '111445' => {
'Header' => 'fru.h',
'Line' => '232',
'Param' => {
@@ -4434,7 +4434,7 @@
'Return' => '100',
'ShortName' => 'encode_get_fru_record_table_metadata_resp'
},
- '87428' => {
+ '111748' => {
'Header' => 'fru.h',
'Line' => '203',
'Param' => {
@@ -4493,7 +4493,7 @@
'Return' => '100',
'ShortName' => 'decode_get_fru_record_table_metadata_resp'
},
- '87638' => {
+ '111958' => {
'Header' => 'fru.h',
'Line' => '178',
'Param' => {
@@ -4513,7 +4513,7 @@
'Return' => '100',
'ShortName' => 'encode_get_fru_record_table_metadata_req'
},
- '104485' => {
+ '139356' => {
'Header' => 'pdr.h',
'Line' => '638',
'Param' => {
@@ -4531,7 +4531,7 @@
},
'3' => {
'name' => 'entities',
- 'type' => '104810'
+ 'type' => '139681'
}
},
'Reg' => {
@@ -4541,13 +4541,13 @@
'Return' => '1',
'ShortName' => 'pldm_entity_association_pdr_extract'
},
- '104825' => {
+ '139696' => {
'Header' => 'pdr.h',
'Line' => '626',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
}
},
'Reg' => {
@@ -4556,13 +4556,13 @@
'Return' => '5459',
'ShortName' => 'pldm_is_empty_entity_assoc_tree'
},
- '104879' => {
+ '139750' => {
'Header' => 'pdr.h',
'Line' => '616',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
}
},
'Reg' => {
@@ -4571,65 +4571,65 @@
'Return' => '1',
'ShortName' => 'pldm_entity_association_tree_destroy_root'
},
- '105038' => {
+ '139909' => {
'Header' => 'pdr.h',
'Line' => '593',
'Param' => {
'0' => {
'name' => 'org_tree',
- 'type' => '104874'
+ 'type' => '139745'
},
'1' => {
'name' => 'new_tree',
- 'type' => '104874'
+ 'type' => '139745'
}
},
'Return' => '1',
'ShortName' => 'pldm_entity_association_tree_copy_root'
},
- '105467' => {
+ '140338' => {
'Header' => 'pdr.h',
'Line' => '567',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
},
'1' => {
'name' => 'entity',
- 'type' => '95475'
+ 'type' => '123554'
}
},
- 'Return' => '89452',
+ 'Return' => '113770',
'ShortName' => 'pldm_entity_association_tree_find'
},
- '105747' => {
+ '140618' => {
'Header' => 'pdr.h',
'Line' => '581',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
},
'1' => {
'name' => 'entity',
- 'type' => '95475'
+ 'type' => '123554'
},
'2' => {
'name' => 'is_remote',
'type' => '5459'
}
},
- 'Return' => '89452',
+ 'Return' => '113770',
'ShortName' => 'pldm_entity_association_tree_find_with_locality'
},
- '106129' => {
+ '141000' => {
'Header' => 'pdr.h',
'Line' => '213',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
},
'1' => {
'name' => 'first',
@@ -4644,16 +4644,16 @@
'1' => 'rsi',
'2' => 'rdx'
},
- 'Return' => '89447',
+ 'Return' => '113765',
'ShortName' => 'pldm_pdr_find_last_in_range'
},
- '106256' => {
+ '141127' => {
'Header' => 'pdr.h',
'Line' => '178',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '90321'
+ 'type' => '115009'
}
},
'Reg' => {
@@ -4662,13 +4662,13 @@
'Return' => '1',
'ShortName' => 'pldm_pdr_remove_remote_pdrs'
},
- '106508' => {
+ '141379' => {
'Header' => 'pdr.h',
'Line' => '187',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '90321'
+ 'type' => '115009'
},
'1' => {
'name' => 'terminus_handle',
@@ -4682,41 +4682,41 @@
'Return' => '1',
'ShortName' => 'pldm_pdr_remove_pdrs_by_terminus_handle'
},
- '106776' => {
+ '141647' => {
'Header' => 'pdr.h',
'Line' => '528',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
},
'1' => {
'name' => 'entity',
- 'type' => '88585'
+ 'type' => '112903'
},
'2' => {
'name' => 'node',
- 'type' => '105462'
+ 'type' => '140333'
}
},
'Return' => '1',
'ShortName' => 'pldm_find_entity_ref_in_tree'
},
- '107063' => {
+ '141934' => {
'Header' => 'pdr.h',
'Line' => '517',
'Param' => {
'0' => {
'name' => 'node',
- 'type' => '89452'
+ 'type' => '113770'
},
'1' => {
'name' => 'repo',
- 'type' => '90321'
+ 'type' => '115009'
},
'2' => {
'name' => 'entities',
- 'type' => '104810'
+ 'type' => '139681'
},
'3' => {
'name' => 'num_entities',
@@ -4747,21 +4747,21 @@
'Return' => '100',
'ShortName' => 'pldm_entity_association_pdr_add_from_node_with_record_handle'
},
- '107296' => {
+ '142167' => {
'Header' => 'pdr.h',
'Line' => '500',
'Param' => {
'0' => {
'name' => 'node',
- 'type' => '89452'
+ 'type' => '113770'
},
'1' => {
'name' => 'repo',
- 'type' => '90321'
+ 'type' => '115009'
},
'2' => {
'name' => 'entities',
- 'type' => '104810'
+ 'type' => '139681'
},
'3' => {
'name' => 'num_entities',
@@ -4779,17 +4779,17 @@
'Return' => '100',
'ShortName' => 'pldm_entity_association_pdr_add_from_node'
},
- '107514' => {
+ '142385' => {
'Header' => 'pdr.h',
'Line' => '451',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
},
'1' => {
'name' => 'repo',
- 'type' => '90321'
+ 'type' => '115009'
},
'2' => {
'name' => 'is_remote',
@@ -4803,17 +4803,17 @@
'Return' => '100',
'ShortName' => 'pldm_entity_association_pdr_add'
},
- '109071' => {
+ '143942' => {
'Header' => 'pdr.h',
'Line' => '554',
'Param' => {
'0' => {
'name' => 'parent',
- 'type' => '89452'
+ 'type' => '113770'
},
'1' => {
'name' => 'node',
- 'type' => '95475'
+ 'type' => '123554'
}
},
'Reg' => {
@@ -4823,13 +4823,13 @@
'Return' => '5459',
'ShortName' => 'pldm_is_current_parent_child'
},
- '109160' => {
+ '144031' => {
'Header' => 'pdr.h',
'Line' => '540',
'Param' => {
'0' => {
'name' => 'node',
- 'type' => '89452'
+ 'type' => '113770'
},
'1' => {
'name' => 'association_type',
@@ -4843,13 +4843,13 @@
'Return' => '135',
'ShortName' => 'pldm_entity_get_num_children'
},
- '109375' => {
+ '144246' => {
'Header' => 'pdr.h',
'Line' => '435',
'Param' => {
'0' => {
'name' => 'node',
- 'type' => '89452'
+ 'type' => '113770'
}
},
'Reg' => {
@@ -4858,37 +4858,37 @@
'Return' => '5459',
'ShortName' => 'pldm_entity_is_exist_parent'
},
- '109424' => {
+ '144295' => {
'Header' => 'pdr.h',
'Line' => '425',
'Param' => {
'0' => {
'name' => 'node',
- 'type' => '89452'
+ 'type' => '113770'
}
},
- 'Return' => '88585',
+ 'Return' => '112903',
'ShortName' => 'pldm_entity_get_parent'
},
- '109558' => {
+ '144429' => {
'Header' => 'pdr.h',
'Line' => '415',
'Param' => {
'0' => {
'name' => 'node',
- 'type' => '89452'
+ 'type' => '113770'
}
},
'Return' => '5459',
'ShortName' => 'pldm_entity_is_node_parent'
},
- '109713' => {
+ '144584' => {
'Header' => 'pdr.h',
'Line' => '405',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
}
},
'Reg' => {
@@ -4897,17 +4897,17 @@
'Return' => '1',
'ShortName' => 'pldm_entity_association_tree_destroy'
},
- '109892' => {
+ '144763' => {
'Header' => 'pdr.h',
'Line' => '377',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
},
'1' => {
'name' => 'entities',
- 'type' => '104810'
+ 'type' => '139681'
},
'2' => {
'name' => 'size',
@@ -4920,17 +4920,17 @@
'Return' => '1',
'ShortName' => 'pldm_entity_association_tree_visit'
},
- '110351' => {
+ '145222' => {
'Header' => 'pdr.h',
'Line' => '359',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
},
'1' => {
'name' => 'entity',
- 'type' => '95475'
+ 'type' => '123554'
},
'2' => {
'name' => 'entity_instance_number',
@@ -4938,7 +4938,7 @@
},
'3' => {
'name' => 'parent',
- 'type' => '89452'
+ 'type' => '113770'
},
'4' => {
'name' => 'association_type',
@@ -4959,20 +4959,20 @@
'type' => '5660'
}
},
- 'Return' => '89452',
+ 'Return' => '113770',
'ShortName' => 'pldm_entity_association_tree_add_entity'
},
- '110958' => {
+ '145829' => {
'Header' => 'pdr.h',
'Line' => '331',
'Param' => {
'0' => {
'name' => 'tree',
- 'type' => '104874'
+ 'type' => '139745'
},
'1' => {
'name' => 'entity',
- 'type' => '95475'
+ 'type' => '123554'
},
'2' => {
'name' => 'entity_instance_number',
@@ -4980,53 +4980,53 @@
},
'3' => {
'name' => 'parent',
- 'type' => '89452'
+ 'type' => '113770'
},
'4' => {
'name' => 'association_type',
'type' => '135'
}
},
- 'Return' => '89452',
+ 'Return' => '113770',
'ShortName' => 'pldm_entity_association_tree_add'
},
- '111281' => {
+ '146152' => {
'Header' => 'pdr.h',
'Line' => '314',
- 'Return' => '104874',
+ 'Return' => '139745',
'ShortName' => 'pldm_entity_association_tree_init'
},
- '111355' => {
+ '146226' => {
'Header' => 'pdr.h',
'Line' => '399',
'Param' => {
'0' => {
'name' => 'entity',
- 'type' => '111489'
+ 'type' => '146360'
}
},
'Return' => '5660',
'ShortName' => 'pldm_entity_node_get_remote_container_id'
},
- '111515' => {
+ '146386' => {
'Header' => 'pdr.h',
'Line' => '388',
'Param' => {
'0' => {
'name' => 'node',
- 'type' => '89452'
+ 'type' => '113770'
}
},
- 'Return' => '88585',
+ 'Return' => '112903',
'ShortName' => 'pldm_entity_extract'
},
- '112111' => {
+ '146982' => {
'Header' => 'pdr.h',
'Line' => '200',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
},
'1' => {
'name' => 'terminus_handle',
@@ -5054,13 +5054,13 @@
'Return' => '1',
'ShortName' => 'pldm_pdr_update_TL_pdr'
},
- '112465' => {
+ '147336' => {
'Header' => 'pdr.h',
'Line' => '279',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
},
'1' => {
'name' => 'fru_rsi',
@@ -5086,16 +5086,16 @@
'Reg' => {
'2' => 'r12'
},
- 'Return' => '91271',
+ 'Return' => '116320',
'ShortName' => 'pldm_pdr_fru_record_set_find_by_rsi'
},
- '112819' => {
+ '147690' => {
'Header' => 'pdr.h',
'Line' => '258',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '90321'
+ 'type' => '115009'
},
'1' => {
'name' => 'terminus_handle',
@@ -5126,65 +5126,65 @@
'Return' => '100',
'ShortName' => 'pldm_pdr_add_fru_record_set'
},
- '113132' => {
+ '148003' => {
'Header' => 'pdr.h',
'Line' => '170',
'Param' => {
'0' => {
'name' => 'record',
- 'type' => '91271'
+ 'type' => '116320'
}
},
'Return' => '5459',
'ShortName' => 'pldm_pdr_record_is_remote'
},
- '113503' => {
+ '148374' => {
'Header' => 'pdr.h',
'Line' => '94',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
},
'1' => {
'name' => 'record',
- 'type' => '91271'
+ 'type' => '116320'
}
},
'Return' => '147',
'ShortName' => 'pldm_pdr_get_record_handle'
},
- '113720' => {
+ '148591' => {
'Header' => 'pdr.h',
'Line' => '62',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
}
},
'Return' => '147',
'ShortName' => 'pldm_pdr_get_repo_size'
},
- '113853' => {
+ '148724' => {
'Header' => 'pdr.h',
'Line' => '52',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
}
},
'Return' => '147',
'ShortName' => 'pldm_pdr_get_record_count'
},
- '113984' => {
+ '148855' => {
'Header' => 'pdr.h',
'Line' => '160',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
},
'1' => {
'name' => 'pdr_type',
@@ -5192,11 +5192,11 @@
},
'2' => {
'name' => 'curr_record',
- 'type' => '91271'
+ 'type' => '116320'
},
'3' => {
'name' => 'data',
- 'type' => '76759'
+ 'type' => '99991'
},
'4' => {
'name' => 'size',
@@ -5208,24 +5208,24 @@
'3' => 'rcx',
'4' => 'r8'
},
- 'Return' => '91271',
+ 'Return' => '116320',
'ShortName' => 'pldm_pdr_find_record_by_type'
},
- '114155' => {
+ '149026' => {
'Header' => 'pdr.h',
'Line' => '142',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
},
'1' => {
'name' => 'curr_record',
- 'type' => '91271'
+ 'type' => '116320'
},
'2' => {
'name' => 'data',
- 'type' => '76759'
+ 'type' => '99991'
},
'3' => {
'name' => 'size',
@@ -5243,16 +5243,16 @@
'3' => 'rcx',
'4' => 'r8'
},
- 'Return' => '91271',
+ 'Return' => '116320',
'ShortName' => 'pldm_pdr_get_next_record'
},
- '114362' => {
+ '149232' => {
'Header' => 'pdr.h',
'Line' => '123',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '106251'
+ 'type' => '141122'
},
'1' => {
'name' => 'record_handle',
@@ -5260,7 +5260,7 @@
},
'2' => {
'name' => 'data',
- 'type' => '76759'
+ 'type' => '99991'
},
'3' => {
'name' => 'size',
@@ -5278,16 +5278,16 @@
'3' => 'rcx',
'4' => 'r8'
},
- 'Return' => '91271',
+ 'Return' => '116320',
'ShortName' => 'pldm_pdr_find_record'
},
- '114541' => {
+ '149410' => {
'Header' => 'pdr.h',
'Line' => '42',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '90321'
+ 'type' => '115009'
}
},
'Reg' => {
@@ -5296,19 +5296,19 @@
'Return' => '1',
'ShortName' => 'pldm_pdr_destroy'
},
- '114694' => {
+ '149563' => {
'Header' => 'pdr.h',
'Line' => '36',
- 'Return' => '90321',
+ 'Return' => '115009',
'ShortName' => 'pldm_pdr_init'
},
- '114766' => {
+ '149635' => {
'Header' => 'pdr.h',
'Line' => '79',
'Param' => {
'0' => {
'name' => 'repo',
- 'type' => '90321'
+ 'type' => '115009'
},
'1' => {
'name' => 'data',
@@ -5340,13 +5340,13 @@
'Return' => '100',
'ShortName' => 'pldm_pdr_add'
},
- '122694' => {
+ '157883' => {
'Header' => 'platform.h',
'Line' => '2543',
'Param' => {
'0' => {
'name' => 'event',
- 'type' => '122743'
+ 'type' => '157932'
}
},
'Reg' => {
@@ -5355,7 +5355,7 @@
'Return' => '1186',
'ShortName' => 'pldm_platform_cper_event_event_data'
},
- '122748' => {
+ '157937' => {
'Header' => 'platform.h',
'Line' => '2532',
'Param' => {
@@ -5369,7 +5369,7 @@
},
'2' => {
'name' => 'cper_event',
- 'type' => '122743'
+ 'type' => '157932'
},
'3' => {
'name' => 'cper_event_length',
@@ -5379,22 +5379,19 @@
'Return' => '100',
'ShortName' => 'decode_pldm_platform_cper_event'
},
- '123885' => {
+ '160145' => {
'Header' => 'platform.h',
'Line' => '2521',
'Param' => {
'0' => {
'name' => 'pdr',
- 'type' => '124496'
+ 'type' => '161402'
}
},
- 'Reg' => {
- '0' => 'rdi'
- },
'Return' => '100',
'ShortName' => 'decode_pldm_entity_auxiliary_names_pdr_index'
},
- '124501' => {
+ '161407' => {
'Header' => 'platform.h',
'Line' => '2499',
'Param' => {
@@ -5408,20 +5405,17 @@
},
'2' => {
'name' => 'pdr',
- 'type' => '124496'
+ 'type' => '161402'
},
'3' => {
'name' => 'pdr_length',
'type' => '164'
}
},
- 'Reg' => {
- '2' => 'rbx'
- },
'Return' => '100',
'ShortName' => 'decode_entity_auxiliary_names_pdr'
},
- '128638' => {
+ '169020' => {
'Header' => 'platform.h',
'Line' => '1883',
'Param' => {
@@ -5431,7 +5425,7 @@
},
'1' => {
'name' => 'resp',
- 'type' => '129747'
+ 'type' => '170922'
},
'2' => {
'name' => 'msg',
@@ -5443,12 +5437,12 @@
}
},
'Reg' => {
- '2' => 'r13'
+ '2' => 'r15'
},
'Return' => '100',
'ShortName' => 'encode_get_state_effecter_states_resp'
},
- '129762' => {
+ '170937' => {
'Header' => 'platform.h',
'Line' => '1866',
'Param' => {
@@ -5462,16 +5456,13 @@
},
'2' => {
'name' => 'resp',
- 'type' => '129747'
+ 'type' => '170922'
}
},
- 'Reg' => {
- '2' => 'rsi'
- },
'Return' => '100',
'ShortName' => 'decode_get_state_effecter_states_resp'
},
- '130792' => {
+ '173193' => {
'Header' => 'platform.h',
'Line' => '1835',
'Param' => {
@@ -5491,7 +5482,7 @@
'Return' => '100',
'ShortName' => 'decode_get_state_effecter_states_req'
},
- '131359' => {
+ '174077' => {
'Header' => 'platform.h',
'Line' => '1849',
'Param' => {
@@ -5515,7 +5506,7 @@
'Return' => '100',
'ShortName' => 'encode_get_state_effecter_states_req'
},
- '147979' => {
+ '200640' => {
'Header' => 'platform.h',
'Line' => '2015',
'Param' => {
@@ -5561,7 +5552,7 @@
'9' => {
'name' => 'event_data',
'offset' => '24',
- 'type' => '80830'
+ 'type' => '104722'
},
'10' => {
'name' => 'event_data_integrity_checksum',
@@ -5572,7 +5563,7 @@
'Return' => '100',
'ShortName' => 'decode_poll_for_platform_event_message_resp'
},
- '150042' => {
+ '204580' => {
'Header' => 'platform.h',
'Line' => '1989',
'Param' => {
@@ -5609,7 +5600,7 @@
'Return' => '100',
'ShortName' => 'encode_poll_for_platform_event_message_req'
},
- '151133' => {
+ '206327' => {
'Header' => 'platform.h',
'Line' => '2459',
'Param' => {
@@ -5629,7 +5620,7 @@
'Return' => '100',
'ShortName' => 'encode_set_event_receiver_resp'
},
- '151306' => {
+ '206500' => {
'Header' => 'platform.h',
'Line' => '2445',
'Param' => {
@@ -5661,7 +5652,7 @@
'Return' => '100',
'ShortName' => 'decode_set_event_receiver_req'
},
- '152366' => {
+ '208222' => {
'Header' => 'platform.h',
'Line' => '2423',
'Param' => {
@@ -5678,15 +5669,10 @@
'type' => '1186'
}
},
- 'Reg' => {
- '0' => 'rdi',
- '1' => 'rsi',
- '2' => 'rdx'
- },
'Return' => '100',
'ShortName' => 'decode_set_event_receiver_resp'
},
- '152859' => {
+ '209038' => {
'Header' => 'platform.h',
'Line' => '2409',
'Param' => {
@@ -5718,7 +5704,7 @@
'Return' => '100',
'ShortName' => 'encode_set_event_receiver_req'
},
- '153117' => {
+ '209296' => {
'Header' => 'platform.h',
'Line' => '1530',
'Param' => {
@@ -5742,7 +5728,7 @@
'Return' => '100',
'ShortName' => 'decode_get_sensor_reading_req'
},
- '153873' => {
+ '210484' => {
'Header' => 'platform.h',
'Line' => '1556',
'Param' => {
@@ -5799,7 +5785,7 @@
'Return' => '100',
'ShortName' => 'encode_get_sensor_reading_resp'
},
- '154427' => {
+ '211034' => {
'Header' => 'platform.h',
'Line' => '2384',
'Param' => {
@@ -5851,7 +5837,7 @@
'Return' => '100',
'ShortName' => 'decode_get_sensor_reading_resp'
},
- '157072' => {
+ '215743' => {
'Header' => 'platform.h',
'Line' => '2359',
'Param' => {
@@ -5875,7 +5861,7 @@
'Return' => '100',
'ShortName' => 'encode_get_sensor_reading_req'
},
- '157290' => {
+ '215961' => {
'Header' => 'platform.h',
'Line' => '2340',
'Param' => {
@@ -5900,16 +5886,10 @@
'type' => '2697'
}
},
- 'Reg' => {
- '0' => 'rdi',
- '2' => 'rdx',
- '3' => 'r9',
- '4' => 'r8'
- },
'Return' => '100',
'ShortName' => 'decode_pldm_pdr_repository_change_record_data'
},
- '158738' => {
+ '218388' => {
'Header' => 'platform.h',
'Line' => '2246',
'Param' => {
@@ -5923,13 +5903,13 @@
},
'2' => {
'name' => 'poll_event',
- 'type' => '159677'
+ 'type' => '220033'
}
},
'Return' => '100',
'ShortName' => 'decode_pldm_message_poll_event_data'
},
- '159682' => {
+ '220038' => {
'Header' => 'platform.h',
'Line' => '2232',
'Param' => {
@@ -5954,16 +5934,10 @@
'type' => '2697'
}
},
- 'Reg' => {
- '0' => 'rdi',
- '2' => 'rdx',
- '3' => 'r9',
- '4' => 'r8'
- },
'Return' => '100',
'ShortName' => 'decode_pldm_pdr_repository_chg_event_data'
},
- '160352' => {
+ '221146' => {
'Header' => 'platform.h',
'Line' => '2294',
'Param' => {
@@ -5985,11 +5959,11 @@
},
'4' => {
'name' => 'change_entries',
- 'type' => '160671'
+ 'type' => '221465'
},
'5' => {
'name' => 'event_data',
- 'type' => '160686'
+ 'type' => '221480'
},
'6' => {
'name' => 'actual_change_records_size',
@@ -6013,7 +5987,7 @@
'Return' => '100',
'ShortName' => 'encode_pldm_pdr_repository_chg_event_data'
},
- '160696' => {
+ '221490' => {
'Header' => 'platform.h',
'Line' => '2210',
'Param' => {
@@ -6050,7 +6024,7 @@
'Return' => '100',
'ShortName' => 'decode_get_numeric_effecter_value_resp'
},
- '164004' => {
+ '227299' => {
'Header' => 'platform.h',
'Line' => '1487',
'Param' => {
@@ -6070,7 +6044,7 @@
'Return' => '100',
'ShortName' => 'decode_get_numeric_effecter_value_req'
},
- '164603' => {
+ '228215' => {
'Header' => 'platform.h',
'Line' => '1511',
'Param' => {
@@ -6112,7 +6086,7 @@
'Return' => '100',
'ShortName' => 'encode_get_numeric_effecter_value_resp'
},
- '165301' => {
+ '228909' => {
'Header' => 'platform.h',
'Line' => '2189',
'Param' => {
@@ -6132,7 +6106,7 @@
'Return' => '100',
'ShortName' => 'encode_get_numeric_effecter_value_req'
},
- '165499' => {
+ '229107' => {
'Header' => 'platform.h',
'Line' => '2174',
'Param' => {
@@ -6146,13 +6120,13 @@
},
'2' => {
'name' => 'pdr_value',
- 'type' => '188116'
+ 'type' => '265181'
}
},
'Return' => '100',
'ShortName' => 'decode_numeric_sensor_pdr_data'
},
- '188121' => {
+ '265186' => {
'Header' => 'platform.h',
'Line' => '2162',
'Param' => {
@@ -6181,13 +6155,10 @@
'type' => '1668'
}
},
- 'Reg' => {
- '5' => 'r9'
- },
'Return' => '100',
'ShortName' => 'decode_numeric_sensor_data'
},
- '190134' => {
+ '268616' => {
'Header' => 'platform.h',
'Line' => '2141',
'Param' => {
@@ -6212,16 +6183,10 @@
'type' => '1186'
}
},
- 'Reg' => {
- '0' => 'rdi',
- '2' => 'rdx',
- '3' => 'r9',
- '4' => 'r8'
- },
'Return' => '100',
'ShortName' => 'decode_state_sensor_data'
},
- '190933' => {
+ '269968' => {
'Header' => 'platform.h',
'Line' => '2123',
'Param' => {
@@ -6242,15 +6207,10 @@
'type' => '1186'
}
},
- 'Reg' => {
- '0' => 'rdi',
- '2' => 'rdx',
- '3' => 'r8'
- },
'Return' => '100',
'ShortName' => 'decode_sensor_op_data'
},
- '191583' => {
+ '271056' => {
'Header' => 'platform.h',
'Line' => '2106',
'Param' => {
@@ -6278,7 +6238,7 @@
'Return' => '100',
'ShortName' => 'decode_sensor_event_data'
},
- '192392' => {
+ '272939' => {
'Header' => 'platform.h',
'Line' => '2085',
'Param' => {
@@ -6317,14 +6277,10 @@
'type' => '135'
}
},
- 'Reg' => {
- '4' => 'r8',
- '5' => 'r9'
- },
'Return' => '100',
'ShortName' => 'decode_event_message_supported_resp'
},
- '193670' => {
+ '275668' => {
'Header' => 'platform.h',
'Line' => '2068',
'Param' => {
@@ -6344,7 +6300,7 @@
'Return' => '100',
'ShortName' => 'encode_event_message_supported_req'
},
- '193868' => {
+ '275866' => {
'Header' => 'platform.h',
'Line' => '2041',
'Param' => {
@@ -6368,7 +6324,7 @@
'Return' => '100',
'ShortName' => 'decode_event_message_buffer_size_resp'
},
- '194637' => {
+ '277261' => {
'Header' => 'platform.h',
'Line' => '2054',
'Param' => {
@@ -6391,7 +6347,7 @@
'Return' => '100',
'ShortName' => 'encode_event_message_buffer_size_req'
},
- '194835' => {
+ '277459' => {
'Header' => 'platform.h',
'Line' => '2030',
'Param' => {
@@ -6412,13 +6368,10 @@
'type' => '1186'
}
},
- 'Reg' => {
- '3' => 'rcx'
- },
'Return' => '100',
'ShortName' => 'decode_platform_event_message_resp'
},
- '195511' => {
+ '278949' => {
'Header' => 'platform.h',
'Line' => '1973',
'Param' => {
@@ -6460,7 +6413,7 @@
'Return' => '100',
'ShortName' => 'encode_platform_event_message_req'
},
- '195912' => {
+ '279350' => {
'Header' => 'platform.h',
'Line' => '1953',
'Param' => {
@@ -6522,7 +6475,7 @@
'Return' => '100',
'ShortName' => 'encode_poll_for_platform_event_message_resp'
},
- '198026' => {
+ '283237' => {
'Header' => 'platform.h',
'Line' => '1931',
'Param' => {
@@ -6546,7 +6499,7 @@
'Return' => '100',
'ShortName' => 'encode_platform_event_message_resp'
},
- '198244' => {
+ '283455' => {
'Header' => 'platform.h',
'Line' => '1916',
'Param' => {
@@ -6578,7 +6531,7 @@
'Return' => '100',
'ShortName' => 'decode_poll_for_platform_event_message_req'
},
- '199494' => {
+ '285741' => {
'Header' => 'platform.h',
'Line' => '1900',
'Param' => {
@@ -6607,23 +6560,16 @@
'type' => '2697'
}
},
- 'Reg' => {
- '0' => 'r10',
- '2' => 'rdx',
- '3' => 'rcx',
- '4' => 'r8',
- '5' => 'r9'
- },
'Return' => '100',
'ShortName' => 'decode_platform_event_message_req'
},
- '200313' => {
+ '287113' => {
'Header' => 'platform.h',
'Line' => '2318',
'Param' => {
'0' => {
'name' => 'event_data',
- 'type' => '200504'
+ 'type' => '287304'
},
'1' => {
'name' => 'event_data_size',
@@ -6635,7 +6581,7 @@
},
'3' => {
'name' => 'sensor_event_class',
- 'type' => '118245'
+ 'type' => '153434'
},
'4' => {
'name' => 'sensor_offset',
@@ -6652,7 +6598,7 @@
},
'7' => {
'name' => 'actual_event_data_size',
- 'type' => '157965'
+ 'type' => '217074'
}
},
'Reg' => {
@@ -6666,7 +6612,7 @@
'Return' => '100',
'ShortName' => 'encode_sensor_event_data'
},
- '200519' => {
+ '287319' => {
'Header' => 'platform.h',
'Line' => '1452',
'Param' => {
@@ -6694,7 +6640,7 @@
'Return' => '100',
'ShortName' => 'decode_get_state_sensor_readings_req'
},
- '201424' => {
+ '288771' => {
'Header' => 'platform.h',
'Line' => '1820',
'Param' => {
@@ -6716,17 +6662,13 @@
},
'4' => {
'name' => 'field',
- 'type' => '202654'
+ 'type' => '291279'
}
},
- 'Reg' => {
- '3' => 'r9',
- '4' => 'r8'
- },
'Return' => '100',
'ShortName' => 'decode_get_state_sensor_readings_resp'
},
- '202659' => {
+ '291284' => {
'Header' => 'platform.h',
'Line' => '1800',
'Param' => {
@@ -6754,7 +6696,7 @@
'Return' => '100',
'ShortName' => 'encode_get_state_sensor_readings_req'
},
- '202897' => {
+ '291522' => {
'Header' => 'platform.h',
'Line' => '1472',
'Param' => {
@@ -6772,7 +6714,7 @@
},
'3' => {
'name' => 'field',
- 'type' => '202654'
+ 'type' => '291279'
},
'4' => {
'name' => 'msg',
@@ -6782,7 +6724,7 @@
'Return' => '100',
'ShortName' => 'encode_get_state_sensor_readings_resp'
},
- '203251' => {
+ '291876' => {
'Header' => 'platform.h',
'Line' => '1781',
'Param' => {
@@ -6807,7 +6749,7 @@
'Return' => '100',
'ShortName' => 'decode_set_numeric_effecter_value_resp'
},
- '203328' => {
+ '291953' => {
'Header' => 'platform.h',
'Line' => '1768',
'Param' => {
@@ -6842,7 +6784,7 @@
'Return' => '100',
'ShortName' => 'encode_set_numeric_effecter_value_req'
},
- '203800' => {
+ '292421' => {
'Header' => 'platform.h',
'Line' => '1343',
'Param' => {
@@ -6866,7 +6808,7 @@
'Return' => '100',
'ShortName' => 'encode_set_numeric_effecter_value_resp'
},
- '203993' => {
+ '292614' => {
'Header' => 'platform.h',
'Line' => '1327',
'Param' => {
@@ -6894,7 +6836,7 @@
'Return' => '100',
'ShortName' => 'decode_set_numeric_effecter_value_req'
},
- '207774' => {
+ '298950' => {
'Header' => 'platform.h',
'Line' => '1679',
'Param' => {
@@ -6949,7 +6891,7 @@
'Return' => '100',
'ShortName' => 'decode_get_pdr_resp'
},
- '209628' => {
+ '302351' => {
'Header' => 'platform.h',
'Line' => '1648',
'Param' => {
@@ -6994,7 +6936,7 @@
'Return' => '100',
'ShortName' => 'encode_get_pdr_req'
},
- '211862' => {
+ '305892' => {
'Header' => 'platform.h',
'Line' => '1610',
'Param' => {
@@ -7046,7 +6988,7 @@
'Return' => '100',
'ShortName' => 'decode_get_pdr_repository_info_resp'
},
- '213921' => {
+ '309508' => {
'Header' => 'platform.h',
'Line' => '1586',
'Param' => {
@@ -7098,7 +7040,7 @@
'Return' => '100',
'ShortName' => 'encode_get_pdr_repository_info_resp'
},
- '214394' => {
+ '309981' => {
'Header' => 'platform.h',
'Line' => '1410',
'Param' => {
@@ -7145,7 +7087,7 @@
'Return' => '100',
'ShortName' => 'encode_get_pdr_resp'
},
- '214843' => {
+ '310430' => {
'Header' => 'platform.h',
'Line' => '1431',
'Param' => {
@@ -7182,7 +7124,7 @@
'Return' => '100',
'ShortName' => 'decode_get_pdr_req'
},
- '216320' => {
+ '312666' => {
'Header' => 'platform.h',
'Line' => '1382',
'Param' => {
@@ -7204,13 +7146,13 @@
},
'4' => {
'name' => 'field',
- 'type' => '217372'
+ 'type' => '314579'
}
},
'Return' => '100',
'ShortName' => 'decode_set_state_effecter_states_req'
},
- '217377' => {
+ '314584' => {
'Header' => 'platform.h',
'Line' => '1747',
'Param' => {
@@ -7235,7 +7177,7 @@
'Return' => '100',
'ShortName' => 'decode_set_state_effecter_states_resp'
},
- '217452' => {
+ '314659' => {
'Header' => 'platform.h',
'Line' => '1728',
'Param' => {
@@ -7253,7 +7195,7 @@
},
'3' => {
'name' => 'field',
- 'type' => '217372'
+ 'type' => '314579'
},
'4' => {
'name' => 'msg',
@@ -7266,7 +7208,7 @@
'Return' => '100',
'ShortName' => 'encode_set_state_effecter_states_req'
},
- '217796' => {
+ '315003' => {
'Header' => 'platform.h',
'Line' => '1360',
'Param' => {
@@ -7286,13 +7228,13 @@
'Return' => '100',
'ShortName' => 'encode_set_state_effecter_states_resp'
},
- '217963' => {
+ '315170' => {
'Header' => 'platform.h',
'Line' => '710',
'Param' => {
'0' => {
'name' => 'sensor',
- 'type' => '218353'
+ 'type' => '315560'
},
'1' => {
'name' => 'allocation_size',
@@ -7300,7 +7242,7 @@
},
'2' => {
'name' => 'possible_states',
- 'type' => '218363'
+ 'type' => '315570'
},
'3' => {
'name' => 'possible_states_size',
@@ -7308,7 +7250,7 @@
},
'4' => {
'name' => 'actual_size',
- 'type' => '157965'
+ 'type' => '217074'
}
},
'Reg' => {
@@ -7321,13 +7263,13 @@
'Return' => '100',
'ShortName' => 'encode_state_sensor_pdr'
},
- '218373' => {
+ '315580' => {
'Header' => 'platform.h',
'Line' => '950',
'Param' => {
'0' => {
'name' => 'effecter',
- 'type' => '218763'
+ 'type' => '315970'
},
'1' => {
'name' => 'allocation_size',
@@ -7335,7 +7277,7 @@
},
'2' => {
'name' => 'possible_states',
- 'type' => '218773'
+ 'type' => '315980'
},
'3' => {
'name' => 'possible_states_size',
@@ -7343,7 +7285,7 @@
},
'4' => {
'name' => 'actual_size',
- 'type' => '157965'
+ 'type' => '217074'
}
},
'Reg' => {
@@ -7356,13 +7298,13 @@
'Return' => '100',
'ShortName' => 'encode_state_effecter_pdr'
},
- '222086' => {
+ '319856' => {
'Header' => 'instance-id.h',
'Line' => '85',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '222266'
+ 'type' => '320036'
},
'1' => {
'name' => 'tid',
@@ -7376,13 +7318,13 @@
'Return' => '100',
'ShortName' => 'pldm_instance_id_free'
},
- '222271' => {
+ '320041' => {
'Header' => 'instance-id.h',
'Line' => '68',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '222266'
+ 'type' => '320036'
},
'1' => {
'name' => 'tid',
@@ -7390,19 +7332,19 @@
},
'2' => {
'name' => 'iid',
- 'type' => '222653'
+ 'type' => '320423'
}
},
'Return' => '100',
'ShortName' => 'pldm_instance_id_alloc'
},
- '222658' => {
+ '320428' => {
'Header' => 'instance-id.h',
'Line' => '51',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '222266'
+ 'type' => '320036'
}
},
'Reg' => {
@@ -7411,25 +7353,25 @@
'Return' => '100',
'ShortName' => 'pldm_instance_db_destroy'
},
- '222743' => {
+ '320513' => {
'Header' => 'instance-id.h',
'Line' => '41',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '222829'
+ 'type' => '320599'
}
},
'Return' => '100',
'ShortName' => 'pldm_instance_db_init_default'
},
- '222834' => {
+ '320604' => {
'Header' => 'instance-id.h',
'Line' => '28',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '222829'
+ 'type' => '320599'
},
'1' => {
'name' => 'dbpath',
@@ -7439,13 +7381,13 @@
'Return' => '100',
'ShortName' => 'pldm_instance_db_init'
},
- '223785' => {
+ '321555' => {
'Header' => 'transport.h',
'Line' => '53',
'Param' => {
'0' => {
'name' => 'transport',
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
'name' => 'tid',
@@ -7466,16 +7408,16 @@
'2' => 'rdx',
'3' => 'rcx'
},
- 'Return' => '223736',
+ 'Return' => '321506',
'ShortName' => 'pldm_transport_send_msg'
},
- '223832' => {
+ '321602' => {
'Header' => 'transport.h',
'Line' => '118',
'Param' => {
'0' => {
'name' => 'transport',
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
'name' => 'tid',
@@ -7491,7 +7433,7 @@
},
'4' => {
'name' => 'pldm_resp_msg',
- 'type' => '80830'
+ 'type' => '104722'
},
'5' => {
'name' => 'resp_msg_len',
@@ -7501,16 +7443,16 @@
'Reg' => {
'2' => 'r14'
},
- 'Return' => '223736',
+ 'Return' => '321506',
'ShortName' => 'pldm_transport_send_recv_msg'
},
- '223889' => {
+ '321659' => {
'Header' => 'mctp-demux.h',
'Line' => '18',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '223780'
+ 'type' => '321550'
}
},
'Reg' => {
@@ -7519,21 +7461,21 @@
'Return' => '1',
'ShortName' => 'pldm_transport_mctp_demux_destroy'
},
- '223926' => {
+ '321696' => {
'Header' => 'transport.h',
'Line' => '81',
'Param' => {
'0' => {
'name' => 'transport',
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
'name' => 'tid',
- 'type' => '223963'
+ 'type' => '321733'
},
'2' => {
'name' => 'pldm_msg',
- 'type' => '80830'
+ 'type' => '104722'
},
'3' => {
'name' => 'msg_len',
@@ -7546,16 +7488,16 @@
'2' => 'rbp',
'3' => 'rcx'
},
- 'Return' => '223736',
+ 'Return' => '321506',
'ShortName' => 'pldm_transport_recv_msg'
},
- '223968' => {
+ '321738' => {
'Header' => 'mctp-demux.h',
'Line' => '32',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '223780'
+ 'type' => '321550'
},
'1' => {
'name' => 'tid',
@@ -7563,7 +7505,7 @@
},
'2' => {
'name' => 'eid',
- 'type' => '223621'
+ 'type' => '321391'
}
},
'Reg' => {
@@ -7574,28 +7516,28 @@
'Return' => '100',
'ShortName' => 'pldm_transport_mctp_demux_map_tid'
},
- '224000' => {
+ '321770' => {
'Header' => 'mctp-demux.h',
'Line' => '22',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '223780'
+ 'type' => '321550'
}
},
'Reg' => {
'0' => 'rdi'
},
- 'Return' => '223822',
+ 'Return' => '321592',
'ShortName' => 'pldm_transport_mctp_demux_core'
},
- '224044' => {
+ '321814' => {
'Header' => 'mctp-demux.h',
'Line' => '15',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '224066'
+ 'type' => '321836'
}
},
'Reg' => {
@@ -7604,19 +7546,19 @@
'Return' => '100',
'ShortName' => 'pldm_transport_mctp_demux_init'
},
- '224125' => {
+ '321895' => {
'Header' => 'pldm.h',
'Line' => '119',
'Return' => '1',
'ShortName' => 'pldm_close'
},
- '224169' => {
+ '321939' => {
'Header' => 'pldm.h',
'Line' => '75',
'Param' => {
'0' => {
'name' => 'eid',
- 'type' => '223621'
+ 'type' => '321391'
},
'1' => {
'name' => 'mctp_fd',
@@ -7637,16 +7579,16 @@
'2' => 'rdx',
'3' => 'rcx'
},
- 'Return' => '223736',
+ 'Return' => '321506',
'ShortName' => 'pldm_send'
},
- '224588' => {
+ '322358' => {
'Header' => 'pldm.h',
'Line' => '57',
'Param' => {
'0' => {
'name' => 'eid',
- 'type' => '223621'
+ 'type' => '321391'
},
'1' => {
'name' => 'mctp_fd',
@@ -7662,7 +7604,7 @@
},
'4' => {
'name' => 'pldm_resp_msg',
- 'type' => '76759'
+ 'type' => '99991'
},
'5' => {
'name' => 'resp_msg_len',
@@ -7677,16 +7619,16 @@
'4' => 'r8',
'5' => 'r9'
},
- 'Return' => '223736',
+ 'Return' => '321506',
'ShortName' => 'pldm_send_recv'
},
- '225071' => {
+ '322841' => {
'Header' => 'pldm.h',
'Line' => '94',
'Param' => {
'0' => {
'name' => 'eid',
- 'type' => '223621'
+ 'type' => '321391'
},
'1' => {
'name' => 'mctp_fd',
@@ -7698,7 +7640,7 @@
},
'3' => {
'name' => 'pldm_resp_msg',
- 'type' => '76759'
+ 'type' => '99991'
},
'4' => {
'name' => 'resp_msg_len',
@@ -7708,16 +7650,16 @@
'Reg' => {
'3' => 'rbx'
},
- 'Return' => '223736',
+ 'Return' => '321506',
'ShortName' => 'pldm_recv'
},
- '225297' => {
+ '323067' => {
'Header' => 'pldm.h',
'Line' => '112',
'Param' => {
'0' => {
'name' => 'eid',
- 'type' => '223621'
+ 'type' => '321391'
},
'1' => {
'name' => 'mctp_fd',
@@ -7725,7 +7667,7 @@
},
'2' => {
'name' => 'pldm_resp_msg',
- 'type' => '76759'
+ 'type' => '99991'
},
'3' => {
'name' => 'resp_msg_len',
@@ -7736,26 +7678,26 @@
'2' => 'r12',
'3' => 'r13'
},
- 'Return' => '223736',
+ 'Return' => '321506',
'ShortName' => 'pldm_recv_any'
},
- '225750' => {
+ '323520' => {
'Header' => 'pldm.h',
'Line' => '39',
- 'Return' => '223736',
+ 'Return' => '321506',
'ShortName' => 'pldm_open'
},
- '228177' => {
+ '325947' => {
'Header' => 'af-mctp.h',
'Line' => '54',
'Param' => {
'0' => {
'name' => 'transport',
- 'type' => '228333'
+ 'type' => '326103'
},
'1' => {
'name' => 'smctp',
- 'type' => '228338'
+ 'type' => '326108'
},
'2' => {
'name' => 'len',
@@ -7769,13 +7711,13 @@
'Return' => '100',
'ShortName' => 'pldm_transport_af_mctp_bind'
},
- '228343' => {
+ '326113' => {
'Header' => 'af-mctp.h',
'Line' => '19',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '228333'
+ 'type' => '326103'
}
},
'Reg' => {
@@ -7784,13 +7726,13 @@
'Return' => '1',
'ShortName' => 'pldm_transport_af_mctp_destroy'
},
- '228427' => {
+ '326197' => {
'Header' => 'af-mctp.h',
'Line' => '16',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '228651'
+ 'type' => '326421'
}
},
'Reg' => {
@@ -7799,13 +7741,13 @@
'Return' => '100',
'ShortName' => 'pldm_transport_af_mctp_init'
},
- '229838' => {
+ '327608' => {
'Header' => 'af-mctp.h',
'Line' => '37',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '228333'
+ 'type' => '326103'
},
'1' => {
'name' => 'tid',
@@ -7813,7 +7755,7 @@
},
'2' => {
'name' => 'eid',
- 'type' => '223621'
+ 'type' => '321391'
}
},
'Reg' => {
@@ -7824,13 +7766,13 @@
'Return' => '100',
'ShortName' => 'pldm_transport_af_mctp_unmap_tid'
},
- '229911' => {
+ '327681' => {
'Header' => 'af-mctp.h',
'Line' => '33',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '228333'
+ 'type' => '326103'
},
'1' => {
'name' => 'tid',
@@ -7838,7 +7780,7 @@
},
'2' => {
'name' => 'eid',
- 'type' => '223621'
+ 'type' => '321391'
}
},
'Reg' => {
@@ -7849,17 +7791,17 @@
'Return' => '100',
'ShortName' => 'pldm_transport_af_mctp_map_tid'
},
- '230152' => {
+ '327922' => {
'Header' => 'af-mctp.h',
'Line' => '28',
'Param' => {
'0' => {
'name' => 't',
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
'name' => 'pollfd',
- 'type' => '226824'
+ 'type' => '324594'
}
},
'Reg' => {
@@ -7869,28 +7811,28 @@
'Return' => '100',
'ShortName' => 'pldm_transport_af_mctp_init_pollfd'
},
- '230230' => {
+ '328000' => {
'Header' => 'af-mctp.h',
'Line' => '23',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '228333'
+ 'type' => '326103'
}
},
'Reg' => {
'0' => 'rdi'
},
- 'Return' => '223822',
+ 'Return' => '321592',
'ShortName' => 'pldm_transport_af_mctp_core'
},
- '233961' => {
+ '331731' => {
'Header' => 'mctp-demux.h',
'Line' => '36',
'Param' => {
'0' => {
'name' => 'ctx',
- 'type' => '223780'
+ 'type' => '321550'
},
'1' => {
'name' => 'tid',
@@ -7898,7 +7840,7 @@
},
'2' => {
'name' => 'eid',
- 'type' => '223621'
+ 'type' => '321391'
}
},
'Reg' => {
@@ -7909,17 +7851,17 @@
'Return' => '100',
'ShortName' => 'pldm_transport_mctp_demux_unmap_tid'
},
- '234275' => {
+ '332045' => {
'Header' => 'mctp-demux.h',
'Line' => '27',
'Param' => {
'0' => {
'name' => 't',
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
'name' => 'pollfd',
- 'type' => '226824'
+ 'type' => '324594'
}
},
'Reg' => {
@@ -7929,13 +7871,13 @@
'Return' => '100',
'ShortName' => 'pldm_transport_mctp_demux_init_pollfd'
},
- '242119' => {
+ '339889' => {
'Header' => 'transport.h',
'Line' => '31',
'Param' => {
'0' => {
'name' => 'transport',
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
'name' => 'timeout',
@@ -7945,7 +7887,7 @@
'Return' => '100',
'ShortName' => 'pldm_transport_poll'
},
- '244321' => {
+ '342091' => {
'Header' => 'file_io.h',
'Line' => '912',
'Param' => {
@@ -7965,7 +7907,7 @@
'Return' => '100',
'ShortName' => 'encode_new_file_with_metadata_resp'
},
- '244521' => {
+ '342291' => {
'Header' => 'file_io.h',
'Line' => '898',
'Param' => {
@@ -8019,7 +7961,7 @@
'Return' => '100',
'ShortName' => 'decode_new_file_with_metadata_req'
},
- '244753' => {
+ '342523' => {
'Header' => 'file_io.h',
'Line' => '881',
'Param' => {
@@ -8044,7 +7986,7 @@
'Return' => '100',
'ShortName' => 'decode_new_file_with_metadata_resp'
},
- '244854' => {
+ '342624' => {
'Header' => 'file_io.h',
'Line' => '866',
'Param' => {
@@ -8094,7 +8036,7 @@
'Return' => '100',
'ShortName' => 'encode_new_file_with_metadata_req'
},
- '245151' => {
+ '342921' => {
'Header' => 'file_io.h',
'Line' => '824',
'Param' => {
@@ -8114,7 +8056,7 @@
'Return' => '100',
'ShortName' => 'encode_file_ack_with_meta_data_resp'
},
- '245346' => {
+ '343116' => {
'Header' => 'file_io.h',
'Line' => '811',
'Param' => {
@@ -8168,7 +8110,7 @@
'Return' => '100',
'ShortName' => 'decode_file_ack_with_meta_data_req'
},
- '245558' => {
+ '343328' => {
'Header' => 'file_io.h',
'Line' => '794',
'Param' => {
@@ -8193,7 +8135,7 @@
'Return' => '100',
'ShortName' => 'decode_file_ack_with_meta_data_resp'
},
- '245654' => {
+ '343424' => {
'Header' => 'file_io.h',
'Line' => '781',
'Param' => {
@@ -8243,7 +8185,7 @@
'Return' => '100',
'ShortName' => 'encode_file_ack_with_meta_data_req'
},
- '245951' => {
+ '343721' => {
'Header' => 'file_io.h',
'Line' => '741',
'Param' => {
@@ -8268,7 +8210,7 @@
'Return' => '100',
'ShortName' => 'decode_file_ack_resp'
},
- '246052' => {
+ '343822' => {
'Header' => 'file_io.h',
'Line' => '730',
'Param' => {
@@ -8296,7 +8238,7 @@
'Return' => '100',
'ShortName' => 'encode_file_ack_req'
},
- '246287' => {
+ '344057' => {
'Header' => 'file_io.h',
'Line' => '718',
'Param' => {
@@ -8316,7 +8258,7 @@
'Return' => '100',
'ShortName' => 'encode_file_ack_resp'
},
- '246477' => {
+ '344247' => {
'Header' => 'file_io.h',
'Line' => '706',
'Param' => {
@@ -8350,7 +8292,7 @@
'Return' => '100',
'ShortName' => 'decode_file_ack_req'
},
- '246619' => {
+ '344389' => {
'Header' => 'file_io.h',
'Line' => '675',
'Param' => {
@@ -8380,7 +8322,7 @@
'Return' => '100',
'ShortName' => 'decode_rw_file_by_type_resp'
},
- '246734' => {
+ '344504' => {
'Header' => 'file_io.h',
'Line' => '661',
'Param' => {
@@ -8417,7 +8359,7 @@
'Return' => '100',
'ShortName' => 'encode_rw_file_by_type_req'
},
- '247004' => {
+ '344774' => {
'Header' => 'file_io.h',
'Line' => '644',
'Param' => {
@@ -8445,7 +8387,7 @@
'Return' => '100',
'ShortName' => 'encode_rw_file_by_type_resp'
},
- '247234' => {
+ '345004' => {
'Header' => 'file_io.h',
'Line' => '626',
'Param' => {
@@ -8484,7 +8426,7 @@
'Return' => '100',
'ShortName' => 'decode_rw_file_by_type_req'
},
- '247396' => {
+ '345166' => {
'Header' => 'file_io.h',
'Line' => '590',
'Param' => {
@@ -8509,7 +8451,7 @@
'Return' => '100',
'ShortName' => 'decode_new_file_resp'
},
- '247497' => {
+ '345267' => {
'Header' => 'file_io.h',
'Line' => '579',
'Param' => {
@@ -8537,7 +8479,7 @@
'Return' => '100',
'ShortName' => 'encode_new_file_req'
},
- '247732' => {
+ '345502' => {
'Header' => 'file_io.h',
'Line' => '567',
'Param' => {
@@ -8557,7 +8499,7 @@
'Return' => '100',
'ShortName' => 'encode_new_file_resp'
},
- '247922' => {
+ '345692' => {
'Header' => 'file_io.h',
'Line' => '555',
'Param' => {
@@ -8591,7 +8533,7 @@
'Return' => '100',
'ShortName' => 'decode_new_file_req'
},
- '248064' => {
+ '345834' => {
'Header' => 'file_io.h',
'Line' => '523',
'Param' => {
@@ -8621,7 +8563,7 @@
'Return' => '100',
'ShortName' => 'decode_rw_file_by_type_memory_resp'
},
- '248179' => {
+ '345949' => {
'Header' => 'file_io.h',
'Line' => '509',
'Param' => {
@@ -8663,7 +8605,7 @@
'Return' => '100',
'ShortName' => 'encode_rw_file_by_type_memory_req'
},
- '248464' => {
+ '346234' => {
'Header' => 'file_io.h',
'Line' => '491',
'Param' => {
@@ -8691,7 +8633,7 @@
'Return' => '100',
'ShortName' => 'encode_rw_file_by_type_memory_resp'
},
- '248694' => {
+ '346464' => {
'Header' => 'file_io.h',
'Line' => '473',
'Param' => {
@@ -8735,7 +8677,7 @@
'Return' => '100',
'ShortName' => 'decode_rw_file_by_type_memory_req'
},
- '248871' => {
+ '346641' => {
'Header' => 'file_io.h',
'Line' => '435',
'Param' => {
@@ -8759,7 +8701,7 @@
'Return' => '100',
'ShortName' => 'encode_write_file_resp'
},
- '249086' => {
+ '346856' => {
'Header' => 'file_io.h',
'Line' => '422',
'Param' => {
@@ -8789,7 +8731,7 @@
'Return' => '100',
'ShortName' => 'decode_write_file_resp'
},
- '249196' => {
+ '346966' => {
'Header' => 'file_io.h',
'Line' => '410',
'Param' => {
@@ -8817,7 +8759,7 @@
'Return' => '100',
'ShortName' => 'encode_write_file_req'
},
- '249431' => {
+ '347201' => {
'Header' => 'file_io.h',
'Line' => '391',
'Param' => {
@@ -8855,7 +8797,7 @@
'Return' => '100',
'ShortName' => 'decode_write_file_req'
},
- '249586' => {
+ '347356' => {
'Header' => 'file_io.h',
'Line' => '377',
'Param' => {
@@ -8879,7 +8821,7 @@
'Return' => '100',
'ShortName' => 'encode_read_file_resp'
},
- '249801' => {
+ '347571' => {
'Header' => 'file_io.h',
'Line' => '359',
'Param' => {
@@ -8913,7 +8855,7 @@
'Return' => '100',
'ShortName' => 'decode_read_file_resp'
},
- '249937' => {
+ '347707' => {
'Header' => 'file_io.h',
'Line' => '344',
'Param' => {
@@ -8941,7 +8883,7 @@
'Return' => '100',
'ShortName' => 'encode_read_file_req'
},
- '250172' => {
+ '347942' => {
'Header' => 'file_io.h',
'Line' => '330',
'Param' => {
@@ -8975,7 +8917,7 @@
'Return' => '100',
'ShortName' => 'decode_read_file_req'
},
- '250308' => {
+ '348078' => {
'Header' => 'file_io.h',
'Line' => '274',
'Param' => {
@@ -9019,7 +8961,7 @@
'Return' => '100',
'ShortName' => 'decode_get_file_table_resp'
},
- '250482' => {
+ '348252' => {
'Header' => 'file_io.h',
'Line' => '258',
'Param' => {
@@ -9047,7 +8989,7 @@
'Return' => '100',
'ShortName' => 'encode_get_file_table_req'
},
- '250709' => {
+ '348479' => {
'Header' => 'file_io.h',
'Line' => '244',
'Param' => {
@@ -9087,7 +9029,7 @@
'Return' => '100',
'ShortName' => 'encode_get_file_table_resp'
},
- '251067' => {
+ '348837' => {
'Header' => 'file_io.h',
'Line' => '227',
'Param' => {
@@ -9121,7 +9063,7 @@
'Return' => '100',
'ShortName' => 'decode_get_file_table_req'
},
- '251202' => {
+ '348972' => {
'Header' => 'file_io.h',
'Line' => '183',
'Param' => {
@@ -9151,7 +9093,7 @@
'Return' => '100',
'ShortName' => 'decode_rw_file_memory_resp'
},
- '251311' => {
+ '349081' => {
'Header' => 'file_io.h',
'Line' => '169',
'Param' => {
@@ -9191,7 +9133,7 @@
'Return' => '100',
'ShortName' => 'encode_rw_file_memory_req'
},
- '251570' => {
+ '349340' => {
'Header' => 'file_io.h',
'Line' => '152',
'Param' => {
@@ -9219,7 +9161,7 @@
'Return' => '100',
'ShortName' => 'encode_rw_file_memory_resp'
},
- '251791' => {
+ '349561' => {
'Header' => 'file_io.h',
'Line' => '136',
'Param' => {
@@ -9258,7 +9200,7 @@
'Return' => '100',
'ShortName' => 'decode_rw_file_memory_req'
},
- '252840' => {
+ '350610' => {
'Header' => 'host.h',
'Line' => '101',
'Param' => {
@@ -9293,7 +9235,7 @@
'Return' => '100',
'ShortName' => 'encode_get_alert_status_resp'
},
- '253088' => {
+ '350858' => {
'Header' => 'host.h',
'Line' => '86',
'Param' => {
@@ -9318,7 +9260,7 @@
'Return' => '100',
'ShortName' => 'decode_get_alert_status_req'
},
- '253171' => {
+ '350941' => {
'Header' => 'host.h',
'Line' => '70',
'Param' => {
@@ -9352,7 +9294,7 @@
'Return' => '100',
'ShortName' => 'decode_get_alert_status_resp'
},
- '253310' => {
+ '351080' => {
'Header' => 'host.h',
'Line' => '52',
'Param' => {
@@ -9376,7 +9318,7 @@
'Return' => '100',
'ShortName' => 'encode_get_alert_status_req'
},
- '254528' => {
+ '352298' => {
'Header' => 'platform.h',
'Line' => '47',
'Param' => {
@@ -9413,7 +9355,7 @@
'Return' => '100',
'ShortName' => 'encode_bios_attribute_update_event_req'
},
- '256378' => {
+ '354148' => {
'Header' => 'file_io.h',
'Line' => '160',
'Param' => {
@@ -9423,7 +9365,7 @@
},
'1' => {
'name' => 'resp',
- 'type' => '258089'
+ 'type' => '357329'
},
'2' => {
'name' => 'resp_len',
@@ -9439,18 +9381,18 @@
}
},
'Reg' => {
- '3' => 'r12'
+ '3' => 'r14'
},
'Return' => '100',
'ShortName' => 'encode_oem_meta_file_io_read_resp'
},
- '258104' => {
+ '357344' => {
'Header' => 'file_io.h',
'Line' => '147',
'Param' => {
'0' => {
'name' => 'resp',
- 'type' => '258089'
+ 'type' => '357329'
}
},
'Reg' => {
@@ -9459,7 +9401,7 @@
'Return' => '126',
'ShortName' => 'pldm_oem_meta_file_io_read_resp_data'
},
- '258152' => {
+ '357392' => {
'Header' => 'file_io.h',
'Line' => '137',
'Param' => {
@@ -9473,13 +9415,13 @@
},
'2' => {
'name' => 'req',
- 'type' => '259218'
+ 'type' => '359587'
}
},
'Return' => '100',
'ShortName' => 'decode_oem_meta_file_io_read_req'
},
- '259223' => {
+ '359592' => {
'Header' => 'file_io.h',
'Line' => '126',
'Param' => {
@@ -9514,7 +9456,7 @@
'Return' => '100',
'ShortName' => 'decode_oem_meta_file_io_req'
},
- '259659' => {
+ '360028' => {
'Header' => 'file_io.h',
'Line' => '113',
'Param' => {
@@ -9528,7 +9470,7 @@
},
'2' => {
'name' => 'req',
- 'type' => '259654'
+ 'type' => '360023'
},
'3' => {
'name' => 'req_length',
@@ -9538,13 +9480,13 @@
'Return' => '100',
'ShortName' => 'decode_oem_meta_file_io_write_req'
},
- '260624' => {
+ '361712' => {
'Header' => 'file_io.h',
'Line' => '102',
'Param' => {
'0' => {
'name' => 'req',
- 'type' => '259654'
+ 'type' => '360023'
}
},
'Reg' => {
@@ -11013,26 +10955,26 @@
'Size' => '8',
'Type' => 'Const'
},
- '37302' => {
+ '37300' => {
'BaseType' => '15038',
'Name' => 'struct variable_field const',
'Size' => '16',
'Type' => 'Const'
},
- '38592' => {
+ '38590' => {
'BaseType' => '135',
'Name' => 'uint8_t[8]',
'Size' => '8',
'Type' => 'Array'
},
- '38608' => {
+ '38606' => {
'Header' => 'firmware_update.h',
'Line' => '441',
'Memb' => {
'0' => {
'name' => 'uuid',
'offset' => '0',
- 'type' => '38712'
+ 'type' => '38710'
},
'1' => {
'name' => 'package_header_format_version',
@@ -11047,7 +10989,7 @@
'3' => {
'name' => 'package_release_date_time',
'offset' => '25',
- 'type' => '38728'
+ 'type' => '38726'
},
'4' => {
'name' => 'component_bitmap_bit_length',
@@ -11069,19 +11011,19 @@
'Size' => '36',
'Type' => 'Struct'
},
- '38712' => {
+ '38710' => {
'BaseType' => '135',
'Name' => 'uint8_t[16]',
'Size' => '16',
'Type' => 'Array'
},
- '38728' => {
+ '38726' => {
'BaseType' => '135',
'Name' => 'uint8_t[13]',
'Size' => '13',
'Type' => 'Array'
},
- '38744' => {
+ '38742' => {
'Header' => 'firmware_update.h',
'Line' => '455',
'Memb' => {
@@ -11120,7 +11062,7 @@
'Size' => '11',
'Type' => 'Struct'
},
- '38939' => {
+ '38937' => {
'Header' => 'firmware_update.h',
'Line' => '489',
'Memb' => {
@@ -11174,7 +11116,7 @@
'Size' => '22',
'Type' => 'Struct'
},
- '39121' => {
+ '39119' => {
'Header' => 'firmware_update.h',
'Line' => '515',
'Memb' => {
@@ -11218,7 +11160,7 @@
'Size' => '11',
'Type' => 'Struct'
},
- '39308' => {
+ '39306' => {
'Header' => 'firmware_update.h',
'Line' => '543',
'Memb' => {
@@ -11252,7 +11194,7 @@
'Size' => '12',
'Type' => 'Struct'
},
- '39386' => {
+ '39384' => {
'Header' => 'firmware_update.h',
'Line' => '555',
'Memb' => {
@@ -11289,7 +11231,7 @@
'6' => {
'name' => 'active_comp_release_date',
'offset' => '17',
- 'type' => '38592'
+ 'type' => '38590'
},
'7' => {
'name' => 'pending_comp_comparison_stamp',
@@ -11309,7 +11251,7 @@
'10' => {
'name' => 'pending_comp_release_date',
'offset' => '37',
- 'type' => '38592'
+ 'type' => '38590'
},
'11' => {
'name' => 'comp_activation_methods',
@@ -11326,7 +11268,7 @@
'Size' => '39',
'Type' => 'Struct'
},
- '39677' => {
+ '39675' => {
'Header' => 'firmware_update.h',
'Line' => '594',
'Memb' => {
@@ -11345,13 +11287,13 @@
'Size' => '8',
'Type' => 'Struct'
},
- '39716' => {
- 'BaseType' => '39677',
+ '39714' => {
+ 'BaseType' => '39675',
'Name' => 'struct pldm_query_downstream_identifiers_req const',
'Size' => '8',
'Type' => 'Const'
},
- '39721' => {
+ '39719' => {
'Header' => 'firmware_update.h',
'Line' => '608',
'Memb' => {
@@ -11385,7 +11327,7 @@
'Size' => '20',
'Type' => 'Struct'
},
- '39799' => {
+ '39797' => {
'Header' => 'firmware_update.h',
'Line' => '621',
'Memb' => {
@@ -11404,7 +11346,7 @@
'Size' => '4',
'Type' => 'Struct'
},
- '39838' => {
+ '39836' => {
'Header' => 'firmware_update.h',
'Line' => '627',
'Memb' => {
@@ -11423,7 +11365,7 @@
'Size' => '24',
'Type' => 'Struct'
},
- '39877' => {
+ '39875' => {
'Header' => 'firmware_update.h',
'Line' => '701',
'Memb' => {
@@ -11447,7 +11389,7 @@
'Size' => '16',
'Type' => 'Struct'
},
- '39945' => {
+ '39943' => {
'Header' => 'firmware_update.h',
'Line' => '707',
'Memb' => {
@@ -11466,7 +11408,7 @@
'Size' => '16',
'Type' => 'Struct'
},
- '39989' => {
+ '39987' => {
'Header' => 'firmware_update.h',
'Line' => '800',
'Memb' => {
@@ -11485,13 +11427,13 @@
'Size' => '8',
'Type' => 'Struct'
},
- '40028' => {
- 'BaseType' => '39989',
+ '40026' => {
+ 'BaseType' => '39987',
'Name' => 'struct pldm_get_downstream_firmware_parameters_req const',
'Size' => '8',
'Type' => 'Const'
},
- '40033' => {
+ '40031' => {
'Header' => 'firmware_update.h',
'Line' => '815',
'Memb' => {
@@ -11525,7 +11467,7 @@
'Size' => '20',
'Type' => 'Struct'
},
- '40111' => {
+ '40109' => {
'Header' => 'firmware_update.h',
'Line' => '833',
'Memb' => {
@@ -11552,7 +11494,7 @@
'4' => {
'name' => 'active_comp_release_date',
'offset' => '16',
- 'type' => '40293'
+ 'type' => '40291'
},
'5' => {
'name' => 'pending_comp_comparison_stamp',
@@ -11572,7 +11514,7 @@
'8' => {
'name' => 'pending_comp_release_date',
'offset' => '38',
- 'type' => '40293'
+ 'type' => '40291'
},
'9' => {
'name' => 'comp_activation_methods',
@@ -11599,13 +11541,13 @@
'Size' => '64',
'Type' => 'Struct'
},
- '40293' => {
+ '40291' => {
'BaseType' => '128',
'Name' => 'char[9]',
'Size' => '9',
'Type' => 'Array'
},
- '41428' => {
+ '41426' => {
'Header' => 'firmware_update.h',
'Line' => '1347',
'Memb' => {
@@ -11624,146 +11566,146 @@
'Size' => '24',
'Type' => 'Struct'
},
- '42723' => {
+ '43333' => {
'BaseType' => '34885',
'Name' => 'bool8_t*',
'Size' => '8',
'Type' => 'Pointer'
},
- '42728' => {
+ '43338' => {
'BaseType' => '36609',
'Name' => 'bitfield64_t*',
'Size' => '8',
'Type' => 'Pointer'
},
- '44972' => {
+ '46774' => {
'BaseType' => '35661',
'Name' => 'bitfield32_t*',
'Size' => '8',
'Type' => 'Pointer'
},
- '47633' => {
+ '50852' => {
'BaseType' => '35161',
'Name' => 'bitfield16_t*',
'Size' => '8',
'Type' => 'Pointer'
},
- '54224' => {
- 'BaseType' => '37302',
+ '61195' => {
+ 'BaseType' => '37300',
'Name' => 'struct variable_field const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '63257' => {
- 'BaseType' => '41428',
+ '76477' => {
+ 'BaseType' => '41426',
'Name' => 'struct pldm_downstream_device_parameters_iter*',
'Size' => '8',
'Type' => 'Pointer'
},
- '63262' => {
- 'BaseType' => '40111',
+ '76482' => {
+ 'BaseType' => '40109',
'Name' => 'struct pldm_downstream_device_parameters_entry*',
'Size' => '8',
'Type' => 'Pointer'
},
- '64622' => {
- 'BaseType' => '40033',
+ '79166' => {
+ 'BaseType' => '40031',
'Name' => 'struct pldm_get_downstream_firmware_parameters_resp*',
'Size' => '8',
'Type' => 'Pointer'
},
- '65310' => {
- 'BaseType' => '40028',
+ '80298' => {
+ 'BaseType' => '40026',
'Name' => 'struct pldm_get_downstream_firmware_parameters_req const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '66066' => {
- 'BaseType' => '39838',
+ '81478' => {
+ 'BaseType' => '39836',
'Name' => 'struct pldm_downstream_device_iter*',
'Size' => '8',
'Type' => 'Pointer'
},
- '66071' => {
- 'BaseType' => '39799',
+ '81483' => {
+ 'BaseType' => '39797',
'Name' => 'struct pldm_downstream_device*',
'Size' => '8',
'Type' => 'Pointer'
},
- '67444' => {
- 'BaseType' => '39721',
+ '84181' => {
+ 'BaseType' => '39719',
'Name' => 'struct pldm_query_downstream_identifiers_resp*',
'Size' => '8',
'Type' => 'Pointer'
},
- '68132' => {
- 'BaseType' => '39716',
+ '85313' => {
+ 'BaseType' => '39714',
'Name' => 'struct pldm_query_downstream_identifiers_req const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '69436' => {
- 'BaseType' => '39308',
+ '87914' => {
+ 'BaseType' => '39306',
'Name' => 'struct pldm_query_downstream_devices_resp*',
'Size' => '8',
'Type' => 'Pointer'
},
- '69883' => {
- 'BaseType' => '39386',
+ '88361' => {
+ 'BaseType' => '39384',
'Name' => 'struct pldm_component_parameter_entry*',
'Size' => '8',
'Type' => 'Pointer'
},
- '74903' => {
- 'BaseType' => '39121',
+ '97019' => {
+ 'BaseType' => '39119',
'Name' => 'struct pldm_get_firmware_parameters_resp*',
'Size' => '8',
'Type' => 'Pointer'
},
- '76759' => {
+ '99991' => {
'BaseType' => '1186',
'Name' => 'uint8_t**',
'Size' => '8',
'Type' => 'Pointer'
},
- '77101' => {
- 'BaseType' => '38939',
+ '100333' => {
+ 'BaseType' => '38937',
'Name' => 'struct pldm_component_image_information*',
'Size' => '8',
'Type' => 'Pointer'
},
- '78952' => {
- 'BaseType' => '39945',
+ '102825' => {
+ 'BaseType' => '39943',
'Name' => 'struct pldm_descriptor_iter*',
'Size' => '8',
'Type' => 'Pointer'
},
- '78957' => {
- 'BaseType' => '39877',
+ '102830' => {
+ 'BaseType' => '39875',
'Name' => 'struct pldm_descriptor*',
'Size' => '8',
'Type' => 'Pointer'
},
- '79242' => {
- 'BaseType' => '38744',
+ '103115' => {
+ 'BaseType' => '38742',
'Name' => 'struct pldm_firmware_device_id_record*',
'Size' => '8',
'Type' => 'Pointer'
},
- '79697' => {
- 'BaseType' => '38608',
+ '103570' => {
+ 'BaseType' => '38606',
'Name' => 'struct pldm_package_header_information*',
'Size' => '8',
'Type' => 'Pointer'
},
- '80830' => {
+ '104722' => {
'BaseType' => '126',
'Name' => 'void**',
'Size' => '8',
'Type' => 'Pointer'
},
- '88331' => {
- 'BaseType' => '88348',
+ '112649' => {
+ 'BaseType' => '112666',
'Header' => 'pdr.h',
'Line' => '16',
'Name' => 'pldm_pdr',
@@ -11771,13 +11713,13 @@
'Size' => '24',
'Type' => 'Typedef'
},
- '88343' => {
- 'BaseType' => '88331',
+ '112661' => {
+ 'BaseType' => '112649',
'Name' => 'pldm_pdr const',
'Size' => '24',
'Type' => 'Const'
},
- '88348' => {
+ '112666' => {
'Line' => '30',
'Memb' => {
'0' => {
@@ -11793,12 +11735,12 @@
'2' => {
'name' => 'first',
'offset' => '8',
- 'type' => '89447'
+ 'type' => '113765'
},
'3' => {
'name' => 'last',
'offset' => '22',
- 'type' => '89447'
+ 'type' => '113765'
}
},
'Name' => 'struct pldm_pdr',
@@ -11807,8 +11749,8 @@
'Source' => 'pdr.c',
'Type' => 'Struct'
},
- '88414' => {
- 'BaseType' => '88431',
+ '112732' => {
+ 'BaseType' => '112749',
'Header' => 'pdr.h',
'Line' => '21',
'Name' => 'pldm_pdr_record',
@@ -11816,13 +11758,13 @@
'Size' => '32',
'Type' => 'Typedef'
},
- '88426' => {
- 'BaseType' => '88414',
+ '112744' => {
+ 'BaseType' => '112732',
'Name' => 'pldm_pdr_record const',
'Size' => '32',
'Type' => 'Const'
},
- '88431' => {
+ '112749' => {
'Line' => '21',
'Memb' => {
'0' => {
@@ -11843,7 +11785,7 @@
'3' => {
'name' => 'next',
'offset' => '22',
- 'type' => '89435'
+ 'type' => '113753'
},
'4' => {
'name' => 'is_remote',
@@ -11862,7 +11804,7 @@
'Source' => 'pdr.c',
'Type' => 'Struct'
},
- '88523' => {
+ '112841' => {
'Header' => 'pdr.h',
'Line' => '288',
'Memb' => {
@@ -11886,16 +11828,16 @@
'Size' => '6',
'Type' => 'Struct'
},
- '88585' => {
- 'BaseType' => '88523',
+ '112903' => {
+ 'BaseType' => '112841',
'Header' => 'pdr.h',
'Line' => '292',
'Name' => 'pldm_entity',
'Size' => '6',
'Type' => 'Typedef'
},
- '88629' => {
- 'BaseType' => '88641',
+ '112947' => {
+ 'BaseType' => '112959',
'Header' => 'pdr.h',
'Line' => '302',
'Name' => 'pldm_entity_association_tree',
@@ -11903,13 +11845,13 @@
'Size' => '16',
'Type' => 'Typedef'
},
- '88641' => {
+ '112959' => {
'Line' => '459',
'Memb' => {
'0' => {
'name' => 'root',
'offset' => '0',
- 'type' => '89452'
+ 'type' => '113770'
},
'1' => {
'name' => 'last_used_container_id',
@@ -11923,8 +11865,8 @@
'Source' => 'pdr.c',
'Type' => 'Struct'
},
- '88684' => {
- 'BaseType' => '88701',
+ '113002' => {
+ 'BaseType' => '113019',
'Header' => 'pdr.h',
'Line' => '307',
'Name' => 'pldm_entity_node',
@@ -11932,24 +11874,24 @@
'Size' => '40',
'Type' => 'Typedef'
},
- '88696' => {
- 'BaseType' => '88684',
+ '113014' => {
+ 'BaseType' => '113002',
'Name' => 'pldm_entity_node const',
'Size' => '40',
'Type' => 'Const'
},
- '88701' => {
+ '113019' => {
'Line' => '464',
'Memb' => {
'0' => {
'name' => 'entity',
'offset' => '0',
- 'type' => '88585'
+ 'type' => '112903'
},
'1' => {
'name' => 'parent',
'offset' => '6',
- 'type' => '88585'
+ 'type' => '112903'
},
'2' => {
'name' => 'remote_container_id',
@@ -11959,12 +11901,12 @@
'3' => {
'name' => 'first_child',
'offset' => '22',
- 'type' => '89452'
+ 'type' => '113770'
},
'4' => {
'name' => 'next_sibling',
'offset' => '36',
- 'type' => '89452'
+ 'type' => '113770'
},
'5' => {
'name' => 'association_type',
@@ -11978,7 +11920,7 @@
'Source' => 'pdr.c',
'Type' => 'Struct'
},
- '88975' => {
+ '113293' => {
'Header' => 'platform.h',
'Line' => '551',
'Memb' => {
@@ -12012,73 +11954,73 @@
'Size' => '10',
'Type' => 'Struct'
},
- '89435' => {
- 'BaseType' => '88431',
+ '113753' => {
+ 'BaseType' => '112749',
'Name' => 'struct pldm_pdr_record*',
'Size' => '8',
'Type' => 'Pointer'
},
- '89447' => {
- 'BaseType' => '88414',
+ '113765' => {
+ 'BaseType' => '112732',
'Name' => 'pldm_pdr_record*',
'Size' => '8',
'Type' => 'Pointer'
},
- '89452' => {
- 'BaseType' => '88684',
+ '113770' => {
+ 'BaseType' => '113002',
'Name' => 'pldm_entity_node*',
'Size' => '8',
'Type' => 'Pointer'
},
- '90321' => {
- 'BaseType' => '88331',
+ '115009' => {
+ 'BaseType' => '112649',
'Name' => 'pldm_pdr*',
'Size' => '8',
'Type' => 'Pointer'
},
- '91271' => {
- 'BaseType' => '88426',
+ '116320' => {
+ 'BaseType' => '112744',
'Name' => 'pldm_pdr_record const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '95475' => {
- 'BaseType' => '88585',
+ '123554' => {
+ 'BaseType' => '112903',
'Name' => 'pldm_entity*',
'Size' => '8',
'Type' => 'Pointer'
},
- '104810' => {
- 'BaseType' => '95475',
+ '139681' => {
+ 'BaseType' => '123554',
'Name' => 'pldm_entity**',
'Size' => '8',
'Type' => 'Pointer'
},
- '104874' => {
- 'BaseType' => '88629',
+ '139745' => {
+ 'BaseType' => '112947',
'Name' => 'pldm_entity_association_tree*',
'Size' => '8',
'Type' => 'Pointer'
},
- '105462' => {
- 'BaseType' => '89452',
+ '140333' => {
+ 'BaseType' => '113770',
'Name' => 'pldm_entity_node**',
'Size' => '8',
'Type' => 'Pointer'
},
- '106251' => {
- 'BaseType' => '88343',
+ '141122' => {
+ 'BaseType' => '112661',
'Name' => 'pldm_pdr const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '111489' => {
- 'BaseType' => '88696',
+ '146360' => {
+ 'BaseType' => '113014',
'Name' => 'pldm_entity_node const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '116286' => {
+ '151475' => {
'BaseType' => '74',
'Header' => 'types.h',
'Line' => '37',
@@ -12087,7 +12029,7 @@
'Size' => '1',
'Type' => 'Typedef'
},
- '116317' => {
+ '151506' => {
'BaseType' => '93',
'Header' => 'types.h',
'Line' => '39',
@@ -12096,7 +12038,7 @@
'Size' => '2',
'Type' => 'Typedef'
},
- '116348' => {
+ '151537' => {
'BaseType' => '100',
'Header' => 'types.h',
'Line' => '41',
@@ -12105,7 +12047,7 @@
'Size' => '4',
'Type' => 'Typedef'
},
- '116386' => {
+ '151575' => {
'BaseType' => '5581',
'Header' => 'types.h',
'Line' => '55',
@@ -12114,8 +12056,8 @@
'Size' => '2',
'Type' => 'Typedef'
},
- '116439' => {
- 'BaseType' => '116286',
+ '151628' => {
+ 'BaseType' => '151475',
'Header' => 'stdint-intn.h',
'Line' => '24',
'Name' => 'int8_t',
@@ -12123,8 +12065,8 @@
'Size' => '1',
'Type' => 'Typedef'
},
- '116451' => {
- 'BaseType' => '116317',
+ '151640' => {
+ 'BaseType' => '151506',
'Header' => 'stdint-intn.h',
'Line' => '25',
'Name' => 'int16_t',
@@ -12132,8 +12074,8 @@
'Size' => '2',
'Type' => 'Typedef'
},
- '116463' => {
- 'BaseType' => '116348',
+ '151652' => {
+ 'BaseType' => '151537',
'Header' => 'stdint-intn.h',
'Line' => '26',
'Name' => 'int32_t',
@@ -12141,7 +12083,7 @@
'Size' => '4',
'Type' => 'Typedef'
},
- '116728' => {
+ '151917' => {
'BaseType' => '444',
'Header' => 'pldm_types.h',
'Line' => '164',
@@ -12149,8 +12091,8 @@
'Size' => '4',
'Type' => 'Typedef'
},
- '117385' => {
- 'BaseType' => '116386',
+ '152574' => {
+ 'BaseType' => '151575',
'Header' => 'uchar.h',
'Line' => '51',
'Name' => 'char16_t',
@@ -12158,7 +12100,7 @@
'Size' => '2',
'Type' => 'Typedef'
},
- '118211' => {
+ '153400' => {
'Header' => 'platform.h',
'Line' => '329',
'Memb' => {
@@ -12179,20 +12121,20 @@
'Size' => '4',
'Type' => 'Enum'
},
- '118245' => {
- 'BaseType' => '118211',
+ '153434' => {
+ 'BaseType' => '153400',
'Name' => 'enum sensor_event_class_states const',
'Size' => '4',
'Type' => 'Const'
},
- '118553' => {
+ '153742' => {
'Header' => 'platform.h',
'Line' => '626',
'Memb' => {
'0' => {
'name' => 'hdr',
'offset' => '0',
- 'type' => '88975'
+ 'type' => '113293'
},
'1' => {
'name' => 'terminus_handle',
@@ -12244,7 +12186,7 @@
'Size' => '24',
'Type' => 'Struct'
},
- '118707' => {
+ '153896' => {
'Header' => 'platform.h',
'Line' => '643',
'Memb' => {
@@ -12261,33 +12203,33 @@
'2' => {
'name' => 'states',
'offset' => '3',
- 'type' => '118769'
+ 'type' => '153958'
}
},
'Name' => 'struct state_sensor_possible_states',
'Size' => '4',
'Type' => 'Struct'
},
- '118764' => {
- 'BaseType' => '118707',
+ '153953' => {
+ 'BaseType' => '153896',
'Name' => 'struct state_sensor_possible_states const',
'Size' => '4',
'Type' => 'Const'
},
- '118769' => {
+ '153958' => {
'BaseType' => '344',
'Name' => 'bitfield8_t[1]',
'Size' => '1',
'Type' => 'Array'
},
- '118785' => {
+ '153974' => {
'Header' => 'platform.h',
'Line' => '653',
'Memb' => {
'0' => {
'name' => 'hdr',
'offset' => '0',
- 'type' => '88975'
+ 'type' => '113293'
},
'1' => {
'name' => 'terminus_handle',
@@ -12344,7 +12286,7 @@
'Size' => '26',
'Type' => 'Struct'
},
- '119138' => {
+ '154327' => {
'Header' => 'platform.h',
'Line' => '744',
'Memb' => {
@@ -12356,7 +12298,7 @@
'1' => {
'name' => 'value_s8',
'offset' => '0',
- 'type' => '116439'
+ 'type' => '151628'
},
'2' => {
'name' => 'value_u16',
@@ -12366,7 +12308,7 @@
'3' => {
'name' => 'value_s16',
'offset' => '0',
- 'type' => '116451'
+ 'type' => '151640'
},
'4' => {
'name' => 'value_u32',
@@ -12376,19 +12318,19 @@
'5' => {
'name' => 'value_s32',
'offset' => '0',
- 'type' => '116463'
+ 'type' => '151652'
},
'6' => {
'name' => 'value_f32',
'offset' => '0',
- 'type' => '116728'
+ 'type' => '151917'
}
},
'Name' => 'union union_range_field_format',
'Size' => '4',
'Type' => 'Union'
},
- '119735' => {
+ '154924' => {
'Header' => 'platform.h',
'Line' => '801',
'Memb' => {
@@ -12400,7 +12342,7 @@
'1' => {
'name' => 'value_s8',
'offset' => '0',
- 'type' => '116439'
+ 'type' => '151628'
},
'2' => {
'name' => 'value_u16',
@@ -12410,7 +12352,7 @@
'3' => {
'name' => 'value_s16',
'offset' => '0',
- 'type' => '116451'
+ 'type' => '151640'
},
'4' => {
'name' => 'value_u32',
@@ -12420,14 +12362,14 @@
'5' => {
'name' => 'value_s32',
'offset' => '0',
- 'type' => '116463'
+ 'type' => '151652'
}
},
'Name' => 'union union_sensor_data_size',
'Size' => '4',
'Type' => 'Union'
},
- '119748' => {
+ '154937' => {
'Header' => 'platform.h',
'Line' => '808',
'Memb' => {
@@ -12461,7 +12403,7 @@
'Size' => '12',
'Type' => 'Struct'
},
- '119833' => {
+ '155022' => {
'Header' => 'platform.h',
'Line' => '826',
'Memb' => {
@@ -12480,14 +12422,14 @@
'Size' => '2',
'Type' => 'Union'
},
- '119868' => {
+ '155057' => {
'Header' => 'platform.h',
'Line' => '821',
'Memb' => {
'0' => {
'name' => 'hdr',
'offset' => '0',
- 'type' => '119748'
+ 'type' => '154937'
},
'1' => {
'name' => 'terminus_handle',
@@ -12507,7 +12449,7 @@
'4' => {
'name' => 'unnamed0',
'offset' => '24',
- 'type' => '119833'
+ 'type' => '155022'
},
'5' => {
'name' => 'container_id',
@@ -12532,7 +12474,7 @@
'9' => {
'name' => 'unit_modifier',
'offset' => '37',
- 'type' => '116439'
+ 'type' => '151628'
},
'10' => {
'name' => 'rate_unit',
@@ -12552,7 +12494,7 @@
'13' => {
'name' => 'aux_unit_modifier',
'offset' => '41',
- 'type' => '116439'
+ 'type' => '151628'
},
'14' => {
'name' => 'aux_rate_unit',
@@ -12582,12 +12524,12 @@
'19' => {
'name' => 'resolution',
'offset' => '54',
- 'type' => '116728'
+ 'type' => '151917'
},
'20' => {
'name' => 'offset',
'offset' => '64',
- 'type' => '116728'
+ 'type' => '151917'
},
'21' => {
'name' => 'accuracy',
@@ -12607,7 +12549,7 @@
'24' => {
'name' => 'hysteresis',
'offset' => '72',
- 'type' => '119735'
+ 'type' => '154924'
},
'25' => {
'name' => 'supported_thresholds',
@@ -12622,22 +12564,22 @@
'27' => {
'name' => 'state_transition_interval',
'offset' => '86',
- 'type' => '116728'
+ 'type' => '151917'
},
'28' => {
'name' => 'update_interval',
'offset' => '96',
- 'type' => '116728'
+ 'type' => '151917'
},
'29' => {
'name' => 'max_readable',
'offset' => '100',
- 'type' => '119735'
+ 'type' => '154924'
},
'30' => {
'name' => 'min_readable',
'offset' => '104',
- 'type' => '119735'
+ 'type' => '154924'
},
'31' => {
'name' => 'range_field_format',
@@ -12652,62 +12594,62 @@
'33' => {
'name' => 'nominal_value',
'offset' => '118',
- 'type' => '119138'
+ 'type' => '154327'
},
'34' => {
'name' => 'normal_max',
'offset' => '128',
- 'type' => '119138'
+ 'type' => '154327'
},
'35' => {
'name' => 'normal_min',
'offset' => '132',
- 'type' => '119138'
+ 'type' => '154327'
},
'36' => {
'name' => 'warning_high',
'offset' => '136',
- 'type' => '119138'
+ 'type' => '154327'
},
'37' => {
'name' => 'warning_low',
'offset' => '146',
- 'type' => '119138'
+ 'type' => '154327'
},
'38' => {
'name' => 'critical_high',
'offset' => '150',
- 'type' => '119138'
+ 'type' => '154327'
},
'39' => {
'name' => 'critical_low',
'offset' => '256',
- 'type' => '119138'
+ 'type' => '154327'
},
'40' => {
'name' => 'fatal_high',
'offset' => '260',
- 'type' => '119138'
+ 'type' => '154327'
},
'41' => {
'name' => 'fatal_low',
'offset' => '264',
- 'type' => '119138'
+ 'type' => '154327'
}
},
'Name' => 'struct pldm_numeric_sensor_value_pdr',
'Size' => '112',
'Type' => 'Struct'
},
- '120461' => {
- 'BaseType' => '117385',
+ '155650' => {
+ 'BaseType' => '152574',
'Header' => 'platform.h',
'Line' => '869',
'Name' => 'pldm_utf16be',
'Size' => '2',
'Type' => 'Typedef'
},
- '120474' => {
+ '155663' => {
'Header' => 'platform.h',
'Line' => '871',
'Memb' => {
@@ -12719,32 +12661,32 @@
'1' => {
'name' => 'name',
'offset' => '8',
- 'type' => '120516'
+ 'type' => '155705'
}
},
'Name' => 'struct pldm_entity_auxiliary_name',
'Size' => '16',
'Type' => 'Struct'
},
- '120516' => {
- 'BaseType' => '120461',
+ '155705' => {
+ 'BaseType' => '155650',
'Name' => 'pldm_utf16be*',
'Size' => '8',
'Type' => 'Pointer'
},
- '120521' => {
+ '155710' => {
'Header' => 'platform.h',
'Line' => '881',
'Memb' => {
'0' => {
'name' => 'hdr',
'offset' => '0',
- 'type' => '119748'
+ 'type' => '154937'
},
'1' => {
'name' => 'container',
'offset' => '18',
- 'type' => '88585'
+ 'type' => '112903'
},
'2' => {
'name' => 'shared_name_count',
@@ -12759,7 +12701,7 @@
'4' => {
'name' => 'names',
'offset' => '36',
- 'type' => '120635'
+ 'type' => '155824'
},
'5' => {
'name' => 'auxiliary_name_data_size',
@@ -12769,26 +12711,26 @@
'6' => {
'name' => 'auxiliary_name_data',
'offset' => '64',
- 'type' => '120640'
+ 'type' => '155829'
}
},
'Name' => 'struct pldm_entity_auxiliary_names_pdr',
'Size' => '40',
'Type' => 'Struct'
},
- '120635' => {
- 'BaseType' => '120474',
+ '155824' => {
+ 'BaseType' => '155663',
'Name' => 'struct pldm_entity_auxiliary_name*',
'Size' => '8',
'Type' => 'Pointer'
},
- '120640' => {
+ '155829' => {
'BaseType' => '128',
'Name' => 'char[]',
'Size' => '8',
'Type' => 'Array'
},
- '120655' => {
+ '155844' => {
'Header' => 'platform.h',
'Line' => '911',
'Memb' => {
@@ -12805,20 +12747,20 @@
'2' => {
'name' => 'states',
'offset' => '3',
- 'type' => '118769'
+ 'type' => '153958'
}
},
'Name' => 'struct state_effecter_possible_states',
'Size' => '4',
'Type' => 'Struct'
},
- '120712' => {
- 'BaseType' => '120655',
+ '155901' => {
+ 'BaseType' => '155844',
'Name' => 'struct state_effecter_possible_states const',
'Size' => '4',
'Type' => 'Const'
},
- '120717' => {
+ '155906' => {
'Header' => 'platform.h',
'Line' => '959',
'Memb' => {
@@ -12837,15 +12779,15 @@
'Size' => '2',
'Type' => 'Struct'
},
- '120760' => {
- 'BaseType' => '120717',
+ '155949' => {
+ 'BaseType' => '155906',
'Header' => 'platform.h',
'Line' => '962',
'Name' => 'set_effecter_state_field',
'Size' => '2',
'Type' => 'Typedef'
},
- '120773' => {
+ '155962' => {
'Header' => 'platform.h',
'Line' => '968',
'Memb' => {
@@ -12874,15 +12816,15 @@
'Size' => '4',
'Type' => 'Struct'
},
- '120844' => {
- 'BaseType' => '120773',
+ '156033' => {
+ 'BaseType' => '155962',
'Header' => 'platform.h',
'Line' => '976',
'Name' => 'get_sensor_state_field',
'Size' => '4',
'Type' => 'Typedef'
},
- '120857' => {
+ '156046' => {
'Header' => 'platform.h',
'Line' => '982',
'Memb' => {
@@ -12906,15 +12848,15 @@
'Size' => '3',
'Type' => 'Struct'
},
- '120914' => {
- 'BaseType' => '120857',
+ '156103' => {
+ 'BaseType' => '156046',
'Header' => 'platform.h',
'Line' => '986',
'Name' => 'get_effecter_state_field',
'Size' => '3',
'Type' => 'Typedef'
},
- '121643' => {
+ '156832' => {
'Header' => 'platform.h',
'Line' => '1131',
'Memb' => {
@@ -12931,20 +12873,20 @@
'2' => {
'name' => 'field',
'offset' => '2',
- 'type' => '121700'
+ 'type' => '156889'
}
},
'Name' => 'struct pldm_get_state_effecter_states_resp',
'Size' => '26',
'Type' => 'Struct'
},
- '121700' => {
- 'BaseType' => '120914',
+ '156889' => {
+ 'BaseType' => '156103',
'Name' => 'get_effecter_state_field[8]',
'Size' => '24',
'Type' => 'Array'
},
- '121716' => {
+ '156905' => {
'Header' => 'platform.h',
'Line' => '1141',
'Memb' => {
@@ -12968,7 +12910,7 @@
'Size' => '4',
'Type' => 'Struct'
},
- '121830' => {
+ '157019' => {
'Header' => 'platform.h',
'Line' => '1181',
'Memb' => {
@@ -12992,7 +12934,7 @@
'Size' => '8',
'Type' => 'Struct'
},
- '121892' => {
+ '157081' => {
'Header' => 'platform.h',
'Line' => '1191',
'Memb' => {
@@ -13014,20 +12956,20 @@
'3' => {
'name' => 'event_data',
'offset' => '4',
- 'type' => '121963'
+ 'type' => '157152'
}
},
'Name' => 'struct pldm_platform_cper_event',
'Size' => '4',
'Type' => 'Struct'
},
- '121963' => {
+ '157152' => {
'BaseType' => '135',
'Name' => 'uint8_t[]',
'Size' => '8',
'Type' => 'Array'
},
- '122119' => {
+ '157308' => {
'Header' => 'platform.h',
'Line' => '1251',
'Memb' => {
@@ -13051,139 +12993,139 @@
'Size' => '3',
'Type' => 'Struct'
},
- '122743' => {
- 'BaseType' => '121892',
+ '157932' => {
+ 'BaseType' => '157081',
'Name' => 'struct pldm_platform_cper_event*',
'Size' => '8',
'Type' => 'Pointer'
},
- '124496' => {
- 'BaseType' => '120521',
+ '161402' => {
+ 'BaseType' => '155710',
'Name' => 'struct pldm_entity_auxiliary_names_pdr*',
'Size' => '8',
'Type' => 'Pointer'
},
- '129747' => {
- 'BaseType' => '121643',
+ '170922' => {
+ 'BaseType' => '156832',
'Name' => 'struct pldm_get_state_effecter_states_resp*',
'Size' => '8',
'Type' => 'Pointer'
},
- '157965' => {
+ '217074' => {
'BaseType' => '2697',
'Name' => 'size_t*const',
'Size' => '8',
'Type' => 'Const'
},
- '159677' => {
- 'BaseType' => '121830',
+ '220033' => {
+ 'BaseType' => '157019',
'Name' => 'struct pldm_message_poll_event*',
'Size' => '8',
'Type' => 'Pointer'
},
- '160671' => {
- 'BaseType' => '160681',
+ '221465' => {
+ 'BaseType' => '221475',
'Name' => 'uint32_t const*const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '160676' => {
+ '221470' => {
'BaseType' => '159',
'Name' => 'uint32_t const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '160681' => {
- 'BaseType' => '160676',
+ '221475' => {
+ 'BaseType' => '221470',
'Name' => 'uint32_t const*const',
'Size' => '8',
'Type' => 'Const'
},
- '160686' => {
- 'BaseType' => '122119',
+ '221480' => {
+ 'BaseType' => '157308',
'Name' => 'struct pldm_pdr_repository_chg_event_data*',
'Size' => '8',
'Type' => 'Pointer'
},
- '188116' => {
- 'BaseType' => '119868',
+ '265181' => {
+ 'BaseType' => '155057',
'Name' => 'struct pldm_numeric_sensor_value_pdr*',
'Size' => '8',
'Type' => 'Pointer'
},
- '200499' => {
- 'BaseType' => '121716',
+ '287299' => {
+ 'BaseType' => '156905',
'Name' => 'struct pldm_sensor_event_data*',
'Size' => '8',
'Type' => 'Pointer'
},
- '200504' => {
- 'BaseType' => '200499',
+ '287304' => {
+ 'BaseType' => '287299',
'Name' => 'struct pldm_sensor_event_data*const',
'Size' => '8',
'Type' => 'Const'
},
- '202654' => {
- 'BaseType' => '120844',
+ '291279' => {
+ 'BaseType' => '156033',
'Name' => 'get_sensor_state_field*',
'Size' => '8',
'Type' => 'Pointer'
},
- '217372' => {
- 'BaseType' => '120760',
+ '314579' => {
+ 'BaseType' => '155949',
'Name' => 'set_effecter_state_field*',
'Size' => '8',
'Type' => 'Pointer'
},
- '218348' => {
- 'BaseType' => '118553',
+ '315555' => {
+ 'BaseType' => '153742',
'Name' => 'struct pldm_state_sensor_pdr*',
'Size' => '8',
'Type' => 'Pointer'
},
- '218353' => {
- 'BaseType' => '218348',
+ '315560' => {
+ 'BaseType' => '315555',
'Name' => 'struct pldm_state_sensor_pdr*const',
'Size' => '8',
'Type' => 'Const'
},
- '218358' => {
- 'BaseType' => '118764',
+ '315565' => {
+ 'BaseType' => '153953',
'Name' => 'struct state_sensor_possible_states const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '218363' => {
- 'BaseType' => '218358',
+ '315570' => {
+ 'BaseType' => '315565',
'Name' => 'struct state_sensor_possible_states const*const',
'Size' => '8',
'Type' => 'Const'
},
- '218758' => {
- 'BaseType' => '118785',
+ '315965' => {
+ 'BaseType' => '153974',
'Name' => 'struct pldm_state_effecter_pdr*',
'Size' => '8',
'Type' => 'Pointer'
},
- '218763' => {
- 'BaseType' => '218758',
+ '315970' => {
+ 'BaseType' => '315965',
'Name' => 'struct pldm_state_effecter_pdr*const',
'Size' => '8',
'Type' => 'Const'
},
- '218768' => {
- 'BaseType' => '120712',
+ '315975' => {
+ 'BaseType' => '155901',
'Name' => 'struct state_effecter_possible_states const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '218773' => {
- 'BaseType' => '218768',
+ '315980' => {
+ 'BaseType' => '315975',
'Name' => 'struct state_effecter_possible_states const*const',
'Size' => '8',
'Type' => 'Const'
},
- '221629' => {
+ '319399' => {
'Line' => '19',
'Memb' => {
'0' => {
@@ -13203,13 +13145,13 @@
'Source' => 'instance-id.c',
'Type' => 'Struct'
},
- '221668' => {
+ '319438' => {
'Line' => '24',
'Memb' => {
'0' => {
'name' => 'state',
'offset' => '0',
- 'type' => '221710'
+ 'type' => '319480'
},
'1' => {
'name' => 'lock_db_fd',
@@ -13223,31 +13165,31 @@
'Source' => 'instance-id.c',
'Type' => 'Struct'
},
- '221710' => {
- 'BaseType' => '221629',
+ '319480' => {
+ 'BaseType' => '319399',
'Name' => 'struct pldm_tid_state[256]',
'Size' => '2048',
'Type' => 'Array'
},
- '222266' => {
- 'BaseType' => '221668',
+ '320036' => {
+ 'BaseType' => '319438',
'Name' => 'struct pldm_instance_db*',
'Size' => '8',
'Type' => 'Pointer'
},
- '222653' => {
+ '320423' => {
'BaseType' => '4841',
'Name' => 'pldm_instance_id_t*',
'Size' => '8',
'Type' => 'Pointer'
},
- '222829' => {
- 'BaseType' => '222266',
+ '320599' => {
+ 'BaseType' => '320036',
'Name' => 'struct pldm_instance_db**',
'Size' => '8',
'Type' => 'Pointer'
},
- '223621' => {
+ '321391' => {
'BaseType' => '135',
'Header' => 'pldm.h',
'Line' => '13',
@@ -13255,7 +13197,7 @@
'Size' => '1',
'Type' => 'Typedef'
},
- '223736' => {
+ '321506' => {
'BaseType' => '4938',
'Header' => 'pldm.h',
'Line' => '30',
@@ -13263,13 +13205,13 @@
'Size' => '4',
'Type' => 'Typedef'
},
- '223754' => {
+ '321524' => {
'Line' => '26',
'Memb' => {
'0' => {
'name' => 'transport',
'offset' => '0',
- 'type' => '223827'
+ 'type' => '321597'
},
'1' => {
'name' => 'socket',
@@ -13279,12 +13221,12 @@
'2' => {
'name' => 'tid_eid_map',
'offset' => '68',
- 'type' => '227532'
+ 'type' => '325302'
},
'3' => {
'name' => 'socket_send_buf',
'offset' => '768',
- 'type' => '226445'
+ 'type' => '324215'
}
},
'Name' => 'struct pldm_transport_mctp_demux',
@@ -13293,19 +13235,19 @@
'Source' => 'mctp-demux.c',
'Type' => 'Struct'
},
- '223780' => {
- 'BaseType' => '223754',
+ '321550' => {
+ 'BaseType' => '321524',
'Name' => 'struct pldm_transport_mctp_demux*',
'Size' => '8',
'Type' => 'Pointer'
},
- '223822' => {
- 'BaseType' => '223827',
+ '321592' => {
+ 'BaseType' => '321597',
'Name' => 'struct pldm_transport*',
'Size' => '8',
'Type' => 'Pointer'
},
- '223827' => {
+ '321597' => {
'Header' => 'transport.h',
'Line' => '18',
'Memb' => {
@@ -13322,17 +13264,17 @@
'2' => {
'name' => 'recv',
'offset' => '22',
- 'type' => '226758'
+ 'type' => '324528'
},
'3' => {
'name' => 'send',
'offset' => '36',
- 'type' => '226799'
+ 'type' => '324569'
},
'4' => {
'name' => 'init_pollfd',
'offset' => '50',
- 'type' => '226880'
+ 'type' => '324650'
}
},
'Name' => 'struct pldm_transport',
@@ -13340,19 +13282,19 @@
'Size' => '40',
'Type' => 'Struct'
},
- '223963' => {
+ '321733' => {
'BaseType' => '4829',
'Name' => 'pldm_tid_t*',
'Size' => '8',
'Type' => 'Pointer'
},
- '224066' => {
- 'BaseType' => '223780',
+ '321836' => {
+ 'BaseType' => '321550',
'Name' => 'struct pldm_transport_mctp_demux**',
'Size' => '8',
'Type' => 'Pointer'
},
- '226163' => {
+ '323933' => {
'BaseType' => '46',
'Header' => 'int-ll64.h',
'Line' => '21',
@@ -13361,7 +13303,7 @@
'Size' => '1',
'Type' => 'Typedef'
},
- '226175' => {
+ '323945' => {
'BaseType' => '53',
'Header' => 'int-ll64.h',
'Line' => '24',
@@ -13370,7 +13312,7 @@
'Size' => '2',
'Type' => 'Typedef'
},
- '226445' => {
+ '324215' => {
'Header' => 'socket.h',
'Line' => '5',
'Memb' => {
@@ -13395,31 +13337,31 @@
'Size' => '12',
'Type' => 'Struct'
},
- '226758' => {
+ '324528' => {
'Name' => 'pldm_requester_rc_t(*)(struct pldm_transport*, pldm_tid_t*, void**, size_t*)',
'Param' => {
'0' => {
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
- 'type' => '223963'
+ 'type' => '321733'
},
'2' => {
- 'type' => '80830'
+ 'type' => '104722'
},
'3' => {
'type' => '2697'
}
},
- 'Return' => '223736',
+ 'Return' => '321506',
'Size' => '8',
'Type' => 'FuncPtr'
},
- '226799' => {
+ '324569' => {
'Name' => 'pldm_requester_rc_t(*)(struct pldm_transport*, pldm_tid_t, void const*, size_t)',
'Param' => {
'0' => {
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
'type' => '4829'
@@ -13431,17 +13373,17 @@
'type' => '164'
}
},
- 'Return' => '223736',
+ 'Return' => '321506',
'Size' => '8',
'Type' => 'FuncPtr'
},
- '226824' => {
- 'BaseType' => '226829',
+ '324594' => {
+ 'BaseType' => '324599',
'Name' => 'struct pollfd*',
'Size' => '8',
'Type' => 'Pointer'
},
- '226829' => {
+ '324599' => {
'Header' => 'poll.h',
'Line' => '36',
'Memb' => {
@@ -13466,21 +13408,21 @@
'Size' => '8',
'Type' => 'Struct'
},
- '226880' => {
+ '324650' => {
'Name' => 'int(*)(struct pldm_transport*, struct pollfd*)',
'Param' => {
'0' => {
- 'type' => '223822'
+ 'type' => '321592'
},
'1' => {
- 'type' => '226824'
+ 'type' => '324594'
}
},
'Return' => '100',
'Size' => '8',
'Type' => 'FuncPtr'
},
- '226885' => {
+ '324655' => {
'BaseType' => '53',
'Header' => 'socket.h',
'Line' => '10',
@@ -13489,14 +13431,14 @@
'Size' => '2',
'Type' => 'Typedef'
},
- '227263' => {
+ '325033' => {
'Header' => 'mctp.h',
'Line' => '18',
'Memb' => {
'0' => {
'name' => 's_addr',
'offset' => '0',
- 'type' => '223621'
+ 'type' => '321391'
}
},
'Name' => 'struct mctp_addr',
@@ -13504,19 +13446,19 @@
'Size' => '1',
'Type' => 'Struct'
},
- '227290' => {
+ '325060' => {
'Header' => 'mctp.h',
'Line' => '22',
'Memb' => {
'0' => {
'name' => 'smctp_family',
'offset' => '0',
- 'type' => '226885'
+ 'type' => '324655'
},
'1' => {
'name' => '__smctp_pad0',
'offset' => '2',
- 'type' => '226175'
+ 'type' => '323945'
},
'2' => {
'name' => 'smctp_network',
@@ -13526,22 +13468,22 @@
'3' => {
'name' => 'smctp_addr',
'offset' => '8',
- 'type' => '227263'
+ 'type' => '325033'
},
'4' => {
'name' => 'smctp_type',
'offset' => '9',
- 'type' => '226163'
+ 'type' => '323933'
},
'5' => {
'name' => 'smctp_tag',
'offset' => '16',
- 'type' => '226163'
+ 'type' => '323933'
},
'6' => {
'name' => '__smctp_pad1',
'offset' => '17',
- 'type' => '226163'
+ 'type' => '323933'
}
},
'Name' => 'struct sockaddr_mctp',
@@ -13549,19 +13491,19 @@
'Size' => '12',
'Type' => 'Struct'
},
- '227395' => {
- 'BaseType' => '227290',
+ '325165' => {
+ 'BaseType' => '325060',
'Name' => 'struct sockaddr_mctp const',
'Size' => '12',
'Type' => 'Const'
},
- '227439' => {
+ '325209' => {
'Line' => '35',
'Memb' => {
'0' => {
'name' => 'transport',
'offset' => '0',
- 'type' => '223827'
+ 'type' => '321597'
},
'1' => {
'name' => 'socket',
@@ -13571,12 +13513,12 @@
'2' => {
'name' => 'tid_eid_map',
'offset' => '68',
- 'type' => '227532'
+ 'type' => '325302'
},
'3' => {
'name' => 'socket_send_buf',
'offset' => '768',
- 'type' => '226445'
+ 'type' => '324215'
},
'4' => {
'name' => 'bound',
@@ -13595,31 +13537,31 @@
'Source' => 'af-mctp.c',
'Type' => 'Struct'
},
- '227532' => {
+ '325302' => {
'BaseType' => '4829',
'Name' => 'pldm_tid_t[256]',
'Size' => '256',
'Type' => 'Array'
},
- '228333' => {
- 'BaseType' => '227439',
+ '326103' => {
+ 'BaseType' => '325209',
'Name' => 'struct pldm_transport_af_mctp*',
'Size' => '8',
'Type' => 'Pointer'
},
- '228338' => {
- 'BaseType' => '227395',
+ '326108' => {
+ 'BaseType' => '325165',
'Name' => 'struct sockaddr_mctp const*',
'Size' => '8',
'Type' => 'Pointer'
},
- '228651' => {
- 'BaseType' => '228333',
+ '326421' => {
+ 'BaseType' => '326103',
'Name' => 'struct pldm_transport_af_mctp**',
'Size' => '8',
'Type' => 'Pointer'
},
- '255319' => {
+ '353089' => {
'Header' => 'file_io.h',
'Line' => '32',
'Memb' => {
@@ -13636,14 +13578,14 @@
'2' => {
'name' => 'data',
'offset' => '8',
- 'type' => '121963'
+ 'type' => '157152'
}
},
'Name' => 'struct pldm_oem_meta_file_io_write_req',
'Size' => '8',
'Type' => 'Struct'
},
- '255386' => {
+ '353156' => {
'Header' => 'file_io.h',
'Line' => '45',
'Memb' => {
@@ -13662,7 +13604,7 @@
'Size' => '4',
'Type' => 'Struct'
},
- '255425' => {
+ '353195' => {
'Header' => 'file_io.h',
'Line' => '55',
'Memb' => {
@@ -13681,21 +13623,21 @@
'Size' => '8',
'Type' => 'Struct'
},
- '255464' => {
+ '353234' => {
'Header' => 'file_io.h',
'Line' => '70',
'Memb' => {
'0' => {
'name' => 'data',
'offset' => '0',
- 'type' => '255386'
+ 'type' => '353156'
}
},
'Name' => 'anon-union-file_io.h-70',
'Size' => '4',
'Type' => 'Union'
},
- '255482' => {
+ '353252' => {
'Header' => 'file_io.h',
'Line' => '65',
'Memb' => {
@@ -13722,33 +13664,33 @@
'4' => {
'name' => 'info',
'offset' => '18',
- 'type' => '255464'
+ 'type' => '353234'
}
},
'Name' => 'struct pldm_oem_meta_file_io_read_req',
'Size' => '16',
'Type' => 'Struct'
},
- '255560' => {
+ '353330' => {
'Header' => 'file_io.h',
'Line' => '86',
'Memb' => {
'0' => {
'name' => 'attr',
'offset' => '0',
- 'type' => '255425'
+ 'type' => '353195'
},
'1' => {
'name' => 'data',
'offset' => '0',
- 'type' => '255386'
+ 'type' => '353156'
}
},
'Name' => 'anon-union-file_io.h-86',
'Size' => '8',
'Type' => 'Union'
},
- '255588' => {
+ '353358' => {
'Header' => 'file_io.h',
'Line' => '80',
'Memb' => {
@@ -13780,32 +13722,32 @@
'5' => {
'name' => 'info',
'offset' => '18',
- 'type' => '255560'
+ 'type' => '353330'
},
'6' => {
'name' => 'data',
'offset' => '32',
- 'type' => '121963'
+ 'type' => '157152'
}
},
'Name' => 'struct pldm_oem_meta_file_io_read_resp',
'Size' => '24',
'Type' => 'Struct'
},
- '258089' => {
- 'BaseType' => '255588',
+ '357329' => {
+ 'BaseType' => '353358',
'Name' => 'struct pldm_oem_meta_file_io_read_resp*',
'Size' => '8',
'Type' => 'Pointer'
},
- '259218' => {
- 'BaseType' => '255482',
+ '359587' => {
+ 'BaseType' => '353252',
'Name' => 'struct pldm_oem_meta_file_io_read_req*',
'Size' => '8',
'Type' => 'Pointer'
},
- '259654' => {
- 'BaseType' => '255319',
+ '360023' => {
+ 'BaseType' => '353089',
'Name' => 'struct pldm_oem_meta_file_io_write_req*',
'Size' => '8',
'Type' => 'Pointer'
diff --git a/src/compiler.h b/src/compiler.h
index 18e1a32..5a2b28e 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -19,6 +19,8 @@
"`unused` attribute is required");
static_assert(__has_attribute(warn_unused_result),
"`warn_unused_result` attribute is required");
+ static_assert(__has_attribute(cleanup),
+ "`cleanup` attribute is required");
int compliance;
} pldm_required_attributes __attribute__((unused));
@@ -30,6 +32,7 @@
#error Missing definition for LIBPLDM_CC_NONNULL
#endif
+#define LIBPLDM_CC_CLEANUP(fn) __attribute__((cleanup(fn)))
#define LIBPLDM_CC_NONNULL_ARGS(...) __attribute__((nonnull(__VA_ARGS__)))
#define LIBPLDM_CC_UNUSED __attribute__((unused))
#define LIBPLDM_CC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
diff --git a/src/dsp/firmware_update.c b/src/dsp/firmware_update.c
index cf27fe7..955fe1c 100644
--- a/src/dsp/firmware_update.c
+++ b/src/dsp/firmware_update.c
@@ -517,8 +517,7 @@
int decode_pldm_descriptor_from_iter(struct pldm_descriptor_iter *iter,
struct pldm_descriptor *desc)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (!iter || !iter->field || !desc) {
@@ -534,7 +533,7 @@
pldm_msgbuf_extract(buf, desc->descriptor_type);
rc = pldm_msgbuf_extract(buf, desc->descriptor_length);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
desc->descriptor_data = NULL;
@@ -816,9 +815,8 @@
const struct pldm_descriptor *descriptors, struct pldm_msg *msg,
size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (descriptors == NULL || msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -856,14 +854,14 @@
pldm_msgbuf_insert(buf, d->descriptor_type);
pldm_msgbuf_insert(buf, d->descriptor_length);
if (d->descriptor_data == NULL) {
- return -EINVAL;
+ return pldm_msgbuf_discard(buf, -EINVAL);
}
rc = pldm_msgbuf_insert_array(
buf, d->descriptor_length,
(const uint8_t *)d->descriptor_data,
d->descriptor_length);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
}
@@ -992,9 +990,8 @@
const struct pldm_get_firmware_parameters_resp_full *resp_data,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (resp_data == NULL || msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -1028,14 +1025,14 @@
resp_data->active_comp_image_set_ver_str.str_data,
resp_data->active_comp_image_set_ver_str.str_len);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_insert_array(
buf, resp_data->pending_comp_image_set_ver_str.str_len,
resp_data->pending_comp_image_set_ver_str.str_data,
resp_data->pending_comp_image_set_ver_str.str_len);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
/* Further calls to encode_get_firmware_parameters_resp_comp_entry
@@ -1049,9 +1046,8 @@
const struct pldm_component_parameter_entry_full *comp,
uint8_t *payload, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (comp == NULL || payload == NULL || payload_length == NULL) {
return -EINVAL;
@@ -1073,7 +1069,7 @@
comp->active_ver.date,
PLDM_FWUP_COMPONENT_RELEASE_DATA_LEN);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
pldm_msgbuf_insert(buf, comp->pending_ver.comparison_stamp);
@@ -1083,7 +1079,7 @@
comp->pending_ver.date,
PLDM_FWUP_COMPONENT_RELEASE_DATA_LEN);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
pldm_msgbuf_insert(buf, comp->comp_activation_methods.value);
@@ -1093,13 +1089,13 @@
comp->active_ver.str.str_data,
comp->active_ver.str.str_len);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_insert_array(buf, comp->pending_ver.str.str_len,
comp->pending_ver.str.str_data,
comp->pending_ver.str.str_len);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
return pldm_msgbuf_complete_used(buf, *payload_length, payload_length);
@@ -1200,8 +1196,7 @@
const struct pldm_msg *msg, size_t payload_length,
struct pldm_query_downstream_devices_resp *resp_data)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || resp_data == NULL || !payload_length) {
@@ -1216,26 +1211,26 @@
rc = pldm_msgbuf_extract(buf, resp_data->completion_code);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (PLDM_SUCCESS != resp_data->completion_code) {
// Return the CC directly without decoding the rest of the payload
- return 0;
+ return pldm_msgbuf_complete(buf);
}
if (payload_length < PLDM_QUERY_DOWNSTREAM_DEVICES_RESP_BYTES) {
- return -EBADMSG;
+ return pldm_msgbuf_discard(buf, -EBADMSG);
}
rc = pldm_msgbuf_extract(buf,
resp_data->downstream_device_update_supported);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (!is_downstream_device_update_support_valid(
resp_data->downstream_device_update_supported)) {
- return -EINVAL;
+ return pldm_msgbuf_discard(buf, -EINVAL);
}
pldm_msgbuf_extract(buf, resp_data->number_of_downstream_devices);
@@ -1251,8 +1246,7 @@
const struct pldm_query_downstream_identifiers_req *params_req,
struct pldm_msg *msg, size_t payload_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (!msg || !params_req) {
@@ -1295,8 +1289,7 @@
struct pldm_query_downstream_identifiers_resp *resp_data,
struct pldm_downstream_device_iter *iter)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
void *remaining = NULL;
int rc = 0;
@@ -1313,14 +1306,14 @@
rc = pldm_msgbuf_extract(buf, resp_data->completion_code);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (PLDM_SUCCESS != resp_data->completion_code) {
- return 0;
+ return pldm_msgbuf_complete(buf);
}
if (payload_length < PLDM_QUERY_DOWNSTREAM_IDENTIFIERS_RESP_MIN_LEN) {
- return -EBADMSG;
+ return pldm_msgbuf_discard(buf, -EBADMSG);
}
pldm_msgbuf_extract(buf, resp_data->next_data_transfer_handle);
@@ -1328,15 +1321,12 @@
rc = pldm_msgbuf_extract(buf, resp_data->downstream_devices_length);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
pldm_msgbuf_extract(buf, resp_data->number_of_downstream_devices);
- rc = pldm_msgbuf_span_required(
- buf, resp_data->downstream_devices_length, &remaining);
- if (rc) {
- return rc;
- }
+ pldm_msgbuf_span_required(buf, resp_data->downstream_devices_length,
+ &remaining);
rc = pldm_msgbuf_complete(buf);
if (rc) {
@@ -1355,11 +1345,10 @@
struct pldm_downstream_device_iter *iter,
struct pldm_downstream_device *dev)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- if (!iter || !dev) {
+ if (!iter || !iter->field.ptr || !dev) {
return -EINVAL;
}
@@ -1371,7 +1360,6 @@
pldm_msgbuf_extract(buf, dev->downstream_device_index);
pldm_msgbuf_extract(buf, dev->downstream_descriptor_count);
- iter->field.ptr = NULL;
pldm_msgbuf_span_remaining(buf, (void **)&iter->field.ptr,
&iter->field.length);
@@ -1384,8 +1372,7 @@
const struct pldm_get_downstream_firmware_parameters_req *params_req,
struct pldm_msg *msg, size_t payload_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (!msg || !params_req) {
@@ -1428,8 +1415,7 @@
struct pldm_get_downstream_firmware_parameters_resp *resp_data,
struct pldm_downstream_device_parameters_iter *iter)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
void *remaining = NULL;
size_t length;
int rc;
@@ -1446,15 +1432,15 @@
rc = pldm_msgbuf_extract(buf, resp_data->completion_code);
if (rc < 0) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (PLDM_SUCCESS != resp_data->completion_code) {
- return 0;
+ return pldm_msgbuf_complete(buf);
}
if (payload_length <
PLDM_GET_DOWNSTREAM_FIRMWARE_PARAMETERS_RESP_MIN_LEN) {
- return -EBADMSG;
+ return pldm_msgbuf_discard(buf, -EBADMSG);
}
pldm_msgbuf_extract(buf, resp_data->next_data_transfer_handle);
@@ -1465,7 +1451,7 @@
rc = pldm_msgbuf_span_remaining(buf, &remaining, &length);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_complete(buf);
@@ -1485,14 +1471,13 @@
struct pldm_downstream_device_parameters_iter *iter,
struct pldm_downstream_device_parameters_entry *entry)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
void *comp_ver_str;
size_t remaining;
void *cursor;
int rc;
- if (iter == NULL || entry == NULL) {
+ if (iter == NULL || iter->field.ptr == NULL || entry == NULL) {
return -EINVAL;
}
@@ -1508,14 +1493,14 @@
pldm_msgbuf_extract(buf, entry->active_comp_ver_str_type);
rc = pldm_msgbuf_extract(buf, entry->active_comp_ver_str_len);
if (rc < 0) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract_array(buf,
PLDM_FWUP_COMPONENT_RELEASE_DATA_LEN,
entry->active_comp_release_date,
sizeof(entry->active_comp_release_date));
if (rc < 0) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
// Fill the last byte with NULL character
@@ -1526,7 +1511,7 @@
pldm_msgbuf_extract(buf, entry->pending_comp_ver_str_type);
rc = pldm_msgbuf_extract(buf, entry->pending_comp_ver_str_len);
if (rc < 0) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract_array(
@@ -1534,7 +1519,7 @@
entry->pending_comp_release_date,
sizeof(entry->pending_comp_release_date));
if (rc < 0) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
// Fill the last byte with NULL character
@@ -1544,26 +1529,29 @@
pldm_msgbuf_extract(buf, entry->comp_activation_methods.value);
pldm_msgbuf_extract(buf, entry->capabilities_during_update.value);
- comp_ver_str = NULL;
- pldm_msgbuf_span_required(buf, entry->active_comp_ver_str_len,
- &comp_ver_str);
+ rc = pldm_msgbuf_span_required(buf, entry->active_comp_ver_str_len,
+ &comp_ver_str);
+ if (rc < 0) {
+ return pldm_msgbuf_discard(buf, rc);
+ }
entry->active_comp_ver_str = comp_ver_str;
- comp_ver_str = NULL;
- pldm_msgbuf_span_required(buf, entry->pending_comp_ver_str_len,
- &comp_ver_str);
+ rc = pldm_msgbuf_span_required(buf, entry->pending_comp_ver_str_len,
+ &comp_ver_str);
+ if (rc < 0) {
+ return pldm_msgbuf_discard(buf, rc);
+ }
entry->pending_comp_ver_str = comp_ver_str;
- cursor = NULL;
rc = pldm_msgbuf_span_remaining(buf, &cursor, &remaining);
if (rc < 0) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
iter->field.ptr = cursor;
iter->field.length = remaining;
- return 0;
+ return pldm_msgbuf_complete(buf);
}
LIBPLDM_ABI_STABLE
@@ -1632,8 +1620,7 @@
{
int rc;
uint8_t t;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
if (msg == NULL || req == NULL) {
return -EINVAL;
@@ -1650,22 +1637,22 @@
pldm_msgbuf_extract(buf, req->pkg_data_len);
rc = pldm_msgbuf_extract(buf, t);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (t > PLDM_STR_TYPE_UTF_16BE) {
- return -EBADMSG;
+ return pldm_msgbuf_discard(buf, -EBADMSG);
}
req->image_set_ver.str_type = (enum pldm_firmware_update_string_type)t;
pldm_msgbuf_extract(buf, req->image_set_ver.str_len);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract_array(buf, req->image_set_ver.str_len,
req->image_set_ver.str_data,
PLDM_FIRMWARE_MAX_STRING);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
return pldm_msgbuf_complete_consumed(buf);
@@ -1706,9 +1693,8 @@
const struct pldm_request_update_resp *resp_data,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -1806,8 +1792,7 @@
{
int rc;
uint8_t t;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
if (msg == NULL || pcomp == NULL) {
return -EINVAL;
@@ -1825,21 +1810,21 @@
pldm_msgbuf_extract(buf, pcomp->comp_comparison_stamp);
rc = pldm_msgbuf_extract(buf, t);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (t > PLDM_STR_TYPE_UTF_16BE) {
- return -EBADMSG;
+ return pldm_msgbuf_discard(buf, -EBADMSG);
}
pcomp->version.str_type = (enum pldm_firmware_update_string_type)t;
rc = pldm_msgbuf_extract(buf, pcomp->version.str_len);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract_array(buf, pcomp->version.str_len,
pcomp->version.str_data,
PLDM_FIRMWARE_MAX_STRING);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
return pldm_msgbuf_complete_consumed(buf);
@@ -1889,9 +1874,8 @@
const struct pldm_pass_component_table_resp *resp_data,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -1981,8 +1965,7 @@
{
int rc;
uint8_t t;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
if (msg == NULL || up == NULL) {
return -EINVAL;
@@ -2001,28 +1984,24 @@
pldm_msgbuf_extract(buf, up->update_option_flags.value);
rc = pldm_msgbuf_extract(buf, t);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (t > PLDM_STR_TYPE_UTF_16BE) {
- return -EBADMSG;
+ return pldm_msgbuf_discard(buf, -EBADMSG);
}
up->version.str_type = (enum pldm_firmware_update_string_type)t;
rc = pldm_msgbuf_extract(buf, up->version.str_len);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract_array(buf, up->version.str_len,
up->version.str_data,
PLDM_FIRMWARE_MAX_STRING);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
- if (buf->remaining != 0) {
- return -EINVAL;
- }
-
- return 0;
+ return pldm_msgbuf_complete_consumed(buf);
}
LIBPLDM_ABI_STABLE
@@ -2078,9 +2057,8 @@
uint8_t instance_id, const struct pldm_update_component_resp *resp_data,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -2135,9 +2113,8 @@
const struct pldm_request_firmware_data_req *req_params,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -2206,9 +2183,8 @@
int encode_transfer_complete_req(uint8_t instance_id, uint8_t transfer_result,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -2225,10 +2201,7 @@
return rc;
}
- rc = pldm_msgbuf_insert(buf, transfer_result);
- if (rc) {
- return rc;
- }
+ pldm_msgbuf_insert(buf, transfer_result);
return pldm_msgbuf_complete_used(buf, *payload_length, payload_length);
}
@@ -2280,9 +2253,8 @@
int encode_verify_complete_req(uint8_t instance_id, uint8_t verify_result,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -2299,10 +2271,7 @@
return rc;
}
- rc = pldm_msgbuf_insert(buf, verify_result);
- if (rc) {
- return rc;
- }
+ pldm_msgbuf_insert(buf, verify_result);
return pldm_msgbuf_complete_used(buf, *payload_length, payload_length);
}
@@ -2368,9 +2337,8 @@
const struct pldm_apply_complete_req *req_data,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -2425,9 +2393,9 @@
int decode_activate_firmware_req(const struct pldm_msg *msg,
size_t payload_length, bool *self_contained)
{
+ uint8_t self_contained_u8 = 0;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || self_contained == NULL) {
return -EINVAL;
@@ -2438,14 +2406,13 @@
return 0;
}
- uint8_t self_contained_u8 = 0;
- rc = pldm_msgbuf_extract(buf, self_contained_u8);
+ pldm_msgbuf_extract(buf, self_contained_u8);
+
+ rc = pldm_msgbuf_complete_consumed(buf);
if (rc) {
return rc;
}
- if (buf->remaining != 0) {
- return -EOVERFLOW;
- }
+
*self_contained = (bool)self_contained_u8;
return 0;
}
@@ -2521,9 +2488,8 @@
const struct pldm_activate_firmware_resp *resp_data,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -2643,9 +2609,8 @@
const struct pldm_get_status_resp *status,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (status == NULL || msg == NULL || payload_length == NULL) {
return -EINVAL;
@@ -2790,9 +2755,8 @@
const struct pldm_cancel_update_resp *resp_data,
struct pldm_msg *msg, size_t *payload_length)
{
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
if (msg == NULL || payload_length == NULL) {
return -EINVAL;
diff --git a/src/dsp/pdr.c b/src/dsp/pdr.c
index 789ceeb..2d90821 100644
--- a/src/dsp/pdr.c
+++ b/src/dsp/pdr.c
@@ -1553,28 +1553,21 @@
int rc = 0;
uint16_t header_length = 0;
uint8_t num_children = 0;
- struct pldm_msgbuf _src;
- struct pldm_msgbuf *src = &_src;
- struct pldm_msgbuf _dst;
- struct pldm_msgbuf *dst = &_dst;
+ PLDM_MSGBUF_DEFINE_P(src);
+ PLDM_MSGBUF_DEFINE_P(dst);
pldm_pdr_find_record_by_handle(&record, &prev, pdr_record_handle);
if (!record) {
return -EINVAL;
}
- // Initialize msg buffer for record and record->data
- rc = pldm_msgbuf_init_errno(src, PDR_ENTITY_ASSOCIATION_MIN_SIZE,
- record->data, record->size);
- if (rc) {
- return rc;
- }
// check if adding another entity to record causes overflow before
// allocating memory for new_record.
if (record->size + sizeof(pldm_entity) < sizeof(pldm_entity)) {
return -EOVERFLOW;
}
+
pldm_pdr_record *new_record = malloc(sizeof(pldm_pdr_record));
if (!new_record) {
return -ENOMEM;
@@ -1590,12 +1583,19 @@
new_record->size = record->size + sizeof(struct pldm_entity);
new_record->is_remote = record->is_remote;
+ // Initialize msg buffer for record and record->data
+ rc = pldm_msgbuf_init_errno(src, PDR_ENTITY_ASSOCIATION_MIN_SIZE,
+ record->data, record->size);
+ if (rc) {
+ goto cleanup_new_record_data;
+ }
+
// Initialize new PDR record with data from original PDR record.
// Start with adding the header of original PDR
rc = pldm_msgbuf_init_errno(dst, PDR_ENTITY_ASSOCIATION_MIN_SIZE,
new_record->data, new_record->size);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_src_msgbuf;
}
pldm_msgbuf_copy(dst, src, uint32_t, hdr_record_handle);
@@ -1606,13 +1606,13 @@
// size of pldm_entity before inserting the value into new_record.
rc = pldm_msgbuf_extract(src, header_length);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_dst_msgbuf;
}
static_assert(UINT16_MAX < (SIZE_MAX - sizeof(pldm_entity)),
"Fix the following bounds check.");
if (header_length + sizeof(pldm_entity) > UINT16_MAX) {
rc = -EOVERFLOW;
- goto cleanup_new_record_data;
+ goto cleanup_dst_msgbuf;
}
header_length += sizeof(pldm_entity);
pldm_msgbuf_insert(dst, header_length);
@@ -1625,11 +1625,11 @@
// by 1 before insert the value to new record.
rc = pldm_msgbuf_extract(src, num_children);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_dst_msgbuf;
}
if (num_children == UINT8_MAX) {
rc = -EOVERFLOW;
- goto cleanup_new_record_data;
+ goto cleanup_dst_msgbuf;
}
num_children += 1;
pldm_msgbuf_insert(dst, num_children);
@@ -1643,23 +1643,25 @@
// Add new contained entity as a child of new PDR
rc = pldm_msgbuf_complete(src);
if (rc) {
+ rc = pldm_msgbuf_discard(dst, rc);
goto cleanup_new_record_data;
}
rc = pldm_msgbuf_init_errno(src, sizeof(struct pldm_entity), entity,
sizeof(struct pldm_entity));
if (rc) {
+ rc = pldm_msgbuf_discard(dst, rc);
goto cleanup_new_record_data;
}
pldm_msgbuf_copy(dst, src, uint16_t, child_entity_type);
pldm_msgbuf_copy(dst, src, uint16_t, child_entity_instance_num);
pldm_msgbuf_copy(dst, src, uint16_t, child_entity_container_id);
- rc = pldm_msgbuf_complete(src);
- if (rc) {
- goto cleanup_new_record_data;
- }
rc = pldm_msgbuf_complete(dst);
if (rc) {
+ goto cleanup_src_msgbuf;
+ }
+ rc = pldm_msgbuf_complete(src);
+ if (rc) {
goto cleanup_new_record_data;
}
@@ -1671,6 +1673,10 @@
free(record->data);
free(record);
return rc;
+cleanup_dst_msgbuf:
+ rc = pldm_msgbuf_discard(dst, rc);
+cleanup_src_msgbuf:
+ rc = pldm_msgbuf_discard(src, rc);
cleanup_new_record_data:
free(new_record->data);
cleanup_new_record:
@@ -1697,12 +1703,9 @@
uint16_t new_pdr_size;
uint16_t container_id = 0;
void *container_id_addr;
- struct pldm_msgbuf _dst;
- struct pldm_msgbuf *dst = &_dst;
- struct pldm_msgbuf _src_p;
- struct pldm_msgbuf *src_p = &_src_p;
- struct pldm_msgbuf _src_c;
- struct pldm_msgbuf *src_c = &_src_c;
+ PLDM_MSGBUF_DEFINE_P(dst);
+ PLDM_MSGBUF_DEFINE_P(src_p);
+ PLDM_MSGBUF_DEFINE_P(src_c);
int rc = 0;
pldm_pdr_record *prev = repo->first;
@@ -1757,13 +1760,13 @@
rc = pldm_msgbuf_init_errno(src_p, sizeof(struct pldm_entity), parent,
sizeof(*parent));
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_dst;
}
rc = pldm_msgbuf_init_errno(src_c, sizeof(struct pldm_entity), entity,
sizeof(*entity));
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_src_p;
}
container_id_addr = NULL;
@@ -1771,7 +1774,7 @@
rc = pldm_msgbuf_span_required(dst, sizeof(container_id),
(void **)&container_id_addr);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_src_c;
}
assert(container_id_addr);
pldm_msgbuf_insert_uint8(dst, PLDM_ENTITY_ASSOCIAION_PHYSICAL);
@@ -1791,15 +1794,15 @@
container_id = htole16(container_id);
memcpy(container_id_addr, &container_id, sizeof(uint16_t));
- rc = pldm_msgbuf_complete(dst);
+ rc = pldm_msgbuf_complete(src_c);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_src_p;
}
rc = pldm_msgbuf_complete(src_p);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_dst;
}
- rc = pldm_msgbuf_complete(src_c);
+ rc = pldm_msgbuf_complete(dst);
if (rc) {
goto cleanup_new_record_data;
}
@@ -1810,6 +1813,12 @@
}
return rc;
+cleanup_msgbuf_src_c:
+ rc = pldm_msgbuf_discard(src_c, rc);
+cleanup_msgbuf_src_p:
+ rc = pldm_msgbuf_discard(src_p, rc);
+cleanup_msgbuf_dst:
+ rc = pldm_msgbuf_discard(dst, rc);
cleanup_new_record_data:
free(new_record->data);
cleanup_new_record:
@@ -1839,10 +1848,10 @@
int rc = 0;
size_t skip_data_size = 0;
pldm_pdr_record *record = repo->first;
- struct pldm_msgbuf _dst;
- struct pldm_msgbuf *dst = &_dst;
while (record != NULL) {
+ PLDM_MSGBUF_DEFINE_P(dst);
+
rc = pldm_msgbuf_init_errno(dst,
PDR_ENTITY_ASSOCIATION_MIN_SIZE,
record->data, record->size);
@@ -1851,7 +1860,10 @@
}
skip_data_size = sizeof(uint32_t) + sizeof(uint8_t);
pldm_msgbuf_span_required(dst, skip_data_size, NULL);
- pldm_msgbuf_extract(dst, hdr_type);
+ rc = pldm_msgbuf_extract(dst, hdr_type);
+ if (rc) {
+ return pldm_msgbuf_discard(dst, rc);
+ }
if (record->is_remote != is_remote ||
hdr_type != PLDM_PDR_ENTITY_ASSOCIATION) {
goto cleanup;
@@ -1860,7 +1872,10 @@
sizeof(uint16_t) + sizeof(uint8_t) +
sizeof(struct pldm_entity);
pldm_msgbuf_span_required(dst, skip_data_size, NULL);
- pldm_msgbuf_extract(dst, num_children);
+ rc = pldm_msgbuf_extract(dst, num_children);
+ if (rc) {
+ return pldm_msgbuf_discard(dst, rc);
+ }
for (int i = 0; i < num_children; ++i) {
struct pldm_entity e;
@@ -1869,12 +1884,12 @@
e.entity_instance_num)) ||
(rc = pldm_msgbuf_extract(dst,
e.entity_container_id))) {
- return rc;
+ return pldm_msgbuf_discard(dst, rc);
}
if (pldm_entity_cmp(entity, &e)) {
*record_handle = record->record_handle;
- return 0;
+ return pldm_msgbuf_complete(dst);
}
}
cleanup:
@@ -1894,10 +1909,8 @@
{
uint16_t header_length = 0;
uint8_t num_children = 0;
- struct pldm_msgbuf _src;
- struct pldm_msgbuf *src = &_src;
- struct pldm_msgbuf _dst;
- struct pldm_msgbuf *dst = &_dst;
+ PLDM_MSGBUF_DEFINE_P(src);
+ PLDM_MSGBUF_DEFINE_P(dst);
int rc;
pldm_pdr_record *record;
pldm_pdr_record *prev;
@@ -1917,12 +1930,6 @@
if (!record) {
return -EINVAL;
}
- // Initialize msg buffer for record and record->data
- rc = pldm_msgbuf_init_errno(src, PDR_ENTITY_ASSOCIATION_MIN_SIZE,
- record->data, record->size);
- if (rc) {
- return rc;
- }
// check if removing an entity from record causes overflow before
// allocating memory for new_record.
if (record->size < sizeof(pldm_entity)) {
@@ -1941,13 +1948,20 @@
new_record->size = record->size - sizeof(struct pldm_entity);
new_record->is_remote = record->is_remote;
+ // Initialize msg buffer for record and record->data
+ rc = pldm_msgbuf_init_errno(src, PDR_ENTITY_ASSOCIATION_MIN_SIZE,
+ record->data, record->size);
+ if (rc) {
+ goto cleanup_new_record_data;
+ }
+
// Initialize new PDR record with data from original PDR record.
// Start with adding the header of original PDR
rc = pldm_msgbuf_init_errno(
dst, (PDR_ENTITY_ASSOCIATION_MIN_SIZE - sizeof(pldm_entity)),
new_record->data, new_record->size);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_src;
}
pldm_msgbuf_copy(dst, src, uint32_t, hdr_record_handle);
pldm_msgbuf_copy(dst, src, uint8_t, hdr_version);
@@ -1957,11 +1971,11 @@
// size of pldm_entity before inserting the value into new_record.
rc = pldm_msgbuf_extract(src, header_length);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_dst;
}
if (header_length < sizeof(pldm_entity)) {
rc = -EOVERFLOW;
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_dst;
}
header_length -= sizeof(pldm_entity);
pldm_msgbuf_insert(dst, header_length);
@@ -1974,16 +1988,16 @@
// by 1 before insert the value to new record.
rc = pldm_msgbuf_extract(src, num_children);
if (rc) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_dst;
}
if (num_children == 1) {
// This is the last child which is getting removed so we need to delete the Entity Association PDR.
pldm_pdr_remove_record(repo, record,
pldm_pdr_get_prev_record(repo, record));
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_dst;
} else if (num_children < 1) {
rc = -EOVERFLOW;
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_dst;
}
num_children -= 1;
pldm_msgbuf_insert(dst, num_children);
@@ -1994,7 +2008,7 @@
if ((rc = pldm_msgbuf_extract(src, e.entity_type)) ||
(rc = pldm_msgbuf_extract(src, e.entity_instance_num)) ||
(rc = pldm_msgbuf_extract(src, e.entity_container_id))) {
- goto cleanup_new_record_data;
+ goto cleanup_msgbuf_dst;
}
if (pldm_entity_cmp(entity, &e)) {
@@ -2006,9 +2020,18 @@
pldm_msgbuf_insert(dst, e.entity_container_id);
}
- if ((rc = pldm_msgbuf_complete(src)) ||
- (rc = pldm_msgbuf_complete(dst)) ||
- (rc = pldm_pdr_replace_record(repo, record, prev, new_record))) {
+ rc = pldm_msgbuf_complete(dst);
+ if (rc) {
+ goto cleanup_msgbuf_src;
+ }
+
+ rc = pldm_msgbuf_complete(src);
+ if (rc) {
+ goto cleanup_new_record_data;
+ }
+
+ rc = pldm_pdr_replace_record(repo, record, prev, new_record);
+ if (rc) {
goto cleanup_new_record_data;
}
@@ -2016,6 +2039,10 @@
free(record);
return rc;
+cleanup_msgbuf_dst:
+ rc = pldm_msgbuf_discard(dst, rc);
+cleanup_msgbuf_src:
+ rc = pldm_msgbuf_discard(src, rc);
cleanup_new_record_data:
free(new_record->data);
cleanup_new_record:
@@ -2066,8 +2093,7 @@
uint16_t record_fru_rsi = 0;
uint8_t *skip_data = NULL;
uint8_t skip_data_size = 0;
- struct pldm_msgbuf _dst;
- struct pldm_msgbuf *dst = &_dst;
+ PLDM_MSGBUF_DEFINE_P(dst);
int rc = 0;
rc = pldm_msgbuf_init_errno(dst, PDR_FRU_RECORD_SET_MIN_SIZE,
@@ -2141,20 +2167,22 @@
record = repo->first;
while (record != NULL) {
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
+
rc = pldm_msgbuf_init_errno(buf, PDR_FRU_RECORD_SET_MIN_SIZE,
record->data, record->size);
if (rc) {
return rc;
}
pldm_msgbuf_span_required(buf, skip_data_size, NULL);
- if ((rc = pldm_msgbuf_extract(buf, hdr_type))) {
+ pldm_msgbuf_extract(buf, hdr_type);
+ rc = pldm_msgbuf_complete(buf);
+ if (rc) {
return rc;
}
if (record->is_remote != is_remote ||
hdr_type != PLDM_PDR_FRU_RECORD_SET) {
- goto cleanup;
+ goto next;
}
match = pldm_pdr_record_matches_fru_rsi(record, fru_rsi);
if (match < 0) {
@@ -2165,11 +2193,7 @@
prev = pldm_pdr_get_prev_record(repo, record);
return pldm_pdr_remove_record(repo, record, prev);
}
- cleanup:
- rc = pldm_msgbuf_complete(buf);
- if (rc) {
- return rc;
- }
+ next:
record = record->next;
}
return rc;
diff --git a/src/dsp/platform.c b/src/dsp/platform.c
index b37de42..0d5d917 100644
--- a/src/dsp/platform.c
+++ b/src/dsp/platform.c
@@ -265,8 +265,7 @@
uint8_t *comp_effecter_count,
set_effecter_state_field *field)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
int i;
@@ -287,10 +286,13 @@
}
pldm_msgbuf_extract_p(buf, effecter_id);
- pldm_msgbuf_extract_p(buf, comp_effecter_count);
+ rc = pldm_msgbuf_extract_p(buf, comp_effecter_count);
+ if (rc) {
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
+ }
if (*comp_effecter_count > 8) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
for (i = 0; i < *comp_effecter_count; i++) {
@@ -312,8 +314,7 @@
uint8_t *transfer_op_flag, uint16_t *request_cnt,
uint16_t *record_chg_num)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || record_hndl == NULL || data_transfer_hndl == NULL ||
@@ -447,8 +448,7 @@
uint32_t *repository_size, uint32_t *largest_record_size,
uint8_t *data_transfer_handle_timeout)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || completion_code == NULL ||
@@ -466,32 +466,35 @@
return pldm_xlate_errno(rc);
}
- pldm_msgbuf_extract_p(buf, completion_code);
+ rc = pldm_msgbuf_extract_p(buf, completion_code);
+ if (rc) {
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
+ }
if (PLDM_SUCCESS != *completion_code) {
return PLDM_SUCCESS;
}
rc = pldm_msgbuf_extract_p(buf, repository_state);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*repository_state > PLDM_FAILED) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
/* NOTE: Memory safety */
rc = pldm_msgbuf_extract_array(buf, PLDM_TIMESTAMP104_SIZE, update_time,
PLDM_TIMESTAMP104_SIZE);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
/* NOTE: Memory safety */
rc = pldm_msgbuf_extract_array(buf, PLDM_TIMESTAMP104_SIZE,
oem_update_time, PLDM_TIMESTAMP104_SIZE);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
pldm_msgbuf_extract_p(buf, record_count);
@@ -512,8 +515,7 @@
const struct pldm_msg *msg, size_t payload_length,
struct pldm_pdr_repository_info_resp *resp)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || resp == NULL) {
@@ -535,7 +537,7 @@
rc = pldm_msgbuf_extract(buf, resp->completion_code);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
pldm_msgbuf_extract(buf, resp->repository_state);
@@ -544,14 +546,14 @@
resp->update_time,
sizeof(resp->update_time));
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract_array(buf, sizeof(resp->oem_update_time),
resp->oem_update_time,
sizeof(resp->oem_update_time));
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
pldm_msgbuf_extract(buf, resp->record_count);
@@ -606,8 +608,7 @@
uint8_t *record_data, size_t record_data_length,
uint8_t *transfer_crc)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || completion_code == NULL ||
@@ -624,11 +625,11 @@
rc = pldm_msgbuf_extract_p(buf, completion_code);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (PLDM_SUCCESS != *completion_code) {
- return PLDM_SUCCESS;
+ return pldm_msgbuf_complete(buf);
}
pldm_msgbuf_extract_p(buf, next_record_hndl);
@@ -636,18 +637,19 @@
pldm_msgbuf_extract_p(buf, transfer_flag);
rc = pldm_msgbuf_extract_p(buf, resp_cnt);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*resp_cnt > 0 && record_data != NULL) {
if (record_data_length < *resp_cnt) {
- return PLDM_ERROR_INVALID_LENGTH;
+ return pldm_msgbuf_discard(buf,
+ PLDM_ERROR_INVALID_LENGTH);
}
/* NOTE: Memory safety */
rc = pldm_msgbuf_extract_array(buf, *resp_cnt, record_data,
*resp_cnt);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
}
@@ -668,8 +670,7 @@
struct pldm_get_pdr_resp *resp, size_t resp_len,
uint8_t *transfer_crc)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || resp == NULL || transfer_crc == NULL) {
@@ -694,19 +695,19 @@
rc = pldm_msgbuf_extract(buf, resp->transfer_flag);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract(buf, resp->response_count);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract_array(
buf, resp->response_count, resp->record_data,
resp_len - (sizeof(*resp) - sizeof(resp->record_data)));
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (resp->transfer_flag == PLDM_END) {
@@ -723,8 +724,7 @@
uint8_t *effecter_data_size,
uint8_t effecter_value[4])
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || effecter_id == NULL || effecter_data_size == NULL ||
@@ -742,11 +742,11 @@
pldm_msgbuf_extract_p(buf, effecter_id);
rc = pldm_msgbuf_extract_p(buf, effecter_data_size);
if (rc) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
if (*effecter_data_size > PLDM_EFFECTER_DATA_SIZE_SINT32) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract_effecter_value(buf, *effecter_data_size,
@@ -948,8 +948,7 @@
uint8_t *comp_sensor_count,
get_sensor_state_field *field)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
uint8_t i;
int rc;
@@ -967,20 +966,20 @@
rc = pldm_msgbuf_extract_p(buf, completion_code);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (PLDM_SUCCESS != *completion_code) {
- return PLDM_SUCCESS;
+ return pldm_msgbuf_discard(buf, PLDM_SUCCESS);
}
rc = pldm_msgbuf_extract_p(buf, comp_sensor_count);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*comp_sensor_count < 0x1 || *comp_sensor_count > 0x8) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
for (i = 0; i < *comp_sensor_count; i++) {
@@ -1005,8 +1004,7 @@
bitfield8_t *sensor_rearm,
uint8_t *reserved)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || sensor_id == NULL || sensor_rearm == NULL) {
@@ -1075,8 +1073,7 @@
uint8_t *event_class,
size_t *event_data_offset)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || format_version == NULL || tid == NULL ||
@@ -1130,8 +1127,7 @@
uint8_t *format_version, uint8_t *transfer_operation_flag,
uint32_t *data_transfer_handle, uint16_t *event_id_to_acknowledge)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || format_version == NULL ||
@@ -1150,22 +1146,22 @@
pldm_msgbuf_extract_p(buf, format_version);
rc = pldm_msgbuf_extract_p(buf, transfer_operation_flag);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*transfer_operation_flag > PLDM_ACKNOWLEDGEMENT_ONLY) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract_p(buf, data_transfer_handle);
rc = pldm_msgbuf_extract_p(buf, event_id_to_acknowledge);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
rc = pldm_platform_poll_for_platform_event_message_validate(
*transfer_operation_flag, *event_id_to_acknowledge);
if (rc < 0) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
rc = pldm_msgbuf_complete(buf);
@@ -1217,8 +1213,7 @@
uint8_t *event_data, uint32_t checksum, struct pldm_msg *msg,
size_t payload_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (!msg) {
@@ -1247,13 +1242,14 @@
pldm_msgbuf_insert(buf, tid);
rc = pldm_msgbuf_insert(buf, event_id);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (event_id == 0xffff || event_id == 0x0000) {
if (PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_MIN_RESP_BYTES !=
payload_length) {
- return PLDM_ERROR_INVALID_LENGTH;
+ return pldm_msgbuf_discard(buf,
+ PLDM_ERROR_INVALID_LENGTH);
}
rc = pldm_msgbuf_complete(buf);
@@ -1265,7 +1261,7 @@
}
if ((event_data == NULL) && (event_data_size > 0)) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_insert(buf, next_data_transfer_handle);
@@ -1273,14 +1269,14 @@
pldm_msgbuf_insert(buf, event_class);
rc = pldm_msgbuf_insert(buf, event_data_size);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if ((event_data_size > 0) && event_data) {
rc = pldm_msgbuf_insert_array(buf, event_data_size, event_data,
event_data_size);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
}
@@ -1357,8 +1353,7 @@
uint8_t *completion_code,
uint8_t *platform_event_status)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || completion_code == NULL ||
@@ -1374,20 +1369,20 @@
rc = pldm_msgbuf_extract_p(buf, completion_code);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (PLDM_SUCCESS != *completion_code) {
- return PLDM_SUCCESS;
+ return pldm_msgbuf_discard(buf, PLDM_SUCCESS);
}
rc = pldm_msgbuf_extract_p(buf, platform_event_status);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*platform_event_status > PLDM_EVENT_LOGGING_REJECTED) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
rc = pldm_msgbuf_complete(buf);
@@ -1428,8 +1423,7 @@
uint8_t *completion_code,
uint16_t *terminus_max_buffer_size)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || completion_code == NULL ||
@@ -1446,11 +1440,11 @@
rc = pldm_msgbuf_extract_p(buf, completion_code);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (PLDM_SUCCESS != *completion_code) {
- return PLDM_SUCCESS;
+ return pldm_msgbuf_discard(buf, PLDM_SUCCESS);
}
pldm_msgbuf_extract_p(buf, terminus_max_buffer_size);
@@ -1504,8 +1498,7 @@
uint8_t *event_class,
uint8_t event_class_count)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int i;
int rc;
@@ -1524,27 +1517,27 @@
rc = pldm_msgbuf_extract_p(buf, completion_code);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (PLDM_SUCCESS != *completion_code) {
- return PLDM_SUCCESS;
+ return pldm_msgbuf_discard(buf, PLDM_SUCCESS);
}
rc = pldm_msgbuf_extract_p(buf, synchrony_config);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*synchrony_config > PLDM_MESSAGE_TYPE_ASYNCHRONOUS_WITH_HEARTBEAT) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract_p(buf, &synchrony_config_support->byte);
rc = pldm_msgbuf_extract_p(buf, number_event_class_returned);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*number_event_class_returned == 0) {
@@ -1557,7 +1550,7 @@
}
if (event_class_count < *number_event_class_returned) {
- return PLDM_ERROR_INVALID_LENGTH;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_LENGTH);
}
for (i = 0; i < *number_event_class_returned; i++) {
@@ -1578,8 +1571,7 @@
uint8_t *sensor_event_class_type,
size_t *event_class_data_offset)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (event_data == NULL || sensor_id == NULL ||
@@ -1595,7 +1587,7 @@
}
if (event_data_length < PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES) {
- return PLDM_ERROR_INVALID_LENGTH;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_LENGTH);
}
size_t event_class_data_length =
@@ -1604,28 +1596,31 @@
pldm_msgbuf_extract_p(buf, sensor_id);
rc = pldm_msgbuf_extract_p(buf, sensor_event_class_type);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*sensor_event_class_type == PLDM_SENSOR_OP_STATE) {
if (event_class_data_length !=
PLDM_SENSOR_EVENT_SENSOR_OP_STATE_DATA_LENGTH) {
- return PLDM_ERROR_INVALID_LENGTH;
+ return pldm_msgbuf_discard(buf,
+ PLDM_ERROR_INVALID_LENGTH);
}
} else if (*sensor_event_class_type == PLDM_STATE_SENSOR_STATE) {
if (event_class_data_length !=
PLDM_SENSOR_EVENT_STATE_SENSOR_STATE_DATA_LENGTH) {
- return PLDM_ERROR_INVALID_LENGTH;
+ return pldm_msgbuf_discard(buf,
+ PLDM_ERROR_INVALID_LENGTH);
}
} else if (*sensor_event_class_type == PLDM_NUMERIC_SENSOR_STATE) {
if (event_class_data_length <
PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_MIN_DATA_LENGTH ||
event_class_data_length >
PLDM_SENSOR_EVENT_NUMERIC_SENSOR_STATE_MAX_DATA_LENGTH) {
- return PLDM_ERROR_INVALID_LENGTH;
+ return pldm_msgbuf_discard(buf,
+ PLDM_ERROR_INVALID_LENGTH);
}
} else {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
*event_class_data_offset =
@@ -1643,8 +1638,7 @@
int decode_sensor_op_data(const uint8_t *sensor_data, size_t sensor_data_length,
uint8_t *present_op_state, uint8_t *previous_op_state)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (sensor_data == NULL || present_op_state == NULL ||
@@ -1676,8 +1670,7 @@
uint8_t *event_state,
uint8_t *previous_event_state)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (sensor_data == NULL || sensor_offset == NULL ||
@@ -1711,8 +1704,7 @@
uint8_t *sensor_data_size,
uint32_t *present_reading)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (sensor_data == NULL || sensor_data_size == NULL ||
@@ -1737,7 +1729,7 @@
pldm_msgbuf_extract_p(buf, previous_event_state);
rc = pldm_msgbuf_extract_p(buf, sensor_data_size);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
/*
@@ -1789,7 +1781,7 @@
break;
}
default:
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
rc = pldm_msgbuf_complete_consumed(buf);
@@ -1805,10 +1797,13 @@
const void *pdr_data, size_t pdr_data_length,
struct pldm_numeric_sensor_value_pdr *pdr_value)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
+ if (!pdr_data || !pdr_value) {
+ return PLDM_ERROR_INVALID_DATA;
+ }
+
rc = pldm_msgbuf_init_errno(buf, PLDM_PDR_NUMERIC_SENSOR_PDR_MIN_LENGTH,
pdr_data, pdr_data_length);
if (rc) {
@@ -1819,7 +1814,7 @@
buf, &pdr_value->hdr, PLDM_PDR_NUMERIC_SENSOR_PDR_MIN_LENGTH,
pdr_data_length);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
pldm_msgbuf_extract(buf, pdr_value->terminus_handle);
@@ -1842,10 +1837,10 @@
rc = pldm_msgbuf_extract(buf, pdr_value->sensor_data_size);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (pdr_value->sensor_data_size > PLDM_SENSOR_DATA_SIZE_MAX) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract(buf, pdr_value->resolution);
@@ -1867,10 +1862,10 @@
rc = pldm_msgbuf_extract(buf, pdr_value->range_field_format);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (pdr_value->range_field_format > PLDM_RANGE_FIELD_FORMAT_MAX) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract(buf, pdr_value->range_field_support.byte);
@@ -2014,8 +2009,7 @@
size_t payload_length,
uint16_t *effecter_id)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || effecter_id == NULL) {
@@ -2048,8 +2042,7 @@
uint8_t *pending_value,
uint8_t *present_value)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || effecter_data_size == NULL ||
@@ -2067,29 +2060,29 @@
rc = pldm_msgbuf_extract_p(buf, completion_code);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (PLDM_SUCCESS != *completion_code) {
- return PLDM_SUCCESS;
+ return pldm_msgbuf_discard(buf, PLDM_SUCCESS);
}
rc = pldm_msgbuf_extract_p(buf, effecter_data_size);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*effecter_data_size > PLDM_EFFECTER_DATA_SIZE_SINT32) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
rc = pldm_msgbuf_extract_p(buf, effecter_oper_state);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*effecter_oper_state > EFFECTER_OPER_STATE_INTEST) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract_effecter_value(buf, *effecter_data_size,
@@ -2176,8 +2169,7 @@
uint8_t *number_of_change_records,
size_t *change_record_data_offset)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (event_data == NULL || event_data_format == NULL ||
@@ -2212,8 +2204,7 @@
const void *event_data, size_t event_data_length,
struct pldm_message_poll_event *poll_event)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (!event_data || !poll_event) {
@@ -2229,11 +2220,11 @@
pldm_msgbuf_extract(buf, poll_event->format_version);
rc = pldm_msgbuf_extract(buf, poll_event->event_id);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (poll_event->event_id == 0x0000 || poll_event->event_id == 0xffff) {
- return -EPROTO;
+ return pldm_msgbuf_discard(buf, -EPROTO);
}
pldm_msgbuf_extract(buf, poll_event->data_transfer_handle);
@@ -2246,8 +2237,7 @@
const struct pldm_message_poll_event *poll_event, void *event_data,
size_t event_data_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (poll_event == NULL || event_data == NULL) {
@@ -2276,8 +2266,7 @@
uint8_t *event_data_operation, uint8_t *number_of_change_entries,
size_t *change_entry_data_offset)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (change_record_data == NULL || event_data_operation == NULL ||
@@ -2344,8 +2333,7 @@
uint8_t *present_state, uint8_t *previous_state, uint8_t *event_state,
uint8_t *present_reading)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || completion_code == NULL ||
@@ -2364,20 +2352,20 @@
rc = pldm_msgbuf_extract_p(buf, completion_code);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (PLDM_SUCCESS != *completion_code) {
- return PLDM_SUCCESS;
+ return pldm_msgbuf_discard(buf, PLDM_SUCCESS);
}
rc = pldm_msgbuf_extract_p(buf, sensor_data_size);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*sensor_data_size > PLDM_SENSOR_DATA_SIZE_SINT32) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract_p(buf, sensor_operational_state);
@@ -2473,8 +2461,7 @@
size_t payload_length, uint16_t *sensor_id,
uint8_t *rearm_event_state)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || sensor_id == NULL || rearm_event_state == NULL) {
@@ -2548,8 +2535,7 @@
size_t payload_length,
uint8_t *completion_code)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || completion_code == NULL) {
@@ -2581,8 +2567,7 @@
uint16_t *heartbeat_timer)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || event_message_global_enable == NULL ||
@@ -2599,7 +2584,7 @@
pldm_msgbuf_extract_p(buf, event_message_global_enable);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
pldm_msgbuf_extract_p(buf, transport_protocol_type);
@@ -2657,8 +2642,7 @@
struct pldm_msg *msg,
size_t payload_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL) {
@@ -2710,8 +2694,7 @@
uint8_t *event_class, uint32_t *event_data_size, void **event_data,
uint32_t *event_data_integrity_checksum)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || completion_code == NULL || tid == NULL ||
@@ -2731,34 +2714,34 @@
rc = pldm_msgbuf_extract_p(buf, completion_code);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (PLDM_SUCCESS != *completion_code) {
- return *completion_code;
+ return pldm_msgbuf_discard(buf, *completion_code);
}
pldm_msgbuf_extract_p(buf, tid);
rc = pldm_msgbuf_extract_p(buf, event_id);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if ((*event_id == 0) || (*event_id == 0xffff)) {
- return PLDM_SUCCESS;
+ return pldm_msgbuf_discard(buf, PLDM_SUCCESS);
}
pldm_msgbuf_extract_p(buf, next_data_transfer_handle);
rc = pldm_msgbuf_extract_p(buf, transfer_flag);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
pldm_msgbuf_extract_p(buf, event_class);
rc = pldm_msgbuf_extract_p(buf, event_data_size);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (*event_data_size > payload_length) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
if (*event_data_size > 0) {
@@ -2783,8 +2766,7 @@
const void *pdr_data, size_t pdr_data_length,
struct pldm_numeric_effecter_value_pdr *pdr_value)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
struct pldm_value_pdr_hdr hdr;
int rc;
@@ -2828,10 +2810,10 @@
rc = pldm_msgbuf_extract(buf, pdr_value->effecter_data_size);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (pdr_value->effecter_data_size > PLDM_SENSOR_DATA_SIZE_MAX) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract(buf, pdr_value->resolution);
@@ -2848,10 +2830,10 @@
rc = pldm_msgbuf_extract(buf, pdr_value->range_field_format);
if (rc) {
- return pldm_xlate_errno(rc);
+ return pldm_xlate_errno(pldm_msgbuf_discard(buf, rc));
}
if (pdr_value->range_field_format > PLDM_RANGE_FIELD_FORMAT_MAX) {
- return PLDM_ERROR_INVALID_DATA;
+ return pldm_msgbuf_discard(buf, PLDM_ERROR_INVALID_DATA);
}
pldm_msgbuf_extract(buf, pdr_value->range_field_support.byte);
@@ -2880,8 +2862,7 @@
struct pldm_msg *msg,
size_t payload_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL) {
@@ -2916,8 +2897,7 @@
size_t payload_length,
uint16_t *effecter_id)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || effecter_id == NULL) {
@@ -2941,8 +2921,7 @@
const struct pldm_msg *msg, size_t payload_length,
struct pldm_get_state_effecter_states_resp *resp)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
get_effecter_state_field *field;
int rc;
int i;
@@ -2960,23 +2939,23 @@
rc = pldm_msgbuf_extract(buf, resp->completion_code);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (PLDM_SUCCESS != resp->completion_code) {
- return 0;
+ return pldm_msgbuf_complete(buf);
}
rc = pldm_msgbuf_extract(buf, resp->comp_effecter_count);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
uint8_t comp_effecter_count = resp->comp_effecter_count;
if (comp_effecter_count < PLDM_GET_EFFECTER_STATE_FIELD_COUNT_MIN ||
comp_effecter_count > PLDM_GET_EFFECTER_STATE_FIELD_COUNT_MAX) {
- return -EBADMSG;
+ return pldm_msgbuf_discard(buf, -EBADMSG);
}
for (i = 0, field = resp->field; i < comp_effecter_count;
@@ -2994,8 +2973,7 @@
uint8_t instance_id, struct pldm_get_state_effecter_states_resp *resp,
struct pldm_msg *msg, size_t payload_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
get_effecter_state_field *field;
int rc;
int i;
@@ -3047,12 +3025,9 @@
const void *data, size_t data_length,
struct pldm_entity_auxiliary_names_pdr *pdr, size_t pdr_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
- struct pldm_msgbuf _src;
- struct pldm_msgbuf *src = &_src;
- struct pldm_msgbuf _dst;
- struct pldm_msgbuf *dst = &_dst;
+ PLDM_MSGBUF_DEFINE_P(buf);
+ PLDM_MSGBUF_DEFINE_P(src);
+ PLDM_MSGBUF_DEFINE_P(dst);
size_t names_len = 0;
void *names = NULL;
int rc;
@@ -3085,7 +3060,7 @@
buf, &pdr->hdr, PLDM_PDR_ENTITY_AUXILIARY_NAME_PDR_MIN_LENGTH,
data_length);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
pldm_msgbuf_extract(buf, pdr->container.entity_type);
@@ -3094,7 +3069,7 @@
pldm_msgbuf_extract(buf, pdr->shared_name_count);
rc = pldm_msgbuf_extract(buf, pdr->name_string_count);
if (rc < 0) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_span_remaining(buf, &names, &names_len);
@@ -3103,6 +3078,11 @@
}
assert(names);
+ rc = pldm_msgbuf_complete_consumed(buf);
+ if (rc) {
+ return rc;
+ }
+
pdr->auxiliary_name_data_size = pdr_length - sizeof(*pdr);
rc = pldm_msgbuf_init_errno(dst, pdr->auxiliary_name_data_size,
@@ -3121,51 +3101,54 @@
/* Initialise for the first pass to extract the UTF16-BE name strings */
rc = pldm_msgbuf_init_errno(src, names_len, names, names_len);
if (rc < 0) {
- return rc;
+ goto cleanup_msgbuf_dst;
}
for (i = 0; i < pdr->name_string_count; i++) {
pldm_msgbuf_span_string_ascii(src, NULL, NULL);
rc = pldm_msgbuf_copy_string_utf16(dst, src);
if (rc) {
- return rc;
+ goto cleanup_msgbuf_src;
}
}
rc = pldm_msgbuf_complete_consumed(src);
if (rc < 0) {
- return rc;
+ goto cleanup_msgbuf_dst;
}
/* Reinitialise for the second pass to extract the ASCII tag strings */
rc = pldm_msgbuf_init_errno(src, names_len, names, names_len);
if (rc < 0) {
- return rc;
+ goto cleanup_msgbuf_dst;
}
for (i = 0; i < pdr->name_string_count; i++) {
rc = pldm_msgbuf_copy_string_ascii(dst, src);
if (rc) {
- return rc;
+ goto cleanup_msgbuf_src;
}
pldm_msgbuf_span_string_utf16(src, NULL, NULL);
}
- if ((rc = pldm_msgbuf_complete(dst)) ||
- (rc = pldm_msgbuf_complete(src)) ||
- (rc = pldm_msgbuf_complete(buf))) {
- return rc;
+ rc = pldm_msgbuf_complete(src);
+ if (rc) {
+ goto cleanup_msgbuf_dst;
}
- return 0;
+ return pldm_msgbuf_complete(dst);
+
+cleanup_msgbuf_src:
+ rc = pldm_msgbuf_discard(src, rc);
+cleanup_msgbuf_dst:
+ return pldm_msgbuf_discard(dst, rc);
}
LIBPLDM_ABI_STABLE
int decode_pldm_entity_auxiliary_names_pdr_index(
struct pldm_entity_auxiliary_names_pdr *pdr)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
int i;
@@ -3227,8 +3210,7 @@
struct pldm_platform_cper_event *cper_event,
size_t cper_event_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (!cper_event || !event_data) {
@@ -3248,29 +3230,29 @@
pldm_msgbuf_extract(buf, cper_event->format_version);
rc = pldm_msgbuf_extract(buf, cper_event->format_type);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (cper_event->format_type != PLDM_PLATFORM_CPER_EVENT_WITH_HEADER &&
cper_event->format_type !=
PLDM_PLATFORM_CPER_EVENT_WITHOUT_HEADER) {
- return -EPROTO;
+ return pldm_msgbuf_discard(buf, -EPROTO);
}
rc = pldm_msgbuf_extract(buf, cper_event->event_data_length);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
if (cper_event->event_data_length >
(cper_event_length - sizeof(*cper_event))) {
- return -EOVERFLOW;
+ return pldm_msgbuf_discard(buf, -EOVERFLOW);
}
rc = pldm_msgbuf_extract_array_uint8(
buf, cper_event->event_data_length, cper_event->event_data,
cper_event_length - sizeof(*cper_event));
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
return pldm_msgbuf_complete_consumed(buf);
diff --git a/src/firmware_device/fd.c b/src/firmware_device/fd.c
index 9ac1ab8..0967033 100644
--- a/src/firmware_device/fd.c
+++ b/src/firmware_device/fd.c
@@ -276,8 +276,7 @@
{
uint16_t entry_count;
const struct pldm_firmware_component_standalone **entries;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
/* No request data */
@@ -311,20 +310,22 @@
fd->ops_ctx, &fwp.active_comp_image_set_ver_str,
&fwp.pending_comp_image_set_ver_str);
if (rc) {
- return pldm_fd_reply_cc(PLDM_ERROR, hdr, resp,
- resp_payload_len);
+ return pldm_msgbuf_discard(
+ buf, pldm_fd_reply_cc(PLDM_ERROR, hdr, resp,
+ resp_payload_len));
}
size_t len = buf->remaining;
rc = encode_get_firmware_parameters_resp(hdr->instance, &fwp,
resp, &len);
if (rc) {
- return pldm_fd_reply_errno(rc, hdr, resp,
- resp_payload_len);
+ return pldm_msgbuf_discard(
+ buf, pldm_fd_reply_errno(rc, hdr, resp,
+ resp_payload_len));
}
rc = pldm_msgbuf_skip(buf, len);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
}
@@ -349,18 +350,18 @@
};
if (pldm_msgbuf_peek_remaining(buf, &out, &len)) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
+
rc = encode_get_firmware_parameters_resp_comp_entry(&comp, out,
&len);
if (rc) {
- return pldm_fd_reply_errno(rc, hdr, resp,
- resp_payload_len);
+ return pldm_msgbuf_discard(
+ buf, pldm_fd_reply_errno(rc, hdr, resp,
+ resp_payload_len));
}
- rc = pldm_msgbuf_skip(buf, len);
- if (rc) {
- return rc;
- }
+
+ pldm_msgbuf_skip(buf, len);
}
return pldm_msgbuf_complete_used(buf, *resp_payload_len,
diff --git a/src/msgbuf.h b/src/msgbuf.h
index cf30bad..d33d8e9 100644
--- a/src/msgbuf.h
+++ b/src/msgbuf.h
@@ -76,6 +76,37 @@
intmax_t remaining;
};
+LIBPLDM_CC_NONNULL
+LIBPLDM_CC_ALWAYS_INLINE
+// NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
+void pldm__msgbuf_cleanup(struct pldm_msgbuf *ctx LIBPLDM_CC_UNUSED)
+{
+ assert(ctx->cursor == NULL && ctx->remaining == INTMAX_MIN);
+}
+
+#ifdef __cplusplus
+// NOLINTBEGIN(bugprone-macro-parentheses)
+#define PLDM_MSGBUF_DEFINE_P(name) \
+ struct pldm_msgbuf _##name LIBPLDM_CC_CLEANUP( \
+ pldm__msgbuf_cleanup) = { NULL, INTMAX_MIN }; \
+ auto *name = &(_##name)
+// NOLINTEND(bugprone-macro-parentheses)
+#else
+#define PLDM_MSGBUF_DEFINE_P(name) \
+ struct pldm_msgbuf _##name LIBPLDM_CC_CLEANUP( \
+ pldm__msgbuf_cleanup) = { NULL, INTMAX_MIN }; \
+ struct pldm_msgbuf *(name) = &(_##name)
+#endif
+
+LIBPLDM_CC_NONNULL
+LIBPLDM_CC_ALWAYS_INLINE
+// NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
+int pldm__msgbuf_invalidate(struct pldm_msgbuf *ctx)
+{
+ ctx->remaining = INTMAX_MIN;
+ return -EOVERFLOW;
+}
+
/**
* @brief Initialize pldm buf struct for buf extractor
*
@@ -95,18 +126,20 @@
pldm_msgbuf_init_errno(struct pldm_msgbuf *ctx, size_t minsize, const void *buf,
size_t len)
{
+ ctx->cursor = NULL;
+
if ((minsize > len)) {
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#if INTMAX_MAX < SIZE_MAX
if (len > INTMAX_MAX) {
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#endif
if (UINTPTR_MAX - (uintptr_t)buf < len) {
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
ctx->cursor = (uint8_t *)buf;
@@ -165,6 +198,29 @@
}
/**
+ * @brief End use of a msgbuf under error conditions
+ *
+ * @param[in] ctx - The msgbuf instance to discard
+ * @param[in] error - The error value to propagate
+ *
+ * Under normal conditions use of a msgbuf instance must be ended using @ref
+ * pldm_msgbuf_complete or one of its related APIs. Under error conditions, @ref
+ * pldm_msgbuf_discard should be used instead, as it makes it straight-forward
+ * to finalise the msgbuf while propagating the existing error code.
+ *
+ * @return The value provided in @param error
+ */
+LIBPLDM_CC_NONNULL
+LIBPLDM_CC_ALWAYS_INLINE
+LIBPLDM_CC_WARN_UNUSED_RESULT
+int pldm_msgbuf_discard(struct pldm_msgbuf *ctx, int error)
+{
+ ctx->cursor = NULL;
+ pldm__msgbuf_invalidate(ctx);
+ return error;
+}
+
+/**
* @brief Complete the pldm_msgbuf instance
*
* @param[in] ctx - pldm_msgbuf context for extractor
@@ -176,14 +232,7 @@
LIBPLDM_CC_WARN_UNUSED_RESULT
int pldm_msgbuf_complete(struct pldm_msgbuf *ctx)
{
- int valid;
-
- valid = pldm_msgbuf_validate(ctx);
-
- ctx->cursor = NULL;
- ctx->remaining = 0;
-
- return valid;
+ return pldm_msgbuf_discard(ctx, pldm_msgbuf_validate(ctx));
}
/**
@@ -202,14 +251,7 @@
LIBPLDM_CC_WARN_UNUSED_RESULT
int pldm_msgbuf_complete_consumed(struct pldm_msgbuf *ctx)
{
- int consumed;
-
- consumed = pldm_msgbuf_consumed(ctx);
-
- ctx->cursor = NULL;
- ctx->remaining = 0;
-
- return consumed;
+ return pldm_msgbuf_discard(ctx, pldm_msgbuf_consumed(ctx));
}
/*
@@ -317,22 +359,20 @@
// NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
pldm__msgbuf_extract_uint8(struct pldm_msgbuf *ctx, void *dst)
{
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
if (ctx->remaining >= (intmax_t)sizeof(uint8_t)) {
+ assert(ctx->cursor);
memcpy(dst, ctx->cursor, sizeof(uint8_t));
ctx->cursor++;
ctx->remaining -= sizeof(uint8_t);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(uint8_t)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(uint8_t)) {
ctx->remaining -= sizeof(uint8_t);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#define pldm_msgbuf_extract_int8(ctx, dst) \
@@ -343,22 +383,20 @@
// NOLINTNEXTLINE(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp)
pldm__msgbuf_extract_int8(struct pldm_msgbuf *ctx, void *dst)
{
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
if (ctx->remaining >= (intmax_t)sizeof(int8_t)) {
+ assert(ctx->cursor);
memcpy(dst, ctx->cursor, sizeof(int8_t));
ctx->cursor++;
ctx->remaining -= sizeof(int8_t);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(int8_t)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(int8_t)) {
ctx->remaining -= sizeof(int8_t);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#define pldm_msgbuf_extract_uint16(ctx, dst) \
@@ -371,10 +409,6 @@
{
uint16_t ldst;
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
// Check for underflow while tracking the magnitude of the buffer overflow
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
@@ -382,6 +416,8 @@
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(ldst)) {
+ assert(ctx->cursor);
+
// Use memcpy() to have the compiler deal with any alignment
// issues on the target architecture
memcpy(&ldst, ctx->cursor, sizeof(ldst));
@@ -397,11 +433,12 @@
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(ldst)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(ldst)) {
ctx->remaining -= sizeof(ldst);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#define pldm_msgbuf_extract_int16(ctx, dst) \
@@ -414,16 +451,13 @@
{
int16_t ldst;
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(ldst) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(ldst)) {
+ assert(ctx->cursor);
memcpy(&ldst, ctx->cursor, sizeof(ldst));
ldst = le16toh(ldst);
memcpy(dst, &ldst, sizeof(ldst));
@@ -432,11 +466,12 @@
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(ldst)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(ldst)) {
ctx->remaining -= sizeof(ldst);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#define pldm_msgbuf_extract_uint32(ctx, dst) \
@@ -449,16 +484,13 @@
{
uint32_t ldst;
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(ldst) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(ldst)) {
+ assert(ctx->cursor);
memcpy(&ldst, ctx->cursor, sizeof(ldst));
ldst = le32toh(ldst);
memcpy(dst, &ldst, sizeof(ldst));
@@ -467,11 +499,12 @@
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(ldst)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(ldst)) {
ctx->remaining -= sizeof(ldst);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#define pldm_msgbuf_extract_int32(ctx, dst) \
@@ -484,16 +517,13 @@
{
int32_t ldst;
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(ldst) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(ldst)) {
+ assert(ctx->cursor);
memcpy(&ldst, ctx->cursor, sizeof(ldst));
ldst = le32toh(ldst);
memcpy(dst, &ldst, sizeof(ldst));
@@ -502,11 +532,12 @@
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(ldst)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(ldst)) {
ctx->remaining -= sizeof(ldst);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#define pldm_msgbuf_extract_real32(ctx, dst) \
@@ -522,16 +553,13 @@
static_assert(sizeof(real32_t) == sizeof(ldst),
"Mismatched type sizes for dst and ldst");
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(ldst) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(ldst)) {
+ assert(ctx->cursor);
memcpy(&ldst, ctx->cursor, sizeof(ldst));
ldst = le32toh(ldst);
memcpy(dst, &ldst, sizeof(ldst));
@@ -540,11 +568,12 @@
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(ldst)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(ldst)) {
ctx->remaining -= sizeof(ldst);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
/**
@@ -595,7 +624,7 @@
pldm__msgbuf_extract_array_void(struct pldm_msgbuf *ctx, size_t count,
void *dst, size_t dst_count)
{
- if (!ctx->cursor || count > dst_count) {
+ if (count > dst_count) {
return -EINVAL;
}
@@ -605,22 +634,24 @@
#if INTMAX_MAX < SIZE_MAX
if (count > INTMAX_MAX) {
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#endif
if (ctx->remaining >= (intmax_t)count) {
+ assert(ctx->cursor);
memcpy(dst, ctx->cursor, count);
ctx->cursor += count;
ctx->remaining -= (intmax_t)count;
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)count) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)count) {
ctx->remaining -= (intmax_t)count;
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
/**
@@ -672,27 +703,25 @@
{
uint64_t val = htole64(src);
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(src) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(src)) {
+ assert(ctx->cursor);
memcpy(ctx->cursor, &val, sizeof(val));
ctx->cursor += sizeof(src);
ctx->remaining -= sizeof(src);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(src)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(src)) {
ctx->remaining -= sizeof(src);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL
@@ -701,27 +730,25 @@
{
uint32_t val = htole32(src);
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(src) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(src)) {
+ assert(ctx->cursor);
memcpy(ctx->cursor, &val, sizeof(val));
ctx->cursor += sizeof(src);
ctx->remaining -= sizeof(src);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(src)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(src)) {
ctx->remaining -= sizeof(src);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL
@@ -730,54 +757,50 @@
{
uint16_t val = htole16(src);
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(src) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(src)) {
+ assert(ctx->cursor);
memcpy(ctx->cursor, &val, sizeof(val));
ctx->cursor += sizeof(src);
ctx->remaining -= sizeof(src);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(src)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(src)) {
ctx->remaining -= sizeof(src);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL
LIBPLDM_CC_ALWAYS_INLINE int pldm_msgbuf_insert_uint8(struct pldm_msgbuf *ctx,
const uint8_t src)
{
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(src) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(src)) {
+ assert(ctx->cursor);
memcpy(ctx->cursor, &src, sizeof(src));
ctx->cursor += sizeof(src);
ctx->remaining -= sizeof(src);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(src)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(src)) {
ctx->remaining -= sizeof(src);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL
@@ -786,27 +809,25 @@
{
int32_t val = htole32(src);
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(src) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(src)) {
+ assert(ctx->cursor);
memcpy(ctx->cursor, &val, sizeof(val));
ctx->cursor += sizeof(src);
ctx->remaining -= sizeof(src);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(src)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(src)) {
ctx->remaining -= sizeof(src);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL
@@ -815,54 +836,50 @@
{
int16_t val = htole16(src);
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(src) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(src)) {
+ assert(ctx->cursor);
memcpy(ctx->cursor, &val, sizeof(val));
ctx->cursor += sizeof(src);
ctx->remaining -= sizeof(src);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(src)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(src)) {
ctx->remaining -= sizeof(src);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL
LIBPLDM_CC_ALWAYS_INLINE int pldm_msgbuf_insert_int8(struct pldm_msgbuf *ctx,
const int8_t src)
{
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
static_assert(
// NOLINTNEXTLINE(bugprone-sizeof-expression)
sizeof(src) < INTMAX_MAX,
"The following addition may not uphold the runtime assertion");
if (ctx->remaining >= (intmax_t)sizeof(src)) {
+ assert(ctx->cursor);
memcpy(ctx->cursor, &src, sizeof(src));
ctx->cursor += sizeof(src);
ctx->remaining -= sizeof(src);
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)sizeof(src)) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)sizeof(src)) {
ctx->remaining -= sizeof(src);
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#define pldm_msgbuf_insert(dst, src) \
@@ -885,7 +902,7 @@
pldm__msgbuf_insert_array_void(struct pldm_msgbuf *ctx, size_t count,
const void *src, size_t src_count)
{
- if (!ctx->cursor || count > src_count) {
+ if (count > src_count) {
return -EINVAL;
}
@@ -895,22 +912,24 @@
#if INTMAX_MAX < SIZE_MAX
if (count > INTMAX_MAX) {
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#endif
if (ctx->remaining >= (intmax_t)count) {
+ assert(ctx->cursor);
memcpy(ctx->cursor, src, count);
ctx->cursor += count;
ctx->remaining -= (intmax_t)count;
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)count) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)count) {
ctx->remaining -= (intmax_t)count;
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
/**
@@ -962,17 +981,14 @@
size_t required,
void **cursor)
{
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
#if INTMAX_MAX < SIZE_MAX
if (required > INTMAX_MAX) {
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#endif
if (ctx->remaining >= (intmax_t)required) {
+ assert(ctx->cursor);
if (cursor) {
*cursor = ctx->cursor;
}
@@ -981,11 +997,12 @@
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)required) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)required) {
ctx->remaining -= (intmax_t)required;
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL_ARGS(1)
@@ -995,31 +1012,21 @@
{
intmax_t measured;
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
if (ctx->remaining < 0) {
- /* Tracking the amount of overflow gets disturbed here */
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
+ assert(ctx->cursor);
measured = (intmax_t)strnlen((const char *)ctx->cursor, ctx->remaining);
if (measured == ctx->remaining) {
- /*
- * We have hit the end of the buffer prior to the NUL terminator.
- * Optimistically, the NUL terminator was one-beyond-the-end. Setting
- * ctx->remaining negative ensures the `pldm_msgbuf_complete*()` APIs also
- * return an error.
- */
- ctx->remaining = -1;
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
/* Include the NUL terminator in the span length, as spans are opaque */
measured++;
if (ctx->remaining >= measured) {
+ assert(ctx->cursor);
if (cursor) {
*cursor = ctx->cursor;
}
@@ -1034,11 +1041,12 @@
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + measured) {
+ if (ctx->remaining > INTMAX_MIN + measured) {
ctx->remaining -= measured;
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL_ARGS(1)
@@ -1050,14 +1058,10 @@
ptrdiff_t measured;
void *end;
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
if (ctx->remaining < 0) {
- /* Tracking the amount of overflow gets disturbed here */
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
+ assert(ctx->cursor);
/*
* Avoid tripping up on UTF16-LE: We may have consecutive NUL _bytes_ that do
@@ -1084,8 +1088,7 @@
* the buffer. Setting ctx->remaining negative ensures the
* `pldm_msgbuf_complete*()` APIs also return an error.
*/
- ctx->remaining = -1;
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
end = (char *)end + sizeof(char16_t);
@@ -1093,11 +1096,12 @@
#if INTMAX_MAX < PTRDIFF_MAX
if (measured >= INTMAX_MAX) {
- return pldm_msgbuf_status(ctx, EOVERFLOW);
+ return pldm__msgbuf_invalidate(ctx);
}
#endif
if (ctx->remaining >= (intmax_t)measured) {
+ assert(ctx->cursor);
if (cursor) {
*cursor = ctx->cursor;
}
@@ -1112,25 +1116,23 @@
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)measured) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)measured) {
ctx->remaining -= (intmax_t)measured;
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
LIBPLDM_CC_NONNULL
LIBPLDM_CC_ALWAYS_INLINE int
pldm_msgbuf_span_remaining(struct pldm_msgbuf *ctx, void **cursor, size_t *len)
{
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
if (ctx->remaining < 0) {
return -EOVERFLOW;
}
+ assert(ctx->cursor);
*cursor = ctx->cursor;
ctx->cursor += ctx->remaining;
*len = ctx->remaining;
@@ -1143,14 +1145,11 @@
LIBPLDM_CC_ALWAYS_INLINE int
pldm_msgbuf_peek_remaining(struct pldm_msgbuf *ctx, void **cursor, size_t *len)
{
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
if (ctx->remaining < 0) {
return -EOVERFLOW;
}
+ assert(ctx->cursor);
*cursor = ctx->cursor;
*len = ctx->remaining;
@@ -1161,27 +1160,25 @@
LIBPLDM_CC_ALWAYS_INLINE int pldm_msgbuf_skip(struct pldm_msgbuf *ctx,
size_t count)
{
- if (!ctx->cursor) {
- return -EINVAL;
- }
-
#if INTMAX_MAX < SIZE_MAX
if (count > INTMAX_MAX) {
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
#endif
if (ctx->remaining >= (intmax_t)count) {
+ assert(ctx->cursor);
ctx->cursor += count;
ctx->remaining -= (intmax_t)count;
return 0;
}
- if (ctx->remaining >= INTMAX_MIN + (intmax_t)count) {
+ if (ctx->remaining > INTMAX_MIN + (intmax_t)count) {
ctx->remaining -= (intmax_t)count;
+ return -EOVERFLOW;
}
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
/**
@@ -1207,17 +1204,20 @@
{
int rc;
+ ctx->cursor = NULL;
rc = pldm_msgbuf_validate(ctx);
if (rc) {
+ pldm__msgbuf_invalidate(ctx);
return rc;
}
if ((size_t)ctx->remaining > orig_len) {
/* Caller passed incorrect orig_len */
- return -EOVERFLOW;
+ return pldm__msgbuf_invalidate(ctx);
}
*ret_used_len = orig_len - ctx->remaining;
+ pldm__msgbuf_invalidate(ctx);
return 0;
}
@@ -1241,18 +1241,17 @@
pldm__msgbuf_copy(struct pldm_msgbuf *dst, struct pldm_msgbuf *src, size_t size,
const char *description LIBPLDM_CC_UNUSED)
{
- if (!src->cursor || !dst->cursor) {
- return -EINVAL;
- }
-
#if INTMAX_MAX < SIZE_MAX
if (size > INTMAX_MAX) {
+ pldm__msgbuf_invalidate(src);
+ pldm__msgbuf_invalidate(dst);
return -EOVERFLOW;
}
#endif
if (src->remaining >= (intmax_t)size &&
dst->remaining >= (intmax_t)size) {
+ assert(src->cursor && dst->cursor);
memcpy(dst->cursor, src->cursor, size);
src->cursor += size;
src->remaining -= (intmax_t)size;
@@ -1261,12 +1260,16 @@
return 0;
}
- if (src->remaining >= INTMAX_MIN + (intmax_t)size) {
+ if (src->remaining > INTMAX_MIN + (intmax_t)size) {
src->remaining -= (intmax_t)size;
+ } else {
+ pldm__msgbuf_invalidate(src);
}
- if (dst->remaining >= INTMAX_MIN + (intmax_t)size) {
+ if (dst->remaining > INTMAX_MIN + (intmax_t)size) {
dst->remaining -= (intmax_t)size;
+ } else {
+ pldm__msgbuf_invalidate(dst);
}
return -EOVERFLOW;
diff --git a/src/oem/meta/file_io.c b/src/oem/meta/file_io.c
index cd125ef..d3e7a6d 100644
--- a/src/oem/meta/file_io.c
+++ b/src/oem/meta/file_io.c
@@ -21,8 +21,7 @@
const struct pldm_msg *msg, size_t payload_length,
struct pldm_oem_meta_file_io_write_req *req, size_t req_length)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
if (msg == NULL || req == NULL) {
@@ -43,13 +42,13 @@
pldm_msgbuf_extract(buf, req->handle);
rc = pldm_msgbuf_extract(buf, req->length);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract_array(buf, req->length, req->data,
req_length - sizeof(*req));
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
return pldm_msgbuf_complete_consumed(buf);
@@ -99,8 +98,7 @@
size_t payload_length,
struct pldm_oem_meta_file_io_read_req *req)
{
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
if (msg == NULL || req == NULL) {
return -EINVAL;
@@ -120,18 +118,18 @@
pldm_msgbuf_extract(buf, req->handle);
rc = pldm_msgbuf_extract(buf, req->option);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
rc = pldm_msgbuf_extract(buf, req->length);
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
switch (req->option) {
case PLDM_OEM_META_FILE_IO_READ_ATTR:
if (req->length != 0) {
- return -EPROTO;
+ return pldm_msgbuf_discard(buf, -EPROTO);
}
break;
case PLDM_OEM_META_FILE_IO_READ_DATA:
@@ -139,7 +137,7 @@
pldm_msgbuf_extract(buf, req->info.data.offset);
break;
default:
- return -EPROTO;
+ return pldm_msgbuf_discard(buf, -EPROTO);
}
return pldm_msgbuf_complete_consumed(buf);
@@ -158,8 +156,7 @@
size_t resp_len, struct pldm_msg *responseMsg, size_t payload_length)
{
int rc;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf *buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
struct pldm_header_info header = { 0 };
if (resp == NULL || responseMsg == NULL) {
@@ -207,11 +204,11 @@
resp->data,
resp_len - sizeof(*resp));
if (rc) {
- return rc;
+ return pldm_msgbuf_discard(buf, rc);
}
break;
default:
- return -EPROTO;
+ return pldm_msgbuf_discard(buf, -EPROTO);
}
return pldm_msgbuf_complete(buf);
diff --git a/tests/dsp/firmware_update.cpp b/tests/dsp/firmware_update.cpp
index 6961483..4fc7994 100644
--- a/tests/dsp/firmware_update.cpp
+++ b/tests/dsp/firmware_update.cpp
@@ -1481,8 +1481,7 @@
std::array<uint8_t, hdrSize + PLDM_QUERY_DOWNSTREAM_DEVICES_RESP_BYTES>
responseMsg{};
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(buf, 0, responseMsg.data() + hdrSize,
responseMsg.size() - hdrSize);
EXPECT_EQ(rc, 0);
@@ -1492,6 +1491,7 @@
pldm_msgbuf_insert_uint16(buf, number_of_downstream_devices_resp);
pldm_msgbuf_insert_uint16(buf, max_number_of_downstream_devices_resp);
pldm_msgbuf_insert_uint32(buf, capabilities_resp.value);
+ ASSERT_EQ(pldm_msgbuf_complete_consumed(buf), 0);
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
auto response = reinterpret_cast<pldm_msg*>(responseMsg.data());
@@ -1527,17 +1527,16 @@
std::array<uint8_t, hdrSize + PLDM_QUERY_DOWNSTREAM_DEVICES_RESP_BYTES>
responseMsg{};
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(buf, 0, responseMsg.data() + hdrSize,
responseMsg.size() - hdrSize);
- EXPECT_EQ(rc, 0);
-
+ ASSERT_EQ(rc, 0);
pldm_msgbuf_insert_uint8(buf, completion_code_resp);
pldm_msgbuf_insert_uint8(buf, downstream_device_update_supported_resp);
pldm_msgbuf_insert_uint16(buf, number_of_downstream_devices_resp);
pldm_msgbuf_insert_uint16(buf, max_number_of_downstream_devices_resp);
pldm_msgbuf_insert_uint32(buf, capabilities_resp.value);
+ ASSERT_EQ(pldm_msgbuf_complete_consumed(buf), 0);
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
auto response = reinterpret_cast<pldm_msg*>(responseMsg.data());
@@ -1567,11 +1566,10 @@
2 /* Inject error length*/>
responseMsg{};
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(buf, 0, responseMsg.data() + hdrSize,
responseMsg.size() - hdrSize);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
pldm_msgbuf_insert_uint8(buf, completion_code_resp);
pldm_msgbuf_insert_uint8(buf, downstream_device_update_supported_resp);
@@ -1579,6 +1577,7 @@
pldm_msgbuf_insert_uint16(buf, max_number_of_downstream_devices_resp);
// Inject error value
pldm_msgbuf_insert_uint16(buf, (uint16_t)capabilities_resp.value);
+ ASSERT_EQ(pldm_msgbuf_complete_consumed(buf), 0);
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
auto response = reinterpret_cast<pldm_msg*>(responseMsg.data());
@@ -1643,8 +1642,7 @@
PLDM_MSG_DEFINE_P(response, PLDM_QUERY_DOWNSTREAM_IDENTIFIERS_RESP_MIN_LEN);
struct pldm_query_downstream_identifiers_resp resp_data = {};
struct pldm_downstream_device_iter devs;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload,
@@ -1686,8 +1684,7 @@
struct pldm_query_downstream_identifiers_resp resp = {};
struct pldm_downstream_device_iter devs;
struct pldm_downstream_device dev;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload,
@@ -1729,8 +1726,7 @@
PLDM_MSG_DEFINE_P(response, payloadLen);
struct pldm_downstream_device_iter devs;
struct pldm_downstream_device dev;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload, payloadLen);
@@ -1818,8 +1814,7 @@
PLDM_MSG_DEFINE_P(response, payloadLen);
struct pldm_downstream_device_iter devs;
struct pldm_downstream_device dev;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload, payloadLen);
@@ -1929,8 +1924,7 @@
PLDM_MSG_DEFINE_P(response, payloadLen);
struct pldm_downstream_device_iter devs;
struct pldm_downstream_device dev;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload, payloadLen);
@@ -2045,8 +2039,7 @@
PLDM_MSG_DEFINE_P(response, payloadLen);
struct pldm_downstream_device_iter devs;
struct pldm_downstream_device dev;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload, payloadLen);
@@ -2178,14 +2171,13 @@
struct pldm_query_downstream_identifiers_resp resp_data = {};
struct pldm_downstream_device_iter devs;
PLDM_MSG_DEFINE_P(response, payloadLen);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
void* devicesStart = NULL;
size_t devicesLen;
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload, payloadLen);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
pldm_msgbuf_insert_uint8(buf, complition_code_resp);
pldm_msgbuf_insert_uint32(buf, next_data_transfer_handle_resp);
@@ -2194,6 +2186,8 @@
pldm_msgbuf_insert_uint16(buf, number_of_downstream_devices_resp);
pldm_msgbuf_span_remaining(buf, &devicesStart, &devicesLen);
+ ASSERT_EQ(0, pldm_msgbuf_complete(buf));
+
/** Filling descriptor data, the correctness of the downstream devices data
* is not checked in this test case so filling with 0xff
*/
@@ -2221,8 +2215,7 @@
struct pldm_query_downstream_identifiers_resp resp_data = {};
struct pldm_downstream_device_iter devs;
PLDM_MSG_DEFINE_P(response, payloadLen);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload, payloadLen);
@@ -2234,6 +2227,7 @@
pldm_msgbuf_insert_uint32(buf, downstream_devices_length_resp);
// Inject error buffer size
pldm_msgbuf_insert_uint8(buf, (uint8_t)number_of_downstream_devices_resp);
+ ASSERT_EQ(pldm_msgbuf_complete_consumed(buf), 0);
rc = decode_query_downstream_identifiers_resp(response, payloadLen,
&resp_data, &devs);
@@ -2316,12 +2310,11 @@
downstreamDeviceParamTableLen;
PLDM_MSG_DEFINE_P(response, payload_len);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload, payload_len);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
// Table 24
pldm_msgbuf_insert_uint8(buf, completion_code_resp);
@@ -2426,12 +2419,11 @@
downstreamDeviceParamTableLen;
PLDM_MSG_DEFINE_P(response, payload_len);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc = 0;
rc = pldm_msgbuf_init_errno(buf, 0, response->payload, payload_len);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
// Table 24
pldm_msgbuf_insert_uint8(buf, completion_code_resp);
@@ -2590,17 +2582,17 @@
int rc = 0;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(buf, 0, responseMsg.data() + hdrSize,
responseMsg.size() - hdrSize);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
pldm_msgbuf_insert_uint8(buf, complition_code_resp);
pldm_msgbuf_insert_uint32(buf, next_data_transfer_handle_resp);
pldm_msgbuf_insert_uint8(buf, transfer_flag_resp);
pldm_msgbuf_insert_uint32(buf, fdp_capabilities_during_update.value);
pldm_msgbuf_insert_uint16(buf, downstreamDeviceCount);
+ ASSERT_EQ(pldm_msgbuf_complete(buf), 0);
/** Filling paramter table, the correctness of the downstream devices data
* is not checked in this test case so filling with 0xff
diff --git a/tests/dsp/platform.cpp b/tests/dsp/platform.cpp
index 9b3a43b..2f88ee4 100644
--- a/tests/dsp/platform.cpp
+++ b/tests/dsp/platform.cpp
@@ -467,8 +467,7 @@
alignas(pldm_msg) unsigned char data[sizeof(pldm_msg_hdr) +
PLDM_GET_PDR_MIN_RESP_BYTES +
sizeof(recordData) - 1 + 1];
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
pldm_msg* msg = new (data) pldm_msg;
@@ -709,8 +708,7 @@
data[sizeof(pldm_msg_hdr) + PLDM_GET_PDR_REPOSITORY_INFO_RESP_BYTES];
uint8_t updateTime[PLDM_TIMESTAMP104_SIZE] = {0};
uint8_t oemUpdateTime[PLDM_TIMESTAMP104_SIZE] = {0};
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
int rc;
pldm_msg* msg = new (data) pldm_msg;
@@ -1466,12 +1464,11 @@
PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES);
EXPECT_EQ(rc, PLDM_SUCCESS);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(
buf, PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES, request->payload,
PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
uint8_t retFormatVersion;
uint8_t retTransferOperationFlag;
@@ -1505,12 +1502,11 @@
PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES);
EXPECT_EQ(rc, PLDM_SUCCESS);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(
buf, PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES, request->payload,
PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
uint8_t retFormatVersion;
uint8_t retTransferOperationFlag;
@@ -1544,12 +1540,11 @@
PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES);
EXPECT_EQ(rc, PLDM_SUCCESS);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(
buf, PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES, request->payload,
PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_REQ_BYTES);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
uint8_t retFormatVersion;
uint8_t retTransferOperationFlag;
@@ -2017,12 +2012,11 @@
eventDataIntegrityChecksum, response, payloadLength);
EXPECT_EQ(rc, PLDM_SUCCESS);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(
buf, PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_MIN_RESP_BYTES,
response->payload, payloadLength);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
uint8_t retCompletionCode;
uint8_t retTid = 0;
@@ -2045,6 +2039,7 @@
sizeof(retEventData));
ASSERT_EQ(rc, 0);
pldm_msgbuf_extract_uint32(buf, retEventDataIntegrityChecksum);
+ ASSERT_EQ(pldm_msgbuf_complete(buf), 0);
EXPECT_EQ(rc, PLDM_SUCCESS);
EXPECT_EQ(retCompletionCode, completionCode);
@@ -2056,8 +2051,6 @@
EXPECT_EQ(retEventDataSize, eventDataSize);
EXPECT_EQ(retEventDataIntegrityChecksum, eventDataIntegrityChecksum);
EXPECT_EQ(0, memcmp(pEventData, retEventData, eventDataSize));
-
- EXPECT_EQ(pldm_msgbuf_complete(buf), PLDM_SUCCESS);
}
TEST(PollForPlatformEventMessage, testGoodEncodeResposeP2)
@@ -2078,12 +2071,11 @@
response, payloadLength);
EXPECT_EQ(rc, PLDM_SUCCESS);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(
buf, PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_MIN_RESP_BYTES,
response->payload, payloadLength);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
uint8_t retCompletionCode;
uint8_t retTid = 0;
@@ -2092,12 +2084,12 @@
pldm_msgbuf_extract_uint8(buf, retCompletionCode);
pldm_msgbuf_extract_uint8(buf, retTid);
pldm_msgbuf_extract_uint16(buf, retEventId);
+ ASSERT_EQ(pldm_msgbuf_complete(buf), 0);
EXPECT_EQ(rc, PLDM_SUCCESS);
EXPECT_EQ(retCompletionCode, completionCode);
EXPECT_EQ(retTid, tId);
EXPECT_EQ(retEventId, eventId);
- EXPECT_EQ(pldm_msgbuf_complete(buf), PLDM_SUCCESS);
}
TEST(PollForPlatformEventMessage, testGoodEncodeResposeP3)
@@ -2118,12 +2110,11 @@
response, payloadLength);
EXPECT_EQ(rc, PLDM_SUCCESS);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(
buf, PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_MIN_RESP_BYTES,
response->payload, payloadLength);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
uint8_t retCompletionCode;
uint8_t retTid = 0;
@@ -2132,12 +2123,12 @@
pldm_msgbuf_extract_uint8(buf, retCompletionCode);
pldm_msgbuf_extract_uint8(buf, retTid);
pldm_msgbuf_extract_uint16(buf, retEventId);
+ ASSERT_EQ(pldm_msgbuf_complete(buf), PLDM_SUCCESS);
EXPECT_EQ(rc, PLDM_SUCCESS);
EXPECT_EQ(retCompletionCode, completionCode);
EXPECT_EQ(retTid, tId);
EXPECT_EQ(retEventId, eventId);
- EXPECT_EQ(pldm_msgbuf_complete(buf), PLDM_SUCCESS);
}
TEST(PollForPlatformEventMessage, testGoodEncodeResposeP4)
@@ -2167,12 +2158,11 @@
eventDataIntegrityChecksum, response, payloadLength);
EXPECT_EQ(rc, PLDM_SUCCESS);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(
buf, PLDM_POLL_FOR_PLATFORM_EVENT_MESSAGE_MIN_RESP_BYTES,
response->payload, payloadLength);
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
uint8_t retCompletionCode;
uint8_t retTid = 0;
@@ -2191,6 +2181,7 @@
pldm_msgbuf_extract_uint8(buf, retEventClass);
pldm_msgbuf_extract_uint32(buf, retEventDataSize);
pldm_msgbuf_extract_uint32(buf, retEventDataIntegrityChecksum);
+ EXPECT_EQ(pldm_msgbuf_complete(buf), 0);
EXPECT_EQ(rc, PLDM_SUCCESS);
EXPECT_EQ(retCompletionCode, completionCode);
@@ -2201,8 +2192,6 @@
EXPECT_EQ(retEventClass, eventClass);
EXPECT_EQ(retEventDataSize, eventDataSize);
EXPECT_EQ(retEventDataIntegrityChecksum, eventDataIntegrityChecksum);
-
- EXPECT_EQ(pldm_msgbuf_complete(buf), PLDM_SUCCESS);
}
TEST(PollForPlatformEventMessage, testBadEncodeResponse)
@@ -2336,8 +2325,7 @@
static constexpr const uint8_t eventData = 34;
static constexpr const uint8_t Tid = 0x03;
struct pldm_platform_event_message_req req;
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
size_t len;
void* data;
@@ -2664,27 +2652,26 @@
EXPECT_EQ(rc, PLDM_SUCCESS);
- struct pldm_msgbuf _buf;
- struct pldm_msgbuf* buf = &_buf;
+ PLDM_MSGBUF_DEFINE_P(buf);
rc = pldm_msgbuf_init_errno(
buf, PLDM_MSG_POLL_EVENT_LENGTH,
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
reinterpret_cast<uint8_t*>(eventData.data()), eventData.size());
- EXPECT_EQ(rc, 0);
+ ASSERT_EQ(rc, 0);
uint8_t retFormatVersion;
uint16_t reteventID;
uint32_t retDataTransferHandle;
- EXPECT_EQ(pldm_msgbuf_extract_uint8(buf, retFormatVersion), PLDM_SUCCESS);
- EXPECT_EQ(pldm_msgbuf_extract_uint16(buf, reteventID), PLDM_SUCCESS);
- EXPECT_EQ(pldm_msgbuf_extract_uint32(buf, retDataTransferHandle),
- PLDM_SUCCESS);
+ pldm_msgbuf_extract_uint8(buf, retFormatVersion);
+ pldm_msgbuf_extract_uint16(buf, reteventID);
+ pldm_msgbuf_extract_uint32(buf, retDataTransferHandle);
+ ASSERT_EQ(pldm_msgbuf_complete_consumed(buf), PLDM_SUCCESS);
+
EXPECT_EQ(retFormatVersion, poll_event.format_version);
EXPECT_EQ(reteventID, poll_event.event_id);
EXPECT_EQ(retDataTransferHandle, poll_event.data_transfer_handle);
- EXPECT_EQ(pldm_msgbuf_complete_consumed(buf), PLDM_SUCCESS);
}
#endif
diff --git a/tests/fuzz/fd-fuzz.cpp b/tests/fuzz/fd-fuzz.cpp
index e238f27..9049ab8 100644
--- a/tests/fuzz/fd-fuzz.cpp
+++ b/tests/fuzz/fd-fuzz.cpp
@@ -368,11 +368,9 @@
extern "C" int LLVMFuzzerTestOneInput(uint8_t* input, size_t len)
{
+ PLDM_MSGBUF_DEFINE_P(fuzzproto);
+ PLDM_MSGBUF_DEFINE_P(fuzzctrl);
int rc;
- struct pldm_msgbuf _fuzzctrl;
- struct pldm_msgbuf* fuzzctrl = &_fuzzctrl;
- struct pldm_msgbuf _fuzzproto;
- struct pldm_msgbuf* fuzzproto = &_fuzzproto;
/* Split input into two parts. First FUZZCTRL_SIZE (0x400 bytes currently)
* is used for fuzzing control (random choices etc).
@@ -437,6 +435,9 @@
}
assert(len <= send_buf.size());
}
+ rc = pldm_msgbuf_discard(fuzzproto, rc);
+ rc = pldm_msgbuf_discard(fuzzctrl, rc);
+ (void)rc;
free(fd);
return 0;
diff --git a/tests/oem/meta/fileio.cpp b/tests/oem/meta/fileio.cpp
index 33c8c9c..747f3be 100644
--- a/tests/oem/meta/fileio.cpp
+++ b/tests/oem/meta/fileio.cpp
@@ -13,8 +13,7 @@
TEST(DecodeOemMetaFileIoWriteReq, testGoodDecodeRequest)
{
constexpr const uint8_t postCode[4] = {0x93, 0xe0, 0x00, 0xea};
- struct pldm_msgbuf _ctx;
- struct pldm_msgbuf* ctx = &_ctx;
+ PLDM_MSGBUF_DEFINE_P(ctx);
int rc;
constexpr size_t encodedPayloadLen =
@@ -83,8 +82,7 @@
TEST(DecodeOemMetaFileIoReadReq, testGoodDecodeRequest)
{
- struct pldm_msgbuf _ctx;
- struct pldm_msgbuf* ctx = &_ctx;
+ PLDM_MSGBUF_DEFINE_P(ctx);
int rc;
constexpr size_t payloadLen = PLDM_OEM_META_FILE_IO_READ_REQ_MIN_LENGTH +