Browse Source

MT#59069 introduce vappend_meta_chunk()

Varargs version of append_meta_chunk(), plus related wrapper and macros.

Functional no-op.

Change-Id: I7701d113bc2e4c5972b228caea32ca0d5b618345
pull/1786/head
Richard Fuchs 2 years ago
parent
commit
2ba84dd4ab
1 changed files with 14 additions and 3 deletions
  1. +14
    -3
      daemon/recording.c

+ 14
- 3
daemon/recording.c View File

@ -38,6 +38,8 @@ static char *meta_setup_file(struct recording *recording, const str *);
static int append_meta_chunk(struct recording *recording, const char *buf, unsigned int buflen,
const char *label_fmt, ...)
__attribute__((format(printf,4,5)));
static int vappend_meta_chunk(struct recording *recording, const char *buf, unsigned int buflen,
const char *label_fmt, va_list ap);
// all methods
static int create_spool_dir_all(const char *spoolpath);
@ -72,6 +74,7 @@ static void kernel_info_proc(struct packet_stream *, struct rtpengine_target_inf
static void rec_pcap_eth_header(unsigned char *, struct packet_stream *);
#define append_meta_chunk_str(r, str, f...) append_meta_chunk(r, (str)->s, (str)->len, f)
#define vappend_meta_chunk_str(r, str, f, ap) vappend_meta_chunk(r, (str)->s, (str)->len, f, ap)
#define append_meta_chunk_s(r, str, f...) append_meta_chunk(r, (str), strlen(str), f)
#define append_meta_chunk_null(r,f...) append_meta_chunk(r, "", 0, f)
@ -783,16 +786,24 @@ static int vappend_meta_chunk_iov(struct recording *recording, struct iovec *in_
return 0;
}
static int append_meta_chunk(struct recording *recording, const char *buf, unsigned int buflen,
const char *label_fmt, ...)
static int vappend_meta_chunk(struct recording *recording, const char *buf, unsigned int buflen,
const char *label_fmt, va_list ap)
{
struct iovec iov;
iov.iov_base = (void *) buf;
iov.iov_len = buflen;
int ret = vappend_meta_chunk_iov(recording, &iov, 1, buflen, label_fmt, ap);
return ret;
}
static int append_meta_chunk(struct recording *recording, const char *buf, unsigned int buflen,
const char *label_fmt, ...)
{
va_list ap;
va_start(ap, label_fmt);
int ret = vappend_meta_chunk_iov(recording, &iov, 1, buflen, label_fmt, ap);
int ret = vappend_meta_chunk(recording, buf, buflen, label_fmt, ap);
va_end(ap);
return ret;


Loading…
Cancel
Save