📄 interposition.c
字号:
int rc; HAVE_PROT_RECVFROM_0 (*function)(HAVE_PROT_RECVFROM_1 s, HAVE_PROT_RECVFROM_2 buf, HAVE_PROT_RECVFROM_3 len, HAVE_PROT_RECVFROM_4 flags, HAVE_PROT_RECVFROM_5 from, HAVE_PROT_RECVFROM_6 fromlen); SYSCALL_START(s); function = symbolfunction(SYMBOL_RECVFROM); rc = function(s, buf, len, flags, from, fromlen); SYSCALL_END(s); return rc;}#endif /* HAVE_EXTRA_OSF_SYMBOLS */#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_RECVMSG_0sys_recvmsg(s, msg, flags) HAVE_PROT_RECVMSG_1 s; HAVE_PROT_RECVMSG_2 msg; HAVE_PROT_RECVMSG_3 flags;{ ssize_t rc; HAVE_PROT_RECVMSG_0 (*function)(HAVE_PROT_RECVMSG_1 s, HAVE_PROT_RECVMSG_2 msg, HAVE_PROT_RECVMSG_3 flags); SYSCALL_START(s); function = symbolfunction(SYMBOL_RECVMSG); rc = function(s, msg, flags); SYSCALL_END(s); return rc;}#endif /* HAVE_EXTRA_OSF_SYMBOLS */intsys_rresvport(port) int *port;{ int (*function)(int *port); function = symbolfunction(SYMBOL_RRESVPORT); return function(port);}HAVE_PROT_SEND_0sys_send(s, msg, len, flags) HAVE_PROT_SEND_1 s; HAVE_PROT_SEND_2 msg; HAVE_PROT_SEND_3 len; HAVE_PROT_SEND_4 flags;{ ssize_t rc; HAVE_PROT_SEND_0 (*function)(HAVE_PROT_SEND_1 s, HAVE_PROT_SEND_2 msg, HAVE_PROT_SEND_3 len, HAVE_PROT_SEND_4 flags); SYSCALL_START(s); function = symbolfunction(SYMBOL_SEND); rc = function(s, msg, len, flags); SYSCALL_END(s); return rc;}#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_SENDMSG_0sys_sendmsg(s, msg, flags) HAVE_PROT_SENDMSG_1 s; HAVE_PROT_SENDMSG_2 msg; HAVE_PROT_SENDMSG_3 flags;{ ssize_t rc; HAVE_PROT_SENDMSG_0 (*function)(HAVE_PROT_SENDMSG_1 s, HAVE_PROT_SENDMSG_2 msg, HAVE_PROT_SENDMSG_3 flags); SYSCALL_START(s); function = symbolfunction(SYMBOL_SENDMSG); rc = function(s, msg, flags); SYSCALL_END(s); return rc;}#endif /* HAVE_EXTRA_OSF_SYMBOLS */#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_SENDTO_0sys_sendto(s, msg, len, flags, to, tolen) HAVE_PROT_SENDTO_1 s; HAVE_PROT_SENDTO_2 msg; HAVE_PROT_SENDTO_3 len; HAVE_PROT_SENDTO_4 flags; HAVE_PROT_SENDTO_5 to; HAVE_PROT_SENDTO_6 tolen;{ ssize_t rc; HAVE_PROT_SENDTO_0 (*function)(HAVE_PROT_SENDTO_1 s, HAVE_PROT_SENDTO_2 msg, HAVE_PROT_SENDTO_3 len, HAVE_PROT_SENDTO_4 flags, HAVE_PROT_SENDTO_5 to, HAVE_PROT_SENDTO_6 tolen); SYSCALL_START(s); function = symbolfunction(SYMBOL_SENDTO); rc = function(s, msg, len, flags, to, tolen); SYSCALL_END(s); return rc;}#endif /* !HAVE_EXTRA_OSF_SYMBOLS */HAVE_PROT_WRITE_0sys_write(d, buf, nbytes) HAVE_PROT_WRITE_1 d; HAVE_PROT_WRITE_2 buf; HAVE_PROT_WRITE_3 nbytes;{ ssize_t rc; HAVE_PROT_WRITE_0 (*function)(HAVE_PROT_WRITE_1 d, HAVE_PROT_WRITE_2 buf, HAVE_PROT_WRITE_3 nbutes); SYSCALL_START(d); function = symbolfunction(SYMBOL_WRITE); rc = function(d, buf, nbytes); SYSCALL_END(d); return rc;}#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_WRITEV_0sys_writev(d, iov, iovcnt) HAVE_PROT_WRITEV_1 d; HAVE_PROT_WRITEV_2 iov; HAVE_PROT_WRITEV_3 iovcnt;{ ssize_t rc; HAVE_PROT_WRITEV_0 (*function)(HAVE_PROT_WRITEV_1 d, HAVE_PROT_WRITEV_2 buf, HAVE_PROT_WRITEV_3 iovcnt); SYSCALL_START(d); function = symbolfunction(SYMBOL_WRITEV); rc = function(d, iov, iovcnt); SYSCALL_END(d); return rc;}#endif /* HAVE_EXTRA_OSF_SYMBOLS */ /* * the interpositioned functions. */#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_ACCEPT_0accept(s, addr, addrlen) HAVE_PROT_ACCEPT_1 s; HAVE_PROT_ACCEPT_2 addr; HAVE_PROT_ACCEPT_3 addrlen;{ if (ISSYSCALL(s)) return sys_accept(s, addr, addrlen); return Raccept(s, addr, addrlen);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_BIND_0bind(s, name, namelen) HAVE_PROT_BIND_1 s; HAVE_PROT_BIND_2 name; HAVE_PROT_BIND_3 namelen;{ if (ISSYSCALL(s)) return sys_bind(s, name, namelen); return Rbind(s, name, namelen);}#endif /* !HAVE_EXTRA_OSF_SYMBOLS */intbindresvport(sd, sin) int sd; struct sockaddr_in *sin;{ if (ISSYSCALL(sd)) return sys_bindresvport(sd, sin); return Rbindresvport(sd, sin);}#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_CONNECT_0connect(s, name, namelen) HAVE_PROT_CONNECT_1 s; HAVE_PROT_CONNECT_2 name; HAVE_PROT_CONNECT_3 namelen;{ if (ISSYSCALL(s)) return sys_connect(s, name, namelen); return Rconnect(s, name, namelen);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */struct hostent *gethostbyname(name) const char *name;{ return Rgethostbyname(name);}struct hostent *gethostbyname2(name, af) const char *name; int af;{ return Rgethostbyname2(name, af);}#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_GETPEERNAME_0getpeername(s, name, namelen) HAVE_PROT_GETPEERNAME_1 s; HAVE_PROT_GETPEERNAME_2 name; HAVE_PROT_GETPEERNAME_3 namelen;{ if (ISSYSCALL(s)) return sys_getpeername(s, name, namelen); return Rgetpeername(s, name, namelen);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_GETSOCKNAME_0getsockname(s, name, namelen) HAVE_PROT_GETSOCKNAME_1 s; HAVE_PROT_GETSOCKNAME_2 name; HAVE_PROT_GETSOCKNAME_3 namelen;{ if (ISSYSCALL(s)) return sys_getpeername(s, name, namelen); return Rgetsockname(s, name, namelen);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */HAVE_PROT_READ_0read(d, buf, nbytes) HAVE_PROT_READ_1 d; HAVE_PROT_READ_2 buf; HAVE_PROT_READ_3 nbytes;{ if (ISSYSCALL(d)) return sys_read(d, buf, nbytes); return Rread(d, buf, nbytes);}#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_READV_0readv(d, iov, iovcnt) HAVE_PROT_READV_1 d; HAVE_PROT_READV_2 iov; HAVE_PROT_READV_3 iovcnt;{ if (ISSYSCALL(d)) return sys_readv(d, iov, iovcnt); return Rreadv(d, iov, iovcnt);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */HAVE_PROT_RECV_0recv(s, msg, len, flags) HAVE_PROT_RECV_1 s; HAVE_PROT_RECV_2 msg; HAVE_PROT_RECV_3 len; HAVE_PROT_RECV_4 flags;{ if (ISSYSCALL(s)) return sys_recv(s, msg, len, flags); return Rrecv(s, msg, len, flags);}#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_RECVFROM_0recvfrom(s, buf, len, flags, from, fromlen) HAVE_PROT_RECVFROM_1 s; HAVE_PROT_RECVFROM_2 buf; HAVE_PROT_RECVFROM_3 len; HAVE_PROT_RECVFROM_4 flags; HAVE_PROT_RECVFROM_5 from; HAVE_PROT_RECVFROM_6 fromlen;{ if (ISSYSCALL(s)) return sys_recvfrom(s, buf, len, flags, from, fromlen); return Rrecvfrom(s, buf, len, flags, from, fromlen);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_RECVMSG_0recvmsg(s, msg, flags) HAVE_PROT_RECVMSG_1 s; HAVE_PROT_RECVMSG_2 msg; HAVE_PROT_RECVMSG_3 flags;{ if (ISSYSCALL(s)) return sys_recvmsg(s, msg, flags); return Rrecvmsg(s, msg, flags);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */intrresvport(port) int *port;{ return Rrresvport(port);}HAVE_PROT_WRITE_0write(d, buf, nbytes) HAVE_PROT_WRITE_1 d; HAVE_PROT_WRITE_2 buf; HAVE_PROT_WRITE_3 nbytes;{ if (ISSYSCALL(d)) return sys_write(d, buf, nbytes); return Rwrite(d, buf, nbytes);}#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_WRITEV_0writev(d, iov, iovcnt) HAVE_PROT_WRITEV_1 d; HAVE_PROT_WRITEV_2 iov; HAVE_PROT_WRITEV_3 iovcnt;{ if (ISSYSCALL(d)) return sys_writev(d, iov, iovcnt); return Rwritev(d, iov, iovcnt);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */HAVE_PROT_SEND_0send(s, msg, len, flags) HAVE_PROT_SEND_1 s; HAVE_PROT_SEND_2 msg; HAVE_PROT_SEND_3 len; HAVE_PROT_SEND_4 flags;{ if (ISSYSCALL(s)) return sys_send(s, msg, len, flags); return Rsend(s, msg, len, flags);}#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_SENDMSG_0sendmsg(s, msg, flags) HAVE_PROT_SENDMSG_1 s; HAVE_PROT_SENDMSG_2 msg; HAVE_PROT_SENDMSG_3 flags;{ if (ISSYSCALL(s)) return sys_sendmsg(s, msg, flags); return Rsendmsg(s, msg, flags);}#endif /* HAVE_EXTRA_OSF_SYMBOLS */#if !HAVE_EXTRA_OSF_SYMBOLSHAVE_PROT_SENDTO_0sendto(s, msg, len, flags, to, tolen) HAVE_PROT_SENDTO_1 s; HAVE_PROT_SENDTO_2 msg; HAVE_PROT_SENDTO_3 len; HAVE_PROT_SENDTO_4 flags; HAVE_PROT_SENDTO_5 to; HAVE_PROT_SENDTO_6 tolen;{ if (ISSYSCALL(s)) return sys_sendto(s, msg, len, flags, to, tolen); return Rsendto(s, msg, len, flags, to, tolen);}#endif /* !HAVE_EXTRA_OSF_SYMBOLS */#endif /* SOCKSLIBRARY_DYNAMIC */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -