| /mOS-networking-stack/core/src/ |
| H A D | logger.c | 21 ctx->free_buff_cnt++; in EnqueueFreeBuffer() 24 assert(ctx->free_buff_cnt + ctx->job_buff_cnt <= NUM_LOG_BUFF); in EnqueueFreeBuffer() 39 assert(ctx->free_buff_cnt + ctx->job_buff_cnt <= NUM_LOG_BUFF); in DequeueFreeBuffer() 48 ctx->job_buff_cnt++; in EnqueueJobBuffer() 51 if (ctx->free_buff_cnt + ctx->job_buff_cnt > NUM_LOG_BUFF) { in EnqueueJobBuffer() 53 ctx->free_buff_cnt, ctx->job_buff_cnt, NUM_LOG_BUFF); in EnqueueJobBuffer() 55 assert(ctx->free_buff_cnt + ctx->job_buff_cnt <= NUM_LOG_BUFF); in EnqueueJobBuffer() 71 assert(ctx->free_buff_cnt + ctx->job_buff_cnt <= NUM_LOG_BUFF); in DequeueJobBuffer() 84 ctx->cpu = cpu; in InitLogThreadContext() 86 ctx->done = 0; in InitLogThreadContext() [all …]
|
| H A D | core.c | 883 while ((!ctx->done || mtcp->flow_cnt) && !ctx->exit) { in RunMainLoop() 1206 mtcp->ctx = ctx; in InitializeMTCPManager() 1295 ctx = calloc(1, sizeof(*ctx)); in MTCPRunThread() 1296 if (!ctx) { in MTCPRunThread() 1302 ctx->cpu = cpu; in MTCPRunThread() 1303 mtcp = ctx->mtcp_manager = InitializeMTCPManager(ctx); in MTCPRunThread() 1472 if (ctx != NULL) in mtcp_destroy_context() 1473 ctx->done = 1; in mtcp_destroy_context() 1510 ctx->done = 1; in mtcp_free_context() 1511 ctx->exit = 1; in mtcp_free_context() [all …]
|
| H A D | api.c | 64 if (!g_mtcp[mctx->cpu] || g_mtcp[mctx->cpu]->ctx->done || g_mtcp[mctx->cpu]->ctx->exit) { in GetMTCPManager() 858 if (mtcp->ctx->done || mtcp->ctx->exit) { in mtcp_accept() 1154 SQ_LOCK(&mtcp->ctx->connect_lock); in mtcp_connect() 1255 SQ_LOCK(&mtcp->ctx->close_lock); in CloseStreamSocket() 1259 SQ_UNLOCK(&mtcp->ctx->close_lock); in CloseStreamSocket() 1439 SQ_LOCK(&mtcp->ctx->reset_lock); in mtcp_abort() 1442 SQ_UNLOCK(&mtcp->ctx->reset_lock); in mtcp_abort() 1488 SQ_LOCK(&mtcp->ctx->ackq_lock); in CopyToUser() 1832 SQ_LOCK(&mtcp->ctx->sendq_lock); in mtcp_write() 1835 SQ_UNLOCK(&mtcp->ctx->sendq_lock); in mtcp_write() [all …]
|
| H A D | mos_api.c | 193 if (mtcp->ctx->thread != pthread_self()) in mtcp_set_uctx() 222 if (mtcp->ctx->thread != pthread_self()) { in mtcp_get_uctx() 259 if (mtcp->ctx->thread != pthread_self()) { in mtcp_peek() 376 if (mtcp->ctx->thread != pthread_self()) { in mtcp_ppeek() 466 if (mtcp->ctx->thread != pthread_self()) { in mtcp_getlastpkt() 537 if (mtcp->ctx->thread != pthread_self()) { in mtcp_getlastpkt() 567 if (mtcp->ctx->thread != pthread_self()) { in mtcp_sendpkt() 831 if (mtcp->ctx->thread != pthread_self()) { in mtcp_cb_get_ts() 872 if (mtcp->ctx->thread != pthread_self()) { in mtcp_getpeername() 956 if (mtcp->ctx->thread != pthread_self()) { in mtcp_setlastpkt() [all …]
|
| H A D | tcp_stream.c | 334 mctx.cpu = mtcp->ctx->cpu; in AddMonitorStreamSockets() 405 mctx.cpu = mtcp->ctx->cpu; in DestroyMonitorStreamSocket() 438 pthread_mutex_lock(&mtcp->ctx->flow_pool_lock); 446 pthread_mutex_unlock(&mtcp->ctx->flow_pool_lock); 455 pthread_mutex_unlock(&mtcp->ctx->flow_pool_lock); 466 pthread_mutex_unlock(&mtcp->ctx->flow_pool_lock); 484 pthread_mutex_unlock(&mtcp->ctx->flow_pool_lock); 503 pthread_mutex_unlock(&mtcp->ctx->flow_pool_lock); 829 pthread_mutex_lock(&mtcp->ctx->flow_pool_lock); 856 pthread_mutex_unlock(&mtcp->ctx->flow_pool_lock);
|
| H A D | eth_out.c | 84 buf = mtcp->iom->get_wptr(mtcp->ctx, nif, iplen + ETHERNET_HEADER_LEN); in EthernetOutput() 123 buf = mtcp->iom->get_wptr(mtcp->ctx, pctx->out_ifidx, pctx->p.eth_len); in ForwardEthernetFrame()
|
| H A D | ip_out.c | 88 mtcp->iom->set_wptr(mtcp->ctx, pctx->out_ifidx, pctx->p.in_ifidx, pctx->batch_index); in ForwardIPPacket() 171 rc = mtcp->iom->dev_ioctl(mtcp->ctx, nif, PKT_TX_IP_CSUM, iph); in IPOutputStandalone() 233 rc = mtcp->iom->dev_ioctl(mtcp->ctx, nif, PKT_TX_IP_CSUM, iph); in IPOutput()
|
| H A D | eventpoll.c | 402 pthread_kill(mtcp->ctx->thread, SIGUSR1); in mtcp_epoll_wait() 449 if (mtcp->ctx->done || mtcp->ctx->exit || mtcp->ctx->interrupt) { in mtcp_epoll_wait() 450 mtcp->ctx->interrupt = FALSE; in mtcp_epoll_wait()
|
| /mOS-networking-stack/samples/epwget/ |
| H A D | epwget.c | 141 if (!ctx) { in CreateContext() 152 return ctx; in CreateContext() 159 free(ctx); in DestroyContext() 458 if (keep_alive && ctx->started < ctx->target) in HandleReadEvent() 618 if (!ctx) in InitWget() 653 ctx->started = ctx->done = ctx->pending = 0; in InitWget() 654 ctx->errors = ctx->incompletes = 0; in InitWget() 699 ctx->events, ctx->maxevents, ctx->pending ? -1 : 10); in RunWget() 732 &ctx->wvars[ctx->events[i].data.sock]); in RunWget() 751 if (ctx->done >= ctx->target) { in RunWget() [all …]
|
| H A D | epwget-mp.c | 140 if (!ctx) { in CreateContext() 151 return ctx; in CreateContext() 158 free(ctx); in DestroyContext() 456 if (keep_alive && ctx->started < ctx->target) in HandleReadEvent() 616 if (!ctx) in InitWget() 651 ctx->started = ctx->done = ctx->pending = 0; in InitWget() 652 ctx->errors = ctx->incompletes = 0; in InitWget() 697 ctx->events, ctx->maxevents, ctx->pending ? -1 : 10); in RunWget() 730 &ctx->wvars[ctx->events[i].data.sock]); in RunWget() 749 if (ctx->done >= ctx->target) { in RunWget() [all …]
|
| /mOS-networking-stack/samples/lighttpd-1.4.32/src/ |
| H A D | configparser.y | 22 if (ctx->configs_stack->used > 0 && ctx->current->context_ndx == 0) { in configparser_push() 26 array_insert_unique(ctx->configs_stack, (data_unset *)ctx->current); in configparser_push() 27 ctx->current = dc; in configparser_push() 32 ctx->current = (data_config *) array_pop(ctx->configs_stack); in configparser_pop() 109 ctx->ok = 0; 147 if (ctx->ok) { in key() 178 ctx->ok = 0; in key() 224 ctx->ok = 0; in expression() 253 ctx->ok = 0; in value() 561 if (0 != config_parse_file(ctx->srv, ctx, A->ptr)) { in stringop() [all …]
|
| H A D | configparser.c | 25 if (ctx->configs_stack->used > 0 && ctx->current->context_ndx == 0) { in configparser_push() 29 array_insert_unique(ctx->configs_stack, (data_unset *)ctx->current); in configparser_push() 30 ctx->current = dc; in configparser_push() 35 ctx->current = (data_config *) array_pop(ctx->configs_stack); in configparser_pop() 176 #define configparserARG_FETCH config_t *ctx = yypParser->ctx 177 #define configparserARG_STORE yypParser->ctx = ctx 843 if (ctx->ok) { in yy_reduce() 878 ctx->ok = 0; in yy_reduce() 931 ctx->ok = 0; in yy_reduce() 967 ctx->ok = 0; in yy_reduce() [all …]
|
| H A D | mod_ssi_exprparser.c | 77 #define ssiexprparserARG_SDECL ssi_ctx_t *ctx; 78 #define ssiexprparserARG_PDECL ,ssi_ctx_t *ctx 79 #define ssiexprparserARG_FETCH ssi_ctx_t *ctx = yypParser->ctx 80 #define ssiexprparserARG_STORE yypParser->ctx = ctx 583 ctx->val.bo = ssi_val_tobool(yymsp[0].minor.yy29); in yy_reduce() 584 ctx->val.type = SSI_TYPE_BOOL; in yy_reduce() 769 ctx->ok = 0; in yy_parse_failed()
|
| H A D | mod_ssi_exprparser.y | 3 %extra_argument {ssi_ctx_t *ctx} 15 ctx->ok = 0; 30 ctx->val.bo = ssi_val_tobool(B); 31 ctx->val.type = SSI_TYPE_BOOL;
|
| H A D | fdevent.c | 132 fdevent_register(fdevents *ev, int fd, fdevent_handler handler, void *ctx) in fdevent_register() argument 139 fdn->ctx = ctx; in fdevent_register() 231 return ev->fdarray[fd]->ctx; in fdevent_get_context()
|
| H A D | fdevent.h | 60 typedef handler_t (*fdevent_handler)(struct server *srv, void *ctx, int revents); 93 void *ctx; member 197 int fdevent_register(fdevents *ev, int fd, fdevent_handler handler, void *ctx);
|
| H A D | http_auth.c | 462 li_MD5_CTX ctx, ctx1; in apr_md5_encode() local 494 li_MD5_Init(&ctx); in apr_md5_encode() 499 li_MD5_Update(&ctx, pw, strlen(pw)); in apr_md5_encode() 504 li_MD5_Update(&ctx, APR1_ID, strlen(APR1_ID)); in apr_md5_encode() 509 li_MD5_Update(&ctx, sp, sl); in apr_md5_encode() 520 li_MD5_Update(&ctx, final, in apr_md5_encode() 534 li_MD5_Update(&ctx, final, 1); in apr_md5_encode() 537 li_MD5_Update(&ctx, pw, 1); in apr_md5_encode() 549 li_MD5_Final(final, &ctx); in apr_md5_encode()
|
| H A D | mod_ssi_expr.h | 25 void ssiexprparser(void *yyp, int yymajor, buffer *yyminor, ssi_ctx_t *ctx);
|
| H A D | configfile.h | 19 void configparser(void *yyp, int yymajor, buffer *yyminor, config_t *ctx);
|
| /mOS-networking-stack/samples/epserver/ |
| H A D | epserver-mp.c | 115 mtcp_epoll_ctl(ctx->mctx, ctx->ep, MOS_EPOLL_CTL_DEL, sockid, NULL); in CloseConnection() 160 mtcp_epoll_ctl(ctx->mctx, ctx->ep, MOS_EPOLL_CTL_MOD, sockid, &ev); in SendUntilAvailable() 262 mtcp_epoll_ctl(ctx->mctx, ctx->ep, MOS_EPOLL_CTL_MOD, sockid, &ev); in HandleReadEvent() 437 if (!ctx) { in InitServer() 442 ctx->mctx = mctx; in InitServer() 446 if (ctx->ep < 0) { in InitServer() 454 if (!ctx->svars) { in InitServer() 459 ctx->listener = CreateListeningSocket(ctx); in InitServer() 479 assert(ctx); in RunServer() 480 int ep = ctx->ep; in RunServer() [all …]
|
| H A D | epserver.c | 116 mtcp_epoll_ctl(ctx->mctx, ctx->ep, MOS_EPOLL_CTL_DEL, sockid, NULL); in CloseConnection() 161 mtcp_epoll_ctl(ctx->mctx, ctx->ep, MOS_EPOLL_CTL_MOD, sockid, &ev); in SendUntilAvailable() 263 mtcp_epoll_ctl(ctx->mctx, ctx->ep, MOS_EPOLL_CTL_MOD, sockid, &ev); in HandleReadEvent() 438 if (!ctx) { in InitServer() 443 ctx->mctx = mctx; in InitServer() 447 if (ctx->ep < 0) { in InitServer() 455 if (!ctx->svars) { in InitServer() 460 ctx->listener = CreateListeningSocket(ctx); in InitServer() 480 assert(ctx); in RunServer() 481 int ep = ctx->ep; in RunServer() [all …]
|
| /mOS-networking-stack/core/src/include/ |
| H A D | io_module.h | 66 void (*init_handle)(struct mtcp_thread_context *ctx); 67 int32_t (*link_devices)(struct mtcp_thread_context *ctx); 68 …void (*release_pkt)(struct mtcp_thread_context *ctx, int ifidx, unsigned char *pkt_data, int … 69 uint8_t * (*get_wptr)(struct mtcp_thread_context *ctx, int ifidx, uint16_t len); 70 void (*set_wptr)(struct mtcp_thread_context *ctx, int out_ifidx, int in_ifidx, int idx); 71 int32_t (*send_pkts)(struct mtcp_thread_context *ctx, int nif); 72 uint8_t * (*get_rptr)(struct mtcp_thread_context *ctx, int ifidx, int index, uint16_t *len); 74 int32_t (*recv_pkts)(struct mtcp_thread_context *ctx, int ifidx); 75 int32_t (*select)(struct mtcp_thread_context *ctx); 76 void (*destroy_handle)(struct mtcp_thread_context *ctx); [all …]
|
| H A D | logger.h | 42 log_buff* DequeueFreeBuffer (log_thread_context *ctx); 43 void EnqueueJobBuffer(log_thread_context *ctx, log_buff* working_bp); 44 void InitLogThreadContext (log_thread_context *ctx, int cpu);
|
| H A D | debug.h | 17 fprintf(stderr, "[CPU %d][%10s:%4d] " f, mtcp->ctx->cpu, \ 42 fprintf(stderr, "[CPU %d][%10s:%4d] " f, mtcp->ctx->cpu, __FUNCTION__, __LINE__, ##m); \
|
| /mOS-networking-stack/samples/simple_firewall/ |
| H A D | simple_firewall.c | 375 CreateAndInitThreadContext(struct thread_context* ctx, in CreateAndInitThreadContext() argument 383 ctx->mctx = mtcp_create_context(core); in CreateAndInitThreadContext() 386 ctx->mon_listener = mtcp_socket(ctx->mctx, AF_INET, in CreateAndInitThreadContext() 388 if (ctx->mon_listener < 0) in CreateAndInitThreadContext() 392 if (mtcp_register_callback(ctx->mctx, ctx->mon_listener, in CreateAndInitThreadContext() 399 if (ctx->mctx->cpu == 0 && in CreateAndInitThreadContext() 400 mtcp_settimer(ctx->mctx, ctx->mon_listener, in CreateAndInitThreadContext() 410 mtcp_app_join(ctx->mctx); in WaitAndCleanupThreadContext() 413 mtcp_close(ctx->mctx, ctx->mon_listener); in WaitAndCleanupThreadContext() 416 mtcp_destroy_context(ctx->mctx); in WaitAndCleanupThreadContext() [all …]
|