Fix various problems in 4G NAS handling

- rename as_nas_info_t member data to nas_data to have a uniq name to
  trace between complex malloc/free of this pointer
- fix, maybe not perfect, these pais od malloc/free
- remove typedef name changes across transmission of these as_nas_info_t
  over itti, as name changing makes it even more confusing
- remove globals that are likely possible races
- in as_message_decode() fix memcpy size, it is hard to understand the
  initial idea, likely the author beleives a struct of struct makes a
  intermediate pointer
- in network_api.c remove globals (static but used globally)
- remove casts that are there to hide gcc warnings on probable unaligned
  access
- remain a weird mix of packed/unpacked versions of the same typedef,
  but gcc is happy
This commit is contained in:
Laurent THOMAS
2024-10-22 11:05:20 +02:00
parent 8df8de894b
commit e48e38650d
15 changed files with 203 additions and 330 deletions
@@ -55,17 +55,14 @@ Description Implements the API used by the NAS layer to send/receive
/****************************************************************************/
/****************** E X P O R T E D F U N C T I O N S ******************/
/****************************************************************************/
#include "openair2/COMMON/as_message.h"
int network_api_initialize(const char* host, const char* port);
int network_api_get_fd(void);
const void* network_api_get_data(void);
int network_api_read_data(int fd);
int network_api_send_data(int fd, int length);
int network_api_read_data(int fd, char *_network_api_recv_buffer);
void network_api_close(int fd);
int network_api_decode_data(int length);
int network_api_encode_data(void* data);
int network_api_decode_data(char *_network_api_recv_buffer, int length, as_message_t *_as_data);
#endif /* __NETWORK_API_H__*/