#import "Root.h"
#import "sys.h"
#import <netinfo/lookup_types.h>
#import "LUDictionary.h"
#import "LUArray.h"
#import "LUGlobal.h"
#import "LUServer.h"
#import "NIAgent.h"
#import <NetInfo/syslock.h>
#ifdef _IPC_UNTYPED_
typedef struct {
NDR_record_t NDR;
lookup_name name;
mach_msg_trailer_t trailer;
} lookup_link_Request;
typedef struct {
NDR_record_t NDR;
int proc;
mach_msg_type_number_t indataCnt;
unit indata[4096];
mach_msg_trailer_t trailer;
} lookup_all_Request;
typedef struct {
NDR_record_t NDR;
int proc;
mach_msg_type_number_t indataCnt;
unit indata[4096];
mach_msg_trailer_t trailer;
} lookup_one_Request;
typedef struct {
mach_msg_body_t msgh_body;
mach_msg_ool_descriptor_t indata;
NDR_record_t NDR;
int proc;
mach_msg_type_number_t indataCnt;
mach_msg_trailer_t trailer;
} lookup_ooall_Request;
typedef struct {
mach_msg_header_t head;
union {
lookup_link_Request link;
lookup_all_Request all;
lookup_one_Request one;
lookup_ooall_Request ooall;
} requests;
} lookup_request_msg;
typedef struct {
NDR_record_t NDR;
kern_return_t RetCode;
int procno;
} __Reply___lookup_link_t;
typedef struct {
mach_msg_body_t msgh_body;
mach_msg_ool_descriptor_t outdata;
NDR_record_t NDR;
mach_msg_type_number_t outdataCnt;
} __Reply___lookup_all_t;
typedef struct {
NDR_record_t NDR;
kern_return_t RetCode;
mach_msg_type_number_t outdataCnt;
unit outdata[4096];
} __Reply___lookup_one_t;
typedef struct {
mach_msg_body_t msgh_body;
mach_msg_ool_descriptor_t outdata;
NDR_record_t NDR;
mach_msg_type_number_t outdataCnt;
} __Reply___lookup_ooall_t;
typedef struct {
mach_msg_header_t head;
union {
__Reply___lookup_link_t lookup;
__Reply___lookup_all_t all;
__Reply___lookup_one_t one;
__Reply___lookup_ooall_t ooall;
mig_reply_error_t error;
} replies;
} lookup_reply_msg;
#else
typedef struct lookup_request_msg {
msg_header_t head;
msg_type_t itype;
int i;
msg_type_t dtype;
inline_data data;
} lookup_request_msg;
#define lookup_reply_msg lookup_request_msg
#endif
@interface Controller : Root
{
syslock *serverLock;
LUArray *lookupOrder[NCATEGORIES];
LUDictionary *globalDict;
LUDictionary *configDict[NCATEGORIES];
LUArray *serverList;
int maxThreads;
int maxIdleThreads;
int maxIdleServers;
int threadCount;
int idleThreadCount;
LUDictionary *loginUser;
char **agentNames;
char **dnsSearchList;
char *portName;
id *agents;
int agentCount;
BOOL shutdownServerThreads;
}
- (Controller *)initWithName:(char *)name;
- (BOOL)registerPort:(char *)name;
- (void)startServerThread;
- (LUServer *)checkOutServer;
- (void)checkInServer:(LUServer *)server;
- (void)serviceRequest:(lookup_request_msg *)request;
- (void)setLoginUser:(int)uid;
- (void)flushCache;
- (void)suspend;
- (char *)portName;
- (char **)dnsSearchList;
- (void)serverLoop;
- (void)lookupdMessage;
@end