add socket.netstat

This commit is contained in:
Cloud Wu
2018-09-07 16:11:27 +08:00
parent 35176383b7
commit 61980c8a1f
9 changed files with 299 additions and 9 deletions

28
skynet-src/socket_info.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef socket_info_h
#define socket_info_h
#define SOCKET_INFO_UNKNOWN 0
#define SOCKET_INFO_LISTEN 1
#define SOCKET_INFO_TCP 2
#define SOCKET_INFO_UDP 3
#define SOCKET_INFO_BIND 4
#include <stdint.h>
struct socket_info {
int id;
int type;
uint64_t opaque;
uint64_t read;
uint64_t write;
uint64_t rtime;
uint64_t wtime;
int64_t wbuffer;
char name[128];
struct socket_info *next;
};
struct socket_info * socket_info_create(struct socket_info *last);
void socket_info_release(struct socket_info *);
#endif