apps/netutils/pppd/: More changes for consistency in coding style.

This commit is contained in:
Gregory Nutt 2018-11-07 13:43:51 -06:00
parent bb21a11a60
commit 48ebc1377a
5 changed files with 22 additions and 22 deletions

View File

@ -211,19 +211,19 @@ uint8_t ahdlc_rx(FAR struct ppp_context_s *ctx, uint8_t c)
{
/* Send up packet */
ppp_upcall(ctx, (uint16_t) ctx->ahdlc_rx_buffer[0],
ppp_upcall(ctx, (uint16_t)ctx->ahdlc_rx_buffer[0],
(FAR uint8_t *) & ctx->ahdlc_rx_buffer[1],
(uint16_t) (ctx->ahdlc_rx_count - 1));
(uint16_t)(ctx->ahdlc_rx_count - 1));
}
else
{
/* Send up packet */
ppp_upcall(ctx,
(uint16_t) (ctx->ahdlc_rx_buffer[0] << 8 | ctx->
ahdlc_rx_buffer[1]),
(uint16_t)(ctx->ahdlc_rx_buffer[0] << 8 | ctx->
ahdlc_rx_buffer[1]),
(FAR uint8_t *) & ctx->ahdlc_rx_buffer[2],
(uint16_t) (ctx->ahdlc_rx_count - 2));
(uint16_t)(ctx->ahdlc_rx_count - 2));
}
ctx->ahdlc_tx_offline = 0; /* The remote side is alive */
@ -400,8 +400,8 @@ uint8_t ahdlc_tx(struct ppp_context_s *ctx, uint16_t protocol,
/* Write Protocol */
ahdlc_tx_char(ctx, protocol, (uint8_t) (protocol >> 8));
ahdlc_tx_char(ctx, protocol, (uint8_t) (protocol & 0xff));
ahdlc_tx_char(ctx, protocol, (uint8_t)(protocol >> 8));
ahdlc_tx_char(ctx, protocol, (uint8_t)(protocol & 0xff));
/* Write header if it exists */
@ -432,8 +432,8 @@ uint8_t ahdlc_tx(struct ppp_context_s *ctx, uint16_t protocol,
/* Send crc, lsb then msb */
i = ctx->ahdlc_tx_crc ^ 0xffff;
ahdlc_tx_char(ctx, protocol, (uint8_t) (i & 0xff));
ahdlc_tx_char(ctx, protocol, (uint8_t) ((i >> 8) & 0xff));
ahdlc_tx_char(ctx, protocol, (uint8_t)(i & 0xff));
ahdlc_tx_char(ctx, protocol, (uint8_t)((i >> 8) & 0xff));
/* Write trailing 0x7e, probably not needed but it doesn't hurt */

View File

@ -146,7 +146,7 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer,
/* len-=2; */
DEBUG1(("check lcplist\n"));
if (scan_packet(ctx, IPCP, g_ipcplist, buffer, bptr, (uint16_t) (len - 4)))
if (scan_packet(ctx, IPCP, g_ipcplist, buffer, bptr, (uint16_t)(len - 4)))
{
DEBUG1(("option was bad\n"));
}
@ -212,7 +212,7 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer,
/* Write the reject frame */
DEBUG1(("Writing NAK frame \n"));
ahdlc_tx(IPCP, buffer, (uint16_t) (tptr - buffer));
ahdlc_tx(IPCP, buffer, (uint16_t)(tptr - buffer));
DEBUG1(("- End NAK Write frame\n"));
}
else
@ -234,7 +234,7 @@ void ipcp_rx(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer,
/* ppp_flags |= tflag; */
DEBUG1(("SET- stuff -- are we up? c=%d dif=%d \n",
count, (uint16_t) (bptr - buffer)));
count, (uint16_t)(bptr - buffer)));
/* Write the ACK frame */
@ -481,10 +481,10 @@ void ipcp_task(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer)
*bptr++ = IPCP_IPADDRESS;
*bptr++ = 0x6;
*bptr++ = (uint8_t) ((FAR uint8_t *) & ctx->local_ip)[0];
*bptr++ = (uint8_t) ((FAR uint8_t *) & ctx->local_ip)[1];
*bptr++ = (uint8_t) ((FAR uint8_t *) & ctx->local_ip)[2];
*bptr++ = (uint8_t) ((FAR uint8_t *) & ctx->local_ip)[3];
*bptr++ = (uint8_t)((FAR uint8_t *) & ctx->local_ip)[0];
*bptr++ = (uint8_t)((FAR uint8_t *) & ctx->local_ip)[1];
*bptr++ = (uint8_t)((FAR uint8_t *) & ctx->local_ip)[2];
*bptr++ = (uint8_t)((FAR uint8_t *) & ctx->local_ip)[3];
#ifdef IPCP_GET_PRI_DNS
if ((ctx->ipcp_state & IPCP_PRI_DNS_BIT) == 0)

View File

@ -138,7 +138,7 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count)
DEBUG1(("received [LCP Config Request id %u\n", id));
if (scan_packet
(ctx, (uint16_t) LCP, g_lcplist, buffer, bptr, (uint16_t) (len - 4)))
(ctx, (uint16_t)LCP, g_lcplist, buffer, bptr, (uint16_t)(len - 4)))
{
/* Must do the -4 here, !scan packet */
@ -284,7 +284,7 @@ void lcp_rx(struct ppp_context_s *ctx, uint8_t * buffer, uint16_t count)
/* Send packet ahdlc_txz(procol,header,data,headerlen,datalen); */
ahdlc_tx(ctx, LCP, 0, buffer, 0, (uint16_t) (tptr - buffer));
ahdlc_tx(ctx, LCP, 0, buffer, 0, (uint16_t)(tptr - buffer));
DEBUG1(("- end NAK Write frame\n"));
}
else

View File

@ -163,11 +163,11 @@ void pap_task(FAR struct ppp_context_s *ctx, FAR uint8_t * buffer)
/* Write peer length */
*bptr++ = (uint8_t) t;
*bptr++ = (uint8_t)t;
bptr = memcpy(bptr, ctx->settings->pap_username, t);
t = strlen((char *)ctx->settings->pap_password);
*bptr++ = (uint8_t) t;
*bptr++ = (uint8_t)t;
bptr = memcpy(bptr, ctx->settings->pap_password, t);
/* Write length */

View File

@ -114,7 +114,7 @@ static void ppp_reject_protocol(FAR struct ppp_context_s *ctx,
pkt->len = htons(count + 6);
*((FAR uint16_t *) (&pkt->data[0])) = htons(protocol);
ahdlc_tx(ctx, LCP, buffer, 0, (uint16_t) (count + 6), 0);
ahdlc_tx(ctx, LCP, buffer, 0, (uint16_t)(count + 6), 0);
}
/****************************************************************************
@ -428,7 +428,7 @@ uint16_t scan_packet(FAR struct ppp_context_s *ctx, uint16_t protocol,
/* Write the reject frame */
DEBUG1(("Writing Reject frame --\n"));
ahdlc_tx(ctx, protocol, buffer, 0, (uint16_t) (tptr - buffer), 0);
ahdlc_tx(ctx, protocol, buffer, 0, (uint16_t)(tptr - buffer), 0);
DEBUG1(("\nEnd writing reject \n"));
}