2 Commits

Author SHA1 Message Date
Harald Welte
e1961beea1 Use gsmtap_inst_fd2() to remove compiler warning
gsmtap.c: In function 'osmo_st2_gsmtap_send_apdu':
gsmtap.c:69:9: warning: 'gsmtap_inst_fd' is deprecated: Use gsmtap_inst_fd2() instead [-Wdeprecated-declarations]
   69 |         rc = write(gsmtap_inst_fd(g_gti), buf, gross_len);
      |         ^~

Change-Id: I62de38175e63cb563635a01b025b805981e4b7a9
2026-02-27 11:18:45 +01:00
Oliver Smith
d0ad985eb0 Generate a version.h file
Related: OS#6626
Change-Id: Ia894a9d9a20e343755d8060822d33b8a1c59b4db
2025-06-23 16:00:59 +02:00
4 changed files with 29 additions and 2 deletions

1
.gitignore vendored
View File

@@ -26,3 +26,4 @@ usb_strings_generated.h
firmware/usbstring/usbstring firmware/usbstring/usbstring
firmware/apps/*/usb_strings.txt.patched firmware/apps/*/usb_strings.txt.patched
firmware/misc/crctool firmware/misc/crctool
host/include/osmocom/simtrace2/version.h

View File

@@ -1,3 +1,12 @@
osmocom/simtrace2/version.h: osmocom/simtrace2/version.h.tpl
$(AM_V_GEN)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)sed \
-e "s/{{VERSION}}/$$(echo '@VERSION@' | cut -d. -f1-3)/g" \
-e "s/{{VERSION_MAJOR}}/$$(echo '@VERSION@' | cut -d. -f1)/g" \
-e "s/{{VERSION_MINOR}}/$$(echo '@VERSION@' | cut -d. -f2)/g" \
-e "s/{{VERSION_PATCH}}/$$(echo '@VERSION@' | cut -d. -f3)/g" \
$< > $@
nobase_include_HEADERS = \ nobase_include_HEADERS = \
osmocom/simtrace2/apdu_dispatch.h \ osmocom/simtrace2/apdu_dispatch.h \
osmocom/simtrace2/simtrace2_api.h \ osmocom/simtrace2/simtrace2_api.h \
@@ -5,4 +14,5 @@ nobase_include_HEADERS = \
osmocom/simtrace2/simtrace_prot.h \ osmocom/simtrace2/simtrace_prot.h \
osmocom/simtrace2/usb_util.h \ osmocom/simtrace2/usb_util.h \
osmocom/simtrace2/gsmtap.h \ osmocom/simtrace2/gsmtap.h \
osmocom/simtrace2/version.h \
$(NULL) $(NULL)

View File

@@ -0,0 +1,16 @@
#pragma once
#define LIBOSMO_SIMTRACE2_VERSION {{VERSION}}
#define LIBOSMO_SIMTRACE2_VERSION_STR "{{VERSION}}"
#define LIBOSMO_SIMTRACE2_VERSION_MAJOR {{VERSION_MAJOR}}
#define LIBOSMO_SIMTRACE2_VERSION_MINOR {{VERSION_MINOR}}
#define LIBOSMO_SIMTRACE2_VERSION_PATCH {{VERSION_PATCH}}
#define LIBOSMO_SIMTRACE2_VERSION_GREATER_EQUAL(major, minor, patch) \
(LIBOSMO_SIMTRACE2_VERSION_MAJOR > (major) || \
(LIBOSMO_SIMTRACE2_VERSION_MAJOR == (major) && \
LIBOSMO_SIMTRACE2_VERSION_MINOR > (minor)) || \
(LIBOSMO_SIMTRACE2_VERSION_MAJOR == (major) && \
LIBOSMO_SIMTRACE2_VERSION_MINOR == (minor) && \
LIBOSMO_SIMTRACE2_VERSION_PATCH >= (patch)))

View File

@@ -66,7 +66,7 @@ int osmo_st2_gsmtap_send_apdu(uint8_t sub_type, const uint8_t *apdu, unsigned in
memcpy(buf + sizeof(*gh), apdu, len); memcpy(buf + sizeof(*gh), apdu, len);
rc = write(gsmtap_inst_fd(g_gti), buf, gross_len); rc = write(gsmtap_inst_fd2(g_gti), buf, gross_len);
if (rc < 0) { if (rc < 0) {
perror("write gsmtap"); perror("write gsmtap");
free(buf); free(buf);