*/
#include <afsconfig.h>
-#include "../afs/param.h"
+#include "afs/param.h"
RCSID("$Header$");
#ifdef AFS_SUN5_ENV
-#include "../rx/rx_kcommon.h"
+#include "rx/rx_kcommon.h"
#ifdef AFS_SUN56_ENV
-#include "../inet/common.h"
-#include "../sys/tiuser.h"
-#include "../sys/t_kuser.h"
-#include "../sys/stropts.h"
-#include "../sys/stream.h"
-#include "../sys/tihdr.h"
-#include "../sys/fcntl.h"
+#include "inet/common.h"
+#include "sys/tiuser.h"
+#include "sys/t_kuser.h"
+#include "sys/stropts.h"
+#include "sys/stream.h"
+#include "sys/tihdr.h"
+#include "sys/fcntl.h"
#ifdef AFS_SUN58_ENV
-#include "../netinet/ip6.h"
+#include "netinet/ip6.h"
#define ipif_local_addr ipif_lcl_addr
#ifndef V4_PART_OF_V6
#define V4_PART_OF_V6(v6) v6.s6_addr32[3]
#endif
#endif
-#include "../inet/ip.h"
-#include "../inet/ip_if.h"
-#include "../netinet/udp.h"
+#include "inet/ip.h"
+#include "inet/ip_if.h"
+#include "netinet/udp.h"
/*
* Function pointers for kernel socket routines
(struct sonode *, struct nmsghdr *, struct uio *) = NULL;
int (*sockfs_sosetsockopt)
(struct sonode *, int, int, void *, int) = NULL;
+int (*sockfs_sounbind)
+ (struct sonode *, int);
+void (*sockfs_sockfree)
+ (struct sonode *);
static afs_uint32 myNetAddrs[ADDRSPERSITE];
static int myNetMTUs[ADDRSPERSITE];
return different;
}
-int
-rxi_FindIfMTU(addr)
- afs_uint32 addr;
+int rxi_FindIfMTU(afs_uint32 addr)
{
ill_t *ill;
ipif_t *ipif;
return NULL;
}
}
+ if (sockfs_sounbind == NULL) {
+ sockfs_sounbind = (int (*)())modlookup("sockfs", "sounbind");
+ if (sockfs_sounbind == NULL)
+ return NULL;
+ }
+ if (sockfs_sockfree == NULL) {
+ sockfs_sockfree = (void (*)())modlookup("sockfs", "sockfree");
+ if (sockfs_sockfree == NULL)
+ return NULL;
+ }
accessvp = sockfs_solookup(AF_INET, SOCK_DGRAM, 0, "/dev/udp", &error);
if (accessvp == NULL) {
return (struct osi_socket *)so;
}
-int osi_FreeSocket(asocket)
- register struct osi_socket *asocket;
+int osi_FreeSocket(register struct osi_socket *asocket)
{
extern int rxk_ListenerPid;
struct sonode *so = (struct sonode *)asocket;
- vnode_t *vp = SOTOV(so);
+ struct sockaddr_in taddr;
+ struct iovec dvec;
+ char c;
AFS_STATCNT(osi_FreeSocket);
- if (rxk_ListenerPid)
- kill(rxk_ListenerPid, SIGUSR1);
+
+ taddr.sin_family = AF_INET;
+ taddr.sin_port = rx_port;
+ taddr.sin_addr.s_addr = htonl(0x7f000001);
+
+ dvec.iov_base = &c;
+ dvec.iov_len = 1;
+
+ while (rxk_ListenerPid) {
+ osi_NetSend(rx_socket, &taddr, &dvec, 1, 1, 0);
+ afs_osi_Sleep(&rxk_ListenerPid);
+ }
+
+ sockfs_sounbind(so, 0);
+ sockfs_sockfree(so);
return 0;
}
-int osi_NetSend(asocket, addr, dvec, nvecs, asize, istack)
- struct osi_socket *asocket;
- struct sockaddr_in *addr;
- struct iovec dvec[];
- int nvecs;
- afs_int32 asize;
- int istack;
+int osi_NetSend(osi_socket asocket, struct sockaddr_in *addr,
+ struct iovec *dvec, int nvecs, afs_int32 asize, int istack)
{
struct sonode *so = (struct sonode *)asocket;
struct nmsghdr msg;
return error;
}
-int osi_NetReceive(asocket, addr, dvec, nvecs, alength)
- struct osi_socket *asocket;
- struct sockaddr_in *addr;
- struct iovec *dvec;
- int nvecs;
- int *alength;
-{
- struct sonode *so = (struct sonode *)asocket;
+int osi_NetReceive(osi_socket so, struct sockaddr_in *addr, struct iovec *dvec,
+ int nvecs, int *alength)
+{
+ struct sonode *asocket = (struct sonode *)so;
struct nmsghdr msg;
struct uio uio;
struct iovec iov[RX_MAXIOVECS];
uio.uio_limit = 0;
uio.uio_resid = *alength;
- error = sockfs_sorecvmsg(so, &msg, &uio);
+ error = sockfs_sorecvmsg(asocket, &msg, &uio);
if (error == 0) {
if (msg.msg_name == NULL) {
error = -1;
#else /* AFS_SUN56_ENV */
-#include "../inet/common.h"
-#include "../sys/tiuser.h"
-#include "../sys/t_kuser.h"
-#include "../sys/ioctl.h"
-#include "../sys/stropts.h"
-#include "../sys/stream.h"
-#include "../sys/strsubr.h"
-#include "../sys/vnode.h"
-#include "../sys/stropts.h"
-#include "../sys/tihdr.h"
-#include "../sys/timod.h"
-#include "../sys/fcntl.h"
-#include "../sys/debug.h"
-#include "../inet/common.h"
-#include "../inet/mi.h"
-#include "../netinet/udp.h"
+#include "inet/common.h"
+#include "sys/tiuser.h"
+#include "sys/t_kuser.h"
+#include "sys/ioctl.h"
+#include "sys/stropts.h"
+#include "sys/stream.h"
+#include "sys/strsubr.h"
+#include "sys/vnode.h"
+#include "sys/stropts.h"
+#include "sys/tihdr.h"
+#include "sys/timod.h"
+#include "sys/fcntl.h"
+#include "sys/debug.h"
+#include "inet/common.h"
+#include "inet/mi.h"
+#include "netinet/udp.h"
extern dev_t afs_udp_rdev;
}
-int osi_FreeSocket(asocket)
- register struct osi_socket *asocket;
+int osi_FreeSocket(register struct osi_socket *asocket)
{
extern int rxk_ListenerPid;
TIUSER *udp_tiptr = (TIUSER *) asocket;
AFS_STATCNT(osi_FreeSocket);
- if (rxk_ListenerPid)
+ if (rxk_ListenerPid) {
kill(rxk_ListenerPid, SIGUSR1);
+ afs_osi_Sleep(&rxk_ListenerPid);
+ }
return 0;
}
-int osi_NetSend(asocket, addr, dvec, nvecs, asize, istack)
- register struct osi_socket *asocket;
- struct iovec dvec[];
- int nvecs;
- register afs_int32 asize;
- struct sockaddr_in *addr;
- int istack;
+int osi_NetSend(osi_socket asocket, struct sockaddr_in *addr,
+ struct iovec *dvec, int nvecs, afs_int32 asize, int istack)
{
int i;
int code;
}
-int osi_NetReceive(asocket, addr, dvec, nvecs, alength)
- struct osi_socket *asocket;
- struct sockaddr_in *addr;
- struct iovec *dvec;
- int nvecs;
- int *alength;
+int osi_NetReceive(struct osi_socket *asocket, struct sockaddr_in *addr,
+ struct iovec *dvec, int nvecs, int *alength)
{
int i;
TIUSER *udp_tiptr = (TIUSER *) asocket;