diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:01:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:01:30 +0000 |
commit | 6beeb1b708550be0d4a53b272283e17e5e35fe17 (patch) | |
tree | 1ce8673d4aaa948e5554000101f46536a1e4cc29 /os/netware | |
parent | Initial commit. (diff) | |
download | apache2-6beeb1b708550be0d4a53b272283e17e5e35fe17.tar.xz apache2-6beeb1b708550be0d4a53b272283e17e5e35fe17.zip |
Adding upstream version 2.4.57.upstream/2.4.57
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'os/netware')
-rw-r--r-- | os/netware/apache.xdc | bin | 0 -> 128 bytes | |||
-rw-r--r-- | os/netware/modules.c | 117 | ||||
-rw-r--r-- | os/netware/netware_config_layout.h | 31 | ||||
-rw-r--r-- | os/netware/os.h | 57 | ||||
-rw-r--r-- | os/netware/pre_nw.h | 70 | ||||
-rw-r--r-- | os/netware/util_nw.c | 112 |
6 files changed, 387 insertions, 0 deletions
diff --git a/os/netware/apache.xdc b/os/netware/apache.xdc Binary files differnew file mode 100644 index 0000000..12a7f6b --- /dev/null +++ b/os/netware/apache.xdc diff --git a/os/netware/modules.c b/os/netware/modules.c new file mode 100644 index 0000000..2a7beee --- /dev/null +++ b/os/netware/modules.c @@ -0,0 +1,117 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* modules.c --- major modules compiled into Apache for NetWare. + * Only insert an entry for a module if it must be compiled into + * the core server + */ + + +#include "httpd.h" +#include "http_config.h" + +extern module core_module; +extern module mpm_netware_module; +extern module http_module; +extern module so_module; +extern module mime_module; +extern module authn_core_module; +extern module authz_core_module; +extern module authz_host_module; +extern module negotiation_module; +extern module include_module; +extern module dir_module; +extern module alias_module; +extern module env_module; +extern module log_config_module; +extern module setenvif_module; +extern module watchdog_module; +#ifdef USE_WINSOCK +extern module nwssl_module; +#endif +extern module netware_module; + +module *ap_prelinked_modules[] = { + &core_module, /* core must come first */ + &mpm_netware_module, + &http_module, + &so_module, + &mime_module, + &authn_core_module, + &authz_core_module, + &authz_host_module, + &negotiation_module, + &include_module, + &dir_module, + &alias_module, + &env_module, + &log_config_module, + &setenvif_module, + &watchdog_module, +#ifdef USE_WINSOCK + &nwssl_module, +#endif + &netware_module, + NULL +}; + +ap_module_symbol_t ap_prelinked_module_symbols[] = { + {"core_module", &core_module}, + {"mpm_netware_module", &mpm_netware_module}, + {"http_module", &http_module}, + {"so_module", &so_module}, + {"mime_module", &mime_module}, + {"authn_core_module", &authn_core_module}, + {"authz_core_module", &authz_core_module}, + {"authz_host_module", &authz_host_module}, + {"negotiation_module", &negotiation_module}, + {"include_module", &include_module}, + {"dir_module", &dir_module}, + {"alias_module", &alias_module}, + {"env_module", &env_module}, + {"log_config_module", &log_config_module}, + {"setenvif_module", &setenvif_module}, + {"watchdog module", &watchdog_module}, +#ifdef USE_WINSOCK + {"nwssl_module", &nwssl_module}, +#endif + {"netware_module", &netware_module}, + {NULL, NULL} +}; + +module *ap_preloaded_modules[] = { + &core_module, + &mpm_netware_module, + &http_module, + &so_module, + &mime_module, + &authn_core_module, + &authz_core_module, + &authz_host_module, + &negotiation_module, + &include_module, + &dir_module, + &alias_module, + &env_module, + &log_config_module, + &setenvif_module, + &watchdog_module, +#ifdef USE_WINSOCK + &nwssl_module, +#endif + &netware_module, + NULL +}; diff --git a/os/netware/netware_config_layout.h b/os/netware/netware_config_layout.h new file mode 100644 index 0000000..29d3320 --- /dev/null +++ b/os/netware/netware_config_layout.h @@ -0,0 +1,31 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file netware/netware_config_layout.h + * @brief This provides layout definitions for non-autoconf-based NetWare + * builds, and is copied to include/ap_config_layout.h during the build. + */ + +#ifndef AP_CONFIG_LAYOUT_H +#define AP_CONFIG_LAYOUT_H + +/* Check for definition of DEFAULT_REL_RUNTIMEDIR */ +#ifndef DEFAULT_REL_RUNTIMEDIR +#define DEFAULT_REL_RUNTIMEDIR "logs" +#endif + +#endif /* AP_CONFIG_LAYOUT_H */ diff --git a/os/netware/os.h b/os/netware/os.h new file mode 100644 index 0000000..3c2209c --- /dev/null +++ b/os/netware/os.h @@ -0,0 +1,57 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file netware/os.h + * @brief This file in included in all Apache source code. It contains definitions + * of facilities available on _this_ operating system (HAVE_* macros), + * and prototypes of OS specific functions defined in os.c or os-inline.c + * + * @defgroup APACHE_OS_NETWARE netware + * @ingroup APACHE_OS + * @{ + */ + +#ifndef APACHE_OS_H +#define APACHE_OS_H + +#ifndef PLATFORM +#define PLATFORM "NETWARE" +#endif + +/* Define command-line rewriting for this platform, handled by core. + * For Netware, this is currently handled inside the Netware MPM. + * XXX To support a choice of MPMs, extract common platform behavior + * into a function specified here. + */ +#define AP_PLATFORM_REWRITE_ARGS_HOOK NULL + +#include <screen.h> + +AP_DECLARE_DATA extern int hold_screen_on_exit; /* Indicates whether the screen should be held open on exit*/ + +#define CASE_BLIND_FILESYSTEM +#define NO_WRITEV + +#define getpid NXThreadGetId + +/* Hold the screen open if there is an exit code and the hold_screen_on_exit flag >= 0 or the + hold_screen_on_exit > 0. If the hold_screen_on_exit flag is < 0 then close the screen no + matter what the exit code is. */ +#define exit(s) {if((s||hold_screen_on_exit)&&(hold_screen_on_exit>=0)){pressanykey();}apr_terminate();exit(s);} + +#endif /* ! APACHE_OS_H */ +/** @} */ diff --git a/os/netware/pre_nw.h b/os/netware/pre_nw.h new file mode 100644 index 0000000..eef1f6f --- /dev/null +++ b/os/netware/pre_nw.h @@ -0,0 +1,70 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file pre_nw.h + * @brief Definitions for Netware systems + * + * @addtogroup APACHE_OS_NETWARE + * @{ + */ + +#ifndef __pre_nw__ +#define __pre_nw__ + +#include <stdint.h> + +#ifndef __GNUC__ +#pragma precompile_target "precomp.mch" +#endif + +#define NETWARE + +#define N_PLAT_NLM + +/* hint for MSL C++ that we're on NetWare platform */ +#define __NETWARE__ + +/* the FAR keyword has no meaning in a 32-bit environment + but is used in the SDK headers so we take it out */ +#define FAR +#define far + +/* no-op for Codewarrior C compiler; a functions are cdecl + by default */ +#define cdecl + +/* if we have wchar_t enabled in C++, predefine this type to avoid + a conflict in Novell's header files */ +#ifndef __GNUC__ +#if (__option(cplusplus) && __option(wchar_type)) +#define _WCHAR_T +#endif +#endif + +/* C9X definition used by MSL C++ library */ +#define DECIMAL_DIG 17 + +/* some code may want to use the MS convention for long long */ +#ifndef __int64 +#define __int64 long long +#endif + +/* Restrict the number of nested includes */ +#define AP_MAX_INCLUDE_DEPTH 48 + +#endif +/** @} */ diff --git a/os/netware/util_nw.c b/os/netware/util_nw.c new file mode 100644 index 0000000..97845d4 --- /dev/null +++ b/os/netware/util_nw.c @@ -0,0 +1,112 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "httpd.h" +#include "http_log.h" +#include "ap_mpm.h" + +#include <netware.h> +#include <nks/netware.h> +#include <nks/vm.h> + +void ap_down_server_cb(void *, void *); +void ap_dummy_cb(void *, void *); +void ap_cb_destroy(void *); + +int nlmUnloadSignaled(int wait); +event_handle_t eh; +Warn_t ref; +Report_t dum; + +AP_DECLARE(apr_status_t) ap_os_create_privileged_process( + const request_rec *r, + apr_proc_t *newproc, const char *progname, + const char * const *args, + const char * const *env, + apr_procattr_t *attr, apr_pool_t *p) +{ + return apr_proc_create(newproc, progname, args, env, attr, p); +} + +int _NonAppCheckUnload(void) +{ + return nlmUnloadSignaled(1); +} + +/* down server event callback */ +void ap_down_server_cb(void *a, void *b) +{ + nlmUnloadSignaled(0); + return; +} + +/* Required place holder event callback */ +void ap_dummy_cb(void *a, void *b) +{ + return; +} + +/* destroy callback resources */ +void ap_cb_destroy(void *a) +{ + /* cleanup down event notification */ + UnRegisterEventNotification(eh); + NX_UNWRAP_INTERFACE(ref); + NX_UNWRAP_INTERFACE(dum); +} + +int _NonAppStart +( + void *NLMHandle, + void *errorScreen, + const char *cmdLine, + const char *loadDirPath, + size_t uninitializedDataLength, + void *NLMFileHandle, + int (*readRoutineP)( int conn, void *fileHandle, size_t offset, + size_t nbytes, size_t *bytesRead, void *buffer ), + size_t customDataOffset, + size_t customDataSize, + int messageCount, + const char **messages +) +{ +#pragma unused(cmdLine) +#pragma unused(loadDirPath) +#pragma unused(uninitializedDataLength) +#pragma unused(NLMFileHandle) +#pragma unused(readRoutineP) +#pragma unused(customDataOffset) +#pragma unused(customDataSize) +#pragma unused(messageCount) +#pragma unused(messages) + + /* register for down server event */ + rtag_t rt = AllocateResourceTag(NLMHandle, "Apache2 Down Server Callback", + EventSignature); + + NX_WRAP_INTERFACE((void *)ap_down_server_cb, 2, (void **)&ref); + NX_WRAP_INTERFACE((void *)ap_dummy_cb, 2, (void **)&dum); + eh = RegisterForEventNotification(rt, EVENT_DOWN_SERVER, + EVENT_PRIORITY_APPLICATION, + ref, dum, NULL); + + /* clean-up */ + NXVmRegisterExitHandler(ap_cb_destroy, NULL); + + return 0; +} + |