Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add netGetSockInfo function #58

Open
AndoniZubimendi opened this issue Feb 15, 2013 · 0 comments
Open

Add netGetSockInfo function #58

AndoniZubimendi opened this issue Feb 15, 2013 · 0 comments

Comments

@AndoniZubimendi
Copy link

Recently Estwald ported Iris Manager to PSL1GHT v2, offering the changes he made to PSL1GHT. (https://github.com/Estwald/PSDK3v2)

This patch is one of the changes, it is very simple and it does not seems to be problematic. It add the function netGetSockInfo() and the associated struct netSocketInfo.

There is also a #define, to be able to use netInitializeNetwork as netInitialize.

    add netGetSockInfo to ppu/include/net/net.h

diff --git a/ppu/include/net/net.h b/ppu/include/net/net.h
index 63f6f2e..a745447 100644
--- a/ppu/include/net/net.h
+++ b/ppu/include/net/net.h
@@ -4,6 +4,7 @@
 #include <net/socket.h>
 #include <net/select.h>
 #include <net/poll.h>
+#include <netinet/in.h>

 #define    NET_EPERM           1
 #define    NET_ENOENT          2
@@ -139,6 +140,19 @@ typedef struct _net_init_param
    s32 flags;
 } netInitParam;

+typedef struct
+{
+   s32 s;
+   s32 proto;
+   s32 recv_queue_len;
+   s32 send_queue_len;
+   struct in_addr local_adr;
+   s32 local_port;
+   struct in_addr remote_adr;
+   s32 remote_port;
+   s32 state;
+} netSocketInfo;
+
 s32 netInitialize();
 s32 netDeinitialize();

@@ -147,6 +161,8 @@ s32* netHErrnoLoc();

 s32 netInitializeNetworkEx(netInitParam* param);
 s32 netFinalizeNetwork();
+#define netInitializeNetwork netInitialize
+s32 netGetSockInfo(s32 socket, netSocketInfo* p, s32 n);
 s32 netShowIfConfig();
 s32 netShowNameServer();
 s32 netShowRoute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant