Browse Source

MT#59086 Unify header files.

In the header files follow the rules:

1. Firstly goes ifndef/define construction, then one empty row.
2. Secondly go system headers, so in angle-brackets, then one empty row.
3. If there are important pre-processor definitions, which affect
   the following custom file headers, they are added next, then one empty row.
4. Thirdly custom header files, so in double quotes,
   then at least one empty row.
5. If there is "xt_RTPENGINE.h", it's mentioned next, but separately,
   then one empty row.
6. Then pre-processor definitions, and one empty row before the code.

In some situations it's allowed to step aside from the rules,
when inclusions are dependent on each other, so on specific sequence,
and also possibly on some inline objects definitions.
But, if possible to follow the rules, it should be done.

Change-Id: I6bec69b508653947c04e7785775373d21112eb58
pull/1783/head
Donat Zenichev 2 years ago
parent
commit
423d7bf824
36 changed files with 36 additions and 156 deletions
  1. +1
    -1
      include/audio_player.h
  2. +2
    -4
      include/call.h
  3. +1
    -2
      include/call_interfaces.h
  4. +0
    -7
      include/cdr.h
  5. +2
    -1
      include/codec.h
  6. +0
    -7
      include/control_tcp.h
  7. +1
    -8
      include/control_udp.h
  8. +1
    -0
      include/cookie_cache.h
  9. +1
    -4
      include/crypto.h
  10. +0
    -10
      include/dtls.h
  11. +1
    -2
      include/dtmf.h
  12. +0
    -7
      include/graphite.h
  13. +1
    -5
      include/helpers.h
  14. +0
    -2
      include/homer.h
  15. +1
    -12
      include/ice.h
  16. +0
    -4
      include/iptables.h
  17. +0
    -1
      include/janus.h
  18. +2
    -4
      include/jitter_buffer.h
  19. +2
    -10
      include/kernel.h
  20. +1
    -1
      include/main.h
  21. +1
    -3
      include/media_player.h
  22. +2
    -4
      include/media_socket.h
  23. +1
    -1
      include/mqtt.h
  24. +1
    -2
      include/recording.h
  25. +4
    -9
      include/redis.h
  26. +2
    -2
      include/rtcp.h
  27. +1
    -11
      include/rtp.h
  28. +1
    -1
      include/sdp.h
  29. +1
    -7
      include/ssrc.h
  30. +0
    -4
      include/statistics.h
  31. +1
    -4
      include/stun.h
  32. +0
    -12
      include/t38.h
  33. +0
    -1
      include/tcp_listener.h
  34. +2
    -2
      include/timerthread.h
  35. +1
    -0
      include/udp_listener.h
  36. +1
    -1
      include/websocket.h

+ 1
- 1
include/audio_player.h View File

@ -6,8 +6,8 @@
#include <stdbool.h>
#include <libavutil/frame.h>
#include <stdint.h>
#include "types.h"
#include "types.h"
/*
* Similar to the existing media_player, but instead of simply producing


+ 2
- 4
include/call.h View File

@ -1,12 +1,9 @@
#ifndef __CALL_H__
#define __CALL_H__
/* XXX split everything into call_signalling.[ch] and call_packets.[ch] or w/e */
#include <glib-object.h>
#include <sys/types.h>
#include <glib.h>
#include <time.h>
@ -27,9 +24,10 @@
#include "statistics.h"
#include "codeclib.h"
#include "t38.h"
#include "xt_RTPENGINE.h"
#include "types.h"
#include "xt_RTPENGINE.h"
#define UNDEFINED ((unsigned int) -1)
enum termination_reason {


+ 1
- 2
include/call_interfaces.h View File

@ -1,9 +1,8 @@
#ifndef _CALL_INTERFACES_H_
#define _CALL_INTERFACES_H_
#include <glib.h>
#include "str.h"
#include "bencode.h"
#include "socket.h"


+ 0
- 7
include/cdr.h View File

@ -1,10 +1,3 @@
/*
* cdr.h
*
* Created on: Mar 14, 2017
* Author: fmetz
*/
#ifndef CDR_H_
#define CDR_H_


+ 2
- 1
include/codec.h View File

@ -4,14 +4,15 @@
#include <glib.h>
#include <sys/time.h>
#include <stdbool.h>
#include "str.h"
#include "codeclib.h"
#include "helpers.h"
#include "rtplib.h"
#include "timerthread.h"
#include "xt_RTPENGINE.h"
#include "types.h"
#include "xt_RTPENGINE.h"
struct call_media;
struct codec_handler;


+ 0
- 7
include/control_tcp.h View File

@ -1,8 +1,6 @@
#ifndef __CONTROL_H__
#define __CONTROL_H__
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@ -13,7 +11,6 @@
#include "helpers.h"
#include "socket.h"
#define RE_TCP_RL_CMD 1
#define RE_TCP_RL_CALLID 2
#define RE_TCP_RL_STREAMS 3
@ -32,10 +29,6 @@
struct control_tcp;
struct streambuf_stream;
struct control_tcp *control_tcp_new(const endpoint_t *);
#endif

+ 1
- 8
include/control_udp.h View File

@ -1,22 +1,17 @@
#ifndef __CONTROL_UDP_H__
#define __CONTROL_UDP_H__
#include <pcre2.h>
#include <glib.h>
#include <time.h>
#include <netinet/in.h>
#include "obj.h"
#include "helpers.h"
#include "cookie_cache.h"
#include "udp_listener.h"
#include "socket.h"
#define RE_UDP_COOKIE 1
#define RE_UDP_UL_CMD 2
#define RE_UDP_UL_FLAGS 3
@ -38,8 +33,6 @@
#define RE_UDP_V_FLAGS 19
#define RE_UDP_V_PARMS 20
struct control_udp {
struct obj obj;


+ 1
- 0
include/cookie_cache.h View File

@ -3,6 +3,7 @@
#include <time.h>
#include <glib.h>
#include "helpers.h"
#include "str.h"


+ 1
- 4
include/crypto.h View File

@ -1,10 +1,9 @@
#ifndef _CRYPTO_H_
#define _CRYPTO_H_
#include <sys/types.h>
#include <glib.h>
#include "compat.h"
#include "str.h"
#include "helpers.h"
@ -16,8 +15,6 @@
#define SRTP_MAX_SESSION_SALT_LEN 14
#define SRTP_MAX_SESSION_AUTH_LEN 20
struct crypto_context;
struct rtp_header;
struct rtcp_packet;


+ 0
- 10
include/dtls.h View File

@ -1,8 +1,6 @@
#ifndef _DTLS_H_
#define _DTLS_H_
#include <time.h>
#include <openssl/x509.h>
#include <openssl/ssl.h>
@ -14,19 +12,11 @@
#include "socket.h"
#include "types.h"
#define DTLS_MAX_DIGEST_LEN 64
struct packet_stream;
struct sockaddr_in6;
struct dtls_hash_func {
const char *name;
unsigned int num_bytes;


+ 1
- 2
include/dtmf.h View File

@ -5,16 +5,15 @@
#include <glib.h>
#include <errno.h>
#include <stdbool.h>
#include "str.h"
#include "socket.h"
#include "call.h"
struct media_packet;
struct call_media;
struct call_monologue;
struct dtmf_event {
int code; // char for start, zero for end
int volume;


+ 0
- 7
include/graphite.h View File

@ -1,10 +1,3 @@
/*
* graphite.h
*
* Created on: Jan 19, 2015
* Author: fmetz
*/
#ifndef GRAPHITE_H_
#define GRAPHITE_H_


+ 1
- 5
include/helpers.h View File

@ -1,8 +1,6 @@
#ifndef __HELPERS_H__
#define __HELPERS_H__
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
@ -18,6 +16,7 @@
#include <math.h>
#include <stdbool.h>
#include <json-glib/json-glib.h>
#include "compat.h"
#include "auxlib.h"
@ -25,9 +24,6 @@
#define __THREAD_DEBUG 1
#endif
/*** PROTOTYPES ***/
typedef bool (*parse_func)(char **, void **, void *);


+ 0
- 2
include/homer.h View File

@ -3,11 +3,9 @@
#include "socket.h"
void homer_sender_init(const endpoint_t *, int, int);
int homer_send(GString *, const str *, const endpoint_t *, const endpoint_t *,
const struct timeval *tv);
int has_homer(void);
#endif

+ 1
- 12
include/ice.h View File

@ -1,13 +1,12 @@
#ifndef __ICE_H__
#define __ICE_H__
#include <arpa/inet.h>
#include <glib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <stdbool.h>
#include "str.h"
#include "obj.h"
#include "helpers.h"
@ -16,9 +15,6 @@
#include "timerthread.h"
#include "types.h"
#define MAX_COMPONENTS 2
#define TIMER_RUN_INTERVAL 20 /* ms */
#define STUN_RETRANSMIT_INTERVAL 100 /* ms, with exponential backoff */
@ -26,8 +22,6 @@
#define MAX_ICE_CANDIDATES 100
#define ICE_FOUNDATION_LENGTH 16
#define ICE_AGENT_COMPLETED 0x0002
#define ICE_AGENT_CONTROLLING 0x0004
#define ICE_AGENT_NOMINATING 0x0008
@ -58,8 +52,6 @@
#define AGENT_CLEAR3(p, f, g, h) \
bf_clear(&(p)->agent_flags, ICE_AGENT_ ## f | ICE_AGENT_ ## g | ICE_AGENT_ ## h)
struct logical_intf;
struct local_intf;
struct packet_stream;
@ -68,9 +60,6 @@ struct stream_params;
struct stun_attrs;
struct call_monologue;
enum ice_candidate_type {
ICT_UNKNOWN = 0,
ICT_HOST,


+ 0
- 4
include/iptables.h View File

@ -1,15 +1,11 @@
#ifndef _IPTABLES_H_
#define _IPTABLES_H_
#include "socket.h"
#include "str.h"
void iptables_init(void);
extern int (*iptables_add_rule)(const socket_t *local_sock, const str *comment);
extern int (*iptables_del_rule)(const socket_t *local_sock);
#endif

+ 0
- 1
include/janus.h View File

@ -7,7 +7,6 @@ struct janus_session;
struct call_monologue;
struct call_media;
void janus_init(void);
void janus_free(void);


+ 2
- 4
include/jitter_buffer.h View File

@ -5,12 +5,10 @@
#include "socket.h"
#include "timerthread.h"
#include "media_socket.h"
//#include "codec.h"
//
//struct packet_handler_ctx;
struct jb_packet;
struct media_packet;
//
struct jb_packet {
struct timerthread_queue_entry ttq_entry;
char *buf;


+ 2
- 10
include/kernel.h View File

@ -1,30 +1,22 @@
#ifndef __KERNEL_H__
#define __KERNEL_H__
#include <sys/types.h>
#include <glib.h>
#include <netinet/in.h>
#include "xt_RTPENGINE.h"
#include "containers.h"
#include "containers.h"
#include "xt_RTPENGINE.h"
#define UNINIT_IDX ((unsigned int) -1)
struct rtpengine_target_info;
struct rtpengine_destination_info;
struct rtpengine_send_packet_info;
struct re_address;
struct rtpengine_ssrc_stats;
struct kernel_interface {
unsigned int table;
int fd;


+ 1
- 1
include/main.h View File

@ -1,9 +1,9 @@
#ifndef _MAIN_H_
#define _MAIN_H_
#include <glib.h>
#include "helpers.h"
#include <glib.h>
#include "socket.h"
#include "auxlib.h"


+ 1
- 3
include/media_player.h View File

@ -1,14 +1,12 @@
#ifndef _MEDIA_PLAYER_H_
#define _MEDIA_PLAYER_H_
#include <stdbool.h>
#include "auxlib.h"
#include "timerthread.h"
#include "str.h"
#include "types.h"
#include <stdbool.h>
struct call_media;
struct call_monologue;


+ 2
- 4
include/media_socket.h View File

@ -1,22 +1,20 @@
#ifndef _MEDIA_SOCKET_H_
#define _MEDIA_SOCKET_H_
#include <glib.h>
#include <string.h>
#include <stdio.h>
#include "str.h"
#include "obj.h"
#include "helpers.h"
#include "dtls.h"
#include "crypto.h"
#include "socket.h"
#include "xt_RTPENGINE.h"
#include "containers.h"
#include "types.h"
#include "xt_RTPENGINE.h"
struct media_packet;
struct transport_protocol;


+ 1
- 1
include/mqtt.h View File

@ -2,12 +2,12 @@
#define _MQTT_H_
#include <stdbool.h>
#include "main.h"
#include "types.h"
struct call_media;
#ifdef HAVE_MQTT


+ 1
- 2
include/recording.h View File

@ -4,7 +4,6 @@
* Handles call recording to PCAP files and recording metadata.
* Mostly filesystem operations
*/
#ifndef __RECORDING_H__
#define __RECORDING_H__
@ -12,12 +11,12 @@
#include <sys/stat.h>
#include <netinet/in.h>
#include <pcap.h>
#include "str.h"
#include "helpers.h"
#include "bencode.h"
#include "types.h"
struct packet_stream;
struct media_packet;
enum call_opmode;


+ 4
- 9
include/redis.h View File

@ -1,24 +1,19 @@
#ifndef __REDIS_MOD_H__
#define __REDIS_MOD_H__
#include <sys/types.h>
#include "compat.h"
#include "socket.h"
#include "helpers.h"
#include <glib.h>
#include <sys/types.h>
#include <hiredis/hiredis.h>
#include "compat.h"
#include "socket.h"
#include "helpers.h"
#include "call.h"
#include "str.h"
#define REDIS_RESTORE_NUM_THREADS 4
enum redis_role {
MASTER_REDIS_ROLE = 0,
SLAVE_REDIS_ROLE = 1,


+ 2
- 2
include/rtcp.h View File

@ -1,11 +1,11 @@
#ifndef _RTCP_H_
#define _RTCP_H_
#include <glib.h>
#include "str.h"
#include "call.h"
#include "media_socket.h"
#include <glib.h>
struct crypto_context;
struct rtcp_packet;


+ 1
- 11
include/rtp.h View File

@ -1,13 +1,10 @@
#ifndef _RTP_H_
#define _RTP_H_
#include <glib.h>
#include "str.h"
#include "types.h"
#include <glib.h>
struct crypto_context;
struct rtp_header;
@ -16,10 +13,6 @@ enum ssrc_dir;
struct ssrc_ctx;
struct codec_store;
const rtp_payload_type *get_rtp_payload_type(unsigned int, struct codec_store *);
int rtp_avp2savp(str *, struct crypto_context *, struct ssrc_ctx *);
@ -30,7 +23,4 @@ int srtp_payloads(str *to_auth, str *to_decrypt, str *auth_tag, str *mki,
int auth_len, int mki_len,
const str *packet, const str *payload);
#endif

+ 1
- 1
include/sdp.h View File

@ -1,8 +1,8 @@
#ifndef _SDP_H_
#define _SDP_H_
#include <glib.h>
#include "str.h"
#include "call.h"
#include "media_socket.h"


+ 1
- 7
include/ssrc.h View File

@ -1,29 +1,23 @@
#ifndef _SSRC_H_
#define _SSRC_H_
#include <sys/types.h>
#include <glib.h>
#include "compat.h"
#include "helpers.h"
#include "obj.h"
#include "codeclib.h"
#include "types.h"
struct call_media;
struct timeval;
struct ssrc_entry;
struct ssrc_entry_call;
enum ssrc_dir;
typedef struct ssrc_entry *(*ssrc_create_func_t)(void *uptr);
struct ssrc_hash {
GHashTable *ht;
GQueue q;


+ 0
- 4
include/statistics.h View File

@ -6,7 +6,6 @@
#include "rtpengine_config.h"
struct packet_stream;
struct stream_stats {
atomic64 packets;
atomic64 bytes;
@ -18,12 +17,9 @@ struct stream_stats {
#endif
};
#include "control_ng.h"
#include "graphite.h"
// "gauge" style stats
struct global_stats_gauge {
#define F(x) atomic64 x;


+ 1
- 4
include/stun.h View File

@ -1,20 +1,17 @@
#ifndef _STUN_H_
#define _STUN_H_
#include <string.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include "compat.h"
#include "call.h"
#include "str.h"
#include "socket.h"
#define STUN_COOKIE 0x2112A442UL
struct stun_attrs {
str username;
char *msg_integrity_attr;


+ 0
- 12
include/t38.h View File

@ -1,7 +1,6 @@
#ifndef _T38_H_
#define _T38_H_
struct t38_gateway;
struct t38_options {
@ -25,12 +24,8 @@ struct t38_options {
unsigned int no_iaf:1;
};
#ifdef WITH_TRANSCODING
#include <inttypes.h>
#include <sys/types.h>
#include <stdbool.h>
@ -45,13 +40,10 @@ struct t38_options {
#include "codeclib.h"
#include "types.h"
struct call_media;
struct media_packet;
struct media_player;
struct t38_gateway {
struct obj obj; // use refcount as this struct is shared between two medias
mutex_t lock;
@ -74,8 +66,6 @@ struct t38_gateway {
unsigned long long pts;
};
void t38_init(void);
int t38_gateway_pair(struct call_media *t38_media, struct call_media *pcm_media, const struct t38_options *);
@ -92,7 +82,6 @@ INLINE void t38_gateway_put(struct t38_gateway **tp) {
*tp = NULL;
}
#else
#include "compat.h"
@ -103,7 +92,6 @@ INLINE void t38_gateway_start(struct t38_gateway *tg) { }
INLINE void t38_gateway_stop(struct t38_gateway *tg) { }
INLINE void t38_gateway_put(struct t38_gateway **tp) { }
#endif
#endif

+ 0
- 1
include/tcp_listener.h View File

@ -6,7 +6,6 @@
#include "helpers.h"
#include "containers.h"
struct obj;
struct streambuf_callback;
struct streambuf_stream;


+ 2
- 2
include/timerthread.h View File

@ -1,11 +1,11 @@
#ifndef _TIMERTHREAD_H_
#define _TIMERTHREAD_H_
#include "obj.h"
#include <glib.h>
#include <sys/time.h>
#include "auxlib.h"
#include "auxlib.h"
#include "obj.h"
struct timerthread {
GTree *tree;


+ 1
- 0
include/udp_listener.h View File

@ -2,6 +2,7 @@
#define _UDP_LISTENER_H_
#include <netinet/in.h>
#include "poller.h"
#include "str.h"
#include "socket.h"


+ 1
- 1
include/websocket.h View File

@ -2,8 +2,8 @@
#define __WEBSOCKET_H__
#include <stdbool.h>
#include "str.h"
#include "str.h"
struct websocket_conn;
struct websocket_message;


Loading…
Cancel
Save