Skip to content

Commit

Permalink
ctl: removed trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Nov 13, 2023
1 parent febac66 commit 7210a36
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 48 deletions.
26 changes: 13 additions & 13 deletions src/modules/ctl/binrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand Down Expand Up @@ -71,10 +71,10 @@
* structs (struct type=3)
* structs are implemented as avp list:
* struct_start, avp1, avp2 .., struct_end
* an avp is a named value pair: name, value.
* an avp is a named value pair: name, value.
* - name behaves like a normal string, but has a diff. type (5)
* - avps are legal only inside structs.
* avp example: name part (str) val part (int here)
* avp example: name part (str) val part (int here)
* "test", int 0x0b -> 0x55 "test" 0x00 0x10 0x0b
*
* struct example:
Expand Down Expand Up @@ -262,7 +262,7 @@ inline static unsigned char *binrpc_write_int(
/* API functions */

/* initialize a binrpc_pkt structure, for packet creation
* params: pkt - binrpc body structure that will be initialized
* params: pkt - binrpc body structure that will be initialized
* buf, b_len - destination buffer/len
* returns -1 on error, 0 on success
*
Expand All @@ -285,7 +285,7 @@ inline static int binrpc_init_pkt(
};


/* used to update internal contents if the original buffer
/* used to update internal contents if the original buffer
* (from binrpc_init_pkt) was realloc'ed (and has grown) */
inline static int binrpc_pkt_update_buf(
struct binrpc_pkt *pkt, unsigned char *new_buf, int new_len)
Expand All @@ -301,7 +301,7 @@ inline static int binrpc_pkt_update_buf(


/* builds a binrpc header for the binrpc pkt. body pkt and writes it in buf
* params:
* params:
* type - binrpc packet type (request, reply, fault)
* body_len - body len
* cookie - binrpc cookie value
Expand Down Expand Up @@ -525,7 +525,7 @@ inline static int binrpc_addavp(struct binrpc_pkt *pkt, struct binrpc_val *avp)
binrpc_add_str_type((pkt), (s), (len), BINRPC_T_BYTES)

/* struct type format:
* start : 0000 | BINRPC_T_STRUCT
* start : 0000 | BINRPC_T_STRUCT
* end: 1000 | BINRPC_T_STRUCT
*/
#define binrpc_start_struct(pkt) binrpc_add_tag((pkt), BINRPC_T_STRUCT, 0)
Expand Down Expand Up @@ -661,7 +661,7 @@ static inline unsigned char *binrpc_parse_init(


/* returns bytes needed (till the end of the packet)
* on error (non. init ctx) returns < 0
* on error (non. init ctx) returns < 0
*/
inline static int binrpc_bytes_needed(struct binrpc_parse_ctx *ctx)
{
Expand All @@ -671,10 +671,10 @@ inline static int binrpc_bytes_needed(struct binrpc_parse_ctx *ctx)
}


/* prefill v with the requested type, if type==BINRPC_T_ALL it
* will be replaced by the actual record type
/* prefill v with the requested type, if type==BINRPC_T_ALL it
* will be replaced by the actual record type
* known problems: no support for arrays inside STRUCT
* param smode: allow simple vals inside struct (needed for
* param smode: allow simple vals inside struct (needed for
* not-strict-formatted rpc responses)
* returns position after the record and *err==0 if successful
* original position and *err<0 if not */
Expand Down Expand Up @@ -838,7 +838,7 @@ inline static unsigned char *binrpc_read_record(struct binrpc_parse_ctx *ctx,


/* reads/skips an entire struct
* the struct start/end are saved in v->u.strval.s, v->u.strval.len
* the struct start/end are saved in v->u.strval.s, v->u.strval.len
* return: - new buffer position and set *err to 0 if successfull
* - original buffer and *err<0 on error */
inline static unsigned char *binrpc_read_struct(struct binrpc_parse_ctx *ctx,
Expand Down
14 changes: 7 additions & 7 deletions src/modules/ctl/binrpc_run.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ static struct rpc_struct_l *new_rpc_struct()
/* doubles the size */
static struct rpc_struct_l* grow_rpc_struct(struct rpc_struct_l *rs)
{

struct rpc_struct_l* new_rs;
int csize; /* body */

csize=binrpc_pkt_len(&rs->pkt);
csize*=2;
new_rs=ctl_realloc(rs, sizeof(struct rpc_struct_l)+csize);
if (new_rs){
binrpc_pkt_update_buf(&rs->pkt,
binrpc_pkt_update_buf(&rs->pkt,
(unsigned char*)new_rs+sizeof(struct rpc_struct_l),
csize);
}
Expand All @@ -235,7 +235,7 @@ static struct rpc_struct_l* grow_rpc_struct(struct rpc_struct_l *rs)
inline static int append_pkt_body(struct binrpc_pkt* p, unsigned char* buf,
int len)
{

if ((int)(p->end-p->crt)<len){
goto error;
#if 0
Expand Down Expand Up @@ -314,13 +314,13 @@ static int body_fill_iovec(struct iovec_array *v_a, struct binrpc_pkt *body,

#if 0
/* expects an initialized new_b */
static int build_structs(struct binrpc_pkt *new_b, struct binrpc_pkt* body,
static int build_structs(struct binrpc_pkt *new_b, struct binrpc_pkt* body,
struct rpc_struct_head* sl_head)
{
int offs;
struct rpc_struct_l* l;
int ret;

offs=0;
clist_foreach(sl_head, l, next){
if ((ret=append_pkt_body(new_b, body->body+offs, l->offset-offs))<0)
Expand Down Expand Up @@ -967,7 +967,7 @@ static int rpc_scan(struct binrpc_ctx *ctx, char *fmt, ...)
v.type = BINRPC_T_STRUCT;
/* FIXME: structure reading doesn't work for now */
#if 0
ctx->in.s=binrpc_read_record(&ctx->in.ctx, ctx->in.s,
ctx->in.s=binrpc_read_record(&ctx->in.ctx, ctx->in.s,
ctx->in.end, &v, 0, &err);
if (err<0) goto error_read;
ctx->in.in_struct++;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/ctl/binrpc_run.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand Down
4 changes: 2 additions & 2 deletions src/modules/ctl/ctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand Down
8 changes: 4 additions & 4 deletions src/modules/ctl/ctrl_socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand All @@ -38,7 +38,7 @@
* tcp|udp|unix:host_name
* host_name:port
* host_name
*
*
*
* where host_name=string, ipv4 address, [ipv6 address],
* unix socket path (starts with '/')
Expand Down Expand Up @@ -179,7 +179,7 @@ struct id_list *parse_listen_id(char *l, int len, enum socket_protos def)
goto error;
}
} else {
/* no port, check if the hostname is a port
/* no port, check if the hostname is a port
* (e.g. tcp:3012 == tcp:*:3012 */
if(proto == TCP_SOCK || proto == UDP_SOCK) {
port = str2s(name, strlen(name), &err);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/ctl/ctrl_socks.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand Down
18 changes: 9 additions & 9 deletions src/modules/ctl/fifo_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
Expand All @@ -34,7 +34,7 @@
* via the proc file system. This might be used for
* making ser do things for you (such as initiating new
* transaction from webpages) or inspect server's health.
*
*
* FIFO server allows new functionality to be registered
* with it -- thats what register_fifo_cmd is good for.
* Remember, the initialization must take place before
Expand Down Expand Up @@ -136,8 +136,8 @@ struct text_chunk
};


/*
* This is the parameter if rpc_struct_add
/*
* This is the parameter if rpc_struct_add
*/
struct rpc_struct_out
{
Expand Down Expand Up @@ -571,7 +571,7 @@ static int read_line(char **b, int *read, struct readline_handle *rh)
/*
* Remove directory path from filename and replace it
* with the path configured through a module parameter.
*
*
* The result is allocated using ctl_malloc and thus
* has to be freed using ctl_free
*/
Expand Down Expand Up @@ -605,7 +605,7 @@ static char *trim_filename(char *file)
/* reply fifo security checks:
* checks if fd is a fifo, is not hardlinked and it's not a softlink
* opened file descriptor + file name (for soft link check)
* returns 0 if ok, <0 if not
* returns 0 if ok, <0 if not
*/
static int fifo_check(int fd, char *fname)
{
Expand Down Expand Up @@ -668,7 +668,7 @@ static int open_reply_pipe(char *pipe_name)
}

tryagain:
/* open non-blocking to make sure that a broken client will not
/* open non-blocking to make sure that a broken client will not
* block the FIFO server forever */
fifofd = open(pipe_name, O_WRONLY | O_NONBLOCK);
if(fifofd == -1) {
Expand All @@ -693,7 +693,7 @@ static int open_reply_pipe(char *pipe_name)
ERR("Open error (%s): %s\n", pipe_name, strerror(errno));
goto error;
}
/* security checks: is this really a fifo?, is
/* security checks: is this really a fifo?, is
* it hardlinked? is it a soft link? */
if(fifo_check(fifofd, pipe_name) < 0)
goto error;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/ctl/fifo_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand Down
6 changes: 3 additions & 3 deletions src/modules/ctl/init_socks.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand Down Expand Up @@ -69,7 +69,7 @@ static int set_non_blocking(int s)
}


/* opens, binds and listens-on a control unix socket of type 'type'
/* opens, binds and listens-on a control unix socket of type 'type'
* it will change the permissions to perm, if perm!=0
* and the ownership to uid.gid if !=-1
* returns socket fd or -1 on error */
Expand Down
4 changes: 2 additions & 2 deletions src/modules/ctl/init_socks.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand Down
4 changes: 2 additions & 2 deletions src/modules/ctl/io_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

Expand Down

0 comments on commit 7210a36

Please sign in to comment.