Changeset 17475 for trunk/Ohana/src/opihi/pcontrol/HostOps.c
- Timestamp:
- Apr 23, 2008, 11:35:39 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/HostOps.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/HostOps.c
r16472 r17475 1 1 # include "pcontrol.h" 2 2 3 Stack *HostPool_Idle; 4 Stack *HostPool_Busy; 5 Stack *HostPool_Done; 6 Stack *HostPool_Down; 7 Stack *HostPool_Off; 3 Stack *HostPool_Idle; // these hosts are waiting for something to do 4 Stack *HostPool_Busy; // these hosts are working 5 Stack *HostPool_Resp; // these hosts are trying to respond 6 Stack *HostPool_Done; // these hosts have finished a job 7 Stack *HostPool_Down; // these hosts are not responding 8 Stack *HostPool_Off; // these hosts are off 8 9 9 10 void InitHostStacks () { 10 11 HostPool_Idle = InitStack (); 11 12 HostPool_Busy = InitStack (); 13 HostPool_Resp = InitStack (); 12 14 HostPool_Done = InitStack (); 13 15 HostPool_Down = InitStack (); … … 26 28 FreeHostStack (HostPool_Idle); 27 29 FreeHostStack (HostPool_Busy); 30 FreeHostStack (HostPool_Resp); 28 31 FreeHostStack (HostPool_Done); 29 32 FreeHostStack (HostPool_Down); … … 35 38 case PCONTROL_HOST_IDLE: return ("IDLE"); 36 39 case PCONTROL_HOST_DOWN: return ("DOWN"); 40 case PCONTROL_HOST_RESP: return ("RESP"); 37 41 case PCONTROL_HOST_DONE: return ("DONE"); 38 42 case PCONTROL_HOST_BUSY: return ("BUSY"); … … 48 52 case PCONTROL_HOST_IDLE: return (HostPool_Idle); 49 53 case PCONTROL_HOST_DOWN: return (HostPool_Down); 54 case PCONTROL_HOST_RESP: return (HostPool_Resp); 50 55 case PCONTROL_HOST_DONE: return (HostPool_Done); 51 56 case PCONTROL_HOST_BUSY: return (HostPool_Busy); … … 60 65 if (!strcasecmp (name, "idle")) return (HostPool_Idle); 61 66 if (!strcasecmp (name, "down")) return (HostPool_Down); 67 if (!strcasecmp (name, "resp")) return (HostPool_Resp); 62 68 if (!strcasecmp (name, "done")) return (HostPool_Done); 63 69 if (!strcasecmp (name, "busy")) return (HostPool_Busy); … … 94 100 if (host != NULL) return (host); 95 101 102 *StackID = PCONTROL_HOST_RESP; 103 host = PullHostFromStackByID (*StackID, HostID); 104 if (host != NULL) return (host); 105 96 106 *StackID = PCONTROL_HOST_DONE; 97 107 host = PullHostFromStackByID (*StackID, HostID); … … 120 130 121 131 *StackID = PCONTROL_HOST_DOWN; 132 host = PullHostFromStackByName (*StackID, name); 133 if (host != NULL) return (host); 134 135 *StackID = PCONTROL_HOST_RESP; 122 136 host = PullHostFromStackByName (*StackID, name); 123 137 if (host != NULL) return (host); … … 180 194 host[0].nexttry.tv_usec = 0; 181 195 196 InitIOBuffer (&host[0].comms_buffer, 0x100); 197 host[0].response_state = PCONTROL_RESP_NONE; 198 host[0].response = NULL; 199 182 200 host[0].markoff = FALSE; 183 201 host[0].job = NULL; … … 187 205 188 206 void DelHost (Host *host) { 207 FreeIOBuffer (&host[0].comms_buffer); 189 208 FREE (host[0].hostname); 190 209 FREE (host[0].job);
Note:
See TracChangeset
for help on using the changeset viewer.
