-/* $OpenBSD: pipex.c,v 1.146 2022/07/15 22:56:13 mvs Exp $ */
+/* $OpenBSD: pipex.c,v 1.147 2022/07/25 08:28:42 mvs Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
#include <netinet/udp_var.h>
#include <crypto/arc4.h>
-/* drop static for ddb debuggability */
-#define Static
-
#include <net/pipex.h>
#include "pipex_local.h"
stats->idle_time = session->idle_time;
}
-Static int
+int
pipex_get_stat(struct pipex_session_stat_req *req, void *ownersc)
{
struct pipex_session *session;
return error;
}
-Static int
+int
pipex_get_closed(struct pipex_session_list_req *req, void *ownersc)
{
struct pipex_session *session, *session_tmp;
return (0);
}
-Static struct pipex_session *
+struct pipex_session *
pipex_lookup_by_ip_address_locked(struct in_addr addr)
{
struct pipex_session *session;
}
-Static struct pipex_session *
+struct pipex_session *
pipex_lookup_by_session_id_locked(int protocol, int session_id)
{
struct pipex_hash_head *list;
/***********************************************************************
* Timer functions
***********************************************************************/
-Static void
+void
pipex_timer_start(void)
{
timeout_set_proc(&pipex_timer_ch, pipex_timer, NULL);
timeout_add_sec(&pipex_timer_ch, pipex_prune);
}
-Static void
+void
pipex_timer_stop(void)
{
timeout_del(&pipex_timer_ch);
}
-Static void
+void
pipex_timer(void *ignored_arg)
{
struct pipex_session *session, *session_tmp;
/***********************************************************************
* Common network I/O functions. (tunnel protocol independent)
***********************************************************************/
-Static void
+void
pipex_ip_output(struct mbuf *m0, struct pipex_session *session)
{
int is_idle;
counters_inc(session->stat_counters, pxc_oerrors);
}
-Static void
+void
pipex_ppp_output(struct mbuf *m0, struct pipex_session *session, int proto)
{
u_char *cp, hdr[16];
counters_inc(session->stat_counters, pxc_oerrors);
}
-Static void
+void
pipex_ppp_input(struct mbuf *m0, struct pipex_session *session, int decrypted)
{
int proto, hlen = 0;
counters_inc(session->stat_counters, pxc_ierrors);
}
-Static void
+void
pipex_ip_input(struct mbuf *m0, struct pipex_session *session)
{
struct ifnet *ifp;
}
#ifdef INET6
-Static void
+void
pipex_ip6_input(struct mbuf *m0, struct pipex_session *session)
{
struct ifnet *ifp;
}
#endif
-Static struct mbuf *
+struct mbuf *
pipex_common_input(struct pipex_session *session, struct mbuf *m0, int hlen,
int plen, int locked)
{
/*
* pipex_ppp_proto
*/
-Static int
+int
pipex_ppp_proto(struct mbuf *m0, struct pipex_session *session, int off,
int *hlenp)
{
/***********************************************************************
* PPPoE
***********************************************************************/
-Static u_char pipex_pppoe_padding[ETHERMIN];
+static const u_char pipex_pppoe_padding[ETHERMIN];
/*
* pipex_pppoe_lookup_session
*/
/*
* pipex_ppope_output
*/
-Static void
+void
pipex_pppoe_output(struct mbuf *m0, struct pipex_session *session)
{
struct pipex_pppoe_header *pppoe;
/***********************************************************************
* PPTP
***********************************************************************/
-Static void
+void
pipex_pptp_output(struct mbuf *m0, struct pipex_session *session,
int has_seq, int has_ack)
{
}
#endif
-Static struct pipex_session *
+struct pipex_session *
pipex_pptp_userland_lookup_session(struct mbuf *m0, struct sockaddr *sa)
{
struct pipex_gre_header gre;
/***********************************************************************
* L2TP support
***********************************************************************/
-Static void
+void
pipex_l2tp_output(struct mbuf *m0, struct pipex_session *session)
{
int hlen, plen, datalen;
rc4_crypt(&mppe->rc4ctx, indata, outdata, len);
}
-Static void
+void
pipex_mppe_init(struct pipex_mppe *mppe, int stateless, int keylenbits,
u_char *master_key, int has_oldkey)
{
0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2,
};
-Static void
+void
GetNewKeyFromSHA(u_char *StartKey, u_char *SessionKey, int SessionKeyLength,
u_char *InterimKey)
{
memcpy(InterimKey, Digest, SessionKeyLength);
}
-Static void
+void
pipex_mppe_reduce_key(struct pipex_mppe *mppe)
{
switch (mppe->keylenbits) {
}
}
-Static void
+void
mppe_key_change(struct pipex_mppe *mppe)
{
u_char interim[16];
return (m0);
}
-Static void
+void
pipex_ccp_input(struct mbuf *m0, struct pipex_session *session)
{
u_char *cp;
counters_inc(session->stat_counters, pxc_ierrors);
}
-Static int
+int
pipex_ccp_output(struct pipex_session *session, int code, int id)
{
u_char *cp;
* The mtu parameter should be the MTU bottleneck (as far as we know)
* on the link between the source and the destination.
*/
-Static struct mbuf *
+struct mbuf *
adjust_tcp_mss(struct mbuf *m0, int mtu)
{
int opt, optlen, acc, mss, maxmss, lpktp;
* Check whether a packet should reset idle timer
* Returns 1 to don't reset timer (i.e. the packet is "idle" packet)
*/
-Static struct mbuf *
+struct mbuf *
ip_is_idle_packet(struct mbuf *m0, int *ris_idle)
{
u_int16_t ip_off;
return (NULL);
}
-Static void
+void
pipex_session_log(struct pipex_session *session, int prio, const char *fmt, ...)
{
char logbuf[1024];
addlog("%s\n", logbuf);
}
-Static uint32_t
+uint32_t
pipex_sockaddr_hash_key(struct sockaddr *sa)
{
switch (sa->sa_family) {
* Compare struct sockaddr_in{,6} with the address only.
* The port number is not covered.
*/
-Static int
+int
pipex_sockaddr_compar_addr(struct sockaddr *a, struct sockaddr *b)
{
int cmp;