void init(void) { app_init(); doi_init(); exchange_init(); group_init(); ipsec_init(); isakmp_doi_init(); libcrypto_init(); timer_init(); /* The following group are depending on timer_init having run. */ conf_init(); connection_init(); /* This depends on conf_init, thus check as soon as possible. */ log_reinit(); /* policy_init depends on conf_init having run. */ policy_init(); /* Depends on conf_init and policy_init having run */ cert_init(); crl_init(); sa_init(); transport_init(); virtual_init(); udp_init(); nat_t_init(); udp_encap_init(); vendor_init(); }
/* ipsec_attach Memory Allcate */ int ipsec_attach( void* Adapter ) { PIPSEC pIpsec=&((pADAPTER)Adapter)->Ipsec_SL.Ipsec; int i; DBG_ENTER(ipsec_attach); /* PMC-Viana-011-カーネルログ出力有効/無効切り替え対応 add start */ #ifdef BUILD_ANDROID TNC_LOGOUT("Call ipsec_attach \n"); #endif /* BUILD_ANDROID */ /* PMC-Viana-011-カーネルログ出力有効/無効切り替え対応 add end */ /* Version Display */ /* PMC-Viana-011-カーネルログ出力有効/無効切り替え対応 add start */ #ifdef BUILD_ANDROID TNC_LOGOUT("<IPsec Ver.0.50 (2003.06.06)>\n"); #else /* BUILD_ANDROID */ printk("<IPsec Ver.0.50 (2003.06.06)>\n"); #endif /* BUILD_ANDROID */ /* PMC-Viana-011-カーネルログ出力有効/無効切り替え対応 add end */ bzero( (char*)pIpsec, sizeof(IPSEC)); pIpsec->hash_buf = (u_char*)kmalloc(HASHB_LEN,GFP_KERNEL); if(pIpsec->hash_buf == NULL){ return IPSEC_ERROR; } pIpsec->hash_mbuf = (u_char*)kmalloc(HASHM_LEN,GFP_KERNEL); if(pIpsec->hash_mbuf == NULL){ return IPSEC_ERROR; } for( i=0; i<4; i++ ) { pIpsec->sched[i] = (u_char*)kmalloc(DESKS_LEN,GFP_KERNEL); if(pIpsec->sched[i] == NULL){ return IPSEC_ERROR; } } pIpsec->MBuf = (struct mbuf*)kmalloc(sizeof(struct mbuf)*MB_MAX,GFP_KERNEL); if(pIpsec->MBuf == NULL){ return IPSEC_ERROR; } init_timer(&pIpsec->Key_LifeTimer[FIRST_OUT]); pIpsec->Key_LifeTimer[FIRST_OUT].function = ipsec_Timeup0; pIpsec->Key_LifeTimer[FIRST_OUT].data = (unsigned long)pIpsec; init_timer(&pIpsec->Key_LifeTimer[SECOND_OUT]); pIpsec->Key_LifeTimer[SECOND_OUT].function = ipsec_Timeup1; pIpsec->Key_LifeTimer[SECOND_OUT].data = (unsigned long)pIpsec; init_timer(&pIpsec->Key_LifeTimer[FIRST_IN]); pIpsec->Key_LifeTimer[FIRST_IN].function = ipsec_Timeup0_in; pIpsec->Key_LifeTimer[FIRST_IN].data = (unsigned long)pIpsec; init_timer(&pIpsec->Key_LifeTimer[SECOND_IN]); pIpsec->Key_LifeTimer[SECOND_IN].function = ipsec_Timeup1_in; pIpsec->Key_LifeTimer[SECOND_IN].data = (unsigned long)pIpsec; return( ipsec_init( Adapter )); }
int init_module(void) { int error = 0; error |= ipsec_init(); return error; }