Re-indent everything with indent-2.2.13
This commit is contained in:
+1
-1
@@ -80,7 +80,7 @@ static void _nvtsrv_init(void)
|
|||||||
dd.tnct = telnet_ctx_init(NULL, _tn_tx, _tn_ss);
|
dd.tnct = telnet_ctx_init(NULL, _tn_tx, _tn_ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _nvtsrv_cmd(tn_ctx_t * tcc, const char *line, int len)
|
static void _nvtsrv_cmd(tn_ctx_t *tcc, const char *line, int len)
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ static const unsigned char tn_opt[256] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static void _telnet_handle_req(tn_ctx_t * tcc, int cmd, int opt)
|
static void _telnet_handle_req(tn_ctx_t *tcc, int cmd, int opt)
|
||||||
{
|
{
|
||||||
char buf[3];
|
char buf[3];
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ static void _telnet_handle_req(tn_ctx_t * tcc, int cmd, int opt)
|
|||||||
telnet_rfc2217_init(tcc, TNI_ON);
|
telnet_rfc2217_init(tcc, TNI_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
void telnet_reply_opt(tn_ctx_t * tcc, int opt, int prm,
|
void telnet_reply_opt(tn_ctx_t *tcc, int opt, int prm,
|
||||||
const void *val, int len)
|
const void *val, int len)
|
||||||
{
|
{
|
||||||
unsigned char buf[128], *pu = buf;
|
unsigned char buf[128], *pu = buf;
|
||||||
@@ -94,7 +94,7 @@ void telnet_reply_opt(tn_ctx_t * tcc, int opt, int prm,
|
|||||||
tcc->cli_tx(tcc->cctx, buf, len);
|
tcc->cli_tx(tcc->cctx, buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _telnet_handle_opt(tn_ctx_t * tcc, int opt,
|
static void _telnet_handle_opt(tn_ctx_t *tcc, int opt,
|
||||||
unsigned char *pu, int nd)
|
unsigned char *pu, int nd)
|
||||||
{
|
{
|
||||||
DBG2_BUF("opti", pu, nd);
|
DBG2_BUF("opti", pu, nd);
|
||||||
@@ -111,7 +111,7 @@ static void _telnet_handle_opt(tn_ctx_t * tcc, int opt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int telnet_rx(tn_ctx_t * tcc, char *buf, int *plen)
|
int telnet_rx(tn_ctx_t *tcc, char *buf, int *plen)
|
||||||
{
|
{
|
||||||
char *s, *p;
|
char *s, *p;
|
||||||
unsigned char *pu;
|
unsigned char *pu;
|
||||||
@@ -230,7 +230,7 @@ int telnet_rx(tn_ctx_t * tcc, char *buf, int *plen)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int telnet_tx(tn_ctx_t * tcc, const char *buf, int len)
|
int telnet_tx(tn_ctx_t *tcc, const char *buf, int len)
|
||||||
{
|
{
|
||||||
const char *s, *p;
|
const char *s, *p;
|
||||||
int rem, nd;
|
int rem, nd;
|
||||||
@@ -260,7 +260,7 @@ int telnet_tx(tn_ctx_t * tcc, const char *buf, int len)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
tn_ctx_t *telnet_ctx_init(void *cctx, cli_tx_f * ftx, cli_ss_f * fss)
|
tn_ctx_t *telnet_ctx_init(void *cctx, cli_tx_f *ftx, cli_ss_f *fss)
|
||||||
{
|
{
|
||||||
tn_ctx_t *tcc;
|
tn_ctx_t *tcc;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "telnet.h"
|
#include "telnet.h"
|
||||||
#include "telnet_param.h"
|
#include "telnet_param.h"
|
||||||
|
|
||||||
void telnet_rfc2217_init(tn_ctx_t * tcc, int when)
|
void telnet_rfc2217_init(tn_ctx_t *tcc, int when)
|
||||||
{
|
{
|
||||||
switch (when)
|
switch (when)
|
||||||
{
|
{
|
||||||
@@ -39,7 +39,7 @@ void telnet_rfc2217_init(tn_ctx_t * tcc, int when)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void telnet_rfc2217_handle_opt(tn_ctx_t * tcc, int opt,
|
void telnet_rfc2217_handle_opt(tn_ctx_t *tcc, int opt,
|
||||||
unsigned char *pu, int nd)
|
unsigned char *pu, int nd)
|
||||||
{
|
{
|
||||||
unsigned int sub, vali, valo, val4;
|
unsigned int sub, vali, valo, val4;
|
||||||
@@ -220,7 +220,7 @@ void telnet_rfc2217_handle_opt(tn_ctx_t * tcc, int opt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void telnet_rfc2217_change_linestate(tn_ctx_t * tcc, int mask)
|
void telnet_rfc2217_change_linestate(tn_ctx_t *tcc, int mask)
|
||||||
{
|
{
|
||||||
unsigned char buf[1];
|
unsigned char buf[1];
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ void telnet_rfc2217_change_linestate(tn_ctx_t * tcc, int mask)
|
|||||||
tcc->linestate = mask;
|
tcc->linestate = mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
void telnet_rfc2217_change_modemstate(tn_ctx_t * tcc, int mask)
|
void telnet_rfc2217_change_modemstate(tn_ctx_t *tcc, int mask)
|
||||||
{
|
{
|
||||||
unsigned char buf[1];
|
unsigned char buf[1];
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -38,7 +38,7 @@ static const unsigned char tn_opt[256] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static void _telnet_handle_req(tn_ctx_t * tcc, int cmd, int opt)
|
static void _telnet_handle_req(tn_ctx_t *tcc, int cmd, int opt)
|
||||||
{
|
{
|
||||||
char buf[3];
|
char buf[3];
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ static void _telnet_handle_req(tn_ctx_t * tcc, int cmd, int opt)
|
|||||||
tcc->srv_tx(tcc->cctx, buf, 3);
|
tcc->srv_tx(tcc->cctx, buf, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _telnet_handle_resp(tn_ctx_t * tcc, int cmd, int opt)
|
static void _telnet_handle_resp(tn_ctx_t *tcc, int cmd, int opt)
|
||||||
{
|
{
|
||||||
if (opt == TNO_CPCO)
|
if (opt == TNO_CPCO)
|
||||||
{
|
{
|
||||||
@@ -76,7 +76,7 @@ static void _telnet_handle_resp(tn_ctx_t * tcc, int cmd, int opt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void telnet_set_opt(tn_ctx_t * tcc, int opt, int prm, const void *val, int len)
|
void telnet_set_opt(tn_ctx_t *tcc, int opt, int prm, const void *val, int len)
|
||||||
{
|
{
|
||||||
unsigned char buf[128], *pu = buf;
|
unsigned char buf[128], *pu = buf;
|
||||||
const unsigned char *pv;
|
const unsigned char *pv;
|
||||||
@@ -106,7 +106,7 @@ void telnet_set_opt(tn_ctx_t * tcc, int opt, int prm, const void *val, int len)
|
|||||||
tcc->srv_tx(tcc->cctx, buf, len);
|
tcc->srv_tx(tcc->cctx, buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _telnet_handle_opt(tn_ctx_t * tcc, int opt,
|
static void _telnet_handle_opt(tn_ctx_t *tcc, int opt,
|
||||||
unsigned char *pu, int nd)
|
unsigned char *pu, int nd)
|
||||||
{
|
{
|
||||||
switch (opt)
|
switch (opt)
|
||||||
@@ -120,7 +120,7 @@ static void _telnet_handle_opt(tn_ctx_t * tcc, int opt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int telnet_rx(tn_ctx_t * tcc, char *buf, int *plen)
|
int telnet_rx(tn_ctx_t *tcc, char *buf, int *plen)
|
||||||
{
|
{
|
||||||
char *s, *p;
|
char *s, *p;
|
||||||
unsigned char *pu;
|
unsigned char *pu;
|
||||||
@@ -233,7 +233,7 @@ int telnet_rx(tn_ctx_t * tcc, char *buf, int *plen)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int telnet_tx(tn_ctx_t * tcc, const char *buf, int len)
|
int telnet_tx(tn_ctx_t *tcc, const char *buf, int len)
|
||||||
{
|
{
|
||||||
const char *s, *p;
|
const char *s, *p;
|
||||||
int rem, nd;
|
int rem, nd;
|
||||||
@@ -263,7 +263,7 @@ int telnet_tx(tn_ctx_t * tcc, const char *buf, int len)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int telnet_open(tn_ctx_t * tcc, int mode)
|
int telnet_open(tn_ctx_t *tcc, int mode)
|
||||||
{
|
{
|
||||||
time_t t = time(NULL);;
|
time_t t = time(NULL);;
|
||||||
char buf[3];
|
char buf[3];
|
||||||
@@ -293,8 +293,8 @@ int telnet_open(tn_ctx_t * tcc, int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tn_ctx_t *telnet_ctx_init(void *cctx, srv_tx_f * ftx,
|
tn_ctx_t *telnet_ctx_init(void *cctx, srv_tx_f *ftx,
|
||||||
srv_rx_f * frx, srv_ms_f * fms)
|
srv_rx_f *frx, srv_ms_f *fms)
|
||||||
{
|
{
|
||||||
tn_ctx_t *tcc;
|
tn_ctx_t *tcc;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
#include "telnet.h"
|
#include "telnet.h"
|
||||||
#include "telnet_param.h"
|
#include "telnet_param.h"
|
||||||
|
|
||||||
void telnet_rfc2217_handle_opt(tn_ctx_t * tcc, int opt,
|
void telnet_rfc2217_handle_opt(tn_ctx_t *tcc, int opt,
|
||||||
unsigned char *pu, int nd)
|
unsigned char *pu, int nd)
|
||||||
{
|
{
|
||||||
unsigned int sub;
|
unsigned int sub;
|
||||||
@@ -32,7 +32,7 @@ void telnet_rfc2217_handle_opt(tn_ctx_t * tcc, int opt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void telnet_rfc2217_cfg(tn_ctx_t * tcc, int cmd, const void *val, int nd)
|
void telnet_rfc2217_cfg(tn_ctx_t *tcc, int cmd, const void *val, int nd)
|
||||||
{
|
{
|
||||||
if (!tcc->mode_rfc2217)
|
if (!tcc->mode_rfc2217)
|
||||||
return;
|
return;
|
||||||
@@ -40,7 +40,7 @@ void telnet_rfc2217_cfg(tn_ctx_t * tcc, int cmd, const void *val, int nd)
|
|||||||
telnet_set_opt(tcc, TNO_CPCO, cmd, val, nd);
|
telnet_set_opt(tcc, TNO_CPCO, cmd, val, nd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void telnet_rfc2217_ctl(tn_ctx_t * tcc, unsigned int val)
|
void telnet_rfc2217_ctl(tn_ctx_t *tcc, unsigned int val)
|
||||||
{
|
{
|
||||||
unsigned char byte = val;
|
unsigned char byte = val;
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -150,7 +150,7 @@ static void _fd_close(int fd)
|
|||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _notify(ttynvt_t * tty)
|
static void _notify(ttynvt_t *tty)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&tty->poll_lock);
|
pthread_mutex_lock(&tty->poll_lock);
|
||||||
if (tty->ph)
|
if (tty->ph)
|
||||||
@@ -162,7 +162,7 @@ static void _notify(ttynvt_t * tty)
|
|||||||
pthread_mutex_unlock(&tty->poll_lock);
|
pthread_mutex_unlock(&tty->poll_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _update_notify(ttynvt_t * tty, struct fuse_pollhandle *ph)
|
static void _update_notify(ttynvt_t *tty, struct fuse_pollhandle *ph)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&tty->poll_lock);
|
pthread_mutex_lock(&tty->poll_lock);
|
||||||
struct fuse_pollhandle *tmp_ph = tty->ph;
|
struct fuse_pollhandle *tmp_ph = tty->ph;
|
||||||
@@ -173,7 +173,7 @@ static void _update_notify(ttynvt_t * tty, struct fuse_pollhandle *ph)
|
|||||||
fuse_pollhandle_destroy(tmp_ph);
|
fuse_pollhandle_destroy(tmp_ph);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _net_read_check_exit(ttynvt_t * tty)
|
static int _net_read_check_exit(ttynvt_t *tty)
|
||||||
{
|
{
|
||||||
if ((tty->tio.c_cflag & CLOCAL) == 0 &&
|
if ((tty->tio.c_cflag & CLOCAL) == 0 &&
|
||||||
(tty->smcr_last & TIOCM_CD) != 0 && (tty->smcr & TIOCM_CD) == 0)
|
(tty->smcr_last & TIOCM_CD) != 0 && (tty->smcr & TIOCM_CD) == 0)
|
||||||
@@ -397,7 +397,7 @@ static ttynvt_t *_ttynvt_ctx_create(void)
|
|||||||
return tty;
|
return tty;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _ttynvt_ctx_destroy(ttynvt_t * tty)
|
static void _ttynvt_ctx_destroy(ttynvt_t *tty)
|
||||||
{
|
{
|
||||||
if (tty)
|
if (tty)
|
||||||
free(tty->tn);
|
free(tty->tn);
|
||||||
|
|||||||
Reference in New Issue
Block a user