10Sigor@sysoev.ru 20Sigor@sysoev.ru /* 384Smax.romanov@nginx.com * Copyright (C) Max Romanov 40Sigor@sysoev.ru * Copyright (C) Valentin V. Bartenev 50Sigor@sysoev.ru * Copyright (C) NGINX, Inc. 60Sigor@sysoev.ru */ 70Sigor@sysoev.ru 80Sigor@sysoev.ru #ifndef _NXT_APPLICATION_H_INCLUDED_ 90Sigor@sysoev.ru #define _NXT_APPLICATION_H_INCLUDED_ 100Sigor@sysoev.ru 110Sigor@sysoev.ru 12678Svbart@nginx.com #include <nxt_conf.h> 13678Svbart@nginx.com 14743Smax.romanov@nginx.com #include <nxt_unit_typedefs.h> 15743Smax.romanov@nginx.com 16678Svbart@nginx.com 17133Sigor@sysoev.ru typedef enum { 18804Svbart@nginx.com NXT_APP_EXTERNAL, 19141Smax.romanov@nginx.com NXT_APP_PYTHON, 20133Sigor@sysoev.ru NXT_APP_PHP, 21510Salexander.borisov@nginx.com NXT_APP_PERL, 22584Salexander.borisov@nginx.com NXT_APP_RUBY, 23977Smax.romanov@gmail.com NXT_APP_JAVA, 24141Smax.romanov@nginx.com 25216Sigor@sysoev.ru NXT_APP_UNKNOWN, 26133Sigor@sysoev.ru } nxt_app_type_t; 27133Sigor@sysoev.ru 28133Sigor@sysoev.ru 29216Sigor@sysoev.ru typedef struct nxt_app_module_s nxt_app_module_t; 30*1488St.nateldemoura@f5.com typedef nxt_int_t (*nxt_application_setup_t)(nxt_task_t *task, 31*1488St.nateldemoura@f5.com nxt_process_t *process, nxt_common_app_conf_t *conf); 32216Sigor@sysoev.ru 33216Sigor@sysoev.ru 34216Sigor@sysoev.ru typedef struct { 35356Svbart@nginx.com nxt_app_type_t type; 36354Svbart@nginx.com u_char *version; 37216Sigor@sysoev.ru char *file; 38743Smax.romanov@nginx.com nxt_app_module_t *module; 39216Sigor@sysoev.ru } nxt_app_lang_module_t; 40216Sigor@sysoev.ru 41216Sigor@sysoev.ru 42141Smax.romanov@nginx.com typedef struct { 43804Svbart@nginx.com char *executable; 44804Svbart@nginx.com nxt_conf_value_t *arguments; 45804Svbart@nginx.com } nxt_external_app_conf_t; 46804Svbart@nginx.com 47804Svbart@nginx.com 48804Svbart@nginx.com typedef struct { 49394Smax.romanov@nginx.com char *home; 50141Smax.romanov@nginx.com nxt_str_t path; 51141Smax.romanov@nginx.com nxt_str_t module; 52141Smax.romanov@nginx.com } nxt_python_app_conf_t; 53141Smax.romanov@nginx.com 54141Smax.romanov@nginx.com 55141Smax.romanov@nginx.com typedef struct { 561473Svbart@nginx.com nxt_conf_value_t *targets; 57687Svbart@nginx.com nxt_conf_value_t *options; 58141Smax.romanov@nginx.com } nxt_php_app_conf_t; 59141Smax.romanov@nginx.com 60141Smax.romanov@nginx.com 61141Smax.romanov@nginx.com typedef struct { 62510Salexander.borisov@nginx.com char *script; 63510Salexander.borisov@nginx.com } nxt_perl_app_conf_t; 64510Salexander.borisov@nginx.com 65510Salexander.borisov@nginx.com 66584Salexander.borisov@nginx.com typedef struct { 67584Salexander.borisov@nginx.com nxt_str_t script; 68584Salexander.borisov@nginx.com } nxt_ruby_app_conf_t; 69584Salexander.borisov@nginx.com 70584Salexander.borisov@nginx.com 71977Smax.romanov@gmail.com typedef struct { 72977Smax.romanov@gmail.com nxt_conf_value_t *classpath; 73977Smax.romanov@gmail.com char *webapp; 74977Smax.romanov@gmail.com nxt_conf_value_t *options; 75977Smax.romanov@gmail.com char *unit_jars; 76977Smax.romanov@gmail.com } nxt_java_app_conf_t; 77977Smax.romanov@gmail.com 78977Smax.romanov@gmail.com 79141Smax.romanov@nginx.com struct nxt_common_app_conf_s { 80678Svbart@nginx.com nxt_str_t name; 81678Svbart@nginx.com nxt_str_t type; 82678Svbart@nginx.com nxt_str_t user; 83678Svbart@nginx.com nxt_str_t group; 84141Smax.romanov@nginx.com 85678Svbart@nginx.com char *working_directory; 86678Svbart@nginx.com nxt_conf_value_t *environment; 87271Smax.romanov@nginx.com 881182St.nateldemoura@f5.com nxt_conf_value_t *isolation; 891320Smax.romanov@nginx.com nxt_conf_value_t *limits; 901320Smax.romanov@nginx.com 911320Smax.romanov@nginx.com size_t shm_limit; 921182St.nateldemoura@f5.com 93141Smax.romanov@nginx.com union { 94804Svbart@nginx.com nxt_external_app_conf_t external; 95804Svbart@nginx.com nxt_python_app_conf_t python; 96804Svbart@nginx.com nxt_php_app_conf_t php; 97804Svbart@nginx.com nxt_perl_app_conf_t perl; 98804Svbart@nginx.com nxt_ruby_app_conf_t ruby; 99977Smax.romanov@gmail.com nxt_java_app_conf_t java; 100141Smax.romanov@nginx.com } u; 1011473Svbart@nginx.com 1021473Svbart@nginx.com nxt_conf_value_t *self; 103141Smax.romanov@nginx.com }; 104141Smax.romanov@nginx.com 105141Smax.romanov@nginx.com 106216Sigor@sysoev.ru struct nxt_app_module_s { 107258Sigor@sysoev.ru size_t compat_length; 108258Sigor@sysoev.ru uint32_t *compat; 109258Sigor@sysoev.ru 110216Sigor@sysoev.ru nxt_str_t type; 111612Salexander.borisov@nginx.com const char *version; 112141Smax.romanov@nginx.com 113*1488St.nateldemoura@f5.com nxt_application_setup_t setup; 114*1488St.nateldemoura@f5.com nxt_process_start_t start; 115141Smax.romanov@nginx.com }; 1160Sigor@sysoev.ru 1170Sigor@sysoev.ru 118216Sigor@sysoev.ru nxt_app_lang_module_t *nxt_app_lang_module(nxt_runtime_t *rt, nxt_str_t *name); 119510Salexander.borisov@nginx.com nxt_app_type_t nxt_app_parse_type(u_char *p, size_t length); 120216Sigor@sysoev.ru 121743Smax.romanov@nginx.com NXT_EXPORT extern nxt_str_t nxt_server; 122804Svbart@nginx.com extern nxt_app_module_t nxt_external_module; 123743Smax.romanov@nginx.com 124743Smax.romanov@nginx.com NXT_EXPORT nxt_int_t nxt_unit_default_init(nxt_task_t *task, 125743Smax.romanov@nginx.com nxt_unit_init_t *init); 126216Sigor@sysoev.ru 127216Sigor@sysoev.ru 1280Sigor@sysoev.ru #endif /* _NXT_APPLICATION_H_INCLIDED_ */ 129