[hipl-commit] [tiny] Rev 3645: Added function hip_run_socket_handles.

  • From: Tim Just <tim.just@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Tue, 9 Mar 2010 18:55:31 +0200

Committer: Tim Just <tim.just@xxxxxxxxxxxxxx>
Date: Tue Mar 09 17:53:56 2010 +0100
Revision: 3645
Revision-id: tim.just@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: tiny

Log:
  Added function hip_run_socket_handles.
  
  Currently the function call in the while loop is commented out, due to
  inconsistency of handle functions.

Modified:
  M  hipd/hipd.c
  M  hipd/modularization.c
  M  hipd/modularization.h

=== modified file 'hipd/hipd.c'
--- hipd/hipd.c 2010-03-09 15:27:31 +0000
+++ hipd/hipd.c 2010-03-09 16:53:56 +0000
@@ -390,6 +390,8 @@
         hip_perf_start_benchmark(perf_set, PERF_ALL);
 #endif
 
+        hip_run_socket_handles(&read_fdset, &packet_ctx);
+
         if (FD_ISSET(hip_raw_sock_input_v6, &read_fdset)) {
 
             hip_msg_init(packet_ctx.input_msg);

=== modified file 'hipd/modularization.c'
--- hipd/modularization.c       2010-03-09 14:14:54 +0000
+++ hipd/modularization.c       2010-03-09 16:53:56 +0000
@@ -284,6 +284,7 @@
 
     new_socket->priority = priority;
     new_socket->fd       = socketfd;
+    new_socket->func_ptr = func_ptr;
 
     hip_sockets = lmod_register_function(hip_sockets,
                                          new_socket,
@@ -322,7 +323,6 @@
 /**
  * hip_prepare_fd_set
  *
- *
  */
 void hip_prepare_fd_set(fd_set *read_fdset)
 {
@@ -340,6 +340,29 @@
 }
 
 /**
+ * hip_run_socket_handles
+ *
+ */
+void hip_run_socket_handles(fd_set *read_fdset, struct hip_packet_context *ctx)
+{
+    hip_ll_node_t *iter = NULL;
+    int socketfd;
+
+    if (hip_sockets) {
+        while ((iter = hip_ll_iterate(hip_sockets, iter))) {
+            socketfd = ((struct socketfd*) iter->ptr)->fd;
+
+            HIP_DEBUG("HuSo\n");
+            if (FD_ISSET(socketfd, read_fdset)) {
+//                ((struct socketfd*) iter->ptr)->func_ptr(socketfd, ctx);
+            }
+        }
+    } else {
+        HIP_DEBUG("No sockets registered.\n");
+    }
+}
+
+/**
  * hip_uninit_sockets
  *
  * Free the memory used for storage of socket fd's.

=== modified file 'hipd/modularization.h'
--- hipd/modularization.h       2010-03-09 14:14:54 +0000
+++ hipd/modularization.h       2010-03-09 16:53:56 +0000
@@ -43,6 +43,8 @@
 
 void hip_prepare_fd_set(fd_set *read_fdset);
 
+void hip_run_socket_handles(fd_set *read_fdset, struct hip_packet_context 
*ctx);
+
 void hip_uninit_sockets(void);
 
 #endif /* HIP_HIPD_MODULARIZATION_H */

Other related posts:

  • » [hipl-commit] [tiny] Rev 3645: Added function hip_run_socket_handles. - Tim Just