OSDN Git Service

*** empty log message ***
authorkoinec <>
Mon, 22 Mar 2010 06:57:35 +0000 (06:57 +0000)
committerkoinec <>
Mon, 22 Mar 2010 06:57:35 +0000 (06:57 +0000)
deamon/drd64_debugd.h
deamon/drd64_debugd_send_cmd_bootinfo.c
deamon/drd64_marshald.h
deamon/drd64_marshald_cmd_connect.c
deamon/drd64_marshald_main.c
deamon/drd64_marshald_send_connect.c
deamon/drd64_marshald_send_connect_count.c
include/drd64_conf.h
include/drd64_error.h
include/drd64_packet.h
libdrd64/drd64_libdrd64_packet.c

index c1c6228..cece302 100644 (file)
@@ -60,6 +60,7 @@ Comment:
 #include"../include/drd64_defines.h"
 #include"../include/drd64_conf.h"
 #include"../include/drd64_packet.h"
+#include"../include/drd64_error.h"
 #include"drd64_server_log.h"
 #include"drd64_server_debuglog.h"
 #include"drd64_server_recvstatus.h"
index 0ee1c67..e2c9587 100644 (file)
@@ -59,8 +59,9 @@ int
        p_phead->w_packettype   = DRD64_PACKETTYPE_REPORT;
        p_phead->i_datalen              = 0;
        p_phead->i_rid_resume   = i_request_fd;
-       p_phead->i_result               = 0x00;
-       p_phead->i_error                = 0x00;
+       p_phead->dw_errcode     = DRD64_ERROR_CODE_CLEAR;
+       p_phead->dw_errlocation = DRD64_ERROR_LOCATION_CLEAR;
+
 
        /* Phase 2 : Create Local-Marshald Socket ------*/
        i_socket_temp   =
index 23e052b..3886caa 100644 (file)
@@ -59,6 +59,7 @@ Comment:
 #include"../include/drd64_defines.h"
 #include"../include/drd64_conf.h"
 #include"../include/drd64_packet.h"
+#include"../include/drd64_error.h"
 #include"drd64_server_recvstatus.h"
 #include"drd64_server_log.h"
 #include"drd64_server_debuglog.h"
index b93ded7..0df664e 100644 (file)
@@ -79,19 +79,40 @@ int
 {
        int                     i_wlen;
        int                     i_fds;
+       int                     i_result;
+       DWord           dw_errcode;
+       DWord           dw_errlocation;
        Drd64_Marshald_ConnectInfo              *p_cinfo;
        Drd64_Server_RecvStatus                 *p_recv;
 
        DRD64_LOG_DEBUG("  [DEBUG] CMD: Connect(Server) Start");
 
+       i_result                = DRD64_MARSHALD_DISPATCH_RESULT_COMPLETE;
+       dw_errcode              = DRD64_ERROR_CODE_CLEAR;
+       dw_errlocation  = DRD64_ERROR_LOCATION_CLEAR;
+
        p_recv  = Drd64_Server_RecvStatus_GetRecvStatus( i_recv_id );
        assert( NULL != p_recv );
        i_fds   = p_recv->i_fds_id;
        
        /* Alloc ConnectInfo. */
        p_cinfo = Drd64_Marshald_CInfo_AllocConnectInfo();
-       if( NULL == p_cinfo )
-               { return DRD64_MARSHALD_DISPATCH_RESULT_CLOSE; }        // XXX > error
+       if( NULL == p_cinfo )           {
+               dw_errcode      = DRD64_ERROR_SET_CODE(
+                                               DRD64_ERROR_TYPE_ERROR,
+                                               DRD64_ERROR_PTN_NOMEMORY,
+                                               0x00, 0x01 );
+               dw_errlocation  = DRD64_ERROR_SET_LOCATION(
+                                               DRD64_ERROR_MODULE_MARSHALD,
+                                               DRD64_ERROR_ARCH_NODEPEND,
+                                               0x0000, 0x0000 );
+               Drd64_LibBrownie_Error_SetErrorInfo(
+                                       dw_errcode, dw_errlocation, errno );
+
+               i_result        =  DRD64_MARSHALD_DISPATCH_RESULT_CLOSE;
+
+               goto goto_Marshald_Cmd_Connect_Server_Answer;
+       }
 
        /* Set Cinfo Common Info. ---*/
        p_cinfo->b_cinfo_type   = DRD64_MARSHALD_CINFOTYPE_SERVER;
@@ -124,22 +145,41 @@ int
        Drd64_Server_RecvStatus_SetConnectionInfoPointer(
                                                                        p_recv, (void *)p_cinfo );
 
-       /* Set Answer Data ---------*/
-       p_phead->w_packettype           |= DRD64_PACKETTYPE_FLAG_ANSWER;
     p_connect->i_connect_id            = p_cinfo->i_cinfo_id;
     p_connect->i_marshald_pid  = getpid();
 
+       /* Set Answer Data ---------*/
+goto_Marshald_Cmd_Connect_Server_Answer:
+       p_phead->dw_errcode                     = dw_errcode;
+       p_phead->dw_errlocation         = dw_errlocation;
+       p_phead->w_packettype           |= DRD64_PACKETTYPE_FLAG_ANSWER;
+
        i_wlen  = send( i_fds, (void *)p_phead, DRD64_PacketSize(p_phead), 0x00 );
-       DRD64_DEBUG_PRINT("send",i_wlen,"FD",i_fds,"errno",errno);
-       if( i_wlen != DRD64_PacketSize(p_phead) )
-               { return DRD64_MARSHALD_DISPATCH_RESULT_CLOSE; }        // XXX > error
+       DRD64_DEBUG_PRINT("send",i_wlen,"Socket",i_fds,"errno",errno);
+       if( i_wlen != DRD64_PacketSize(p_phead) )       {
+               dw_errcode      = DRD64_ERROR_SET_CODE(
+                                               DRD64_ERROR_TYPE_ERROR,
+                                               DRD64_ERROR_PTN_SOCKET,
+                                               0x00, 0x02 );
+               dw_errlocation  = DRD64_ERROR_SET_LOCATION(
+                                               DRD64_ERROR_MODULE_MARSHALD,
+                                               DRD64_ERROR_ARCH_NODEPEND,
+                                               0x0000, 0x0000 );
+               Drd64_LibBrownie_Error_SetErrorInfo(
+                                       dw_errcode, dw_errlocation, errno );
+
+               i_result        =  DRD64_MARSHALD_DISPATCH_RESULT_CLOSE;
+       }
        
        DRD64_LOG_DEBUG("  [DEBUG] CMD: Connect(Server) Complete ");
 
-       return DRD64_MARSHALD_DISPATCH_RESULT_COMPLETE;
+       return i_result;
 }
 
 
+/*----------------------------------------------------------------------
+Drd64_Marshald_Cmd_Connect(
+----------------------------------------------------------------------*/
 int
        Drd64_Marshald_Cmd_Connect(
                int             i_recv_id,
@@ -148,7 +188,7 @@ int
 {
        int             i_result;
 
-       DRD64_LOG_VERBOSE("[STAT]CMD: Connect");
+       DRD64_LOG_VERBOSE("[STAT]CMD: Connect Start");
        
        if( DRD64_IsPacketType_Answer( p_phead ) )      {
                i_result        = Drd64_Marshald_Cmd_Connect_Client(
@@ -160,6 +200,8 @@ int
                                                                i_recv_id, p_phead, p_connect );
        }
        
+       DRD64_LOG_VERBOSE("[STAT]CMD: Connect Ended");
+
        return i_result;
 }
 
index f6e9245..6081ce8 100644 (file)
@@ -44,6 +44,8 @@ void Drd64_Marshald_SigTerm( siginfo_t *info, ucontext_t *uap)
        close( drd64_marshald_info.i_socket_inet );
        close( drd64_marshald_info.i_socket_local );
 
+       Drd64_LibBrownie_Error_TermErrorSystem();
+
        DRD64_LOG_INFO("[INFO] Terminate drmarshald. Good-Bye.");
        Drd64_Server_Log_TermLogSystem();
        exit( 0x00 );
@@ -57,6 +59,8 @@ void Drd64_Marshald_SigHup( siginfo_t *info, ucontext_t *uap)
 
 
 
+/*----------------------------------------------------------------------
+----------------------------------------------------------------------*/
 int    
        Drd64_Marshald_Init(
                Drd64_Marshald_MasterInformation *p_marshald )
@@ -75,6 +79,11 @@ int
        DRD64_LOG_INFO("[INFO] Booting drmarshald ...");
 
        /* */
+       i_err = Drd64_LibBrownie_Error_InitErrorSystem(
+                               DRD64_ERRORINFO_HISTORY_MARSHALD );
+       if( 0x00 != i_err )             { return 0x04; }
+
+       /* */
        Drd64_Server_Common_Signal( SIGINT, Drd64_Marshald_SigTerm );
        Drd64_Server_Common_Signal( SIGTERM, Drd64_Marshald_SigTerm );
        Drd64_Server_Common_Signal( SIGHUP, Drd64_Marshald_SigHup );
@@ -120,6 +129,7 @@ int
        gp_sendbuffer   = (Byte *)malloc( DRD64_MAX_PACKET_LENGTH );
        if( NULL == gp_sendbuffer )             { return 0x03; }
 
+
        return 0x00;
 }
 
index 8b7fae8..1a2431a 100644 (file)
@@ -81,8 +81,9 @@ Drd64_Marshald_ConnectInfo *
        p_phead->w_packettype   = DRD64_PACKETTYPE_LINK;
        p_phead->i_datalen              = sizeof( Drd64_PacketData_Connect );
        p_phead->i_rid_resume   = i_recv_id;
-       p_phead->i_result               = 0x00;
-       p_phead->i_error                = 0x00;
+       p_phead->dw_errcode     = DRD64_ERROR_CODE_CLEAR;
+       p_phead->dw_errlocation = DRD64_ERROR_LOCATION_CLEAR;
+
 
        p_connect
                = (Drd64_PacketData_Connect *)DRD64_PacketData( gp_sendbuffer );
index 2458f37..90642f6 100644 (file)
@@ -65,8 +65,9 @@ int
        p_phead->w_packettype   = DRD64_PACKETTYPE_LINK;
        p_phead->i_datalen              = sizeof( Drd64_PacketData_ConnectCount );
        p_phead->i_rid_resume   = i_rid_resume;
-       p_phead->i_result               = 0x00;
-       p_phead->i_error                = 0x00;
+       p_phead->dw_errcode     = DRD64_ERROR_CODE_CLEAR;
+       p_phead->dw_errlocation = DRD64_ERROR_LOCATION_CLEAR;
+
 
        p_ccount
                = (Drd64_PacketData_ConnectCount *)DRD64_PacketData( gp_sendbuffer );
index 5a017ed..66b122a 100644 (file)
@@ -51,6 +51,9 @@ Comment:
 #define DRD64_LOG_FACILITY_DEBUGD              LOG_LOCAL4
 #define        DRD64_LOG_LEVEL_DEBUGD                  DRD64_LOG_LEVEL_DEBUG
 
+#define        DRD64_ERRORINFO_HISTORY_MARSHALD        5
+#define        DRD64_ERRORINFO_HISTORY_DEBUGD          5
+
 #define        DRD64_PACKET_MAX_MULTIPLE               2
 
 #endif /* DRD64_HEADER_CONF */
index 365d276..729164f 100644 (file)
@@ -40,6 +40,9 @@ Comment:
 #include"drd64_types.h"
 #include"drd64_defines.h"
 
+#define        DRD64_ERROR_SET_CODE(c,p,m,n)   (((DWord)(c))|((DWord)(p))|(((DWord)(m))<<8)|((DWord)(n)))
+#define        DRD64_ERROR_SET_LOCATION(m,a,s,f)       (((DWord)(m))|((DWord)(a))|(((DWord)(s))<<8)|((DWord)(f)))
+
 /*DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
 
  [Error] : Error Code
@@ -49,7 +52,7 @@ Comment:
      RRRR => Reserved. 
      PPPP => Error Pattern     
      1111 => Error Code Level-1 ( defined by Each-Module )
-     2222 => Error Code Level-1 ( defined by Each-Module )
+     2222 => Error Code Level-2 ( defined by Each-Module )
 
 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
 
@@ -63,20 +66,26 @@ DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
 
 DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*/
 
+#define        DRD64_ERROR_CODE_CLEAR                  0x00000000
+#define        DRD64_ERROR_LOCATION_CLEAR              0x00000000
+
 /* [Error] Type Code ================== __*_______ */
-#define        DRD64_ERROR_TYPE_FATAL                  0x40000000
-#define        DRD64_ERROR_TYPE_ERROR                  0x20000000
-#define        DRD64_ERROR_TYPE_WARNING                0x10000000
-#define        DRD64_ERROR_TYPE_INFO                   0x00000000
+#define        DRD64_ERROR_TYPE_FATAL                  0x80000000
+#define        DRD64_ERROR_TYPE_ERROR                  0x40000000
+#define        DRD64_ERROR_TYPE_WARNING                0x20000000
+#define        DRD64_ERROR_TYPE_INFO                   0x10000000
+#define        DRD64_ERROR_TYPE_NONE                   0x00000000
 
 /* [Error] Pattern Code =============== ____**____ */
 #define        DRD64_ERROR_PTN_NOERROR                 0x00000000
-#define        DRD64_ERROR_PTN_PACKET                  0x00000000
-#define        DRD64_ERROR_PTN_COMMAND                 0x00000000
-#define        DRD64_ERROR_PTN_LOG                             0x00000000
-#define        DRD64_ERROR_PTN_SYSCALL                 0x00000000
-#define        DRD64_ERROR_PTN_TIMEOUT                 0x00000000
-#define        DRD64_ERROR_PTN_NOEXIST                 0x00000000
+#define        DRD64_ERROR_PTN_PACKET                  0x00010000
+#define        DRD64_ERROR_PTN_COMMAND                 0x00020000
+#define        DRD64_ERROR_PTN_LOG                             0x00030000
+#define        DRD64_ERROR_PTN_SYSCALL                 0x00040000
+#define        DRD64_ERROR_PTN_TIMEOUT                 0x00050000
+#define        DRD64_ERROR_PTN_NOEXIST                 0x00060000
+#define        DRD64_ERROR_PTN_NOMEMORY                0x00070000
+#define        DRD64_ERROR_PTN_SOCKET                  0x00080000
 
 
 /* [Location] Module Level-1 Code ===== __*+______ */
@@ -90,6 +99,7 @@ DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD*/
 #define        DRD64_ERROR_MODULE_UI                   0x71000000
 
 /* [Location] Archtechture Code ======= ___**_____ */
+#define        DRD64_ERROR_ARCH_NODEPEND               0x00000000
 #define        DRD64_ERROR_ARCH_INTEL64                0x01100000
 #define        DRD64_ERROR_ARCH_INTEL32                0x01200000
 #define        DRD64_ERROR_ARCH_INTEL16                0x01300000
index c1acbee..7ecd252 100644 (file)
@@ -99,8 +99,10 @@ typedef struct       {
        INT             i_rid_resume;   /* resume_recvstatus_id */
 
        /* Answer */
-       INT             i_result;
-       INT             i_error;
+       //INT           i_result;
+       //INT           i_error;
+       DWord   dw_errcode;
+       DWord   dw_errlocation;
 
 } __attribute((packed)) Drd64_PacketHeader;
 
index 759242f..8d1a204 100644 (file)
@@ -54,8 +54,8 @@ int
        p_phead->i_datalen              = i_datalen;
        p_phead->i_rid_resume   = -1;
 
-       p_phead->i_result               = 0x00;
-       p_phead->i_error                = 0x00;
+       p_phead->dw_errcode             = DRD64_ERROR_CODE_CLEAR;
+       p_phead->dw_errlocation = DRD64_ERROR_LOCATION_CLEAR;
 
        return;
 }