| 1 |
/* |
| 2 |
* Copyright (c) 2005-2006 Atheme Development Group |
| 3 |
* Rights to this code are documented in doc/LICENSE. |
| 4 |
* |
| 5 |
* This file contains functionality which implements the OService RAW command. |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "atheme.h" |
| 10 |
#include "uplink.h" |
| 11 |
|
| 12 |
DECLARE_MODULE_V1 |
| 13 |
( |
| 14 |
"operserv/raw", false, _modinit, _moddeinit, |
| 15 |
PACKAGE_STRING, |
| 16 |
VENDOR_STRING |
| 17 |
); |
| 18 |
|
| 19 |
static void os_cmd_raw(sourceinfo_t *si, int parc, char *parv[]); |
| 20 |
|
| 21 |
command_t os_raw = { "RAW", N_("Sends data to the uplink."), PRIV_ADMIN, 1, os_cmd_raw, { .path = "oservice/raw" } }; |
| 22 |
|
| 23 |
void _modinit(module_t *m) |
| 24 |
{ |
| 25 |
service_named_bind_command("operserv", &os_raw); |
| 26 |
} |
| 27 |
|
| 28 |
void _moddeinit(module_unload_intent_t intent) |
| 29 |
{ |
| 30 |
service_named_unbind_command("operserv", &os_raw); |
| 31 |
} |
| 32 |
|
| 33 |
static void os_cmd_raw(sourceinfo_t *si, int parc, char *parv[]) |
| 34 |
{ |
| 35 |
char *s = parv[0]; |
| 36 |
|
| 37 |
if (!config_options.raw) |
| 38 |
return; |
| 39 |
|
| 40 |
if (!s) |
| 41 |
{ |
| 42 |
command_fail(si, fault_needmoreparams, STR_INSUFFICIENT_PARAMS, "RAW"); |
| 43 |
command_fail(si, fault_needmoreparams, _("Syntax: RAW <parameters>")); |
| 44 |
return; |
| 45 |
} |
| 46 |
|
| 47 |
logcommand(si, CMDLOG_ADMIN, "RAW: \2%s\2", s); |
| 48 |
sts("%s", s); |
| 49 |
} |
| 50 |
|
| 51 |
/* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs |
| 52 |
* vim:ts=8 |
| 53 |
* vim:sw=8 |
| 54 |
* vim:noexpandtab |
| 55 |
*/ |