Lines 81-86
Link Here
|
81 |
static unsigned short skip_pktid; |
81 |
static unsigned short skip_pktid; |
82 |
static skip_softc_t skip_softc[SKIP_MAX_OPENS]; |
82 |
static skip_softc_t skip_softc[SKIP_MAX_OPENS]; |
83 |
|
83 |
|
|
|
84 |
#ifdef NEW_TIMEOUT_INTERFACE |
85 |
static struct callout_handle |
86 |
skip_timeout_handle = CALLOUT_HANDLE_INITIALIZER(&skip_timeout_handle); |
87 |
#endif |
88 |
|
84 |
/* |
89 |
/* |
85 |
* statistics |
90 |
* statistics |
86 |
*/ |
91 |
*/ |
Lines 252-258
Link Here
|
252 |
for (pr = inetdomain.dom_protosw; |
257 |
for (pr = inetdomain.dom_protosw; |
253 |
pr < inetdomain.dom_protoswNPROTOSW; pr++) { |
258 |
pr < inetdomain.dom_protoswNPROTOSW; pr++) { |
254 |
|
259 |
|
255 |
pr->pr_input = skip_ifinput; |
260 |
if (pr->pr_protocol == IPPROTO_DIVERT) |
|
|
261 |
continue; |
262 |
pr->pr_input = |
263 |
(void (*)(struct mbuf *, int)) skip_ifinput; |
256 |
} |
264 |
} |
257 |
splx(s); |
265 |
splx(s); |
258 |
} |
266 |
} |
Lines 788-794
Link Here
|
788 |
static void |
796 |
static void |
789 |
skip_inittimers() |
797 |
skip_inittimers() |
790 |
{ |
798 |
{ |
|
|
799 |
#ifdef NEW_TIMEOUT_INTERFACE |
800 |
skip_timeout_handle = timeout(skip_timer, NULL, skip_key_tick * hz); |
801 |
#else |
791 |
timeout(skip_timer, NULL, skip_key_tick * hz); |
802 |
timeout(skip_timer, NULL, skip_key_tick * hz); |
|
|
803 |
#endif |
792 |
} |
804 |
} |
793 |
|
805 |
|
794 |
/* skip_uninittimers() |
806 |
/* skip_uninittimers() |
Lines 800-806
Link Here
|
800 |
static void |
812 |
static void |
801 |
skip_uninittimers() |
813 |
skip_uninittimers() |
802 |
{ |
814 |
{ |
|
|
815 |
#ifdef NEW_TIMEOUT_INTERFACE |
816 |
untimeout(skip_timer, NULL, skip_timeout_handle); |
817 |
callout_handle_init(&skip_timeout_handle); |
818 |
#else |
803 |
untimeout(skip_timer, NULL); |
819 |
untimeout(skip_timer, NULL); |
|
|
820 |
#endif |
804 |
} |
821 |
} |
805 |
|
822 |
|
806 |
/* skip_timer() |
823 |
/* skip_timer() |
Lines 819-825
Link Here
|
819 |
* run through the key store |
836 |
* run through the key store |
820 |
*/ |
837 |
*/ |
821 |
skip_key_iterate(skip_key_check, NULL); |
838 |
skip_key_iterate(skip_key_check, NULL); |
|
|
839 |
#ifdef NEW_TIMEOUT_INTERFACE |
840 |
skip_timeout_handle = timeout(skip_timer, NULL, skip_key_tick * hz); |
841 |
#else |
822 |
timeout(skip_timer, NULL, skip_key_tick * hz); |
842 |
timeout(skip_timer, NULL, skip_key_tick * hz); |
|
|
843 |
#endif |
823 |
} |
844 |
} |
824 |
|
845 |
|
825 |
#ifdef notdef |
846 |
#ifdef notdef |
Lines 1718-1724
Link Here
|
1718 |
*/ |
1739 |
*/ |
1719 |
decryptbuf->m_data += iphlen; |
1740 |
decryptbuf->m_data += iphlen; |
1720 |
|
1741 |
|
1721 |
SKIP_DEBUG2("skip_ifinput: decryptbuf m_len=%d m_data=%d\n", |
1742 |
SKIP_DEBUG2("skip_ifinput: decryptbuf m_len=%d m_data=%p\n", |
1722 |
decryptbuf->m_len, decryptbuf->m_data); |
1743 |
decryptbuf->m_len, decryptbuf->m_data); |
1723 |
|
1744 |
|
1724 |
} |
1745 |
} |
Lines 2005-2011
Link Here
|
2005 |
if (params.kp_alg) { |
2026 |
if (params.kp_alg) { |
2006 |
newip->ip_p = SKIP_NEXT_ESP; |
2027 |
newip->ip_p = SKIP_NEXT_ESP; |
2007 |
} else { |
2028 |
} else { |
2008 |
newip->ip_p = IPPROTO_ENCAP; |
2029 |
newip->ip_p = IPPROTO_IPIP; |
2009 |
} |
2030 |
} |
2010 |
} |
2031 |
} |
2011 |
skip_if->stats.skip_if_raw_out++; |
2032 |
skip_if->stats.skip_if_raw_out++; |
Lines 2097-2103
Link Here
|
2097 |
register skip_param_t *params = &res->params; |
2118 |
register skip_param_t *params = &res->params; |
2098 |
register struct ip *ip = mtod(original, struct ip *); |
2119 |
register struct ip *ip = mtod(original, struct ip *); |
2099 |
int rc, s, iphlen; |
2120 |
int rc, s, iphlen; |
2100 |
struct mbuf *outbuf, *new_hdr; |
2121 |
struct mbuf *outbuf; |
2101 |
|
2122 |
|
2102 |
SKIP_PRINT("skip_decrypt_done", params); |
2123 |
SKIP_PRINT("skip_decrypt_done", params); |
2103 |
|
2124 |
|
Lines 2125-2131
Link Here
|
2125 |
*/ |
2146 |
*/ |
2126 |
outbuf = (res->modes & SKIP_CRYPT_ON) ? m : original; |
2147 |
outbuf = (res->modes & SKIP_CRYPT_ON) ? m : original; |
2127 |
|
2148 |
|
2128 |
if (res->proto != IPPROTO_ENCAP) { |
2149 |
if (res->proto != IPPROTO_IPIP) { |
2129 |
/* |
2150 |
/* |
2130 |
* transport mode, need to copy original IP header |
2151 |
* transport mode, need to copy original IP header |
2131 |
*/ |
2152 |
*/ |