summaryrefslogtreecommitdiff
path: root/apps/netutils/pppd/chat.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-03-11 08:33:57 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-03-11 08:33:57 -0600
commit5fc714c4968c0db423ae358007cca8aadf3786ad (patch)
tree90ad9ff18dc92d053b25ac759daa8b5c6834fdce /apps/netutils/pppd/chat.c
parent678358057d08cee1d1e9c417d820da966a019ed7 (diff)
downloadpx4-nuttx-5fc714c4968c0db423ae358007cca8aadf3786ad.tar.gz
px4-nuttx-5fc714c4968c0db423ae358007cca8aadf3786ad.tar.bz2
px4-nuttx-5fc714c4968c0db423ae358007cca8aadf3786ad.zip
Add file headers to all PPPD files (still lots of style incompatibilies)
Diffstat (limited to 'apps/netutils/pppd/chat.c')
-rw-r--r--apps/netutils/pppd/chat.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/apps/netutils/pppd/chat.c b/apps/netutils/pppd/chat.c
index 9042437dc..ce900f478 100644
--- a/apps/netutils/pppd/chat.c
+++ b/apps/netutils/pppd/chat.c
@@ -1,12 +1,59 @@
+/****************************************************************************
+ * netutils/pppd/chat.c
+ *
+ * Copyright (C) 2015 Max Nekludov. All rights reserved.
+ * Author: Max Nekludov <macscomp@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
#include "ppp_conf.h"
#include "ppp_arch.h"
#include "chat.h"
#include <poll.h>
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
#define CHAT_MAX_SKIP 8
#define CHAT_ECHO_TIMEOUT 500
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
static int chat_read_byte(int fd, char* c, int timeout)
{
int ret;