Browse Source

MT#59086 Unify header files inclusions.

In the file implementations follow the rules:

1. Firstly goes the correlated header file, then one empty row.
2. Secondly go system headers, so in angle-brackets, then one empty row.
3. Thirdly, go custom header files, so in double quotes,
   then one empty row.
4. If there is "xt_RTPENGINE.h", it's mentioned next, but separately,
   then one empty row.
5. If there are pre-processor definitions, they are added.
6. And eventually at least 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 the sequence,
and also possibly on some inline objects definitions, but if possible
to follow the rules, it's being done.

Change-Id: Ie512a970e230fe202398656d1942e8874bb14cd9
pull/1783/head
Donat Zenichev 2 years ago
parent
commit
bebe291656
33 changed files with 50 additions and 91 deletions
  1. +2
    -0
      daemon/bencode.c
  2. +2
    -1
      daemon/call.c
  3. +0
    -1
      daemon/call_interfaces.c
  4. +3
    -1
      daemon/cdr.c
  5. +2
    -3
      daemon/cli.c
  6. +2
    -3
      daemon/codec.c
  7. +0
    -3
      daemon/control_tcp.c
  8. +0
    -1
      daemon/control_udp.c
  9. +1
    -6
      daemon/crypto.c
  10. +3
    -1
      daemon/dtmf.c
  11. +2
    -7
      daemon/graphite.c
  12. +2
    -5
      daemon/helpers.c
  13. +0
    -6
      daemon/homer.c
  14. +2
    -8
      daemon/ice.c
  15. +2
    -1
      daemon/janus.c
  16. +4
    -2
      daemon/jitter_buffer.c
  17. +1
    -11
      daemon/kernel.c
  18. +2
    -0
      daemon/load.c
  19. +2
    -3
      daemon/log.c
  20. +2
    -4
      daemon/media_player.c
  21. +3
    -1
      daemon/media_socket.c
  22. +2
    -0
      daemon/mqtt.c
  23. +1
    -4
      daemon/nftables.c
  24. +2
    -3
      daemon/recording.c
  25. +0
    -1
      daemon/redis.c
  26. +0
    -2
      daemon/rtcp.c
  27. +0
    -3
      daemon/rtp.c
  28. +2
    -2
      daemon/ssrc.c
  29. +3
    -2
      daemon/statistics.c
  30. +0
    -2
      daemon/stun.c
  31. +0
    -4
      daemon/t38.c
  32. +1
    -0
      daemon/timerthread.c
  33. +2
    -0
      daemon/websocket.c

+ 2
- 0
daemon/bencode.c View File

@ -1,4 +1,5 @@
#include "bencode.h"
#include <stdio.h>
#include <sys/uio.h>
#include <unistd.h>
@ -7,6 +8,7 @@
#include <string.h>
#include <ctype.h>
#include <json-glib/json-glib.h>
#include "helpers.h"
/* set to 0 for alloc debugging, e.g. through valgrind */


+ 2
- 1
daemon/call.c View File

@ -24,7 +24,6 @@
#include "control_tcp.h"
#include "streambuf.h"
#include "redis.h"
#include "xt_RTPENGINE.h"
#include "bencode.h"
#include "sdp.h"
#include "str.h"
@ -52,6 +51,8 @@
#include "audio_player.h"
#include "sdp.h"
#include "xt_RTPENGINE.h"
struct iterator_helper {
uint64_t count;
GSList *del_timeout;


+ 0
- 1
daemon/call_interfaces.c View File

@ -31,7 +31,6 @@
#include "codec.h"
#include "dtmf.h"
typedef union {
const struct sdp_attr_helper *attr_helper;
str_q *q;


+ 3
- 1
daemon/cdr.c View File

@ -1,6 +1,8 @@
#include "cdr.h"
#include <inttypes.h>
#include "rtplib.h"
#include "cdr.h"
#include "call.h"
#include "poller.h"
#include "str.h"


+ 2
- 3
daemon/cli.c View File

@ -1,3 +1,5 @@
#include "cli.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
@ -15,7 +17,6 @@
#include "log.h"
#include "log_funcs.h"
#include "call.h"
#include "cli.h"
#include "socket.h"
#include "redis.h"
#include "control_ng.h"
@ -30,10 +31,8 @@
#include "rtplib.h"
#include "ssrc.h"
#include "codec.h"
#include "rtpengine_config.h"
typedef void (*cli_handler_func)(str *, struct cli_writer *);
typedef struct {
const char *cmd;


+ 2
- 3
daemon/codec.c View File

@ -1,8 +1,10 @@
#include "codec.h"
#include <glib.h>
#include <assert.h>
#include <inttypes.h>
#include <sys/types.h>
#include "call.h"
#include "log.h"
#include "rtplib.h"
@ -22,9 +24,6 @@
#include "fix_frame_channel_layout.h"
#endif
struct codec_timer {
struct timerthread_obj tt_obj;
struct timeval next;


+ 0
- 3
daemon/control_tcp.c View File

@ -20,9 +20,6 @@
#include "log_funcs.h"
#include "tcp_listener.h"
struct control_tcp {
struct obj obj;


+ 0
- 1
daemon/control_udp.c View File

@ -20,7 +20,6 @@
#include "socket.h"
#include "log_funcs.h"
static void control_udp_incoming(struct obj *obj, struct udp_buffer *udp_buf) {
struct control_udp *u = (void *) obj;
int ret;


+ 1
- 6
daemon/crypto.c View File

@ -5,8 +5,6 @@
#include <openssl/hmac.h>
#include <glib.h>
#include "xt_RTPENGINE.h"
#include "str.h"
#include "helpers.h"
#include "rtp.h"
@ -18,13 +16,10 @@
#include "ssllib.h"
#include "types.h"
#include "xt_RTPENGINE.h"
__thread GString *crypto_debug_string;
static int aes_cm_encrypt_rtp(struct crypto_context *, struct rtp_header *, str *, uint64_t);
static int aes_cm_encrypt_rtcp(struct crypto_context *, struct rtcp_packet *, str *, uint64_t);
static int aes_gcm_encrypt_rtp(struct crypto_context *, struct rtp_header *, str *, uint64_t);


+ 3
- 1
daemon/dtmf.c View File

@ -1,5 +1,7 @@
#include <errno.h>
#include "dtmf.h"
#include <errno.h>
#include "bencode.h"
#include "control_ng.h"
#include "media_socket.h"


+ 2
- 7
daemon/graphite.c View File

@ -1,9 +1,5 @@
/*
* graphite.c
*
* Created on: Jan 19, 2015
* Author: fmetz
*/
#include "graphite.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <poll.h>
@ -18,7 +14,6 @@
#include "log.h"
#include "call.h"
#include "graphite.h"
#include "socket.h"
#include "statistics.h"
#include "main.h"


+ 2
- 5
daemon/helpers.c View File

@ -1,4 +1,5 @@
#include "helpers.h"
#include <string.h>
#include <stdio.h>
#include <glib.h>
@ -8,20 +9,16 @@
#include <sys/resource.h>
#include <errno.h>
#include <unistd.h>
#include "log.h"
#include "main.h"
#if 0
#define BSDB(x...) fprintf(stderr, x)
#else
#define BSDB(x...) ((void)0)
#endif
struct detach_thread {
void (*func)(void *);
void *data;


+ 0
- 6
daemon/homer.c View File

@ -14,14 +14,8 @@
#include "str.h"
#include "types.h"
#define SEND_QUEUE_LIMIT 200
TYPED_GQUEUE(gstring, GString)
struct homer_sender {


+ 2
- 8
daemon/ice.c View File

@ -1,7 +1,9 @@
#include "ice.h"
#include <glib.h>
#include <sys/time.h>
#include <unistd.h>
#include "str.h"
#include "call.h"
#include "helpers.h"
@ -13,8 +15,6 @@
#include "timerthread.h"
#include "call_interfaces.h"
#if __DEBUG
#define ICE_DEBUG 1
#else
@ -27,18 +27,12 @@
#define __DBG(x...) ilogs(internals, LOG_DEBUG, x)
#endif
#define PAIR_FORMAT STR_FORMAT_M ":" STR_FORMAT_M ":%lu"
#define PAIR_FMT(p) \
STR_FMT_M(&(p)->local_intf->ice_foundation), \
STR_FMT_M(&(p)->remote_candidate->foundation), \
(p)->remote_candidate->component_id
struct fragment_key {
str call_id;
str from_tag;


+ 2
- 1
daemon/janus.c View File

@ -1,6 +1,8 @@
#include "janus.h"
#include <json-glib/json-glib.h>
#include <stdbool.h>
#include "websocket.h"
#include "log.h"
#include "main.h"
@ -11,7 +13,6 @@
#include "rtplib.h"
#include "ice.h"
TYPED_GHASHTABLE(janus_handles_set, uint64_t, void, g_int64_hash, g_int64_equal, NULL, NULL)
TYPED_GHASHTABLE(janus_websockets_ht, struct websocket_conn, struct websocket_conn,
g_direct_hash, g_direct_equal, NULL, NULL)


+ 4
- 2
daemon/jitter_buffer.c View File

@ -1,12 +1,14 @@
#include "jitter_buffer.h"
#include <math.h>
#include <errno.h>
#include "timerthread.h"
#include "media_socket.h"
#include "call.h"
#include "codec.h"
#include "main.h"
#include "rtcplib.h"
#include <math.h>
#include <errno.h>
#define INITIAL_PACKETS 0x1E
#define CONT_SEQ_COUNT 0x1F4


+ 1
- 11
daemon/kernel.c View File

@ -9,25 +9,15 @@
#include <glib.h>
#include <errno.h>
#include "xt_RTPENGINE.h"
#include "helpers.h"
#include "log.h"
#include "xt_RTPENGINE.h"
#define PREFIX "/proc/rtpengine"
struct kernel_interface kernel;
static int kernel_action_table(const char *action, unsigned int id) {
char s[64];
int saved_errno;


+ 2
- 0
daemon/load.c View File

@ -1,10 +1,12 @@
#include "load.h"
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "helpers.h"
#include "log.h"
#include "main.h"


+ 2
- 3
daemon/log.c View File

@ -1,8 +1,10 @@
#include "log.h"
#include <syslog.h>
#include <stdarg.h>
#include <stdio.h>
#include <glib.h>
#include "str.h"
#include "call.h"
#include "poller.h"
@ -10,9 +12,6 @@
#include "loglib.h"
#include "main.h"
__thread struct log_info log_info;
__thread GSList *log_info_stack;


+ 2
- 4
daemon/media_player.c View File

@ -1,9 +1,11 @@
#include "media_player.h"
#include <glib.h>
#ifdef WITH_TRANSCODING
#include <mysql.h>
#include <mysql/errmsg.h>
#endif
#include "obj.h"
#include "log.h"
#include "timerthread.h"
@ -21,12 +23,8 @@
#endif
#include "kernel.h"
#define DEFAULT_AVIO_BUFSIZE 4096
#ifdef WITH_TRANSCODING
static struct timerthread media_player_thread;
static __thread MYSQL *mysql_conn;


+ 3
- 1
daemon/media_socket.c View File

@ -1,9 +1,11 @@
#include "media_socket.h"
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <errno.h>
#include <netinet/in.h>
#include "str.h"
#include "ice.h"
#include "socket.h"
@ -12,7 +14,6 @@
#include "ice.h"
#include "stun.h"
#include "kernel.h"
#include "xt_RTPENGINE.h"
#include "rtcp.h"
#include "sdp.h"
#include "helpers.h"
@ -31,6 +32,7 @@
#include "mqtt.h"
#include "janus.h"
#include "xt_RTPENGINE.h"
#ifndef PORT_RANDOM_MIN
#define PORT_RANDOM_MIN 6


+ 2
- 0
daemon/mqtt.c View File

@ -1,6 +1,7 @@
#ifdef HAVE_MQTT
#include "mqtt.h"
#include <mosquitto.h>
#include <errno.h>
#include <string.h>
@ -8,6 +9,7 @@
#include <glib.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
#include "main.h"
#include "log.h"
#include "log_funcs.h"


+ 1
- 4
daemon/nftables.c View File

@ -17,12 +17,9 @@
#include <libnftnl/rule.h>
#include <libnftnl/expr.h>
#include "xt_RTPENGINE.h"
#include "helpers.h"
#include "xt_RTPENGINE.h"
struct iterate_callbacks {
// called for each expression


+ 2
- 3
daemon/recording.c View File

@ -1,4 +1,5 @@
#include "recording.h"
#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
@ -13,8 +14,6 @@
#include <assert.h>
#include <stdarg.h>
#include "xt_RTPENGINE.h"
#include "call.h"
#include "kernel.h"
#include "bencode.h"
@ -23,7 +22,7 @@
#include "log.h"
#include "call_interfaces.h"
#include "xt_RTPENGINE.h"
struct rec_pcap_format {
int linktype;


+ 0
- 1
daemon/redis.c View File

@ -34,7 +34,6 @@
#include "main.h"
#include "codec.h"
typedef union {
GQueue *q;
stream_fd_q *sfds_q;


+ 0
- 2
daemon/rtcp.c View File

@ -18,8 +18,6 @@
#include "sdp.h"
#include "log_funcs.h"
/* This toggles between two different and incompatible interpretations of
* RFC 3711, namely sections 4.3.2 and 4.3.1.
* See http://www.ietf.org/mail-archive/web/avt/current/msg06124.html


+ 0
- 3
daemon/rtp.c View File

@ -12,9 +12,6 @@
#include "ssrc.h"
#include "call.h"
INLINE int check_session_keys(struct crypto_context *c) {
str s;
const char *err;


+ 2
- 2
daemon/ssrc.c View File

@ -1,12 +1,12 @@
#include "ssrc.h"
#include <glib.h>
#include "helpers.h"
#include "call.h"
#include "rtplib.h"
#include "codeclib.h"
static void __free_ssrc_entry_call(void *e);


+ 3
- 2
daemon/statistics.c View File

@ -1,12 +1,13 @@
#include "statistics.h"
#include <math.h>
#include <stdarg.h>
#include "call.h"
#include "statistics.h"
#include "graphite.h"
#include "main.h"
#include "control_ng.h"
struct timeval rtpe_started;


+ 0
- 2
daemon/stun.c View File

@ -15,8 +15,6 @@
#include "ice.h"
#include "ssllib.h"
#define STUN_CRC_XOR 0x5354554eUL
#define STUN_USERNAME 0x0006


+ 0
- 4
daemon/t38.c View File

@ -1,10 +1,6 @@
#include "t38.h"
#ifdef WITH_TRANSCODING
#include <assert.h>
#include <spandsp/t30.h>
#include <spandsp/logging.h>


+ 1
- 0
daemon/timerthread.c View File

@ -1,4 +1,5 @@
#include "timerthread.h"
#include "helpers.h"
#include "log_funcs.h"


+ 2
- 0
daemon/websocket.c View File

@ -1,7 +1,9 @@
#include "websocket.h"
#include <libwebsockets.h>
#include <assert.h>
#include <json-glib/json-glib.h>
#include "log.h"
#include "main.h"
#include "str.h"


Loading…
Cancel
Save