void inject(char* msg, int len) { struct mbuf *m = m_devget(msg, len, 0, NULL, NULL); enqueue(&ipintrq, m); updatetime(); ipintr(); }
int handle_inter_proc () { input_eth(); ipintr(); arpintr(); }
/* do_sw_intr() -- do software interrupt processing */ void do_sw_intr(void) { int n, s; s = splhigh(); n = netisr; netisr = 0; splx(s); if (n & (1 << NETISR_ARP)) arpintr(); if (n & (1 << NETISR_IP)) ipintr(); }
void netintr(void *unused) /* ARGSUSED */ { int n, t = 0; while ((n = netisr) != 0) { atomic_clearbits_int(&netisr, n); #ifdef INET #if NETHER > 0 if (n & (1 << NETISR_ARP)) arpintr(); #endif if (n & (1 << NETISR_IP)) ipintr(); #endif #ifdef INET6 if (n & (1 << NETISR_IPV6)) ip6intr(); #endif #ifdef MPLS if (n & (1 << NETISR_MPLS)) mplsintr(); #endif #if NPPP > 0 if (n & (1 << NETISR_PPP)) pppintr(); #endif #if NBRIDGE > 0 if (n & (1 << NETISR_BRIDGE)) bridgeintr(); #endif #if NPPPOE > 0 if (n & (1 << NETISR_PPPOE)) pppoeintr(); #endif #if NBLUETOOTH > 0 if (n & (1 << NETISR_BT)) btintr(); #endif t |= n; } #if NPFSYNC > 0 if (t & (1 << NETISR_PFSYNC)) pfsyncintr(); #endif if (t & (1 << NETISR_TX)) nettxintr(); }
void handshake() { int port = 1234; listenon(port); struct socket* so = NULL; socreate(AF_INET, &so, SOCK_STREAM, 0); struct sockaddr_in addr; bzero(&addr, sizeof addr); addr.sin_len = sizeof addr; addr.sin_family = AF_INET; addr.sin_port = htons(port); addr.sin_addr.s_addr = htonl(0x7f000001); struct mbuf* nam = m_devget((caddr_t)&addr, sizeof addr, 0, NULL, NULL); soconnect(so, nam); ipintr(); }
/* * net_poll(): run scheduled network level protocols * this routine is called from sana_poll */ void net_poll(void) { extern void ipintr(void); extern void impintr(void); extern void isointr(void); extern void ccittintr(void); extern void nsintr(void); spl_t s = splimp(); int n = netisr; netisr = 0; splx(s); if (!n) return; #if INET if (n & (1<<NETISR_IP)) { ipintr(); } #endif /* INET */ #if NIMP > 0 if (n & (1<<NETISR_IMP)) { impintr(); } #endif /* NIMP > 0 */ #if ISO if (n & (1<<NETISR_ISO)) { isointr(); } #endif /* ISO */ #if CCITT if (n & (1<<NETISR_CCITT)) { ccittintr(); } #endif /* CCITT */ #if NS if (n & (1<<NETISR_NS)) { nsintr(); } #endif /* NS */ #if 0 /* raw input do not go through the isr */ if (n & (1<<NETISR_RAW)) { rawintr(); } #endif }