added tcp-keepalive-detect with local response (ipv4 only)

added host-only-interface support
(source ipaddr == interface ipaddr) (ipv4 only)
ok with kernel 2.3.18 and 2.2.12
This commit is contained in:
Detlef Wengorz 1999-09-23 22:22:42 +00:00
parent a554b4f41e
commit bf969d6407
4 changed files with 876 additions and 65 deletions

View File

@ -82,15 +82,17 @@ if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
if [ "$CONFIG_ISDN_WITH_ABC" != "n" ]; then
bool 'Use D-Channel-Callback with Channel in use check' CONFIG_ISDN_WITH_ABC_CALLB
bool 'Use Phonenumber and EAZ for async-calls' CONFIG_ISDN_WITH_ABC_CALL_CHECK_SYNCRO
bool 'Enable Outgoing-EAZ-Support' CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
bool 'Enable LCR-Support (need isdnlog)' CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
bool 'TCP keepalive detect and response (ip4 only)' CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE
bool 'Drop frames s_addr != iface_addr (ip4 only)' CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
bool 'Enable UDP-Info-Support' CONFIG_ISDN_WITH_ABC_UDP_CHECK
if [ "$CONFIG_ISDN_WITH_ABC_UDP_CHECK" != "n" ]; then
bool 'Enable Hangup-Support with UDP-INFO' CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
fi
bool 'Enable Outgoing-EAZ-Support' CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
bool 'Enable LCR-Support (need isdnlog)' CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
fi
fi

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.92 1999/09/13 23:25:17 he
* serialized xmitting frames from isdn_ppp and BSENT statcallb
*
* Revision 1.91 1999/09/12 16:19:39 detabc
* added abc features
* low cost routing for net-interfaces (only the HL side).
@ -388,7 +391,11 @@ char *isdn_net_revision = "$Revision$";
* Code for raw-networking over ISDN
*/
#ifdef CONFIG_ISDN_WITH_ABC
void
#else
static void
#endif
isdn_net_unreachable(struct net_device *dev, struct sk_buff *skb, char *reason)
{
@ -1021,7 +1028,7 @@ dw_abc_lcr_next_click:;
strcpy(dev->num[i], cmd.parm.setup.phone);
isdn_info_update();
}
#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
#ifdef CONFIG_ISDN_WITH_ABC
printk(KERN_INFO "%s: dialing %d %s -> %s...\n", lp->name,
lp->dialretry,
cmd.parm.setup.eazmsn,
@ -1406,11 +1413,23 @@ isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
#ifdef CONFIG_ISDN_X25
struct concap_proto * cprot = lp -> netdev -> cprot;
#endif
#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
if(dw_abc_udp_test(skb,ndev)) {
dev_kfree_skb(skb);
return 0;
#ifdef CONFIG_ISDN_WITH_ABC
#if CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE || CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_TCP_KEEPALIVE)) {
if(isdn_dw_abc_ip4_keepalive_test(ndev,skb)) {
dev_kfree_skb(skb);
return(0);
}
}
#endif
#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_UDP_CHECK)) {
if(dw_abc_udp_test(skb,ndev)) {
dev_kfree_skb(skb);
return 0;
}
}
#endif
#endif
if (ndev->tbusy) {
if (jiffies - ndev->trans_start < (2 * HZ))
@ -1872,6 +1891,10 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
return;
}
#ifdef CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE
if(!(lp->dw_abc_flags & ISDN_DW_ABC_FLAG_NO_TCP_KEEPALIVE))
(void)isdn_dw_abc_ip4_keepalive_test(NULL,skb);
#endif
netif_rx(skb);
return;
}
@ -2245,7 +2268,6 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm setup)
#endif
#ifdef CONFIG_ISDN_WITH_ABC_CALLB
{
#ifdef CONFIG_ISDN_WITH_ABC_CALL_CHECK_SYNCRO
int use_this_call = 0;
if(!(lp->flags & ISDN_NET_CBOUT) && ((lp->dialstate == 4) || (lp->dialstate == 12))) {
@ -2270,12 +2292,8 @@ isdn_net_find_icall(int di, int ch, int idx, setup_parm setup)
use_this_call = 1;
}
#endif
if(
#ifdef CONFIG_ISDN_WITH_ABC_CALL_CHECK_SYNCRO
use_this_call ||
#endif
if( use_this_call ||
((lp->flags & ISDN_NET_CBOUT) && (lp->flags & ISDN_NET_CONNECTED))) {
/*
@ -3125,9 +3143,8 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
strcpy(n->num, phone->phone);
n->next = p->local->phone[phone->outgoing & 1];
p->local->phone[phone->outgoing & 1] = n;
#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
if(*(phone->phone) == '>')
strncpy(p->local->dw_out_msn,phone->phone + 1,ISDN_MSNLEN - 1);
#ifdef CONFIG_ISDN_WITH_ABC
isdn_dwabc_test_phone(p->local);
#endif
return 0;
}
@ -3209,10 +3226,6 @@ isdn_net_delphone(isdn_net_ioctl_phone * phone)
int flags;
if (p) {
#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
if(*(phone->phone) == '>')
*p->local->dw_out_msn = 0;
#endif
save_flags(flags);
cli();
n = p->local->phone[inout];
@ -3226,6 +3239,9 @@ isdn_net_delphone(isdn_net_ioctl_phone * phone)
else
p->local->phone[inout] = n->next;
kfree(n);
#ifdef CONFIG_ISDN_WITH_ABC
isdn_dwabc_test_phone(p->local);
#endif
restore_flags(flags);
return 0;
}
@ -3261,6 +3277,9 @@ isdn_net_rmallphone(isdn_net_dev * p)
p->local->phone[i] = NULL;
}
p->local->dial = NULL;
#ifdef CONFIG_ISDN_WITH_ABC
isdn_dwabc_test_phone(p->local);
#endif
restore_flags(flags);
return 0;
}

View File

@ -21,6 +21,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log$
* Revision 1.76 1999/09/14 10:16:21 keil
* change ABC include
*
* Revision 1.75 1999/09/13 23:25:17 he
* serialized xmitting frames from isdn_ppp and BSENT statcallb
*
@ -300,11 +303,19 @@
#undef CONFIG_ISDN_WITH_ABC_CALLB
#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK
#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_HANGUP
#undef CONFIG_ISDN_WITH_ABC_UDP_CHECK_DIAL
#undef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
#undef CONFIG_ISDN_WITH_ABC_CALL_CHECK_SYNCRO
#undef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
#undef CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE
#undef CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
#else
#include <linux/isdn_dwabc.h>
#define ISDN_DW_ABC_FLAG_NO_TCP_KEEPALIVE 0x00000001L
#define ISDN_DW_ABC_FLAG_NO_UDP_CHECK 0x00000002L
#define ISDN_DW_ABC_FLAG_NO_UDP_HANGUP 0x00000004L
#define ISDN_DW_ABC_FLAG_NO_UDP_DIAL 0x00000008L
#define ISDN_DW_ABC_FLAG_DYNADDR 0x00000010L
extern void isdn_dw_abc_init_func(void);
extern void isdn_dw_abc_release_func(void);
#endif
@ -644,14 +655,15 @@ typedef struct isdn_net_local_s {
ulong cisco_myseq; /* Local keepalive seq. for Cisco */
ulong cisco_yourseq; /* Remote keepalive seq. for Cisco */
#ifdef CONFIG_ISDN_WITH_ABC
int dw_abc_old_onhtime;
ulong dw_abc_flags;
int dw_abc_old_onhtime;
#ifdef CONFIG_ISDN_WITH_ABC_OUTGOING_EAZ
char dw_out_msn[ISDN_MSNLEN]; /* eaz for outgoing call if *out_msn != 0 */
#endif
#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
u_long dw_abc_lcr_callid;
u_long dw_abc_lcr_start_request;
u_long dw_abc_lcr_end_request;
ulong dw_abc_lcr_callid;
ulong dw_abc_lcr_start_request;
ulong dw_abc_lcr_end_request;
isdn_ctrl *dw_abc_lcr_cmd;
struct ISDN_DWABC_LCR_IOCTL *dw_abc_lcr_io;
#endif
@ -938,12 +950,14 @@ typedef struct isdn_devt {
extern isdn_dev *dev;
#ifdef CONFIG_ISDN_WITH_ABC
extern void isdn_net_unreachable(struct net_device *,struct sk_buff *,char *);
extern void isdn_net_hangup(struct net_device *d);
extern void isdn_dw_clear_if(ulong pm,isdn_net_local *);
extern void isdn_dwabc_test_phone(isdn_net_local *);
#ifdef CONFIG_ISDN_WITH_ABC_LCR_SUPPORT
extern size_t isdn_dw_abc_lcr_readstat(char *,size_t);
extern u_long isdn_dw_abc_lcr_call_number(isdn_net_local *,isdn_ctrl *);
extern ulong isdn_dw_abc_lcr_call_number(isdn_net_local *,isdn_ctrl *);
extern void isdn_dw_abc_lcr_open(void);
extern void isdn_dw_abc_lcr_close(void);
extern void isdn_dw_abc_lcr_ioctl(u_long);
@ -953,8 +967,11 @@ extern void isdn_dw_abc_lcr_clear(isdn_net_local *);
#ifdef CONFIG_ISDN_WITH_ABC_UDP_CHECK
extern int dw_abc_udp_test(struct sk_buff *skb,struct net_device *ndev);
#endif
#if CONFIG_ISDN_WITH_ABC_IPV4_TCP_KEEPALIVE || CONFIG_ISDN_WITH_ABC_IPV4_DYNADDR
int isdn_dw_abc_ip4_keepalive_test(struct net_device *ndev,struct sk_buff *skb);
#endif
#endif
/* Utility-Macros */
#define MIN(a,b) ((a<b)?a:b)