Fixes building strace - the network types should be reworked to work with the
new syscalls, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25075 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
* Ingo Weinhold <[email protected]>
|
||||
*/
|
||||
|
||||
// headers required for network structures
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
@@ -15,8 +14,6 @@
|
||||
#include <map>
|
||||
#include <utility>
|
||||
|
||||
#include <net_stack_driver.h>
|
||||
|
||||
#include "Context.h"
|
||||
#include "MemoryReader.h"
|
||||
#include "TypeHandler.h"
|
||||
@@ -24,6 +21,7 @@
|
||||
using std::map;
|
||||
using std::pair;
|
||||
|
||||
|
||||
template<typename Type>
|
||||
static bool
|
||||
obtain_pointer_data(Context &context, Type *data, void *address, uint32 what)
|
||||
@@ -40,6 +38,7 @@ obtain_pointer_data(Context &context, Type *data, void *address, uint32 what)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
format_number(uint32 value)
|
||||
{
|
||||
@@ -48,6 +47,7 @@ format_number(uint32 value)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
read_fdset(Context &context, void *data)
|
||||
{
|
||||
@@ -89,6 +89,7 @@ read_fdset(Context &context, void *data)
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
string
|
||||
TypeHandlerImpl<fd_set *>::GetParameterValue(Context &context, Parameter *,
|
||||
@@ -100,6 +101,7 @@ TypeHandlerImpl<fd_set *>::GetParameterValue(Context &context, Parameter *,
|
||||
return context.FormatPointer(data);
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
string
|
||||
TypeHandlerImpl<fd_set *>::GetReturnValue(Context &context, uint64 value)
|
||||
@@ -107,6 +109,7 @@ TypeHandlerImpl<fd_set *>::GetReturnValue(Context &context, uint64 value)
|
||||
return context.FormatPointer((void *)value);
|
||||
}
|
||||
|
||||
|
||||
template<typename Type>
|
||||
static string
|
||||
format_pointer_value(Context &context, void *address)
|
||||
@@ -119,6 +122,7 @@ format_pointer_value(Context &context, void *address)
|
||||
return context.FormatPointer(address);
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
get_ipv4_address(in_addr *addr)
|
||||
{
|
||||
@@ -131,6 +135,7 @@ get_ipv4_address(in_addr *addr)
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
format_socket_family(Context &context, int family)
|
||||
{
|
||||
@@ -153,6 +158,8 @@ format_socket_family(Context &context, int family)
|
||||
return "family = " + context.FormatSigned(family);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static string
|
||||
format_socket_type(Context &context, int type)
|
||||
{
|
||||
@@ -170,6 +177,7 @@ format_socket_type(Context &context, int type)
|
||||
return "type = " + context.FormatSigned(type);
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
format_socket_protocol(Context &context, int protocol)
|
||||
{
|
||||
@@ -190,6 +198,8 @@ format_socket_protocol(Context &context, int protocol)
|
||||
|
||||
return "protocol = " + context.FormatSigned(protocol);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static string
|
||||
format_pointer(Context &context, sockaddr *saddr)
|
||||
@@ -215,6 +225,8 @@ format_pointer(Context &context, sockaddr *saddr)
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static string
|
||||
format_pointer(Context &context, sockaddr_args *args)
|
||||
{
|
||||
@@ -226,6 +238,7 @@ format_pointer(Context &context, sockaddr_args *args)
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
struct socket_option_info {
|
||||
int level;
|
||||
int option;
|
||||
@@ -306,6 +319,7 @@ private:
|
||||
|
||||
static const SocketOptionsMap kSocketOptionsMap;
|
||||
|
||||
|
||||
static string
|
||||
format_pointer(Context &context, sockopt_args *args)
|
||||
{
|
||||
@@ -344,6 +358,7 @@ format_pointer(Context &context, sockopt_args *args)
|
||||
return level + ", " + option + ", " + value;
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
format_pointer(Context &context, socket_args *args)
|
||||
{
|
||||
@@ -356,6 +371,7 @@ format_pointer(Context &context, socket_args *args)
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
get_iovec(Context &context, iovec *iov, int iovlen)
|
||||
{
|
||||
@@ -368,6 +384,7 @@ get_iovec(Context &context, iovec *iov, int iovlen)
|
||||
return r + "}";
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
format_pointer(Context &context, message_args *msg)
|
||||
{
|
||||
@@ -381,6 +398,7 @@ format_pointer(Context &context, message_args *msg)
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
format_pointer(Context &context, msghdr *h)
|
||||
{
|
||||
@@ -397,6 +415,7 @@ format_pointer(Context &context, msghdr *h)
|
||||
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
static string
|
||||
format_pointer(Context &context, ifreq *ifr)
|
||||
@@ -404,6 +423,7 @@ format_pointer(Context &context, ifreq *ifr)
|
||||
return string(ifr->ifr_name) + ", ...";
|
||||
}
|
||||
|
||||
|
||||
static string
|
||||
format_pointer(Context &context, ifconf *conf)
|
||||
{
|
||||
@@ -452,6 +472,7 @@ format_pointer(Context &context, ifconf *conf)
|
||||
return r + "]";
|
||||
}
|
||||
|
||||
|
||||
template<typename Type>
|
||||
class SpecializedPointerTypeHandler : public TypeHandler {
|
||||
string GetParameterValue(Context &context, Parameter *,
|
||||
@@ -481,8 +502,11 @@ class SpecializedPointerTypeHandler : public TypeHandler {
|
||||
DEFINE_TYPE(fdset_ptr, fd_set *);
|
||||
POINTER_TYPE(ifconf_ptr, ifconf);
|
||||
POINTER_TYPE(ifreq_ptr, ifreq);
|
||||
#if 0
|
||||
POINTER_TYPE(message_args_ptr, message_args);
|
||||
POINTER_TYPE(msghdr_ptr, msghdr);
|
||||
POINTER_TYPE(sockaddr_args_ptr, sockaddr_args);
|
||||
POINTER_TYPE(sockopt_args_ptr, sockopt_args);
|
||||
POINTER_TYPE(socket_args_ptr, socket_args);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user