オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.8.x/ccs-patch/security/ccsecurity/network.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3753 by kumaneko, Thu Jun 10 03:54:43 2010 UTC revision 3754 by kumaneko, Sat Jun 12 04:30:07 2010 UTC
# Line 19  Line 19 
19  #include <net/udp.h>  #include <net/udp.h>
20  #include "internal.h"  #include "internal.h"
21    
22    const char *ccs_net_keyword[CCS_MAX_NETWORK_OPERATION] = {
23            [CCS_NETWORK_UDP_BIND] = "UDP bind",
24            [CCS_NETWORK_UDP_CONNECT] = "UDP connect",
25            [CCS_NETWORK_TCP_BIND] = "TCP bind",
26            [CCS_NETWORK_TCP_LISTEN] = "TCP listen",
27            [CCS_NETWORK_TCP_CONNECT] = "TCP connect",
28            [CCS_NETWORK_TCP_ACCEPT] = "TCP accept",
29            [CCS_NETWORK_RAW_BIND] = "RAW bind",
30            [CCS_NETWORK_RAW_CONNECT] = "RAW connect"
31    };
32    
33  /**  /**
34   * ccs_audit_network_log - Audit network log.   * ccs_audit_network_log - Audit network log.
35   *   *
# Line 29  Line 40 
40  static int ccs_audit_network_log(struct ccs_request_info *r)  static int ccs_audit_network_log(struct ccs_request_info *r)
41  {  {
42          char buf[128];          char buf[128];
43          const char *operation = ccs_net2keyword(r->param.network.operation);          const char *operation = ccs_net_keyword[r->param.network.operation];
44          const u32 *address = r->param.network.address;          const u32 *address = r->param.network.address;
45          const u16 port = r->param.network.port;          const u16 port = r->param.network.port;
46          if (r->param.network.is_ipv6)          if (r->param.network.is_ipv6)
# Line 141  void ccs_print_ipv6(char *buffer, const Line 152  void ccs_print_ipv6(char *buffer, const
152                   NIP6(*max_ip));                   NIP6(*max_ip));
153  }  }
154    
 /**  
  * ccs_net2keyword - Convert network operation index to network operation name.  
  *  
  * @operation: Type of operation.  
  *  
  * Returns the name of operation.  
  */  
 const char *ccs_net2keyword(const u8 operation)  
 {  
         const char *keyword = "unknown";  
         switch (operation) {  
         case CCS_NETWORK_UDP_BIND:  
                 keyword = "UDP bind";  
                 break;  
         case CCS_NETWORK_UDP_CONNECT:  
                 keyword = "UDP connect";  
                 break;  
         case CCS_NETWORK_TCP_BIND:  
                 keyword = "TCP bind";  
                 break;  
         case CCS_NETWORK_TCP_LISTEN:  
                 keyword = "TCP listen";  
                 break;  
         case CCS_NETWORK_TCP_CONNECT:  
                 keyword = "TCP connect";  
                 break;  
         case CCS_NETWORK_TCP_ACCEPT:  
                 keyword = "TCP accept";  
                 break;  
         case CCS_NETWORK_RAW_BIND:  
                 keyword = "RAW bind";  
                 break;  
         case CCS_NETWORK_RAW_CONNECT:  
                 keyword = "RAW connect";  
                 break;  
         }  
         return keyword;  
 }  
   
155  static bool ccs_check_network_acl(const struct ccs_request_info *r,  static bool ccs_check_network_acl(const struct ccs_request_info *r,
156                                    const struct ccs_acl_info *ptr)                                    const struct ccs_acl_info *ptr)
157  {  {

Legend:
Removed from v.3753  
changed lines
  Added in v.3754

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26