Changeset 166

Show
Ignore:
Timestamp:
03/19/09 23:55:15 (15 years ago)
Author:
bhilburn
Message:

Starting converting the shell code to our new design and good code style.

Location:
vtcross/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/lib/socketcomm/socketcomm.cpp

    r164 r166  
    77/* TODO DESCRIPTION OF FILE. 
    88 */ 
     9 
    910 
    1011#include <cstdlib> 
  • vtcross/trunk/src/shell/cr_shell.cpp

    r161 r166  
     1/* Virginia Tech Cognitive Radio Open Source Systems 
     2 * Virginia Tech, 2009 
     3 * 
     4 * TODO LICENSE INFORMATION GOES HERE 
     5 */ 
     6 
     7/* TODO DESCRIPTION OF FILE. 
     8 */ 
     9 
     10 
     11#include <arpa/inet.h> 
    112#include <iostream> 
     13#include <netinet/in.h> 
     14#include <netdb.h> 
     15#include <fcntl.h> 
     16#include <sys/ioctl.h> 
     17#include <sys/mman.h> 
     18#include <sys/socket.h> 
    219#include <sys/types.h> 
    320#include <sys/wait.h> 
    4 #include <sys/socket.h> 
    5 #include <netinet/in.h> 
    6 #include <netdb.h> 
    7 #include <arpa/inet.h> 
    8 #include <sys/mman.h> 
    9 #include <fcntl.h> 
    10 #include <sys/ioctl.h> 
    11  
    12 //#include "socket/ServerSocket.h" 
    13 //#include "socket/SocketException.h" 
    14  
    15 #include "vtcross/containers.h" 
    16 #include "vtcross/common.h" 
     21 
    1722#include "tinyxml/tinyxml.h" 
    1823#include "tinyxml/tinystr.h" 
    1924 
     25#include "vtcross/common.h" 
     26#include "vtcross/components.h" 
     27#include "vtcross/containers.h" 
     28#include "vtcross/debug.h" 
     29#include "vtcross/error.h" 
     30#include "vtcross/socketcomm.h" 
     31 
     32 
    2033using namespace std; 
    2134 
     35 
    2236#define CE_SERVER_PORT 30001 
    23 #define POLICY_SERVER_PORT 30003 
    24  
    25 void DieWithError(char *errorMessage) 
    26 { 
    27         perror(errorMessage); 
    28             exit(1); 
    29 } 
    30  
    31 void print_current_config(Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info) { 
    32         int i = 0; 
    33         int j = 0; 
    34  
    35         for(i = 0; i < ce_info->numUtilities ; i++) { 
    36                 cout << "Utility:  " << uList[i]->name << endl; 
    37                 cout << "     Units:  " << uList[i]->units << endl; 
    38                 cout << "     Goal:   " << uList[i]->goal << endl; 
    39                 cout << "     Target: " << uList[i]->target << endl; 
    40         } 
    41  
    42         for(i = 0; i < ce_info->numParameters; i++) { 
    43                 cout << "Parameter:  " << pList[i]->name << endl; 
    44         printf("Cognitive Radio:: Radio Operation Profile has been sucessfully sent.\n"); 
    45                 cout << "       Units:   " << pList[i]->units << endl; 
    46                 cout << "       Min:     " << pList[i]->min << endl; 
    47                 cout << "       Max:     " << pList[i]->max << endl; 
    48                 cout << "       Step:    " << pList[i]->step << endl; 
    49                 for(j = 0; j < pList[i]->numAffects; j++) { 
    50                         cout << "       Affect: " << pList[i]->affection_list[j].u->name << " -> " << pList[i]->affection_list[j].relation << endl; 
     37#define PE_SERVER_PORT 30003 
     38 
     39 
     40void  
     41print_current_config(Utility* uList[], Parameter* pList[], \ 
     42        Observable* oList[], CE_Info* ce_info) 
     43{ 
     44        for(size_t i = 0; i < ce_info->numUtilities ; i++) { 
     45        LOG("Shell:: Utility: %s\n\tUnits: %s\n\tGoal: %s\n\tTarget: %s\n", \ 
     46                uList[i]->name, uList[i]->units, uList[i]->goal, \ 
     47                uList[i]->target); 
     48        } 
     49 
     50        for(size_t i = 0; i < ce_info->numParameters; i++) { 
     51            LOG("Shell:: Radio Operation Profile has been sucessfully sent.\n"); 
     52        LOG("Shell:: Parameter: %s\n\tUnits: %s\n\tMin: %s\n\t", \ 
     53                pList[i]->name, pList[i]->units, pList[i]->min); 
     54        LOG("\tMax: %s\n\tStep: %s\n", pList[i]->max, pList[i]->step); 
     55 
     56                for(size_t j = 0; j < pList[i]->numAffects; j++) { 
     57                        LOG("\t\tAffect %s -> %s\n", pList[i]->affection_list[j].u->name, \ 
     58                    pList[i]->affection_list[j].relation); 
    5159                } 
    5260        } 
    5361         
    54     for(i = 0; i < ce_info->numObservables; i++) { 
    55                 cout << "Observable:  " << oList[i]->name << endl; 
    56                 for(j = 0; j < oList[i]->numAffects; j++) { 
    57                         cout << "       Affect: " << oList[i]->affection_list[j].u->name << " -> " << oList[i]->affection_list[j].relation << endl; 
     62    for(size_t i = 0; i < ce_info->numObservables; i++) { 
     63                LOG("Observable: %s\n", oList[i]->name); 
     64                for(size_t j = 0; j < oList[i]->numAffects; j++) { 
     65                        LOG("\t\tAffect %s -> %s ", oList[i]->affection_list[j].u->name, \ 
     66                    oList[i]->affection_list[j].relation); 
    5867                } 
    5968        } 
     
    6170 
    6271 
    63 int parse_ce_config( TiXmlDocument * doc , Utility * u[], Parameter * p[], Observable * o[], CE_Info * ce_info) { 
     72int32_t 
     73parse_ce_config(TiXmlDocument* doc, Utility* u[], Parameter* p[], \ 
     74        Observable* o[], CE_Info* ce_info) 
     75{ 
    6476 
    6577        TiXmlElement* pElem;    //!current element 
     
    7082        TiXmlHandle hRoot(0); //! handle to root element  
    7183 
    72         int count = 0; 
    73         int i = 0; 
    74         int j = 0; 
    75         int k = 0; 
    76         int match_found = 0; 
     84        int32_t count = 0; 
     85        int32_t i = 0; 
     86        int32_t j = 0; 
     87        int32_t k = 0; 
     88        int32_t match_found = 0; 
    7789 
    7890        pElem = hDoc.FirstChildElement().Element(); 
     
    199211 
    200212 
    201 void error(char *msg) 
    202 { 
    203     perror(msg); 
    204     exit(1); 
    205 } 
    206  
    207  
    208 int ReceiveMessage(int socket,char * buffer)  
    209 { 
    210     int i,n; 
     213int32_t  
     214ReceiveMessage(int32_t socket, char* buffer)  
     215{ 
     216    int32_t i,n; 
    211217    
    212218    n = recv(socket,buffer,256,MSG_PEEK); 
     
    218224    if (n < 0) 
    219225        error("ERROR reading from socket"); 
    220     //    printf("ReadMessage:%s %d\n",buffer,n); 
     226    //    print32_tf("ReadMessage:%s %d\n",buffer,n); 
    221227 
    222228    return n; 
     
    224230 
    225231 
    226 int SendMessage(int socketfd, string message) { 
    227         int n; 
     232int32_t 
     233SendMessage(int32_t socketfd, string message)  
     234{ 
     235        int32_t n; 
    228236 
    229237        message.append("\0");    
     
    233241        error("Error sending to client\n"); 
    234242    if(n == 0) 
    235         printf("Client closed the socket.\n"); 
    236  
    237         //printf("SendMessage:%s %d\n",message.c_str(),n);       
     243        print32_tf("Client closed the socket.\n"); 
     244 
     245        //print32_tf("SendMessage:%s %d\n",message.c_str(),n);   
    238246    return n; 
    239247} 
    240248 
    241 void GetEnvironment() { 
    242  
    243 } 
    244  
    245 void Policy_ValidateSettings() { 
    246  
    247 } 
    248  
    249  
    250 void LoadCEConfiguration(int socketfd,Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info){ 
    251         int n,i,j; 
     249 
     250void  
     251LoadCEConfiguration(int32_t socketfd,Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info){ 
     252        int32_t n,i,j; 
    252253        char counter[55]; 
    253254        char var[50]; 
    254         //int total_bytes;    
    255  
    256         printf("Cognitive Radio:: Sending Radio Operating Profile to Cognitive Engine.\n\n"); 
     255        //int32_t total_bytes;    
     256 
     257        print32_tf("Cognitive Radio:: Sending Radio Operating Profile to Cognitive Engine.\n\n"); 
    257258  
    258259        // utilities 
    259260        // Send number of utilities 
    260         sprintf(counter,"%d",ce_info->numUtilities); 
     261        sprint32_tf(counter,"%d",ce_info->numUtilities); 
    261262        SendMessage(socketfd,counter); 
    262263        // send utility  
     
    265266                SendMessage(socketfd,uList[i]->units); 
    266267                SendMessage(socketfd,uList[i]->goal); 
    267                 sprintf(var,"%f",uList[i]->target); 
     268                sprint32_tf(var,"%f",uList[i]->target); 
    268269                SendMessage(socketfd,var); 
    269270        } 
    270271 
    271272        // parameters 
    272     sprintf(counter,"%i",ce_info->numParameters); 
     273    sprint32_tf(counter,"%i",ce_info->numParameters); 
    273274        SendMessage(socketfd,counter); 
    274275        for(i = 0; i < ce_info->numParameters; i++) { 
    275276                SendMessage(socketfd,pList[i]->name); 
    276277                SendMessage(socketfd,pList[i]->units); 
    277                 sprintf(var,"%f",pList[i]->min); 
    278                 SendMessage(socketfd,var); 
    279                 sprintf(var,"%f",pList[i]->max); 
    280                 SendMessage(socketfd,var); 
    281                 sprintf(var,"%f",pList[i]->step); 
     278                sprint32_tf(var,"%f",pList[i]->min); 
     279                SendMessage(socketfd,var); 
     280                sprint32_tf(var,"%f",pList[i]->max); 
     281                SendMessage(socketfd,var); 
     282                sprint32_tf(var,"%f",pList[i]->step); 
    282283                SendMessage(socketfd,var); 
    283284                 
    284                 sprintf(counter,"%i",pList[i]->numAffects);  
     285                sprint32_tf(counter,"%i",pList[i]->numAffects);  
    285286                SendMessage(socketfd,counter); 
    286287                for(j = 0; j < pList[i]->numAffects; j++) { 
     
    291292 
    292293    // observables 
    293         sprintf(counter,"%i",ce_info->numObservables); 
     294        sprint32_tf(counter,"%i",ce_info->numObservables); 
    294295        SendMessage(socketfd,counter); 
    295296        for(i = 0; i < ce_info->numObservables; i++) { 
    296297                SendMessage(socketfd,oList[i]->name); 
    297298                 
    298                 sprintf(counter,"%i",oList[i]->numAffects);  
     299                sprint32_tf(counter,"%i",oList[i]->numAffects);  
    299300                SendMessage(socketfd,counter); 
    300301                for(j = 0; j < oList[i]->numAffects; j++) { 
     
    308309        string message; 
    309310        n = ReceiveMessage(socketfd, buffer); 
    310     //printf("%s\n", buffer); 
     311    //print32_tf("%s\n", buffer); 
    311312        //cout << message << endl; 
    312         //printf("ACK received.\n"); 
     313        //print32_tf("ACK received.\n"); 
    313314 
    314315} 
     
    322323} 
    323324 
    324 void UpdateCEExperience(int socketfd, int num_rows, int num_cols,  
     325void UpdateCEExperience(int32_t socketfd, int32_t num_rows, int32_t num_cols,  
    325326        float * past_exp[])  
    326327{ 
    327     int i, j; 
     328    int32_t i, j; 
    328329        char counter[55]; 
    329330        char var[50]; 
     
    331332    for (i = 0; i < num_rows; i++){ 
    332333        for (j = 0; j< num_cols; j++){ 
    333                 sprintf(var,"%f",past_exp[i][j]); 
    334         //printf("%f, \n", past_exp[i][j]); 
    335         //printf("%s, \n", var); 
     334                sprint32_tf(var,"%f",past_exp[i][j]); 
     335        //print32_tf("%f, \n", past_exp[i][j]); 
     336        //print32_tf("%s, \n", var); 
    336337        } 
    337338    } 
    338339     
    339340    // send the number of rows to the ce first 
    340         sprintf(counter,"%d",num_rows); 
     341        sprint32_tf(counter,"%d",num_rows); 
    341342        SendMessage(socketfd,counter); 
    342343    // send the number of columns to the ce 
    343         sprintf(counter,"%d",num_cols); 
     344        sprint32_tf(counter,"%d",num_cols); 
    344345        SendMessage(socketfd,counter); 
    345346    // update ce with experience 
    346347    for (i = 0; i < num_rows; i++){ 
    347348        for (j = 0; j< num_cols; j++){ 
    348                 sprintf(var,"%f",past_exp[i][j]); 
     349                sprint32_tf(var,"%f",past_exp[i][j]); 
    349350                SendMessage(socketfd,var); 
    350351        } 
     
    358359 
    359360// Update operating settings 
    360 // This function will interact with the hardware "drivers" 
     361// This function will int32_teract with the hardware "drivers" 
    361362void UpdateRadioSettings()  
    362363{ 
     
    364365 
    365366 
    366 int RequestPolicyValidation(Parameter * pList[], CE_Info *ce_info) 
     367int32_t RequestPolicyValidation(Parameter * pList[], CE_Info *ce_info) 
    367368{ 
    368369        char counter[55]; 
    369370        char var[50]; 
    370     int i; 
     371    int32_t i; 
    371372    string control_msg; 
    372373     
    373     int socketfd = ce_info->policy_socket; 
     374    int32_t socketfd = ce_info->policy_socket; 
    374375 
    375376    // Control message that validation request is coming 
     
    377378        SendMessage(socketfd,control_msg); 
    378379 
    379     printf("Cognitive Radio:: Here. %i\n\n", socketfd); 
     380    print32_tf("Cognitive Radio:: Here. %i\n\n", socketfd); 
    380381 
    381382        // Send parameter information  
    382     sprintf(counter,"%i",ce_info->numParameters); 
     383    sprint32_tf(counter,"%i",ce_info->numParameters); 
    383384        SendMessage(socketfd,counter); 
    384385        for(i = 0; i < ce_info->numParameters; i++) { 
    385386                SendMessage(socketfd,pList[i]->name); 
    386387                SendMessage(socketfd,pList[i]->units); 
    387                 sprintf(var,"%f",pList[i]->min); 
    388                 SendMessage(socketfd,var); 
    389                 sprintf(var,"%f",pList[i]->max); 
    390                 SendMessage(socketfd,var); 
    391                 sprintf(var,"%f",pList[i]->step); 
    392                 SendMessage(socketfd,var); 
    393                 sprintf(var,"%f",pList[i]->value); 
     388                sprint32_tf(var,"%f",pList[i]->min); 
     389                SendMessage(socketfd,var); 
     390                sprint32_tf(var,"%f",pList[i]->max); 
     391                SendMessage(socketfd,var); 
     392                sprint32_tf(var,"%f",pList[i]->step); 
     393                SendMessage(socketfd,var); 
     394                sprint32_tf(var,"%f",pList[i]->value); 
    394395                SendMessage(socketfd,var); 
    395396                 
     
    400401 
    401402 
    402 int RequestCEOptimization(int sockfd, Utility *uList[],  
     403int32_t RequestCEOptimization(int32_t sockfd, Utility *uList[],  
    403404        Parameter *pList[], Observable *oList[], 
    404405        CE_Info *ce_info) 
    405406{ 
    406407    char buffer[256]; 
    407     int i; 
     408    int32_t i; 
    408409    float var; 
    409410 
     
    428429    if(ce_info->policy_engine == 1) { 
    429430 
    430         printf("Cognitive Radio:: Found Policy Engine!\n"); 
    431         printf("Cognitive Radio:: Validating parameters with Policy Engine\n\n"); 
     431        print32_tf("Cognitive Radio:: Found Policy Engine!\n"); 
     432        print32_tf("Cognitive Radio:: Validating parameters with Policy Engine\n\n"); 
    432433        RequestPolicyValidation(pList,ce_info);  
    433         printf("Cognitive Radio:: Done\n\n"); 
     434        print32_tf("Cognitive Radio:: Done\n\n"); 
    434435 
    435436    } 
     
    439440} 
    440441 
    441 void RunSimulator(int socketfd, Utility * uList[],  
     442void RunSimulator(int32_t socketfd, Utility * uList[],  
    442443        Parameter * pList[], Observable * oList[],  
    443444        CE_Info * ce_info) { 
    444445         
    445446        float **past_exp; 
    446     int num_rows, num_cols; 
     447    int32_t num_rows, num_cols; 
    447448 
    448449        // Set fake current environment params = current environment 
     
    457458} 
    458459 
    459 void InitializePE(int socket, CE_Info * ce_info)  
     460void InitializePE(int32_t socket, CE_Info * ce_info)  
    460461{ 
    461462    // Policy Engine is connected 
     
    467468} 
    468469 
    469 void InitializeCE(int socketfd, Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info)  
     470void InitializeCE(int32_t socketfd, Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info)  
    470471{ 
    471472        LoadCEConfiguration(socketfd, uList, pList, oList, ce_info); 
     
    473474    // cr experience 
    474475    float **past_exp; 
    475         int num_cols; 
     476        int32_t num_cols; 
    476477    // get number of columns 
    477478    num_cols = ce_info->numUtilities + ce_info->numParameters; 
    478479    num_cols = num_cols + ce_info->numObservables; 
    479480    num_cols = num_cols + 1;    // overall utility 
    480     int num_rows = 2; 
     481    int32_t num_rows = 2; 
    481482    past_exp = (float **)malloc(sizeof(float)*num_rows); 
    482     int i; 
     483    int32_t i; 
    483484    for (i=0; i<num_rows; i++){ 
    484485        past_exp[i] = (float*)malloc(sizeof(float)*num_cols); 
     
    502503 
    503504        // update ce with experience 
    504     printf("Cognitive Radio:: Sending Previous Experience to New Cognitive Engine.\n\n"); 
     505    print32_tf("Cognitive Radio:: Sending Previous Experience to New Cognitive Engine.\n\n"); 
    505506    UpdateCEExperience(socketfd, num_rows, num_cols, past_exp);  
    506507 
     
    508509} 
    509510 
    510 int AcceptTCPConnection(int servSock) 
    511 { 
    512     int clntSock;                    /* Socket descriptor for client */ 
     511int32_t AcceptTCPConnection(int32_t servSock) 
     512{ 
     513    int32_t clntSock;                    /* Socket descriptor for client */ 
    513514    struct sockaddr_in echoClntAddr; 
    514     unsigned int clntLen; 
     515    unsigned int32_t clntLen; 
    515516 
    516517    /* Set the size of the in-out parameter */ 
     
    525526    /* clntSock is connected to a client! */ 
    526527     
    527     printf("Handling client %s\n", inet_ntoa(echoClntAddr.sin_addr)); 
     528    print32_tf("Handling client %s\n", inet_ntoa(echoClntAddr.sin_addr)); 
    528529 
    529530    return clntSock; 
    530531} 
    531532 
    532 int CreateTCPServerSocket(unsigned short port) 
    533 { 
    534     int sock;                        /* socket to create */ 
     533int32_t CreateTCPServerSocket(unsigned short port) 
     534{ 
     535    int32_t sock;                        /* socket to create */ 
    535536    struct sockaddr_in echoServAddr; /* Local address */ 
    536537 
     
    541542    /* Construct local address structure */ 
    542543    memset(&echoServAddr, 0, sizeof(echoServAddr));   /* Zero out structure */ 
    543     echoServAddr.sin_family = AF_INET;                /* Internet address family */ 
    544     echoServAddr.sin_addr.s_addr = htonl(INADDR_ANY); /* Any incoming interface */ 
     544    echoServAddr.sin_family = AF_INET;                /* int32_ternet address family */ 
     545    echoServAddr.sin_addr.s_addr = htonl(INADDR_ANY); /* Any incoming int32_terface */ 
    545546    echoServAddr.sin_port = htons(port);              /* Local port */ 
    546547 
     
    551552    /* Mark the socket so it will listen for incoming connections */ 
    552553    if (listen(sock, 5) < 0) { 
    553         printf("listen() failed\n"); 
     554        print32_tf("listen() failed\n"); 
    554555        return 0; 
    555556    } 
     
    558559} 
    559560 
    560 void HandleTCPClient(int socketfd, Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info)  
     561void HandleTCPClient(int32_t socketfd, Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info)  
    561562{ 
    562563    char buffer[256];        /* Buffer for echo string */ 
     
    566567    ReceiveMessage(socketfd,buffer); 
    567568 
    568     printf("Cognitive Radio:: Message Received - %s.\n\n", buffer); 
     569    print32_tf("Cognitive Radio:: Message Received - %s.\n\n", buffer); 
    569570 
    570571    if(strcmp(buffer,"c_register") == 0)  
     
    580581} 
    581582 
    582 int StartServers(Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info) { 
    583     int * servSock;  
    584     int running = 1; 
     583int32_t StartServers(Utility * uList[], Parameter * pList[], Observable * oList[], CE_Info * ce_info) { 
     584    int32_t * servSock;  
     585    int32_t running = 1; 
    585586    struct timeval selTimeout; 
    586     int timeout = 10; 
    587     int cognitive_engine = 0;  
    588     int policy_engine = 1;  
    589     int port, rc, on = 1; 
    590     int new_sd; 
    591     int desc_ready = 0; 
     587    int32_t timeout = 10; 
     588    int32_t cognitive_engine = 0;  
     589    int32_t policy_engine = 1;  
     590    int32_t port, rc, on = 1; 
     591    int32_t new_sd; 
     592    int32_t desc_ready = 0; 
    592593    fd_set sockSet; 
    593594     
    594     servSock = (int *) malloc(2 * sizeof(int)); 
     595    servSock = (int32_t *) malloc(2 * sizeof(int32_t)); 
    595596 
    596597    servSock[cognitive_engine] = CreateTCPServerSocket(CE_SERVER_PORT); 
    597     servSock[policy_engine] = CreateTCPServerSocket(POLICY_SERVER_PORT); 
    598  
    599  
    600     int maxDescriptor = servSock[cognitive_engine]; 
     598    servSock[policy_engine] = CreateTCPServerSocket(PE_SERVER_PORT); 
     599 
     600 
     601    int32_t maxDescriptor = servSock[cognitive_engine]; 
    601602 
    602603    if(servSock[cognitive_engine] < servSock[policy_engine]) 
     
    635636    } 
    636637     
    637     printf("Starting server:  Hit return to shutdown\n"); 
     638    print32_tf("Starting server:  Hit return to shutdown\n"); 
    638639    while (running) 
    639640    { 
     
    654655        rc = select(maxDescriptor + 1, &sockSet, NULL, NULL, &selTimeout);  
    655656        if (rc == 0) 
    656             printf("No echo requests for %i secs...Server still alive\n", timeout); 
     657            print32_tf("No echo requests for %i secs...Server still alive\n", timeout); 
    657658        else  
    658659        { 
    659660            if (FD_ISSET(0, &sockSet)) /* Check keyboard */ 
    660661            { 
    661                 printf("Shutting down server\n"); 
     662                print32_tf("Shutting down server\n"); 
    662663                getchar(); 
    663664                running = 0; 
     
    669670                if (FD_ISSET(port, &sockSet)) 
    670671                { 
    671                     printf("Request on port %d:  ", port); 
     672                    print32_tf("Request on port %d:  ", port); 
    672673                        desc_ready -= 1; 
    673674 
     
    687688                            if(new_sd > maxDescriptor)  
    688689                                maxDescriptor = new_sd; 
    689                             printf("New incoming connection - %i\n\n",new_sd); 
     690                            print32_tf("New incoming connection - %i\n\n",new_sd); 
    690691                        } while(new_sd != -1); 
    691692                    } else { 
    692693                         
    693                         printf("Request on already open descriptor.\n\n"); 
     694                        print32_tf("Request on already open descriptor.\n\n"); 
    694695                        HandleTCPClient(port, uList, pList, oList, ce_info); 
    695696 
     
    711712} 
    712713 
    713 int main(int argc, char* argv[]) { 
    714  
    715  
     714int32_t  
     715main(int32_t argc, char* argv[]) 
     716{ 
    716717        // CognitiveEngine CE; 
    717718        // CognitiveEngineShell Shell; 
    718719        string pFilename;  
    719     int fd; 
     720    int32_t fd; 
    720721 
    721722        Utility * uList[10]; 
     
    750751        cout << "Initialize:: Configuration file parsing completed.\n" << endl; 
    751752 
    752     //print_current_config(uList, pList, oList, &ce_info); 
     753    //print32_t_current_config(uList, pList, oList, &ce_info); 
    753754         
    754755   StartServers(uList, pList, oList, ce_info);