File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -839,6 +839,32 @@ translate_internal_lbf(translator_t *trans)
839839 return 0 ;
840840}
841841
842+ /**
843+ * \brief Convert (fill) ODID field
844+ *
845+ * \note This function uses a message context configured by the user. It's independent on the
846+ * content of an IPFIX record.
847+ * \param[in] trans Internal translator structure
848+ * \return On success returns 0. Otherwise returns non-zero value!
849+ */
850+ static int
851+ translate_internal_odid (translator_t * trans )
852+ {
853+ if (!trans -> msg_context .hdr ) {
854+ return 1 ; // Message header is not available!
855+ }
856+
857+ // Get the ODID value
858+ uint32_t odid = ntohl (trans -> msg_context .hdr -> odid );
859+
860+ ur_field_type_t ur_id = trans -> extra_conv .odid .field_id ;
861+ void * field_ptr = ur_get_ptr_by_id (trans -> record .ur_tmplt , trans -> record .data , ur_id );
862+
863+ * ((uint32_t * ) field_ptr ) = odid ;
864+
865+ return 0 ;
866+ }
867+
842868/**
843869 * \brief Get size of UniRec numeric data types
844870 * \param type UniRec data types
You can’t perform that action at this time.
0 commit comments