diff options
author | sc | 1999-02-18 17:33:32 +0000 |
---|---|---|
committer | sc | 1999-02-18 17:33:32 +0000 |
commit | 2732f1ee8cf7590c53fd52abc9be0c4ee6a4a3c2 (patch) | |
tree | 024a4d9385680a6985fc7a57b99abeee9f645f7f /src/inivyd.c | |
parent | 3dfd47dde8bb049a797f5dc653105c1cb57af617 (diff) | |
download | ivyd-2732f1ee8cf7590c53fd52abc9be0c4ee6a4a3c2.zip ivyd-2732f1ee8cf7590c53fd52abc9be0c4ee6a4a3c2.tar.gz ivyd-2732f1ee8cf7590c53fd52abc9be0c4ee6a4a3c2.tar.bz2 ivyd-2732f1ee8cf7590c53fd52abc9be0c4ee6a4a3c2.tar.xz |
Port registration is now based on bus number.
This allows to have one server per bus.
Diffstat (limited to 'src/inivyd.c')
-rw-r--r-- | src/inivyd.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/inivyd.c b/src/inivyd.c index 56d7106..7f4a06f 100644 --- a/src/inivyd.c +++ b/src/inivyd.c @@ -62,20 +62,14 @@ const int default_port = 3006; typedef struct { short s_port; /* le port sur lequel le client communique avec son serveur */ - short s_uid; /* le numero de processus du serveur wixd */ + short s_key; /* le numero de processus du serveur wixd */ } serverinfo; #define TABSIZ 64 /* 64 connections simultanees, ca devrait aller */ serverinfo si_table [TABSIZ]; -/* - * GetInfo (name) - * - * Rend l'information concernant l'utilisateur uid. - */ - serverinfo* -GetInfo (int uid) +GetInfo (int key) { register serverinfo *si; register serverinfo *res = 0; @@ -86,7 +80,7 @@ GetInfo (int uid) res = si; continue; } - if (si->s_uid != uid) + if (si->s_key != key) continue; res = si; break; @@ -113,7 +107,7 @@ DumpInfo () for (si = si_table; si - si_table < TABSIZ; ++si) { if (! si->s_port) continue; - (void) sprintf (buf, "user %5d, port %d\n", si->s_uid, ntohs (si->s_port)); + (void) sprintf (buf, "user %5d, port %d\n", si->s_key, ntohs (si->s_port)); (void) write (fd, buf, strlen (buf)); } (void) close (fd); @@ -202,11 +196,11 @@ main (int argc, const char **argv) continue; exit (1); } - si = GetInfo (msg.msg_uid); + si = GetInfo (msg.msg_key); switch (msg.msg_type) { case MSG_SERVER: si->s_port = msg.msg_port; - si->s_uid = msg.msg_uid; + si->s_key = msg.msg_key; break; case MSG_CLIENT: |