aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux
AgeCommit message (Collapse)AuthorFilesLines
2016-10-06qmi-codegen: allow fields to be hidden with 'visible':'no'Dan Williams6-0/+95
We want to mark some TLV fields as reserved and not exposed through the public API due to alignment or other issues.
2016-09-05qmi-codegen: fixed multiple common-refs processingAliaksandr Barouski1-3/+5
2016-03-20qmicli: fix --dms-get-band-capabilities output on 32-bit platformsReinhard Speyerer1-1/+1
The @enum_name@_build_string_from_mask template in qmi-flags64-types-template.c uses a local gulong number variable. On platforms where sizeof(gulong) < sizeof(Qmi*BandCapability) this may cause bands to be missing from qmicli output or incorrect bands to be contained in the output. Replace gulong number with guint64 number to fix this. Signed-off-by: Reinhard Speyerer <rspmn@arcor.de>
2016-02-10qmi-codegen: fix too-small transaction id in internal message codeDan Williams1-1/+1
Found by John. https://bugs.freedesktop.org/show_bug.cgi?id=94083
2015-08-02qmi-codegen: avoid variable names like 'new'Aleksander Morgado1-2/+2
For C++ compatibility, we should not generate variables with the names of protected C++ keywords, like 'new'. Currently this was happening in the "DMS Set Service Programming Code" method, where we had a TLV named "New". Instead of renaming the TLV, which would change the name of the getter method as well, we will force prepending the "value_" string to the variable names of the getter and setter methods. https://bugs.freedesktop.org/show_bug.cgi?id=91479
2015-01-25qmi-codegen: require Service set for a correct Client definitionAleksander Morgado1-1/+3
2015-01-11qmi-codegen: update copyright of built filesAleksander Morgado1-0/+1
2015-01-11qmi-codegen: avoid breaking API when defining strings in public structsAleksander Morgado3-6/+53
Commit b9c3701e337198 introduced an API break, where we would change a pointer to a heap allocated string and instead use a fixed size char array. This commit will instead recover the pointer to the string when used in a public struct, so that API isn't broken w.r.t. previous stable libqmi versions. The string is now properly allocated before reading and deallocated as part of the struct deallocation.
2014-12-12qmi-codegen: fix printing contents of structs with fixed sized stringsAleksander Morgado1-2/+4
If the fixed sized string contains no characters or is shorter than the explicit size, NUL bytes will be included. If we try to append exactly the size of the string, we'll end up with embedded NULs in our string to print, so the actual output will be cut, even if the string is longer after the embedded NUL bytes. E.g.: >>>>>> TLV: >>>>>> type = "GERAN Info" (0x10) >>>>>> length = 61 >>>>>> value = 00:00:00:00:00:00:00:00:00:00:00:00:FF:FF:FF:FF:28:00:03:7D:6F:00:00:32:F4:51:B3:00:4D:00:11:2A:00:8A:3C:00:00:32:F4:51:B3:00:63:00:30:14:00:89:3C:00:00:32:F4:51:B3:00:59:00:11:0D:00 >>>>>> translated = [ cell_id = '0' plmn = ' With this fix, we avoid this by explicitly finishing ourselves the fixed sized string with a NUL byte, and then adding the C string as the non-fixed sized ones, i.e. until the first NUL byte is found. E.g.: >>>>>> TLV: >>>>>> type = "GERAN Info" (0x10) >>>>>> length = 61 >>>>>> value = 00:00:00:00:00:00:00:00:00:00:00:00:FF:FF:FF:FF:28:00:03:7D:6F:00:00:32:F4:51:B3:00:4D:00:11:2A:00:8A:3C:00:00:32:F4:51:B3:00:63:00:30:14:00:89:3C:00:00:32:F4:51:B3:00:59:00:11:0D:00 >>>>>> translated = [ cell_id = '0' plmn = '' lac = '0' geran_absolute_rf_channel_number = '0' base_station_identity_code = '0' timing_advance = '4294967295' rx_level = '40' cell = '{ [0] = '[ cell_id = '28541' plmn = '2\xf4Q' lac = '179' geran_absolute_rf_channel_number = '77' base_station_identity_code = '17' rx_level = '42' ] ' [1] = '[ cell_id = '15498' plmn = '2\xf4Q' lac = '179' geran_absolute_rf_channel_number = '99' base_station_identity_code = '48' rx_level = '20' ] ' [2] = '[ cell_id = '15497' plmn = '2\xf4Q' lac = '179' geran_absolute_rf_channel_number = '89' base_station_identity_code = '17' rx_level = '13' ] '}' ]
2014-12-12qmi-codegen: fix public struct type generationAleksander Morgado7-16/+17
This change triggers an API break. When building structs to be included in the public header, we were just relying on using the 'public_format' of each variable. This is an error, as the variable may be more complex than just public/private. E.g. could be another struct, or an array, or a fixed sized string, as in the example. In particular, this bug currently affects one public type, where one of its elements changes from being just a pointer to a string to a fixed sized array of 4 bytes. The following type is changed from: typedef struct _QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement { guint32 cell_id; gchar * plmn; guint16 lac; guint16 geran_absolute_rf_channel_number; guint8 base_station_identity_code; guint16 rx_level; } QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement; To: typedef struct _QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement { guint32 cell_id; gchar plmn[4]; guint16 lac; guint16 geran_absolute_rf_channel_number; guint8 base_station_identity_code; guint16 rx_level; } QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement; Thanks to Joseba Sanjuan <joseba.sanjuan@gmail.com> for finding the bug.
2014-11-21qmi-codegen: don't mark missing optional TLVs as setDan Williams1-11/+16
In the optional TLV case, 'tlv_error' was never set to TRUE when the optional TLV was missing, because the return value of qmi_message_tlv_read_init() was ignored. This caused "self->arg_*_set" to always be TRUE and NULL strings to be returned to callers requesting the TLV value later. Also prevent incorrect "Left X bytes unread when getting..." messages caused when the TLV is missing. This bug was found when probing a modem that does not return an MEID TLV to DMSGetIds (because it is GSM/UMTS/LTE only), but qmi_message_dms_get_ids_output_get_meid() returned TRUE and a NULL 'str': if (qmi_message_dms_get_ids_output_get_meid (output, &str, NULL) && --> str[0] != '\0' && str[0] != '0') { Bug introduced in b143b7f6 (qmi-codegen: use the new TLV reader API). Before: ======= gsize offset = 0; gsize init_offset; gboolean tlv_error = FALSE; init_offset = qmi_message_tlv_read_init (message, QMI_INDICATION_DMS_EVENT_REPORT_OUTPUT_TLV_POWER_STATE, NULL, NULL); <<<snip>>> /* The remaining size of the buffer needs to be 0 if we successfully read the TLV */ if ((offset = __qmi_message_tlv_read_remaining_size (message, init_offset, offset)) > 0) { g_warning ("Left '%" G_GSIZE_FORMAT "' bytes unread when getting the 'Power State' TLV", offset); } qmi_indication_dms_event_report_output_power_state_out: if (!tlv_error) self->arg_power_state_set = TRUE; After: ====== gsize offset = 0; gsize init_offset; if ((init_offset = qmi_message_tlv_read_init (message, QMI_INDICATION_DMS_EVENT_REPORT_OUTPUT_TLV_POWER_STATE, NULL, NULL)) == 0) { goto qmi_indication_dms_event_report_output_power_state_out; } <<<snip>>> /* The remaining size of the buffer needs to be 0 if we successfully read the TLV */ if ((offset = __qmi_message_tlv_read_remaining_size (message, init_offset, offset)) > 0) { g_warning ("Left '%" G_GSIZE_FORMAT "' bytes unread when getting the 'Power State' TLV", offset); } self->arg_power_state_set = TRUE; qmi_indication_dms_event_report_output_power_state_out: ;
2014-11-09qmi-codegen: use the new TLV reader APIAleksander Morgado7-409/+134
2014-11-09qmi-codegen: use the new TLV builder APIAleksander Morgado8-111/+71
2014-10-08qmi-codegen: make sure expected len is 4 bytesAleksander Morgado1-1/+1
Suggested by Thomas Haller <thaller@redhat.com>.
2014-10-08qmi-codegen: error out if invalid array size element in JSONAleksander Morgado1-1/+1
Suggested by Thomas Haller <thaller@redhat.com>.
2014-10-08qmi-codegen: avoid buffer overlow in emit_input_tlv_add()Thomas Haller7-28/+77
https://bugzilla.redhat.com/show_bug.cgi?id=1031738 Reported-by: Florian Weimer <fweimer@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-08qmi-codegen: ensure enough buffer available to read string/array size variableAleksander Morgado3-4/+28
Code generation via emit_size_read() creates the _validate() functions. The generated code for strings and arrays used to read the length prefix without checking that the provided buffer is large enough. https://bugzilla.redhat.com/show_bug.cgi?id=1031738 Patch based on a patch from Thomas Haller <thaller@redhat.com> Reported-by: Florian Weimer <fweimer@redhat.com>
2014-05-28nas: consolidate variable namesAleksander Morgado1-1/+1
2014-05-28qmi-codegen: handle 'gfloat' typesAleksander Morgado3-5/+23
2014-02-17build-aux,qmi-codegen: explicitly state which services have flags64Aleksander Morgado1-2/+2
... not the other way around.
2013-09-04oma: setup generation of the OMA service supportAleksander Morgado1-2/+2
2013-09-02uim: integrate the UIM serviceAleksander Morgado1-2/+2
Also implement "Reset" and "Read Record" request/response.
2013-07-15qmi-codegen: allow handling built-in sequence numbers in arraysAleksander Morgado1-22/+125
TLVs are really limited in size, so if you want to have truly long data passed between host and modem, you may end up needing multiple QMI messages where the long TLV is split in segments. Currently support this by handling a built-in sequence number expected to be found between the array size prefix and the array itself (see e.g. TLV 0x13 (PRL) in 'DMS Activate Manual'). This sequence number can be enabled with the new 'sequence-prefix-format' keyword in the array definition.
2013-07-04pbm: setup generation of the PBM service supportAleksander Morgado1-2/+2
Only 'Indication Register' message for now.
2013-03-07dms: activation code string needs explicit 1-byte length prefixAleksander Morgado1-5/+5
Reported by Arman Uguray <armansito@google.com>
2012-12-24qmi-codegen: clean up compiled python filesMarius Kotsbak1-0/+2
These caused problems for deb packaging, as their content depends on the Python version used.
2012-12-17qmi-codegen python3: change string.lower(str) to str.lower()Shawn J. Goff1-2/+2
The string.lower(str) class method is no longer available. sed regex: s/string\.lower(\(.*\))/\1.lower()/
2012-12-17qmi-codegen python3: fix dict.has_key('key') to 'key' in dictShawn J. Goff1-1/+1
Python 3 no longer supports the has_key() method. sed regex: s/\([^ ]\+\)\.has_key(\([^)]*\))/\2 in \1/g
2012-12-17qmi-codegen python3: change string.replace() class method use to ↵Shawn J. Goff3-8/+7
str.replace() instance method Python 3 doesn't support the replace class method; it's now an instance method only. string.replace(object, old, new) changes to object.replace(old, new) sed: s/string\.replace(\([^,]*\), /\1.replace(/
2012-12-17qmi-codegen: fix some python3 compatibility issuesDan Williams5-14/+14
Simple methods are no longer in the string module.
2012-11-02qmi-codegen: translate the values of enums/flags in tracesAleksander Morgado5-27/+52
2012-11-02qmi-codegen: fix computation of expected TLV length when using stringsAleksander Morgado1-2/+2
2012-10-30qmi-codegen: validate TLV before really reading itAleksander Morgado10-23/+220
Try to handle buggy firmware, or just make the library more robust, by validating the read TLV before really reading it. If a TLV is not considered valid, we just skip it for now. E.g.: the "Detailed Service Status" TLV (0x21) in the "NAS Get Serving System" message is supposed to be a sequence of 5 bytes, but some models (e.g. ZTE MF683) end up sending only the first 4 bytes.
2012-10-29libqmi-glib,utils: no need to pass endianness when reading/writing single bytesAleksander Morgado1-10/+25
2012-10-23libqmi-glib,qmi-codegen: add endian-ness annotation capabilityDan Williams3-4/+25
Some values are sent by the firmware in big endian byte order, specifically IP addresses, which are sent in network byte order (ie, big endian). Add the ability to specify the byte order the firmware handles the value as, and convert that to host byte order when reading/writing QMI buffers.
2012-10-10libqmi-glib,qmi-codegen: cancelled operations will issue an ABORT messageAleksander Morgado1-1/+2
We allow passing a GCancellable to every async operation with the clients. Now, if the cancellable gets cancelled and the operation can be ABORT-ed, then we do it.
2012-10-10libqmi-glib,qmi-codegen: timed out operations will issue an ABORT messageAleksander Morgado4-40/+147
Messages can now be tagged with a special 'abort' keyword, so that whenever the message times out we issue a new ABORT command to cancel the specific timed out request. This support is currently only available for the NAS and WDS services, which are the ones supporting ABORT for their long-running operations.
2012-10-09libqmi-glib,utils: make qmi_utils_str_hex() private to the libraryAleksander Morgado1-1/+1
2012-10-09qmi-codegen: make internal get_printable() and get_version_introduced()Aleksander Morgado1-20/+18
These methods are (should only be) used only by the library.
2012-10-09docs: improve documentation of enums, flags and errorsAleksander Morgado3-12/+38
2012-10-09qmi-codegen: request creator and response/indication parsers are privateAleksander Morgado2-46/+8
2012-10-09libqmi-glib: completely hide the implicit CTL Client in the APIAleksander Morgado1-11/+14
2012-10-09libqmi-glib: new header file for private enum/flag typesAleksander Morgado1-0/+3
2012-10-09build: include missing files in distAleksander Morgado1-0/+1
2012-10-09docs: improve generated `libqmi-glib' documentationAleksander Morgado14-15/+396
Among the tons of fixes done here, we now generate some per-service .sections file which we then concatenate to build the final libqmi-glib-sections.txt file.
2012-10-09libmm-glib: fix multiple documentation issuesAleksander Morgado3-5/+5
2012-09-26qmi-codegen: don't issue the array element clear function on 'Input' arraysAleksander Morgado6-17/+32
When an array is required to be passed in an input TLV, the user who created it is responsible for freeing it. Therefore, we should not dump the static array element clear function in these cases, or these unused methods will end up breaking the compilation.
2012-09-26message: swapped buffer/length variables in `qmi_message_get_tlv_printable()'Aleksander Morgado1-2/+2
2012-09-26message: renamed `qmi_message_tlv_foreach()' to `qmi_message_foreach_raw_tlv()'Aleksander Morgado1-4/+4
2012-09-26message: renamed `qmi_message_tlv_add()' to `qmi_message_add_raw_tlv()'Aleksander Morgado1-5/+5
Also swapped length and buffer variables; it no longer follows the 'TLV' name (type,length,value), but it's more consistent with other interfaces where buffer is given first and then the length.