SSI (Server Side Includes) More...
#include "core/net.h"
#include "http/http_server.h"
#include "http/http_server_misc.h"
#include "http/mime.h"
#include "http/ssi.h"
#include "str.h"
#include "debug.h"
#include "fs_port.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL HTTP_TRACE_LEVEL |
Functions | |
error_t | ssiExecuteScript (HttpConnection *connection, const char_t *uri, uint_t level) |
Execute SSI script. More... | |
error_t | ssiProcessCommand (HttpConnection *connection, const char_t *tag, size_t length, const char_t *uri, uint_t level) |
Process SSI directive. More... | |
error_t | ssiProcessIncludeCommand (HttpConnection *connection, const char_t *tag, size_t length, const char_t *uri, uint_t level) |
Process SSI include directive. More... | |
error_t | ssiProcessEchoCommand (HttpConnection *connection, const char_t *tag, size_t length) |
Process SSI echo directive. More... | |
error_t | ssiProcessExecCommand (HttpConnection *connection, const char_t *tag, size_t length) |
Process SSI exec directive. More... | |
error_t | ssiSearchTag (const char_t *s, size_t sLen, const char_t *tag, size_t tagLen, size_t *pos) |
Search a string for a given tag. More... | |
Detailed Description
SSI (Server Side Includes)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Description
Server Side Includes (SSI) is a simple interpreted server-side scripting language used to generate dynamic content to web pages
- Version
- 2.4.4
Definition in file ssi.c.
Macro Definition Documentation
◆ TRACE_LEVEL
Function Documentation
◆ ssiExecuteScript()
error_t ssiExecuteScript | ( | HttpConnection * | connection, |
const char_t * | uri, | ||
uint_t | level | ||
) |
◆ ssiProcessCommand()
error_t ssiProcessCommand | ( | HttpConnection * | connection, |
const char_t * | tag, | ||
size_t | length, | ||
const char_t * | uri, | ||
uint_t | level | ||
) |
Process SSI directive.
- Parameters
-
[in] connection Structure representing an HTTP connection [in] tag Pointer to the SSI tag [in] length Total length of the SSI tag [in] uri NULL-terminated string containing the file being processed [in] level Current level of recursion
- Returns
- Error code
◆ ssiProcessEchoCommand()
error_t ssiProcessEchoCommand | ( | HttpConnection * | connection, |
const char_t * | tag, | ||
size_t | length | ||
) |
Process SSI echo directive.
This echo directive displays the contents of a specified HTTP environment variable
- Parameters
-
[in] connection Structure representing an HTTP connection [in] tag Pointer to the SSI tag [in] length Total length of the SSI tag
- Returns
- Error code
◆ ssiProcessExecCommand()
error_t ssiProcessExecCommand | ( | HttpConnection * | connection, |
const char_t * | tag, | ||
size_t | length | ||
) |
Process SSI exec directive.
This exec directive executes a program, script, or shell command on the server. The cmd parameter specifies a server-side command. The cgi parameter specifies the path to a CGI script
- Parameters
-
[in] connection Structure representing an HTTP connection [in] tag Pointer to the SSI tag [in] length Total length of the SSI tag
- Returns
- Error code
◆ ssiProcessIncludeCommand()
error_t ssiProcessIncludeCommand | ( | HttpConnection * | connection, |
const char_t * | tag, | ||
size_t | length, | ||
const char_t * | uri, | ||
uint_t | level | ||
) |
Process SSI include directive.
This include directive allows the content of one document to be included in another. The file parameter defines the included file as relative to the document path. The virtual parameter defines the included file as relative to the document root
- Parameters
-
[in] connection Structure representing an HTTP connection [in] tag Pointer to the SSI tag [in] length Total length of the SSI tag [in] uri NULL-terminated string containing the file being processed [in] level Current level of recursion
- Returns
- Error code
◆ ssiSearchTag()
error_t ssiSearchTag | ( | const char_t * | s, |
size_t | sLen, | ||
const char_t * | tag, | ||
size_t | tagLen, | ||
size_t * | pos | ||
) |
Search a string for a given tag.
- Parameters
-
[in] s String to search [in] sLen Length of the string to search [in] tag String containing the tag to search for [in] tagLen Length of the tag [out] pos The index of the first occurrence of the tag in the string,
- Return values
-
NO_ERROR if the specified tag has been found ERROR_PARTIAL_MATCH if a partial match occurs ERROR_NO_MATCH if the tag does not appear in the string