-/* $OpenBSD: addr_range.c,v 1.5 2015/12/17 18:37:58 mmcc Exp $ */
+/* $OpenBSD: addr_range.c,v 1.6 2017/05/30 17:22:00 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* All rights reserved.
* Author:
* Yasuoka Masahiko <yasuoka@iij.ad.jp>
*
- * $Id: addr_range.c,v 1.5 2015/12/17 18:37:58 mmcc Exp $
+ * $Id: addr_range.c,v 1.6 2017/05/30 17:22:00 yasuoka Exp $
*/
#ifdef ADDR_RANGE_DEBUG
#define IIJDEBUG
#endif
#include "addr_range.h"
-static void in_addr_range_list_uniq __P((struct in_addr_range **));
-static int in_addr_range_list_add0 __P((struct in_addr_range **, u_int32_t, u_int32_t));
-static int bitmask2masklen __P((u_int32_t));
+static void in_addr_range_list_uniq(struct in_addr_range **);
+static int in_addr_range_list_add0(struct in_addr_range **, u_int32_t, u_int32_t);
+static int bitmask2masklen(u_int32_t);
struct in_addr_range *
in_addr_range_create()
#ifdef ADDR_RANGE_DEBUG
#include <unistd.h>
-static void usage __P ((void));
+static void usage(void);
static void
usage()
-/* $OpenBSD: addr_range.h,v 1.3 2012/05/08 13:15:11 yasuoka Exp $ */
+/* $OpenBSD: addr_range.h,v 1.4 2017/05/30 17:22:00 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* All rights reserved.
extern "C" {
#endif
-struct in_addr_range *in_addr_range_create __P((void));
-void in_addr_range_destroy __P((struct in_addr_range *));
-void in_addr_range_list_remove_all __P((struct in_addr_range **));
-int in_addr_range_list_includes __P((struct in_addr_range **, struct in_addr *));
-int in_addr_range_list_add __P((struct in_addr_range **, const char *));
-int main __P((int, char *[]));
+struct in_addr_range *in_addr_range_create(void);
+void in_addr_range_destroy(struct in_addr_range *);
+void in_addr_range_list_remove_all(struct in_addr_range **);
+int in_addr_range_list_includes(struct in_addr_range **, struct in_addr *);
+int in_addr_range_list_add(struct in_addr_range **, const char *);
+int main(int, char *[]);
#ifdef __cplusplus
}
-/* $OpenBSD: debugutil.c,v 1.5 2015/12/17 08:01:55 tb Exp $ */
+/* $OpenBSD: debugutil.c,v 1.6 2017/05/30 17:22:00 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* All rights reserved.
FILE *debugfp = NULL;
static int prio_idx_inititialized = 0;
-static void set_prio_idx_init __P((void));
+static void set_prio_idx_init(void);
#ifndef countof
#define countof(x) (sizeof((x)) / sizeof((x)[0]))
-/* $OpenBSD: hash.h,v 1.2 2015/12/17 08:01:55 tb Exp $ */
+/* $OpenBSD: hash.h,v 1.3 2017/05/30 17:22:00 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* All rights reserved.
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* $Id: hash.h,v 1.2 2015/12/17 08:01:55 tb Exp $ */
+/* $Id: hash.h,v 1.3 2017/05/30 17:22:00 yasuoka Exp $ */
#ifndef HASH_H
#define HASH_H
extern "C" {
#endif
hash_table *hash_create(int (*)(const void *, const void *), uint32_t (*) (const void *, int), int);
-hash_link *hash_first __P((hash_table *));
-hash_link *hash_next __P((hash_table *));
-hash_link *hash_lookup __P((hash_table *, const void *));
-int hash_insert __P((hash_table *, const void *, void *));
-int hash_delete __P((hash_table *, const void *, int));
-void hash_delete_all __P((hash_table *, int));
-void hash_free __P((hash_table *));
+hash_link *hash_first(hash_table *);
+hash_link *hash_next(hash_table *);
+hash_link *hash_lookup(hash_table *, const void *);
+int hash_insert(hash_table *, const void *, void *);
+int hash_delete(hash_table *, const void *, int);
+void hash_delete_all(hash_table *, int);
+void hash_free(hash_table *);
#ifdef __cplusplus
}
-/* $OpenBSD: radish.h,v 1.4 2016/09/21 04:45:23 yasuoka Exp $ */
+/* $OpenBSD: radish.h,v 1.5 2017/05/30 17:22:00 yasuoka Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
* Email: kazu@is.aist-nara.ac.jp
*/
-#ifndef __P
-#ifdef __STDC__
-#define __P(x) x
-#else
-#define __P(x) ()
-#endif /* __STDC__ */
-#endif /* __P */
-
#ifdef RADISH
#ifndef _NET_RADISH_H_
#define _NET_RADISH_H_
* prototype for radish functions
*/
-int rd_inithead __P((void **, int, int, int, int, int (*)(void *, void *)));
-struct sockaddr *rd_mask __P((struct sockaddr *, struct radish_head *, int *));
+int rd_inithead(void **, int, int, int, int, int (*)(void *, void *));
+struct sockaddr *rd_mask(struct sockaddr *, struct radish_head *, int *);
#ifndef GENERIC_USE
-int rd_insert __P((struct sockaddr *, struct sockaddr *,
- struct radish_head *, struct rtentry *));
+int rd_insert(struct sockaddr *, struct sockaddr *,
+ struct radish_head *, struct rtentry *);
#else /* GENERIC_USE */
-int rd_insert __P((struct sockaddr *, struct sockaddr *,
- struct radish_head *, void *));
+int rd_insert(struct sockaddr *, struct sockaddr *,
+ struct radish_head *, void *);
#endif /* GENERIC_USE */
-int rd_glue __P((struct radish *, struct radish *, int, struct radish_head *));
-int rd_match __P((struct sockaddr *, struct radish_head *, struct radish **));
-int rd_match_next __P((struct sockaddr *, struct radish_head *, struct radish **, struct radish *));
+int rd_glue(struct radish *, struct radish *, int, struct radish_head *);
+int rd_match(struct sockaddr *, struct radish_head *, struct radish **);
+int rd_match_next(struct sockaddr *, struct radish_head *, struct radish **, struct radish *);
#ifndef GENERIC_USE
-struct rtentry *rd_lookup __P((struct sockaddr *,
- struct sockaddr *, struct radish_head *));
-int rd_delete __P((struct sockaddr *, struct sockaddr *,
- struct radish_head *, struct rtentry **));
+struct rtentry *rd_lookup(struct sockaddr *,
+ struct sockaddr *, struct radish_head *);
+int rd_delete(struct sockaddr *, struct sockaddr *,
+ struct radish_head *, struct rtentry **);
#else /* GENERIC_USE */
-void *rd_lookup __P((struct sockaddr *,
- struct sockaddr *, struct radish_head *));
-int rd_delete __P((struct sockaddr *, struct sockaddr *,
- struct radish_head *, void **));
+void *rd_lookup(struct sockaddr *,
+ struct sockaddr *, struct radish_head *);
+int rd_delete(struct sockaddr *, struct sockaddr *,
+ struct radish_head *, void **);
#endif /* GENERIC_USE */
-void rd_unlink __P((struct radish *, struct radish *));
-int rd_walktree __P((struct radish_head *, int (*)(struct radish *, void *), void *));
-int rd_refines __P((void *, void *));
+void rd_unlink(struct radish *, struct radish *);
+int rd_walktree(struct radish_head *, int (*)(struct radish *, void *), void *);
+int rd_refines(void *, void *);
#endif /* !_NET_RADISH_H_ */
#endif /* RADISH */
-/* $OpenBSD: fsm.c,v 1.8 2016/03/16 04:58:34 yasuoka Exp $ */
+/* $OpenBSD: fsm.c,v 1.9 2017/05/30 17:22:00 yasuoka Exp $ */
/**@file
* This file was adapted from NetBSD:/usr/src/usr.sbin/pppd/pppd/fsm.c
static const char rcsid[] = RCSID;
#endif
-static void fsm_timeout __P((void *));
-static void fsm_rconfreq __P((fsm *, int, u_char *, int));
-static void fsm_rconfack __P((fsm *, int, u_char *, int));
-static void fsm_rconfnakrej __P((fsm *, int, int, u_char *, int));
-static void fsm_rtermreq __P((fsm *, int, u_char *, int));
-static void fsm_rtermack __P((fsm *));
-static void fsm_rcoderej __P((fsm *, u_char *, int));
-static void fsm_sconfreq __P((fsm *, int));
+static void fsm_timeout(void *);
+static void fsm_rconfreq(fsm *, int, u_char *, int);
+static void fsm_rconfack(fsm *, int, u_char *, int);
+static void fsm_rconfnakrej(fsm *, int, int, u_char *, int);
+static void fsm_rtermreq(fsm *, int, u_char *, int);
+static void fsm_rtermack(fsm *);
+static void fsm_rcoderej(fsm *, u_char *, int);
+static void fsm_sconfreq(fsm *, int);
#define PROTO_NAME(f) ((f)->callbacks->proto_name)
u_char *inp;
int len;
{
- int (*proc) __P((fsm *, u_char *, int));
+ int (*proc)(fsm *, u_char *, int);
int ret;
if (id != f->reqid || f->seen_ack) /* Expected id? */
-/* $OpenBSD: fsm.h,v 1.5 2012/05/08 13:15:11 yasuoka Exp $ */
+/* $OpenBSD: fsm.h,v 1.6 2017/05/30 17:22:00 yasuoka Exp $ */
/* $NetBSD: fsm.h,v 1.10 2000/09/23 22:39:35 christos Exp $ */
/*
typedef struct fsm_callbacks {
- void (*resetci) /* Reset our Configuration Information */
- __P((fsm *));
- int (*cilen) /* Length of our Configuration Information */
- __P((fsm *));
+ void (*resetci)(fsm *); /* Reset our Configuration Information */
+ int (*cilen)(fsm *); /* Length of our Configuration Information */
void (*addci) /* Add our Configuration Information */
- __P((fsm *, u_char *, int *));
+ (fsm *, u_char *, int *);
int (*ackci) /* ACK our Configuration Information */
- __P((fsm *, u_char *, int));
+ (fsm *, u_char *, int);
int (*nakci) /* NAK our Configuration Information */
- __P((fsm *, u_char *, int));
+ (fsm *, u_char *, int);
int (*rejci) /* Reject our Configuration Information */
- __P((fsm *, u_char *, int));
+ (fsm *, u_char *, int);
int (*reqci) /* Request peer's Configuration Information */
- __P((fsm *, u_char *, int *, int));
- void (*up) /* Called when fsm reaches OPENED state */
- __P((fsm *));
- void (*down) /* Called when fsm leaves OPENED state */
- __P((fsm *));
- void (*starting) /* Called when we want the lower layer */
- __P((fsm *));
- void (*finished) /* Called when we don't want the lower layer */
- __P((fsm *));
- void (*protreject) /* Called when Protocol-Reject received */
- __P((int));
- void (*retransmit) /* Retransmission is necessary */
- __P((fsm *));
+ (fsm *, u_char *, int *, int);
+ void (*up)(fsm *); /* Called when fsm reaches OPENED state */
+ void (*down)(fsm *); /* Called when fsm leaves OPENED state */
+
+ void (*starting)(fsm *); /* Called when we want the lower layer */
+ void (*finished)(fsm *); /* Called when we don't want the lower layer */
+ void (*protreject)(int); /* Called when Protocol-Reject received */
+ void (*retransmit)(fsm *); /* Retransmission is necessary */
int (*extcode) /* Called when unknown code received */
- __P((fsm *, int, int, u_char *, int));
+ (fsm *, int, int, u_char *, int);
char *proto_name; /* String name for protocol (for messages) */
} fsm_callbacks;
/*
* Prototypes
*/
-void fsm_evtimer_timeout __P((int, short, void *));
-void fsm_init __P((fsm *));
-void fsm_lowerup __P((fsm *));
-void fsm_lowerdown __P((fsm *));
-void fsm_open __P((fsm *));
-void fsm_close __P((fsm *, const char *));
-void fsm_input __P((fsm *, u_char *, int));
-void fsm_protreject __P((fsm *));
-void fsm_sdata __P((fsm *, int, int, u_char *, int));
-void fsm_log __P((fsm *, uint32_t, const char *, ...)) __attribute__((__format__ (__printf__, 3, 4)));
+void fsm_evtimer_timeout(int, short, void *);
+void fsm_init(fsm *);
+void fsm_lowerup(fsm *);
+void fsm_lowerdown(fsm *);
+void fsm_open(fsm *);
+void fsm_close(fsm *, const char *);
+void fsm_input(fsm *, u_char *, int);
+void fsm_protreject(fsm *);
+void fsm_sdata(fsm *, int, int, u_char *, int);
+void fsm_log(fsm *, uint32_t, const char *, ...) __attribute__((__format__ (__printf__, 3, 4)));
#endif
-/* $OpenBSD: lcp.c,v 1.16 2015/12/05 18:43:36 mmcc Exp $ */
+/* $OpenBSD: lcp.c,v 1.17 2017/05/30 17:22:00 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* $Id: lcp.c,v 1.16 2015/12/05 18:43:36 mmcc Exp $ */
+/* $Id: lcp.c,v 1.17 2017/05/30 17:22:00 yasuoka Exp $ */
/**@file
* This file provides LCP related functions.
*<pre>
#define ECHOREP 0x0a
#define IDENTIFICATION 0x0c
-static void lcp_resetci __P((fsm *));
-static void lcp_addci __P((fsm *, u_char *, int *));
-static int lcp_reqci __P((fsm *, u_char *, int *, int));
-static int lcp_ackci __P((fsm *, u_char *, int));
-static int lcp_nakci __P((fsm *, u_char *, int));
-static int lcp_rejci __P((fsm *, u_char *, int));
-static int lcp_cilen __P((fsm *));
-static void lcp_open __P((fsm *));
-static void lcp_down __P((fsm *));
-static void lcp_finished __P((fsm *));
-static int lcp_ext __P((fsm *, int, int, u_char *, int));
+static void lcp_resetci(fsm *);
+static void lcp_addci(fsm *, u_char *, int *);
+static int lcp_reqci(fsm *, u_char *, int *, int);
+static int lcp_ackci(fsm *, u_char *, int);
+static int lcp_nakci(fsm *, u_char *, int);
+static int lcp_rejci(fsm *, u_char *, int);
+static int lcp_cilen(fsm *);
+static void lcp_open(fsm *);
+static void lcp_down(fsm *);
+static void lcp_finished(fsm *);
+static int lcp_ext(fsm *, int, int, u_char *, int);
static void lcp_timeout(void *);
static void lcp_reset_timeout(void *);
static int lcp_proxy_recv_ci(fsm *, u_char *, int);
-/* $OpenBSD: mppe.c,v 1.13 2015/12/05 18:43:36 mmcc Exp $ */
+/* $OpenBSD: mppe.c,v 1.14 2017/05/30 17:22:00 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* $Id: mppe.c,v 1.13 2015/12/05 18:43:36 mmcc Exp $ */
+/* $Id: mppe.c,v 1.14 2017/05/30 17:22:00 yasuoka Exp $ */
/**@file
*
* The implementation of MPPE(Microsoft Point-To-Point Encryption Protocol)
#define COHER_GE(a, b) (!COHER_LT((a), (b)))
-static const char *mppe_bits_to_string __P((uint32_t));
-static void mppe_log __P((mppe *, uint32_t, const char *, ...)) __printflike(3,4);
-static int mppe_rc4_init __P((mppe *, mppe_rc4_t *, int));
-static int mppe_rc4_setkey __P((mppe *, mppe_rc4_t *));
-static int mppe_rc4_setoldkey __P((mppe *, mppe_rc4_t *, uint16_t));
-static void mppe_rc4_destroy __P((mppe *, mppe_rc4_t *));
-static void mppe_rc4_encrypt __P((mppe *, mppe_rc4_t *, int, u_char *, u_char *));
-static void *rc4_create_ctx __P((void));
-static int rc4_key __P((void *, int, u_char *));
-static void rc4 __P((void *, int, u_char *, u_char *));
-static void GetNewKeyFromSHA __P((u_char *, u_char *, int, u_char *));
+static const char *mppe_bits_to_string(uint32_t);
+static void mppe_log(mppe *, uint32_t, const char *, ...) __printflike(3,4);
+static int mppe_rc4_init(mppe *, mppe_rc4_t *, int);
+static int mppe_rc4_setkey(mppe *, mppe_rc4_t *);
+static int mppe_rc4_setoldkey(mppe *, mppe_rc4_t *, uint16_t);
+static void mppe_rc4_destroy(mppe *, mppe_rc4_t *);
+static void mppe_rc4_encrypt(mppe *, mppe_rc4_t *, int, u_char *, u_char *);
+static void *rc4_create_ctx(void);
+static int rc4_key(void *, int, u_char *);
+static void rc4(void *, int, u_char *, u_char *);
+static void GetNewKeyFromSHA(u_char *, u_char *, int, u_char *);
/**
* initializing mppe context.
-/* $OpenBSD: npppd_pool.c,v 1.9 2015/12/05 18:43:36 mmcc Exp $ */
+/* $OpenBSD: npppd_pool.c,v 1.10 2017/05/30 17:22:00 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
#define SA(sin4) ((struct sockaddr *)(sin4))
#define SHUFLLE_MARK 0xffffffffL
-static int npppd_pool_log __P((npppd_pool *, int, const char *, ...)) __printflike(3, 4);
+static int npppd_pool_log(npppd_pool *, int, const char *, ...) __printflike(3, 4);
static int is_valid_host_address (uint32_t);
static int npppd_pool_regist_radish(npppd_pool *, struct in_addr_range *,
struct sockaddr_npppd *, int );
-/* $OpenBSD: ppp.h,v 1.19 2015/12/05 16:10:31 yasuoka Exp $ */
+/* $OpenBSD: ppp.h,v 1.20 2017/05/30 17:22:00 yasuoka Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
int chap_proxy_authen_prepare (chap *, dialin_proxy_info *);
#ifdef USE_NPPPD_EAP_RADIUS
-void eap_init __P((eap *, npppd_ppp *));
-void eap_stop __P((eap *));
-void eap_start __P((eap *));
-void eap_input __P((eap *, u_char *, int));
+void eap_init(eap *, npppd_ppp *);
+void eap_stop(eap *);
+void eap_start(eap *);
+void eap_input(eap *, u_char *, int);
#endif
#ifdef USE_NPPPD_MPPE