-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move functions from fuzz_rtpp_utils.h into its own TUs.
- Loading branch information
Showing
8 changed files
with
123 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include <sys/socket.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
#define HAVE_CONFIG_H 1 | ||
#include "config_pp.h" | ||
|
||
#include "rtpp_types.h" | ||
#include "rtpp_cfg.h" | ||
#include "rtpp_refcnt.h" | ||
#include "rtpp_command.h" | ||
#include "rtpp_command_args.h" | ||
#include "rtpp_command_sub.h" | ||
#include "rtpp_command_private.h" | ||
#include "rtpp_command_stats.h" | ||
#include "rtpp_time.h" | ||
|
||
#include "rfz_utils.h" | ||
#include "rfz_command.h" | ||
|
||
int | ||
ExecuteRTPPCommand(struct rtpp_conf *gcp, const char *data, size_t size) | ||
{ | ||
struct rtpp_timestamp dtime = {}; | ||
static struct rtpp_command_stats cstat = {}; | ||
struct rtpp_command *cmd; | ||
int rval = -1; | ||
|
||
if (size >= RTPP_CMD_BUFLEN) | ||
return (-1); | ||
|
||
cmd = rtpp_command_ctor(gcp->cfsp, gcp->tfd, &dtime, &cstat, 0); | ||
if (cmd == NULL) | ||
return (-1); | ||
memcpy(cmd->buf, data, size); | ||
cmd->buf[size] = '\0'; | ||
|
||
rval = rtpp_command_split(cmd, size, &rval, NULL); | ||
if (rval == 0) { | ||
rval = handle_command(gcp->cfsp, cmd); | ||
} | ||
free_command(cmd); | ||
return (rval); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
|
||
int ExecuteRTPPCommand(struct rtpp_conf *, const char *, size_t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
struct RTPPInitializeParams { | ||
const char *ttl; | ||
const char *setup_ttl; | ||
const char *socket; | ||
const char *debug_level; | ||
const char *notify_socket; | ||
const char *rec_spool_dir; | ||
const char *rec_final_dir; | ||
const char *modules[]; | ||
}; | ||
|
||
struct rtpp_conf { | ||
struct rtpp_cfg *cfsp; | ||
int tfd; | ||
}; | ||
|
||
int RTPPInitialize(void); | ||
void SeedRNGs(void); | ||
|
||
extern struct rtpp_conf gconf; | ||
extern struct RTPPInitializeParams RTPPInitializeParams; |