virtual_service_endpoint_udp = invirtual_service_endpoint_udp;
}
- //replication用インターフェイス
- //これが呼ばれたら、replication領域にデータを書き込む
- //注意:内部でループは不要です。
- // ループとタイマー制御はvirtual_serviceで行います。
- // virtual_serviceは設定時間に1回replication_interruptをCallします。
- // replication_interrupt呼ばれたら1回データ書き込みを行います。
+ // For replication interface
+ // when call this function, write data to replication area.
+ // Caution: Not need loop inside.
+ // Because Loop and Timer control is in virtual_service.
+ // virtual_service call replication_interrupt in specified time at once.
+ // when called, replication_interrupt write data at once.
//! replication interval interrrupt
//! timer thread call this function. from virtualservice.
virtual void replication_interrupt() = 0;
#include <stdint.h>
-// dcasで格納できる最大の値をふたつパッキングした構造体
-// intptr_tはx86時には32bit長=4byte, x86_64時には8byteとなり、
-// この構造体のサイズはそれぞれ8byteと16byとなる。
+// structure of packing two max value of dcas
+// when x86, intptr_t size is 32bit=4byte, so structure size is 8byte.
+// when x86_64, intptr_t size is 64bit=8byte, so structure size is 16byte.
struct dcas_t{
intptr_t val;
};
extern "C" bool __sync_bool_double_compare_and_swap(
- volatile dcas_t* addr, // ターゲットのdcas_tが存在するアドレス
- intptr_t new_val1, // 入れる新しい値1
- intptr_t new_val2, // 入れる新しい値2
- intptr_t old_val1, // 比較する値
- intptr_t old_val2 ){ // 比較する値
+ volatile dcas_t* addr, // target dcas_t address
+ intptr_t new_val1, // new value 1 for input
+ intptr_t new_val2, // new value 2 for input
+ intptr_t old_val1, // old value 1 for compare
+ intptr_t old_val2 ){ // old value 2 for compare
char result;
#ifndef __X86_64__
session_data_ptr = session_thread_it->second;
}
- //current_message_rest_size > 0
+ //current_message_rest_size > 0
if (session_data_ptr->current_message_rest_size > 0)
{
- //data size > 0
+ //data size > 0
if (session_data_ptr->data_length > 0)
{
//set return status
//current_message_rest_size is 0
else
{
- //data size > 0
+ //data size > 0
if (session_data_ptr->data_length > 0)
{
//data state is HTTP_BODY
session_data_ptr = session_thread_it->second;
}
- //current_message_rest_size > 0
+ //current_message_rest_size > 0
if (session_data_ptr->current_message_rest_size > 0)
{
- //data size > 0
+ //data size > 0
if (session_data_ptr->data_length > 0)
{
//set return status
//current_message_rest_size is 0
else
{
- //data size > 0
+ //data size > 0
if (session_data_ptr->data_length> 0)
{
//data state is HTTP_BODY
session_data_ptr = session_thread_it->second;
}
- //current_message_rest_size > 0
+ //current_message_rest_size > 0
if (session_data_ptr->current_message_rest_size > 0)
{
- //data size > 0
+ //data size > 0
if (session_data_ptr->data_length > 0)
{
//set return status
//current_message_rest_size is 0
else
{
- //data size > 0
+ //data size > 0
if (session_data_ptr->data_length > 0)
{
//data state is HTTP_BODY
if( l7vsadm_request::CMD_ADD_VS == cmd &&
( count_map["-z"] > 0 || count_map["--ssl"] > 0 ) ) {
- protocol_module_control& ctrl
+ protocol_module_control& ctrl
= protocol_module_control::getInstance();
ctrl.initialize( L7VS_MODULE_PATH );
protocol_module_base* module;
}
cpu_set_t mask;
- //numが1以上なら、その数だけCPU_SETする
+ // when num>0, do CPU_SET times of "num_of_core_uses".
if( 0 < num_of_core_uses ){
CPU_ZERO( &mask );
for( int i = 0; i < num_of_core_uses; ++i ){
Logger::putLogDebug( LOG_CAT_L7VSD_VIRTUALSERVICE, 4, fmt.str(), __FILE__, __LINE__ );
}
cpu_set_t mask;
- //numが1以上なら、その数だけCPU_SETする
+ // when num>0, do CPU_SET times of "num_of_core_uses".
if( 0 < num_of_core_uses ){
CPU_ZERO( &mask );
for( int i = 0; i < num_of_core_uses; ++i ){
std::string tcp_session::endpoint_to_string(
const boost::asio::ip::tcp::endpoint& target_endpoint){
std::stringstream ret;
- if( target_endpoint.address().is_v6() ){
+ if( target_endpoint.address().is_v6() ){
ret << "[" << target_endpoint.address().to_string() << "]:" << target_endpoint.port();
}else{
ret << target_endpoint.address().to_string() << ":" << target_endpoint.port();
// read interrupts.
while( getline( ifs, buff ) ){
if( string::npos == buff.find( nic_name ) ) continue;
- //割り込みIDを取得
+ // get interrupt ID
algorithm::split( split_vec, buff, algorithm::is_any_of( ":" ));
- if( !split_vec.size() ) return mask; //interrupt分割不可
+ if( !split_vec.size() ) return mask; // cannot split interrupt
algorithm::trim( split_vec[0] );
target_interrupt = lexical_cast<unsigned int>( split_vec[0] );
for( size_t i = 0; i < cpu_nic_map.size(); ++i ){