int ret = 0;
struct ctf_field_class_int *int_fc;
struct ctf_field_class *fc;
- bool has_total_size = false;
- bool has_content_size = false;
if (sc->is_translated) {
goto end;
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
(void *) sc->packet_context_fc, "timestamp_begin");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet context field class: "
"`timestamp_begin` member is not an integer field class.");
goto invalid;
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
(void *) sc->packet_context_fc, "timestamp_end");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet context field class: "
"`timestamp_end` member is not an integer field class.");
goto invalid;
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
(void *) sc->packet_context_fc, "events_discarded");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet context field class: "
"`events_discarded` member is not an integer field class.");
goto invalid;
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
(void *) sc->packet_context_fc, "packet_seq_num");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet context field class: "
"`packet_seq_num` member is not an integer field class.");
goto invalid;
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
(void *) sc->packet_context_fc, "packet_size");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet context field class: "
"`packet_size` member is not an integer field class.");
goto invalid;
"`packet_size` member is signed.");
goto invalid;
}
-
- has_total_size = true;
}
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
(void *) sc->packet_context_fc, "content_size");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet context field class: "
"`content_size` member is not an integer field class.");
goto invalid;
"`content_size` member is signed.");
goto invalid;
}
-
- has_content_size = true;
- }
-
- if (has_content_size && !has_total_size) {
- BT_LOGE_STR("Invalid packet context field class: "
- "`content_size` member exists without "
- "`packet_size` member.");
- goto invalid;
}
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
(void *) sc->event_header_fc, "id");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid event header field class: "
"`id` member is not an integer field class.");
goto invalid;
goto invalid;
}
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet header field class: "
"`magic` member is not an integer field class.");
goto invalid;
fc = ctf_field_class_struct_borrow_member_field_class_by_name(
(void *) ctf_tc->packet_header_fc, "stream_id");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet header field class: "
"`stream_id` member is not an integer field class.");
goto invalid;
(void *) ctf_tc->packet_header_fc,
"stream_instance_id");
if (fc) {
- if (fc->id != CTF_FIELD_CLASS_ID_INT &&
- fc->id != CTF_FIELD_CLASS_ID_ENUM) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_INT &&
+ fc->type != CTF_FIELD_CLASS_TYPE_ENUM) {
BT_LOGE_STR("Invalid packet header field class: "
"`stream_instance_id` member is not an integer field class.");
goto invalid;
if (fc) {
struct ctf_field_class_array *array_fc = (void *) fc;
- if (fc->id != CTF_FIELD_CLASS_ID_ARRAY) {
+ if (fc->type != CTF_FIELD_CLASS_TYPE_ARRAY) {
BT_LOGE_STR("Invalid packet header field class: "
"`uuid` member is not an array field class.");
goto invalid;
goto invalid;
}
- if (array_fc->base.elem_fc->id != CTF_FIELD_CLASS_ID_INT) {
+ if (array_fc->base.elem_fc->type != CTF_FIELD_CLASS_TYPE_INT) {
BT_LOGE_STR("Invalid packet header field class: "
"`uuid` member's element field class is not "
"an integer field class.");