Defines | Typedefs | Enumerations | Functions | Variables

ts.h File Reference

Traffic Server SDK API header file. More...

#include "apidefs.h"
Include dependency graph for ts.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define TSmalloc(s)   _TSmalloc ((s), TS_RES_MEM_PATH)
#define TSrealloc(p, s)   _TSrealloc ((p), (s), TS_RES_MEM_PATH)
#define TSstrdup(p)   _TSstrdup ((p), -1, TS_RES_MEM_PATH)
#define TSstrndup(p, n)   _TSstrdup ((p), (n), TS_RES_MEM_PATH)
#define TSstrlcpy(d, s, l)   _TSstrlcpy ((d), (s), (l))
#define TSstrlcat(d, s, l)   _TSstrlcat ((d), (s), (l))
#define TSfree(p)   _TSfree (p)
#define TSReleaseAssert(EX)   ( (void)((EX) ? (void)0 : _TSReleaseAssert(#EX, __FILE__, __LINE__)) )
#define TSAssert(EX)   (void)((EX) || (_TSAssert(#EX, __FILE__, __LINE__)))
#define TSDEBUG   if (diags_on_for_plugins) TSDebug

Typedefs

typedef struct
tsapi_textlogobject * 
TSTextLogObject
 This type represents a custom log file that you create with TSTextLogObjectCreate().
typedef void(* TSRecordDumpCb )(TSRecordType rec_type, void *edata, int registered, const char *name, TSRecordDataType data_type, TSRecordData *datum)

Enumerations

enum  TSStatPersistence { TS_STAT_PERSISTENT = 1, TS_STAT_NON_PERSISTENT }
enum  TSStatSync { TS_STAT_SYNC_SUM = 0, TS_STAT_SYNC_COUNT, TS_STAT_SYNC_AVG, TS_STAT_SYNC_TIMEAVG }
enum  { TS_LOG_MODE_ADD_TIMESTAMP = 1, TS_LOG_MODE_DO_NOT_RENAME = 2, TS_LOG_MODE_INVALID_FLAG = 4 }
 

The following enum values are flags, so they should be powers of two.

More...

Functions

tsapi void * _TSmalloc (size_t size, const char *path)
tsapi void * _TSrealloc (void *ptr, size_t size, const char *path)
tsapi char * _TSstrdup (const char *str, int64_t length, const char *path)
tsapi size_t _TSstrlcpy (char *dst, const char *str, size_t siz)
tsapi size_t _TSstrlcat (char *dst, const char *str, size_t siz)
tsapi void _TSfree (void *ptr)
tsapi TSReturnCode TSHandleMLocRelease (TSMBuffer bufp, TSMLoc parent, TSMLoc mloc)
 Releases the TSMLoc mloc created from the TSMLoc parent.
tsapi const char * TSInstallDirGet (void)
 Gets the path of the directory in which Traffic Server is installed.
tsapi const char * TSConfigDirGet (void)
 Gets the path of the directory of Traffic Server configuration.
tsapi const char * TSPluginDirGet (void)
 Gets the path of the plugin directory relative to the Traffic Server install directory.
tsapi const char * TSTrafficServerVersionGet (void)
 Gets the version of Traffic Server currently running.
int TSTrafficServerVersionGetMajor (void)
 Get the major version of Traffic Server currently running.
int TSTrafficServerVersionGetMinor (void)
 Get the minor version of Traffic Server currently running.
int TSTrafficServerVersionGetPatch (void)
 Get the patch version of Traffic Server currently running.
tsapi TSReturnCode TSPluginRegister (TSSDKVersion sdk_version, TSPluginRegistrationInfo *plugin_info)
 This function registers your plugin with a particular version of Traffic Server SDK.
tsapi TSFile TSfopen (const char *filename, const char *mode)
 Opens a file for reading or writing and returns a descriptor for accessing the file.
tsapi void TSfclose (TSFile filep)
 Closes the file to which filep points and frees the data structures and buffers associated with it.
tsapi size_t TSfread (TSFile filep, void *buf, size_t length)
 Attempts to read length bytes of data from the file pointed to by filep into the buffer buf.
tsapi size_t TSfwrite (TSFile filep, const void *buf, size_t length)
 Attempts to write length bytes of data from the buffer buf to the file filep.
tsapi void TSfflush (TSFile filep)
 Flushes pending data that has been buffered up in memory from previous calls to TSfwrite().
tsapi char * TSfgets (TSFile filep, char *buf, size_t length)
 Reads a line from the file pointed to by filep into the buffer buf.
tsapi void TSError (const char *fmt,...) TS_PRINTFLIKE(1
 Writes printf-style error messages to the Traffic Server error log.
tsapi void tsapi void _TSReleaseAssert (const char *txt, const char *f, int l) TS_NORETURN
tsapi int _TSAssert (const char *txt, const char *f, int l)
tsapi TSMBuffer TSMBufferCreate (void)
 Creates a new marshal buffer and initializes the reference count to 1.
tsapi TSReturnCode TSMBufferDestroy (TSMBuffer bufp)
 Ignores the reference count and destroys the marshal buffer bufp.
tsapi TSReturnCode TSUrlCreate (TSMBuffer bufp, TSMLoc *locp)
 Creates a new URL within the marshal buffer bufp.
tsapi TS_DEPRECATED TSReturnCode TSUrlDestroy (TSMBuffer bufp, TSMLoc offset)
 Destroys the URL located at url_loc within the marshal buffer bufp.
tsapi TSReturnCode TSUrlClone (TSMBuffer dest_bufp, TSMBuffer src_bufp, TSMLoc src_url, TSMLoc *locp)
 Copies the URL located at src_url within src_bufp to a URL location within the marshal buffer dest_bufp, and returns the TSMLoc location of the copied URL.
tsapi TSReturnCode TSUrlCopy (TSMBuffer dest_bufp, TSMLoc dest_offset, TSMBuffer src_bufp, TSMLoc src_offset)
 Copies the contents of the URL at location src_loc within the marshal buffer src_bufp to the location dest_loc within the marshal buffer dest_bufp.
tsapi void TSUrlPrint (TSMBuffer bufp, TSMLoc offset, TSIOBuffer iobufp)
 Formats a URL stored in an TSMBuffer into an TSIOBuffer.
tsapi TSParseResult TSUrlParse (TSMBuffer bufp, TSMLoc offset, const char **start, const char *end)
 Parses a URL.
tsapi int TSUrlLengthGet (TSMBuffer bufp, TSMLoc offset)
 Calculates the length of the URL located at url_loc within the marshal buffer bufp if it were returned as a string.
tsapi char * TSUrlStringGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Constructs a string representation of the URL located at url_loc within bufp.
tsapi const char * TSUrlSchemeGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Retrieves the scheme portion of the URL located at url_loc within the marshal buffer bufp.
tsapi TSReturnCode TSUrlSchemeSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
 Sets the scheme portion of the URL located at url_loc within the marshal buffer bufp to the string value.
tsapi const char * TSUrlUserGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Retrieves the user portion of the URL located at url_loc within bufp.
tsapi TSReturnCode TSUrlUserSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
 Sets the user portion of the URL located at url_loc within bufp to the string value.
tsapi const char * TSUrlPasswordGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Retrieves the password portion of the URL located at url_loc within bufp.
tsapi TSReturnCode TSUrlPasswordSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
 Sets the password portion of the URL located at url_loc within bufp to the string value.
tsapi const char * TSUrlHostGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Retrieves the host portion of the URL located at url_loc within bufp.
tsapi TSReturnCode TSUrlHostSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
 Sets the host portion of the URL at url_loc to the string value.
tsapi int TSUrlPortGet (TSMBuffer bufp, TSMLoc offset)
 Retrieves the port portion of the URL located at url_loc.
tsapi TSReturnCode TSUrlPortSet (TSMBuffer bufp, TSMLoc offset, int port)
 Sets the port portion of the URL located at url_loc.
tsapi const char * TSUrlPathGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Retrieves the path portion of the URL located at url_loc within bufp.
tsapi TSReturnCode TSUrlPathSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
 Sets the path portion of the URL located at url_loc within bufp to the string value.
tsapi int TSUrlFtpTypeGet (TSMBuffer bufp, TSMLoc offset)
 Retrieves the FTP type of the URL located at url_loc within bufp.
tsapi TSReturnCode TSUrlFtpTypeSet (TSMBuffer bufp, TSMLoc offset, int type)
 Sets the FTP type portion of the URL located at url_loc within bufp to the value type.
tsapi const char * TSUrlHttpParamsGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Retrieves the HTTP params portion of the URL located at url_loc within bufp.
tsapi TSReturnCode TSUrlHttpParamsSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
 Sets the HTTP params portion of the URL located at url_loc within bufp to the string value.
tsapi const char * TSUrlHttpQueryGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Retrieves the HTTP query portion of the URL located at url_loc within bufp.
tsapi TSReturnCode TSUrlHttpQuerySet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
 Sets the HTTP query portion of the URL located at url_loc within bufp to value.
tsapi const char * TSUrlHttpFragmentGet (TSMBuffer bufp, TSMLoc offset, int *length)
 Retrieves the HTTP fragment portion of the URL located at url_loc within bufp.
tsapi TSReturnCode TSUrlHttpFragmentSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
 Sets the HTTP fragment portion of the URL located at url_loc within bufp to value.
tsapi TSReturnCode TSStringPercentEncode (const char *str, int str_len, char *dst, size_t dst_size, size_t *length, const unsigned char *map)
 Perform percent-encoding of the string in the buffer, storing the new string in the destination buffer.
tsapi TSReturnCode TSUrlPercentEncode (TSMBuffer bufp, TSMLoc offset, char *dst, size_t dst_size, size_t *length, const unsigned char *map)
 Similar to TSStringPercentEncode(), but works on a URL object.
tsapi TSReturnCode TSStringPercentDecode (const char *str, size_t str_len, char *dst, size_t dst_size, size_t *length)
 Perform percent-decoding of the string in the buffer, writing to the output buffer.
tsapi TSMimeParser TSMimeParserCreate (void)
 Creates a MIME parser.
tsapi void TSMimeParserClear (TSMimeParser parser)
 Clears the specified MIME parser so that it can be used again.
tsapi void TSMimeParserDestroy (TSMimeParser parser)
 Destroys the specified MIME parser and frees the associated memory.
tsapi TSReturnCode TSMimeHdrCreate (TSMBuffer bufp, TSMLoc *locp)
 Creates a new MIME header within bufp.
tsapi TSReturnCode TSMimeHdrDestroy (TSMBuffer bufp, TSMLoc offset)
 Destroys the MIME header located at hdr_loc within bufp.
tsapi TSReturnCode TSMimeHdrClone (TSMBuffer dest_bufp, TSMBuffer src_bufp, TSMLoc src_hdr, TSMLoc *locp)
 Copies a specified MIME header to a specified marshal buffer, and returns the location of the copied MIME header within the destination marshal buffer.
tsapi TSReturnCode TSMimeHdrCopy (TSMBuffer dest_bufp, TSMLoc dest_offset, TSMBuffer src_bufp, TSMLoc src_offset)
 Copies the contents of the MIME header located at src_loc within src_bufp to the MIME header located at dest_loc within dest_bufp.
tsapi void TSMimeHdrPrint (TSMBuffer bufp, TSMLoc offset, TSIOBuffer iobufp)
 Formats the MIME header located at hdr_loc within bufp into the TSIOBuffer iobufp.
tsapi TSParseResult TSMimeHdrParse (TSMimeParser parser, TSMBuffer bufp, TSMLoc offset, const char **start, const char *end)
 Parses a MIME header.
tsapi int TSMimeHdrLengthGet (TSMBuffer bufp, TSMLoc offset)
 Calculates the length of the MIME header located at hdr_loc if it were returned as a string.
tsapi TSReturnCode TSMimeHdrFieldsClear (TSMBuffer bufp, TSMLoc offset)
 Removes and destroys all the MIME fields within the MIME header located at hdr_loc within the marshal buffer bufp.
tsapi int TSMimeHdrFieldsCount (TSMBuffer bufp, TSMLoc offset)
 Returns a count of the number of MIME fields within the MIME header located at hdr_loc within the marshal buffer bufp.
tsapi TSMLoc TSMimeHdrFieldGet (TSMBuffer bufp, TSMLoc hdr, int idx)
 Retrieves the location of a specified MIME field within the MIME header located at hdr_loc within bufp.
tsapi TSMLoc TSMimeHdrFieldFind (TSMBuffer bufp, TSMLoc hdr, const char *name, int length)
 Retrieves the TSMLoc location of a specified MIME field from within the MIME header located at hdr.
tsapi TSReturnCode TSMimeHdrFieldAppend (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
 Returns the TSMLoc location of a specified MIME field from within the MIME header located at hdr.
tsapi TSReturnCode TSMimeHdrFieldRemove (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
 Removes the MIME field located at field within bufp from the header located at hdr within bufp.
tsapi TSReturnCode TSMimeHdrFieldCreate (TSMBuffer bufp, TSMLoc hdr, TSMLoc *locp)
tsapi TSReturnCode TSMimeHdrFieldCreateNamed (TSMBuffer bufp, TSMLoc mh_mloc, const char *name, int name_len, TSMLoc *locp)
tsapi TSReturnCode TSMimeHdrFieldDestroy (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
 Destroys the MIME field located at field within bufp.
tsapi TSReturnCode TSMimeHdrFieldClone (TSMBuffer dest_bufp, TSMLoc dest_hdr, TSMBuffer src_bufp, TSMLoc src_hdr, TSMLoc src_field, TSMLoc *locp)
tsapi TSReturnCode TSMimeHdrFieldCopy (TSMBuffer dest_bufp, TSMLoc dest_hdr, TSMLoc dest_field, TSMBuffer src_bufp, TSMLoc src_hdr, TSMLoc src_field)
tsapi TSReturnCode TSMimeHdrFieldCopyValues (TSMBuffer dest_bufp, TSMLoc dest_hdr, TSMLoc dest_field, TSMBuffer src_bufp, TSMLoc src_hdr, TSMLoc src_field)
tsapi TSMLoc TSMimeHdrFieldNext (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
tsapi TSMLoc TSMimeHdrFieldNextDup (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
tsapi int TSMimeHdrFieldLengthGet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
tsapi const char * TSMimeHdrFieldNameGet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int *length)
tsapi TSReturnCode TSMimeHdrFieldNameSet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, const char *name, int length)
tsapi TSReturnCode TSMimeHdrFieldValuesClear (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
tsapi int TSMimeHdrFieldValuesCount (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
tsapi const char * TSMimeHdrFieldValueStringGet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, int *value_len_ptr)
tsapi int TSMimeHdrFieldValueIntGet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx)
tsapi int64_t TSMimeHdrFieldValueInt64Get (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx)
tsapi unsigned int TSMimeHdrFieldValueUintGet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx)
tsapi time_t TSMimeHdrFieldValueDateGet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field)
tsapi TSReturnCode TSMimeHdrFieldValueStringSet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, const char *value, int length)
tsapi TSReturnCode TSMimeHdrFieldValueIntSet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, int value)
tsapi TSReturnCode TSMimeHdrFieldValueInt64Set (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, int64_t value)
tsapi TSReturnCode TSMimeHdrFieldValueUintSet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, unsigned int value)
tsapi TSReturnCode TSMimeHdrFieldValueDateSet (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, time_t value)
tsapi TSReturnCode TSMimeHdrFieldValueAppend (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, const char *value, int length)
tsapi TSReturnCode TSMimeHdrFieldValueStringInsert (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, const char *value, int length)
tsapi TSReturnCode TSMimeHdrFieldValueIntInsert (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, int value)
tsapi TSReturnCode TSMimeHdrFieldValueUintInsert (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx, unsigned int value)
tsapi TSReturnCode TSMimeHdrFieldValueDateInsert (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, time_t value)
tsapi TSReturnCode TSMimeHdrFieldValueDelete (TSMBuffer bufp, TSMLoc hdr, TSMLoc field, int idx)
tsapi TSHttpParser TSHttpParserCreate (void)
tsapi void TSHttpParserClear (TSHttpParser parser)
tsapi void TSHttpParserDestroy (TSHttpParser parser)
tsapi TSParseResult TSHttpHdrParseReq (TSHttpParser parser, TSMBuffer bufp, TSMLoc offset, const char **start, const char *end)
 Parses an HTTP request header.
tsapi TSParseResult TSHttpHdrParseResp (TSHttpParser parser, TSMBuffer bufp, TSMLoc offset, const char **start, const char *end)
tsapi TSMLoc TSHttpHdrCreate (TSMBuffer bufp)
tsapi void TSHttpHdrDestroy (TSMBuffer bufp, TSMLoc offset)
 Destroys the HTTP header located at hdr_loc within the marshal buffer bufp.
tsapi TSReturnCode TSHttpHdrClone (TSMBuffer dest_bufp, TSMBuffer src_bufp, TSMLoc src_hdr, TSMLoc *locp)
tsapi TSReturnCode TSHttpHdrCopy (TSMBuffer dest_bufp, TSMLoc dest_offset, TSMBuffer src_bufp, TSMLoc src_offset)
 Copies the contents of the HTTP header located at src_loc within src_bufp to the HTTP header located at dest_loc within dest_bufp.
tsapi void TSHttpHdrPrint (TSMBuffer bufp, TSMLoc offset, TSIOBuffer iobufp)
tsapi int TSHttpHdrLengthGet (TSMBuffer bufp, TSMLoc offset)
tsapi TSHttpType TSHttpHdrTypeGet (TSMBuffer bufp, TSMLoc offset)
tsapi TSReturnCode TSHttpHdrTypeSet (TSMBuffer bufp, TSMLoc offset, TSHttpType type)
tsapi int TSHttpHdrVersionGet (TSMBuffer bufp, TSMLoc offset)
tsapi TSReturnCode TSHttpHdrVersionSet (TSMBuffer bufp, TSMLoc offset, int ver)
tsapi const char * TSHttpHdrMethodGet (TSMBuffer bufp, TSMLoc offset, int *length)
tsapi TSReturnCode TSHttpHdrMethodSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
tsapi TSReturnCode TSHttpHdrUrlGet (TSMBuffer bufp, TSMLoc offset, TSMLoc *locp)
tsapi TSReturnCode TSHttpHdrUrlSet (TSMBuffer bufp, TSMLoc offset, TSMLoc url)
tsapi TSHttpStatus TSHttpHdrStatusGet (TSMBuffer bufp, TSMLoc offset)
tsapi TSReturnCode TSHttpHdrStatusSet (TSMBuffer bufp, TSMLoc offset, TSHttpStatus status)
tsapi const char * TSHttpHdrReasonGet (TSMBuffer bufp, TSMLoc offset, int *length)
tsapi TSReturnCode TSHttpHdrReasonSet (TSMBuffer bufp, TSMLoc offset, const char *value, int length)
tsapi const char * TSHttpHdrReasonLookup (TSHttpStatus status)
tsapi TSThread TSThreadCreate (TSThreadFunc func, void *data)
tsapi TSThread TSThreadInit (void)
tsapi void TSThreadDestroy (TSThread thread)
tsapi TSThread TSThreadSelf (void)
tsapi TSMutex TSMutexCreate (void)
tsapi void TSMutexLock (TSMutex mutexp)
tsapi TSReturnCode TSMutexLockTry (TSMutex mutexp)
tsapi void TSMutexUnlock (TSMutex mutexp)
tsapi TSCacheKey TSCacheKeyCreate (void)
 Creates (allocates memory for) a new cache key.
tsapi TSReturnCode TSCacheKeyDigestSet (TSCacheKey key, const char *input, int length)
 Generates a key for an object to be cached (written to the cache).
tsapi TSReturnCode TSCacheKeyDigestFromUrlSet (TSCacheKey key, TSMLoc url)
tsapi TSReturnCode TSCacheKeyHostNameSet (TSCacheKey key, const char *hostname, int host_len)
 Associates a host name to the cache key.
tsapi TSReturnCode TSCacheKeyPinnedSet (TSCacheKey key, time_t pin_in_cache)
tsapi TSReturnCode TSCacheKeyDestroy (TSCacheKey key)
 Destroys a cache key.
tsapi TSReturnCode TSCacheUrlSet (TSHttpTxn txnp, const char *url, int length)
tsapi unsigned int TSConfigSet (unsigned int id, void *data, TSConfigDestroyFunc funcp)
tsapi TSConfig TSConfigGet (unsigned int id)
tsapi void TSConfigRelease (unsigned int id, TSConfig configp)
tsapi void * TSConfigDataGet (TSConfig configp)
tsapi void TSMgmtUpdateRegister (TSCont contp, const char *plugin_name)
tsapi TSReturnCode TSMgmtIntGet (const char *var_name, TSMgmtInt *result)
tsapi TSReturnCode TSMgmtCounterGet (const char *var_name, TSMgmtCounter *result)
tsapi TSReturnCode TSMgmtFloatGet (const char *var_name, TSMgmtFloat *result)
tsapi TSReturnCode TSMgmtStringGet (const char *var_name, TSMgmtString *result)
tsapi TSCont TSContCreate (TSEventFunc funcp, TSMutex mutexp)
tsapi void TSContDestroy (TSCont contp)
tsapi void TSContDataSet (TSCont contp, void *data)
tsapi void * TSContDataGet (TSCont contp)
tsapi TSAction TSContSchedule (TSCont contp, TSHRTime timeout, TSThreadPool tp)
tsapi TSAction TSContScheduleEvery (TSCont contp, TSHRTime every, TSThreadPool tp)
tsapi TSAction TSHttpSchedule (TSCont contp, TSHttpTxn txnp, TSHRTime timeout)
tsapi int TSContCall (TSCont contp, TSEvent event, void *edata)
tsapi TSMutex TSContMutexGet (TSCont contp)
tsapi void TSLifecycleHookAdd (TSLifecycleHookID id, TSCont contp)
tsapi void TSHttpHookAdd (TSHttpHookID id, TSCont contp)
tsapi void TSHttpSsnHookAdd (TSHttpSsn ssnp, TSHttpHookID id, TSCont contp)
tsapi void TSHttpSsnReenable (TSHttpSsn ssnp, TSEvent event)
tsapi int TSHttpSsnTransactionCount (TSHttpSsn ssnp)
tsapi void TSHttpTxnHookAdd (TSHttpTxn txnp, TSHttpHookID id, TSCont contp)
tsapi TSHttpSsn TSHttpTxnSsnGet (TSHttpTxn txnp)
tsapi TSReturnCode TSHttpTxnClientReqGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpTxnClientRespGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpTxnServerReqGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpTxnServerRespGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpTxnCachedReqGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpTxnCachedRespGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpTxnPristineUrlGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *url_loc)
tsapi char * TSHttpTxnEffectiveUrlStringGet (TSHttpTxn txnp, int *length)
 Get the effective URL for the transaction.
tsapi void TSHttpTxnRespCacheableSet (TSHttpTxn txnp, int flag)
tsapi void TSHttpTxnReqCacheableSet (TSHttpTxn txnp, int flag)
tsapi TSReturnCode TSHttpTxnServerRespNoStoreSet (TSHttpTxn txnp, int flag)
 Set flag indicating whether or not to cache the server response for given TSHttpTxn.
tsapi TSReturnCode TSFetchPageRespGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi char * TSFetchRespGet (TSHttpTxn txnp, int *length)
tsapi TSReturnCode TSHttpTxnCacheLookupStatusGet (TSHttpTxn txnp, int *lookup_status)
tsapi TSReturnCode TSHttpTxnTransformRespGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi void TSHttpTxnClientIncomingPortSet (TSHttpTxn txnp, int port)
tsapi void * TSHttpSsnSSLConnectionGet (TSHttpSsn ssnp)
 Get SSL object of this session.
tsapi struct sockaddr const * TSHttpTxnClientAddrGet (TSHttpTxn txnp)
 Get client address for transaction txnp.
tsapi struct sockaddr const * TSHttpTxnIncomingAddrGet (TSHttpTxn txnp)
 Get the incoming address.
tsapi struct sockaddr const * TSHttpTxnServerAddrGet (TSHttpTxn txnp)
 Get the origin server address.
tsapi TSReturnCode TSHttpTxnServerAddrSet (TSHttpTxn txnp, struct sockaddr const *addr)
 Set the origin server address.
tsapi struct sockaddr const * TSHttpTxnNextHopAddrGet (TSHttpTxn txnp)
 Get the next hop address.
tsapi TSReturnCode TSHttpTxnClientFdGet (TSHttpTxn txnp, int *fdp)
tsapi TSReturnCode TSHttpTxnOutgoingAddrSet (TSHttpTxn txnp, struct sockaddr const *addr)
tsapi TSReturnCode TSHttpTxnOutgoingTransparencySet (TSHttpTxn txnp, int flag)
tsapi struct sockaddr const * TSHttpSsnClientAddrGet (TSHttpSsn ssnp)
tsapi struct sockaddr const * TSHttpSsnIncomingAddrGet (TSHttpSsn ssnp)
tsapi TSReturnCode TSHttpSsnClientFdGet (TSHttpSsn ssnp, int *fdp)
tsapi TSReturnCode TSHttpTxnClientPacketMarkSet (TSHttpTxn txnp, int mark)
 Change packet firewall mark for the client side connection.
tsapi TSReturnCode TSHttpTxnServerPacketMarkSet (TSHttpTxn txnp, int mark)
 Change packet firewall mark for the server side connection.
tsapi TSReturnCode TSHttpTxnClientPacketTosSet (TSHttpTxn txnp, int tos)
 Change packet TOS for the client side connection.
tsapi TSReturnCode TSHttpTxnServerPacketTosSet (TSHttpTxn txnp, int tos)
 Change packet TOS for the server side connection.
tsapi void TSHttpTxnErrorBodySet (TSHttpTxn txnp, char *buf, size_t buflength, char *mimetype)
 Sets an error type body to a transaction.
tsapi TSReturnCode TSHttpTxnParentProxyGet (TSHttpTxn txnp, char **hostname, int *port)
 Retrieves the parent proxy hostname and port, if parent proxying is enabled.
tsapi void TSHttpTxnParentProxySet (TSHttpTxn txnp, char *hostname, int port)
 Sets the parent proxy name and port.
tsapi void TSHttpTxnUntransformedRespCache (TSHttpTxn txnp, int on)
tsapi void TSHttpTxnTransformedRespCache (TSHttpTxn txnp, int on)
tsapi void TSHttpTxnReenable (TSHttpTxn txnp, TSEvent event)
 Notifies the HTTP transaction txnp that the plugin is finished processing the current hook.
tsapi TSReturnCode TSHttpCacheReenable (TSCacheTxn txnp, const TSEvent event, const void *data, const uint64_t size)
tsapi void TSHttpTxnArgSet (TSHttpTxn txnp, int arg_idx, void *arg)
tsapi void * TSHttpTxnArgGet (TSHttpTxn txnp, int arg_idx)
tsapi void TSHttpSsnArgSet (TSHttpSsn ssnp, int arg_idx, void *arg)
tsapi void * TSHttpSsnArgGet (TSHttpSsn ssnp, int arg_idx)
tsapi TSReturnCode TSHttpArgIndexReserve (const char *name, const char *description, int *arg_idx)
tsapi TSReturnCode TSHttpArgIndexNameLookup (const char *name, int *arg_idx, const char **description)
tsapi TSReturnCode TSHttpArgIndexLookup (int arg_idx, const char **name, const char **description)
tsapi void TSHttpTxnSetHttpRetStatus (TSHttpTxn txnp, TSHttpStatus http_retstatus)
tsapi void TSHttpTxnActiveTimeoutSet (TSHttpTxn txnp, int timeout)
 timeout is in msec overrides as proxy.config.http.transaction_active_timeout_out
tsapi void TSHttpTxnConnectTimeoutSet (TSHttpTxn txnp, int timeout)
 timeout is in msec overrides as proxy.config.http.connect_attempts_timeout
tsapi void TSHttpTxnDNSTimeoutSet (TSHttpTxn txnp, int timeout)
 timeout is in msec overrides as proxy.config.dns.lookup_timeout
tsapi void TSHttpTxnNoActivityTimeoutSet (TSHttpTxn txnp, int timeout)
 timeout is in msec overrides as proxy.config.http.transaction_no_activity_timeout_out
tsapi TSServerState TSHttpTxnServerStateGet (TSHttpTxn txnp)
tsapi void TSHttpTxnDebugSet (TSHttpTxn txnp, int on)
 Set the transaction specific debugging flag for this transaction.
tsapi int TSHttpTxnDebugGet (TSHttpTxn txnp)
 Returns the transaction specific debugging flag for this transaction.
tsapi void TSHttpSsnDebugSet (TSHttpSsn ssnp, int on)
 Set the session specific debugging flag for this client session.
tsapi int TSHttpSsnDebugGet (TSHttpSsn ssnp, int *on)
 Returns the transaction specific debugging flag for this client session.
tsapi void TSHttpTxnIntercept (TSCont contp, TSHttpTxn txnp)
 Allows a plugin take over the servicing of the request as though it was the origin server.
tsapi void TSHttpTxnServerIntercept (TSCont contp, TSHttpTxn txnp)
 Allows a plugin take over the servicing of the request as though it was the origin server.
tsapi TSVConn TSHttpConnectWithPluginId (struct sockaddr const *addr, char const *tag, int64_t id)
 Allows the plugin to initiate an http connection.
tsapi TSVConn TSHttpConnect (struct sockaddr const *addr)
 Backwards compatible version.
tsapi TSVConn TSHttpConnectTransparent (struct sockaddr const *client_addr, struct sockaddr const *server_addr)
 Allows the plugin to initiate a transparent http connection.
tsapi void TSFetchUrl (const char *request, int request_len, struct sockaddr const *addr, TSCont contp, TSFetchWakeUpOptions callback_options, TSFetchEvent event)
tsapi void TSFetchPages (TSFetchUrlParams_t *params)
tsapi TSReturnCode TSHttpIsInternalRequest (TSHttpTxn txnp)
tsapi TSReturnCode TSHttpIsInternalSession (TSHttpSsn ssnp)
tsapi TSReturnCode TSHttpAltInfoClientReqGet (TSHttpAltInfo infop, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpAltInfoCachedReqGet (TSHttpAltInfo infop, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpAltInfoCachedRespGet (TSHttpAltInfo infop, TSMBuffer *bufp, TSMLoc *offset)
tsapi void TSHttpAltInfoQualitySet (TSHttpAltInfo infop, float quality)
tsapi void TSActionCancel (TSAction actionp)
tsapi int TSActionDone (TSAction actionp)
tsapi TSVIO TSVConnReadVIOGet (TSVConn connp)
tsapi TSVIO TSVConnWriteVIOGet (TSVConn connp)
tsapi int TSVConnClosedGet (TSVConn connp)
tsapi TSVIO TSVConnRead (TSVConn connp, TSCont contp, TSIOBuffer bufp, int64_t nbytes)
tsapi TSVIO TSVConnWrite (TSVConn connp, TSCont contp, TSIOBufferReader readerp, int64_t nbytes)
tsapi void TSVConnClose (TSVConn connp)
tsapi void TSVConnAbort (TSVConn connp, int error)
tsapi void TSVConnShutdown (TSVConn connp, int read, int write)
tsapi int64_t TSVConnCacheObjectSizeGet (TSVConn connp)
tsapi TSVConn TSTransformCreate (TSEventFunc event_funcp, TSHttpTxn txnp)
tsapi TSVConn TSTransformOutputVConnGet (TSVConn connp)
tsapi struct sockaddr const * TSNetVConnRemoteAddrGet (TSVConn vc)
tsapi TSAction TSNetConnect (TSCont contp, struct sockaddr const *to)
 Opens a network connection to the host specified by ip on the port specified by port.
tsapi TSAction TSNetAccept (TSCont contp, int port, int domain, int accept_threads)
tsapi TSReturnCode TSNetAcceptNamedProtocol (TSCont contp, const char *protocol)
 Listen on all SSL ports for connections for the specified protocol name.
tsapi TSPortDescriptor TSPortDescriptorParse (const char *descriptor)
 Create a new port from the string specification used by the proxy.config.http.server_ports configuration value.
tsapi TSReturnCode TSPortDescriptorAccept (TSPortDescriptor, TSCont)
 Start listening on the given port descriptor.
tsapi TSAction TSHostLookup (TSCont contp, const char *hostname, size_t namelen)
tsapi struct sockaddr const * TSHostLookupResultAddrGet (TSHostLookupResult lookup_result)
tsapi TSAction TSCacheRead (TSCont contp, TSCacheKey key)
 Asks the Traffic Server cache if the object corresponding to key exists in the cache and can be read.
tsapi TSAction TSCacheWrite (TSCont contp, TSCacheKey key)
 Asks the Traffic Server cache if contp can start writing the object (corresponding to key) to the cache.
tsapi TSAction TSCacheRemove (TSCont contp, TSCacheKey key)
 Removes the object corresponding to key from the cache.
tsapi TSReturnCode TSCacheReady (int *is_ready)
tsapi TSAction TSCacheScan (TSCont contp, TSCacheKey key, int KB_per_second)
tsapi void TSVIOReenable (TSVIO viop)
tsapi TSIOBuffer TSVIOBufferGet (TSVIO viop)
tsapi TSIOBufferReader TSVIOReaderGet (TSVIO viop)
tsapi int64_t TSVIONBytesGet (TSVIO viop)
tsapi void TSVIONBytesSet (TSVIO viop, int64_t nbytes)
tsapi int64_t TSVIONDoneGet (TSVIO viop)
tsapi void TSVIONDoneSet (TSVIO viop, int64_t ndone)
tsapi int64_t TSVIONTodoGet (TSVIO viop)
tsapi TSMutex TSVIOMutexGet (TSVIO viop)
tsapi TSCont TSVIOContGet (TSVIO viop)
tsapi TSVConn TSVIOVConnGet (TSVIO viop)
tsapi TSIOBuffer TSIOBufferCreate (void)
tsapi TSIOBuffer TSIOBufferSizedCreate (TSIOBufferSizeIndex index)
 Creates a new TSIOBuffer of the specified size.
tsapi int64_t TSIOBufferWaterMarkGet (TSIOBuffer bufp)
 The watermark of an TSIOBuffer is the minimum number of bytes of data that have to be in the buffer before calling back any continuation that has initiated a read operation on this buffer.
tsapi void TSIOBufferWaterMarkSet (TSIOBuffer bufp, int64_t water_mark)
 The watermark of an TSIOBuffer is the minimum number of bytes of data that have to be in the buffer before calling back any continuation that has initiated a read operation on this buffer.
tsapi void TSIOBufferDestroy (TSIOBuffer bufp)
tsapi TSIOBufferBlock TSIOBufferStart (TSIOBuffer bufp)
tsapi int64_t TSIOBufferCopy (TSIOBuffer bufp, TSIOBufferReader readerp, int64_t length, int64_t offset)
tsapi int64_t TSIOBufferWrite (TSIOBuffer bufp, const void *buf, int64_t length)
 Writes length bytes of data contained in the string buf to the TSIOBuffer bufp.
tsapi void TSIOBufferProduce (TSIOBuffer bufp, int64_t nbytes)
tsapi TSIOBufferBlock TSIOBufferBlockNext (TSIOBufferBlock blockp)
tsapi const char * TSIOBufferBlockReadStart (TSIOBufferBlock blockp, TSIOBufferReader readerp, int64_t *avail)
tsapi int64_t TSIOBufferBlockReadAvail (TSIOBufferBlock blockp, TSIOBufferReader readerp)
tsapi char * TSIOBufferBlockWriteStart (TSIOBufferBlock blockp, int64_t *avail)
tsapi int64_t TSIOBufferBlockWriteAvail (TSIOBufferBlock blockp)
tsapi TSIOBufferReader TSIOBufferReaderAlloc (TSIOBuffer bufp)
tsapi TSIOBufferReader TSIOBufferReaderClone (TSIOBufferReader readerp)
tsapi void TSIOBufferReaderFree (TSIOBufferReader readerp)
tsapi TSIOBufferBlock TSIOBufferReaderStart (TSIOBufferReader readerp)
tsapi void TSIOBufferReaderConsume (TSIOBufferReader readerp, int64_t nbytes)
tsapi int64_t TSIOBufferReaderAvail (TSIOBufferReader readerp)
tsapi struct sockaddr const * TSNetVConnLocalAddrGet (TSVConn vc)
tsapi TSReturnCode TSMgmtStringCreate (TSRecordType rec_type, const char *name, const TSMgmtString data_default, TSRecordUpdateType update_type, TSRecordCheckType check_type, const char *check_regex, TSRecordAccessType access_type)
tsapi TSReturnCode TSMgmtIntCreate (TSRecordType rec_type, const char *name, TSMgmtInt data_default, TSRecordUpdateType update_type, TSRecordCheckType check_type, const char *check_regex, TSRecordAccessType access_type)
tsapi int TSStatCreate (const char *the_name, TSRecordDataType the_type, TSStatPersistence persist, TSStatSync sync)
tsapi void TSStatIntIncrement (int the_stat, TSMgmtInt amount)
tsapi void TSStatIntDecrement (int the_stat, TSMgmtInt amount)
tsapi TSMgmtInt TSStatIntGet (int the_stat)
tsapi void TSStatIntSet (int the_stat, TSMgmtInt value)
tsapi TSReturnCode TSStatFindName (const char *name, int *idp)
tsapi int TSIsDebugTagSet (const char *t)
tsapi void TSDebug (const char *tag, const char *format_str,...) TS_PRINTFLIKE(2
tsapi void tsapi void TSDebugSpecific (int debug_flag, const char *tag, const char *format_str,...) TS_PRINTFLIKE(3
 Output a debug line even if the debug tag is turned off, as long as debugging is enabled.
tsapi void TSRecordDump (int rec_type, TSRecordDumpCb callback, void *edata)
tsapi TSReturnCode TSTextLogObjectCreate (const char *filename, int mode, TSTextLogObject *new_log_obj)
 Creates a new custom log file that your plugin can write to.
tsapi TSReturnCode TSTextLogObjectWrite (TSTextLogObject the_object, const char *format,...) TS_PRINTFLIKE(2
 Writes a printf-style formatted statement to an TSTextLogObject (a plugin custom log).
tsapi TSReturnCode tsapi void TSTextLogObjectFlush (TSTextLogObject the_object)
 This immediately flushes the contents of the log write buffer for the_object to disk.
tsapi TSReturnCode TSTextLogObjectDestroy (TSTextLogObject the_object)
 Destroys a log object and releases the memory allocated to it.
tsapi void TSTextLogObjectHeaderSet (TSTextLogObject the_object, const char *header)
 Set log header.
tsapi TSReturnCode TSTextLogObjectRollingEnabledSet (TSTextLogObject the_object, int rolling_enabled)
 Enable/disable rolling.
tsapi void TSTextLogObjectRollingIntervalSecSet (TSTextLogObject the_object, int rolling_interval_sec)
 Set the rolling interval.
tsapi void TSTextLogObjectRollingOffsetHrSet (TSTextLogObject the_object, int rolling_offset_hr)
 Set the rolling offset.
tsapi TSReturnCode TSAIORead (int fd, off_t offset, char *buf, size_t buffSize, TSCont contp)
 Async disk IO read.
tsapi char * TSAIOBufGet (TSAIOCallback data)
 Async disk IO buffer get.
tsapi int TSAIONBytesGet (TSAIOCallback data)
 Async disk IO get number of bytes.
tsapi TSReturnCode TSAIOWrite (int fd, off_t offset, char *buf, size_t bufSize, TSCont contp)
 Async disk IO write.
tsapi TSReturnCode TSAIOThreadNumSet (int thread_num)
 Async disk IO set number of threads.
tsapi TSReturnCode TSHttpTxnAborted (TSHttpTxn txnp)
 Check if transaction was aborted (due client/server errors etc.
tsapi TSVConn TSVConnCreate (TSEventFunc event_funcp, TSMutex mutexp)
tsapi TSVConn TSVConnFdCreate (int fd)
tsapi int TSHttpTxnClientReqHdrBytesGet (TSHttpTxn txnp)
tsapi int64_t TSHttpTxnClientReqBodyBytesGet (TSHttpTxn txnp)
tsapi int TSHttpTxnServerReqHdrBytesGet (TSHttpTxn txnp)
tsapi int64_t TSHttpTxnServerReqBodyBytesGet (TSHttpTxn txnp)
tsapi int TSHttpTxnPushedRespHdrBytesGet (TSHttpTxn txnp)
tsapi int64_t TSHttpTxnPushedRespBodyBytesGet (TSHttpTxn txnp)
tsapi int TSHttpTxnServerRespHdrBytesGet (TSHttpTxn txnp)
tsapi int64_t TSHttpTxnServerRespBodyBytesGet (TSHttpTxn txnp)
tsapi int TSHttpTxnClientRespHdrBytesGet (TSHttpTxn txnp)
tsapi int64_t TSHttpTxnClientRespBodyBytesGet (TSHttpTxn txnp)
tsapi void TSVConnInactivityTimeoutSet (TSVConn connp, TSHRTime timeout)
tsapi void TSVConnInactivityTimeoutCancel (TSVConn connp)
tsapi void TSVConnActiveTimeoutSet (TSVConn connp, TSHRTime timeout)
tsapi void TSVConnActiveTimeoutCancel (TSVConn connp)
tsapi void TSSkipRemappingSet (TSHttpTxn txnp, int flag)
tsapi TSReturnCode TSHttpTxnConfigIntSet (TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtInt value)
tsapi TSReturnCode TSHttpTxnConfigIntGet (TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtInt *value)
tsapi TSReturnCode TSHttpTxnConfigFloatSet (TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtFloat value)
tsapi TSReturnCode TSHttpTxnConfigFloatGet (TSHttpTxn txnp, TSOverridableConfigKey conf, TSMgmtFloat *value)
tsapi TSReturnCode TSHttpTxnConfigStringSet (TSHttpTxn txnp, TSOverridableConfigKey conf, const char *value, int length)
tsapi TSReturnCode TSHttpTxnConfigStringGet (TSHttpTxn txnp, TSOverridableConfigKey conf, const char **value, int *length)
tsapi TSReturnCode TSHttpTxnConfigFind (const char *name, int length, TSOverridableConfigKey *conf, TSRecordDataType *type)
tsapi TSReturnCode TSHttpTxnFollowRedirect (TSHttpTxn txnp, int on)
 This API informs the core to try to follow redirections (e.g.
tsapi void TSHttpTxnRedirectUrlSet (TSHttpTxn txnp, const char *url, const int url_len)
 This is a generalization of the TSHttpTxnFollowRedirect(), but gives finer control over the behavior.
tsapi TS_DEPRECATED void TSRedirectUrlSet (TSHttpTxn txnp, const char *url, const int url_len)
tsapi const char * TSHttpTxnRedirectUrlGet (TSHttpTxn txnp, int *url_len_ptr)
 Return the current (if set) redirection URL string.
tsapi TS_DEPRECATED const char * TSRedirectUrlGet (TSHttpTxn txnp, int *url_len_ptr)
tsapi int TSHttpTxnRedirectRetries (TSHttpTxn txnp)
 Return the number of redirection retries we have done.
tsapi int TSHttpCurrentClientConnectionsGet (void)
tsapi int TSHttpCurrentActiveClientConnectionsGet (void)
tsapi int TSHttpCurrentIdleClientConnectionsGet (void)
tsapi int TSHttpCurrentCacheConnectionsGet (void)
tsapi int TSHttpCurrentServerConnectionsGet (void)
tsapi TSReturnCode TSHttpTxnCachedRespModifiableGet (TSHttpTxn txnp, TSMBuffer *bufp, TSMLoc *offset)
tsapi TSReturnCode TSHttpTxnCacheLookupStatusSet (TSHttpTxn txnp, int cachelookup)
tsapi TSReturnCode TSHttpTxnCacheLookupUrlGet (TSHttpTxn txnp, TSMBuffer bufp, TSMLoc obj)
tsapi TSReturnCode TSHttpTxnPrivateSessionSet (TSHttpTxn txnp, int private_session)
tsapi int TSHttpTxnBackgroundFillStarted (TSHttpTxn txnp)
tsapi TSReturnCode TSBase64Decode (const char *str, size_t str_len, unsigned char *dst, size_t dst_size, size_t *length)
tsapi TSReturnCode TSBase64Encode (const char *str, size_t str_len, char *dst, size_t dst_size, size_t *length)
tsapi TSReturnCode TSHttpTxnMilestoneGet (TSHttpTxn txnp, TSMilestonesType milestone, TSHRTime *time)
 Return the particular milestone timer for the transaction.
tsapi int TSHttpTxnIsCacheable (TSHttpTxn txnp, TSMBuffer request, TSMBuffer response)
 Test whether a request / response header pair would be cacheable under the current configuration.
tsapi const char * TSHttpServerStateNameLookup (TSServerState state)
 Return a string respresentation for a TSServerState value.
tsapi const char * TSHttpHookNameLookup (TSHttpHookID hook)
 Return a string respresentation for a TSHttpHookID value.
tsapi const char * TSHttpEventNameLookup (TSEvent event)
 Return a string respresentation for a TSEvent value.

Variables

tsapi void tsapi void int diags_on_for_plugins

Detailed Description

Traffic Server SDK API header file.

License

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.

Developers

Developers, when adding a new element to an enum, append it. DO NOT insert it. Otherwise, binary compatibility of plugins will be broken!

Definition in file ts.h.


Define Documentation

#define TSAssert (   EX  )     (void)((EX) || (_TSAssert(#EX, __FILE__, __LINE__)))
#define TSDEBUG   if (diags_on_for_plugins) TSDebug

Definition at line 1976 of file ts.h.

#define TSfree (   p  )     _TSfree (p)
#define TSmalloc (   s  )     _TSmalloc ((s), TS_RES_MEM_PATH)
#define TSrealloc (   p,
  s 
)    _TSrealloc ((p), (s), TS_RES_MEM_PATH)

Definition at line 43 of file ts.h.

#define TSReleaseAssert (   EX  )     ( (void)((EX) ? (void)0 : _TSReleaseAssert(#EX, __FILE__, __LINE__)) )

Definition at line 265 of file ts.h.

Referenced by cache_handler(), cont_test_handler(), and SpdyNV::SpdyNV().

#define TSstrdup (   p  )     _TSstrdup ((p), -1, TS_RES_MEM_PATH)

Definition at line 44 of file ts.h.

Referenced by SDK_API_TSTextLog(), and ssn_handler().

#define TSstrlcat (   d,
  s,
  l 
)    _TSstrlcat ((d), (s), (l))

Definition at line 47 of file ts.h.

#define TSstrlcpy (   d,
  s,
  l 
)    _TSstrlcpy ((d), (s), (l))

Definition at line 46 of file ts.h.

#define TSstrndup (   p,
  n 
)    _TSstrdup ((p), (n), TS_RES_MEM_PATH)

Definition at line 45 of file ts.h.


Typedef Documentation

typedef void(* TSRecordDumpCb)(TSRecordType rec_type, void *edata, int registered, const char *name, TSRecordDataType data_type, TSRecordData *datum)

Definition at line 2007 of file ts.h.

typedef struct tsapi_textlogobject* TSTextLogObject

This type represents a custom log file that you create with TSTextLogObjectCreate().

Your plugin writes entries into this log file using TSTextLogObjectWrite().

Definition at line 2005 of file ts.h.


Enumeration Type Documentation

anonymous enum

The following enum values are flags, so they should be powers of two.

With the exception of TS_LOG_MODE_INVALID_FLAG, they are all used to configure the creation of an TSTextLogObject through the mode argument to TSTextLogObjectCreate(). TS_LOG_MODE_INVALID_FLAG is used internally to check the validity of this argument. Insert new flags before TS_LOG_MODE_INVALID_FLAG, and set TS_LOG_MODE_INVALID_FLAG to the largest power of two of the enum.

Enumerator:
TS_LOG_MODE_ADD_TIMESTAMP 
TS_LOG_MODE_DO_NOT_RENAME 
TS_LOG_MODE_INVALID_FLAG 

Definition at line 1992 of file ts.h.

Enumerator:
TS_STAT_PERSISTENT 
TS_STAT_NON_PERSISTENT 

Definition at line 1916 of file ts.h.

enum TSStatSync
Enumerator:
TS_STAT_SYNC_SUM 
TS_STAT_SYNC_COUNT 
TS_STAT_SYNC_AVG 
TS_STAT_SYNC_TIMEAVG 

Definition at line 1922 of file ts.h.


Function Documentation

tsapi int _TSAssert ( const char *  txt,
const char *  f,
int  l 
)

Definition at line 416 of file InkAPI.cc.

tsapi void _TSfree ( void *  ptr  ) 

Definition at line 1656 of file InkAPI.cc.

References ats_free().

tsapi void* _TSmalloc ( size_t  size,
const char *  path 
)

Definition at line 1625 of file InkAPI.cc.

References ats_malloc().

tsapi void* _TSrealloc ( void *  ptr,
size_t  size,
const char *  path 
)

Definition at line 1631 of file InkAPI.cc.

References ats_realloc().

tsapi void tsapi void _TSReleaseAssert ( const char *  txt,
const char *  f,
int  l 
)

Definition at line 402 of file InkAPI.cc.

References _ink_assert().

tsapi char* _TSstrdup ( const char *  str,
int64_t  length,
const char *  path 
)

Definition at line 1638 of file InkAPI.cc.

References _xstrdup().

tsapi size_t _TSstrlcat ( char *  dst,
const char *  str,
size_t  siz 
)

Definition at line 1650 of file InkAPI.cc.

References ink_strlcat().

tsapi size_t _TSstrlcpy ( char *  dst,
const char *  str,
size_t  siz 
)

Definition at line 1644 of file InkAPI.cc.

References ink_strlcpy().

tsapi void TSActionCancel ( TSAction  actionp  ) 
tsapi int TSActionDone ( TSAction  actionp  ) 

Definition at line 6141 of file InkAPI.cc.

References ACTION_RESULT_DONE.

Referenced by SDK_API_TSActionCancel(), synclient_txn_delete(), and synserver_stop().

tsapi char* TSAIOBufGet ( TSAIOCallback  data  ) 

Async disk IO buffer get.

Returns:
char* to the buffer

Definition at line 7437 of file InkAPI.cc.

References ink_aiocb::aio_buf, and AIOCallback::aiocb.

tsapi int TSAIONBytesGet ( TSAIOCallback  data  ) 

Async disk IO get number of bytes.

Returns:
the number of bytes

Definition at line 7444 of file InkAPI.cc.

References AIOCallback::aio_result.

tsapi TSReturnCode TSAIORead ( int  fd,
off_t  offset,
char *  buf,
size_t  buffSize,
TSCont  contp 
)
tsapi TSReturnCode TSAIOThreadNumSet ( int  thread_num  ) 

Async disk IO set number of threads.

Returns:
TS_SUCCESS or TS_ERROR.

Definition at line 7475 of file InkAPI.cc.

References ink_aio_thread_num_set(), and TS_SUCCESS.

tsapi TSReturnCode TSAIOWrite ( int  fd,
off_t  offset,
char *  buf,
size_t  bufSize,
TSCont  contp 
)

Async disk IO write.

Returns:
TS_SUCCESS or TS_ERROR.

Definition at line 7451 of file InkAPI.cc.

References ink_aio_write(), Continuation::mutex, new_AIOCallback(), sdk_assert, sdk_sanity_check_iocore_structure(), sdk_sanity_check_null_ptr(), and TS_SUCCESS.

tsapi TSReturnCode TSBase64Decode ( const char *  str,
size_t  str_len,
unsigned char *  dst,
size_t  dst_size,
size_t *  length 
)

Definition at line 1667 of file InkAPI.cc.

References ats_base64_decode(), sdk_assert, sdk_sanity_check_null_ptr(), and TS_SUCCESS.

Referenced by SDK_API_ENCODING().

tsapi TSReturnCode TSBase64Encode ( const char *  str,
size_t  str_len,
char *  dst,
size_t  dst_size,
size_t *  length 
)

Definition at line 1676 of file InkAPI.cc.

References ats_base64_encode(), sdk_assert, sdk_sanity_check_null_ptr(), and TS_SUCCESS.

Referenced by SDK_API_ENCODING().

tsapi TSCacheKey TSCacheKeyCreate ( void   ) 

Creates (allocates memory for) a new cache key.

Definition at line 3896 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_cachekey(), and TS_SUCCESS.

Referenced by SDK_API_TSCache().

tsapi TSReturnCode TSCacheKeyDestroy ( TSCacheKey  key  ) 

Destroys a cache key.

You must destroy cache keys when you are finished with them, i.e. after all reads and writes are completed.

Parameters:
key to be destroyed.

Definition at line 3988 of file InkAPI.cc.

References ats_free(), CACHE_INFO_MAGIC_ALIVE, CacheInfo::hostname, CacheInfo::magic, sdk_assert, sdk_sanity_check_cachekey(), and TS_SUCCESS.

Referenced by cache_handler(), and SDK_API_TSCache().

tsapi TSReturnCode TSCacheKeyDigestFromUrlSet ( TSCacheKey  key,
TSMLoc  url 
)
tsapi TSReturnCode TSCacheKeyDigestSet ( TSCacheKey  key,
const char *  input,
int  length 
)

Generates a key for an object to be cached (written to the cache).

Parameters:
key to be associated with the cached object. Before calling TSCacheKeySetDigest() you must create the key with TSCacheKeyCreate().
input string that uniquely identifies the object. In most cases, it is the URL of the object.
length of the string input.

Definition at line 3906 of file InkAPI.cc.

References CACHE_INFO_MAGIC_ALIVE, CacheInfo::cache_key, CacheInfo::magic, sdk_assert, sdk_sanity_check_cachekey(), sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

Referenced by SDK_API_TSCache().

tsapi TSReturnCode TSCacheKeyHostNameSet ( TSCacheKey  key,
const char *  hostname,
int  host_len 
)

Associates a host name to the cache key.

Use this function if the cache has been partitioned by hostname. The hostname tells the cache which volume to use for the object.

Parameters:
key of the cached object.
hostname to associate with the cache key.
host_len length of the string hostname.

Definition at line 3956 of file InkAPI.cc.

References ats_malloc(), CACHE_INFO_MAGIC_ALIVE, CacheInfo::hostname, CacheInfo::len, memcpy, sdk_assert, sdk_sanity_check_cachekey(), sdk_sanity_check_null_ptr(), and TS_SUCCESS.

tsapi TSReturnCode TSCacheKeyPinnedSet ( TSCacheKey  key,
time_t  pin_in_cache 
)
tsapi TSAction TSCacheRead ( TSCont  contp,
TSCacheKey  key 
)

Asks the Traffic Server cache if the object corresponding to key exists in the cache and can be read.

If the object can be read, the Traffic Server cache calls the continuation contp back with the event TS_EVENT_CACHE_OPEN_READ. In this case, the cache also passes contp a cache vconnection and contp can then initiate a read operation on that vconnection using TSVConnRead.

If the object cannot be read, the cache calls contp back with the event TS_EVENT_CACHE_OPEN_READ_FAILED. The user (contp) has the option to cancel the action returned by TSCacheRead. Note that reentrant calls are possible, i.e. the cache can call back the user (contp) in the same call.

Parameters:
contp continuation to be called back if a read operation is permissible.
key cache key corresponding to the object to be read.
Returns:
something allowing the user to cancel or schedule the cache read.

Definition at line 6590 of file InkAPI.cc.

References CacheInfo::cache_key, cacheProcessor, FORCE_PLUGIN_MUTEX, CacheInfo::frag_type, CacheInfo::hostname, CacheInfo::len, CacheProcessor::open_read(), sdk_assert, sdk_sanity_check_cachekey(), sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

Referenced by cache_handler().

tsapi TSReturnCode TSCacheReady ( int *  is_ready  ) 
tsapi TSAction TSCacheRemove ( TSCont  contp,
TSCacheKey  key 
)

Removes the object corresponding to key from the cache.

If the object was removed successfully, the cache calls contp back with the event TS_EVENT_CACHE_REMOVE. If the object was not found in the cache, the cache calls contp back with the event TS_EVENT_CACHE_REMOVE_FAILED.

In both of these callbacks, the user (contp) does not have to do anything. The user does not get any vconnection from the cache, since no data needs to be transferred. When the cache calls contp back with TS_EVENT_CACHE_REMOVE, the remove has already been commited.

Parameters:
contp continuation that the cache calls back reporting the success or failure of the remove.
key cache key corresponding to the object to be removed.
Returns:
something allowing the user to cancel or schedule the remove.

Definition at line 6619 of file InkAPI.cc.

References CacheInfo::cache_key, cacheProcessor, FORCE_PLUGIN_MUTEX, CacheInfo::frag_type, CacheInfo::hostname, CacheInfo::len, CacheProcessor::remove(), sdk_assert, sdk_sanity_check_cachekey(), sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

Referenced by cache_handler().

tsapi TSAction TSCacheScan ( TSCont  contp,
TSCacheKey  key,
int  KB_per_second 
)
tsapi TSReturnCode TSCacheUrlSet ( TSHttpTxn  txnp,
const char *  url,
int  length 
)
tsapi TSAction TSCacheWrite ( TSCont  contp,
TSCacheKey  key 
)

Asks the Traffic Server cache if contp can start writing the object (corresponding to key) to the cache.

If the object can be written, the cache calls contp back with the event TS_EVENT_CACHE_OPEN_WRITE. In this case, the cache also passes contp a cache vconnection and contp can then initiate a write operation on that vconnection using TSVConnWrite. The object is not committed to the cache until the vconnection is closed. When all data has been transferred, the user (contp) must do an TSVConnClose. In case of any errors, the user MUST do an TSVConnAbort(contp, 0).

If the object cannot be written, the cache calls contp back with the event TS_EVENT_CACHE_OPEN_WRITE_FAILED. This can happen, for example, if there is another object with the same key being written to the cache. The user (contp) has the option to cancel the action returned by TSCacheWrite.

Note that reentrant calls are possible, i.e. the cache can call back the user (contp) in the same call.

Parameters:
contp continuation that the cache calls back (telling it whether the write operation can proceed or not).
key cache key corresponding to the object to be cached.
Returns:
something allowing the user to cancel or schedule the cache write.

Definition at line 6604 of file InkAPI.cc.

References CacheInfo::cache_key, cacheProcessor, FORCE_PLUGIN_MUTEX, CacheInfo::frag_type, CacheInfo::hostname, CacheInfo::len, CacheProcessor::open_write(), CacheInfo::pin_in_cache, sdk_assert, sdk_sanity_check_cachekey(), sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

Referenced by SDK_API_TSCache().

tsapi void* TSConfigDataGet ( TSConfig  configp  ) 

Definition at line 4140 of file InkAPI.cc.

References INKConfigImpl::mdata.

Referenced by SDK_API_TSConfig().

tsapi const char* TSConfigDirGet ( void   ) 

Gets the path of the directory of Traffic Server configuration.

Returns:
pointer to Traffic Server configuration directory.

Definition at line 1721 of file InkAPI.cc.

References Layout::get(), and Layout::sysconfdir.

Referenced by SDK_API_TSfopen().

tsapi TSConfig TSConfigGet ( unsigned int  id  ) 

Definition at line 4128 of file InkAPI.cc.

Referenced by SDK_API_TSConfig().

tsapi void TSConfigRelease ( unsigned int  id,
TSConfig  configp 
)

Definition at line 4134 of file InkAPI.cc.

Referenced by SDK_API_TSConfig().

tsapi unsigned int TSConfigSet ( unsigned int  id,
void *  data,
TSConfigDestroyFunc  funcp 
)

Definition at line 4119 of file InkAPI.cc.

References INKConfigImpl::m_destroy_func, and INKConfigImpl::mdata.

Referenced by SDK_API_TSConfig().

tsapi int TSContCall ( TSCont  contp,
TSEvent  event,
void *  edata 
)
tsapi TSCont TSContCreate ( TSEventFunc  funcp,
TSMutex  mutexp 
)
tsapi void* TSContDataGet ( TSCont  contp  ) 
tsapi void TSContDataSet ( TSCont  contp,
void *  data 
)
tsapi void TSContDestroy ( TSCont  contp  ) 
tsapi TSMutex TSContMutexGet ( TSCont  contp  ) 
tsapi TSAction TSContSchedule ( TSCont  contp,
TSHRTime  timeout,
TSThreadPool  tp 
)
tsapi TSAction TSContScheduleEvery ( TSCont  contp,
TSHRTime  every,
TSThreadPool  tp 
)
tsapi void TSDebug ( const char *  tag,
const char *  format_str,
  ... 
)
tsapi void tsapi void TSDebugSpecific ( int  debug_flag,
const char *  tag,
const char *  format_str,
  ... 
)

Output a debug line even if the debug tag is turned off, as long as debugging is enabled.

Could be used as follows:

      TSDebugSpecifc(TSHttpTxnDebugGet(txn), "plugin_tag" , "Hello World from transaction %p", txn);

will be printed if the plugin_tag is enabled or the transaction specific debugging is turned on for txn.

Parameters:
debug_flag boolean flag.
tag Debug tag for the line.
format Format string.
... Format arguments.
tsapi void TSError ( const char *  fmt,
  ... 
)

Writes printf-style error messages to the Traffic Server error log.

One advantage of TSError over printf is that each call is atomically placed into the error log and is not garbled with other error entries. This is not an issue in single-threaded programs but is a definite nuisance in multi-threaded programs.

Parameters:
fmt printf format description.
... argument for the printf format description.
tsapi void TSfclose ( TSFile  filep  ) 

Closes the file to which filep points and frees the data structures and buffers associated with it.

If the file was opened for writing, any pending data is flushed.

Parameters:
filep file to be closed.

Definition at line 1811 of file InkAPI.cc.

References FileImpl::fclose().

Referenced by log_test_handler(), and SDK_API_TSfopen().

tsapi TSReturnCode TSFetchPageRespGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi void TSFetchPages ( TSFetchUrlParams_t params  ) 
tsapi char* TSFetchRespGet ( TSHttpTxn  txnp,
int *  length 
)

Definition at line 7223 of file InkAPI.cc.

References FetchSM::resp_get(), sdk_assert, sdk_sanity_check_null_ptr(), and TS_SUCCESS.

tsapi void TSFetchUrl ( const char *  request,
int  request_len,
struct sockaddr const *  addr,
TSCont  contp,
TSFetchWakeUpOptions  callback_options,
TSFetchEvent  event 
)
tsapi void TSfflush ( TSFile  filep  ) 

Flushes pending data that has been buffered up in memory from previous calls to TSfwrite().

Parameters:
filep file to flush.

Definition at line 1833 of file InkAPI.cc.

References FileImpl::fflush().

Referenced by SDK_API_TSfopen().

tsapi char* TSfgets ( TSFile  filep,
char *  buf,
size_t  length 
)

Reads a line from the file pointed to by filep into the buffer buf.

Lines are terminated by a line feed character, '
'. The line placed in the buffer includes the line feed character and is terminated with a NULL. If the line is longer than length bytes then only the first length-minus-1 bytes are placed in buf.

Parameters:
filep file to read from.
buf buffer to read into.
length size of the buffer to read into.
Returns:
pointer to the string read into the buffer buf.

Definition at line 1840 of file InkAPI.cc.

References FileImpl::fgets().

Referenced by log_test_handler(), and SDK_API_TSfopen().

tsapi TSFile TSfopen ( const char *  filename,
const char *  mode 
)

Opens a file for reading or writing and returns a descriptor for accessing the file.

The current implementation cannot open a file for both reading or writing. See the SDK Programmer's Guide for sample code.

Parameters:
filename file to be opened.
mode specifies whether to open the file for reading or writing. If mode is "r" then the file is opened for reading. If mode is "w" then the file is opened for writing. Currently "r" and "w" are the only two valid modes for opening a file.
Returns:
descriptor for the file that TSfopen opens. Descriptors of type TSFile can be greater than 256.

Definition at line 1797 of file InkAPI.cc.

References FileImpl::fopen().

Referenced by log_test_handler(), and SDK_API_TSfopen().

tsapi size_t TSfread ( TSFile  filep,
void *  buf,
size_t  length 
)

Attempts to read length bytes of data from the file pointed to by filep into the buffer buf.

Parameters:
filep name of the file to read from.
buf buffer to read into.
length amount of data to read, in bytes.
Returns:
number of bytes read. If end of the file, it returns 0. If the file was not opened for reading or if an error occurs while reading the file, it returns -1.

Definition at line 1819 of file InkAPI.cc.

References FileImpl::fread().

Referenced by SDK_API_TSfopen().

tsapi size_t TSfwrite ( TSFile  filep,
const void *  buf,
size_t  length 
)

Attempts to write length bytes of data from the buffer buf to the file filep.

Make sure that filep is open for writing. You might want to check the number of bytes written (TSfwrite() returns this value) against the value of length. If it is less, there might be insufficient space on disk, for example.

Parameters:
filep file to write into.
buf buffer containing the data to be written.
length amount of data to write to filep, in bytes.
Returns:
number of bytes written to filep. If the file was not opened for writing, it returns -1. If an error occurs while writing, it returns the number of bytes successfully written.

Definition at line 1826 of file InkAPI.cc.

References FileImpl::fwrite().

Referenced by SDK_API_TSfopen().

tsapi TSReturnCode TSHandleMLocRelease ( TSMBuffer  bufp,
TSMLoc  parent,
TSMLoc  mloc 
)

Releases the TSMLoc mloc created from the TSMLoc parent.

If there is no parent TSMLoc, use TS_NULL_MLOC.

Parameters:
bufp marshal buffer containing the TSMLoc handle to be released.
parent location of the parent object from which the handle was created.
mloc location of the handle to be released.

Definition at line 1853 of file InkAPI.cc.

References HDR_HEAP_OBJ_FIELD_SDK_HANDLE, HDR_HEAP_OBJ_HTTP_HEADER, HDR_HEAP_OBJ_MIME_HEADER, HDR_HEAP_OBJ_URL, ink_release_assert, HdrHeapObjImpl::m_type, sdk_assert, sdk_free_field_handle(), sdk_sanity_check_field_handle(), sdk_sanity_check_mbuffer(), TS_ERROR, TS_NULL_MLOC, and TS_SUCCESS.

Referenced by cache_hook_handler(), get_request_id(), SDK_API_TSHttpHdr(), SDK_API_TSHttpHdrParse(), SDK_API_TSMimeHdrField(), SDK_API_TSMimeHdrParse(), SDK_API_TSUrl(), SDK_API_TSUrlParse(), SpdyNV::SpdyNV(), and transform_hook_handler().

tsapi TSAction TSHostLookup ( TSCont  contp,
const char *  hostname,
size_t  namelen 
)
tsapi struct sockaddr const* TSHostLookupResultAddrGet ( TSHostLookupResult  lookup_result  )  [read]
tsapi TSReturnCode TSHttpAltInfoCachedReqGet ( TSHttpAltInfo  infop,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi TSReturnCode TSHttpAltInfoCachedRespGet ( TSHttpAltInfo  infop,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi TSReturnCode TSHttpAltInfoClientReqGet ( TSHttpAltInfo  infop,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi void TSHttpAltInfoQualitySet ( TSHttpAltInfo  infop,
float  quality 
)

Definition at line 6035 of file InkAPI.cc.

References HttpAltInfo::m_qvalue, sdk_assert, sdk_sanity_check_alt_info(), and TS_SUCCESS.

Referenced by altinfo_hook_handler().

tsapi TSReturnCode TSHttpArgIndexLookup ( int  arg_idx,
const char **  name,
const char **  description 
)
tsapi TSReturnCode TSHttpArgIndexNameLookup ( const char *  name,
int *  arg_idx,
const char **  description 
)
tsapi TSReturnCode TSHttpArgIndexReserve ( const char *  name,
const char *  description,
int *  arg_idx 
)
tsapi TSReturnCode TSHttpCacheReenable ( TSCacheTxn  txnp,
const TSEvent  event,
const void *  data,
const uint64_t  size 
)
tsapi TSVConn TSHttpConnect ( struct sockaddr const *  addr  ) 

Backwards compatible version.

This provides a tag of "plugin" and an id of 0.

Referenced by SDK_API_TSHttpConnectIntercept(), and SDK_API_TSHttpConnectServerIntercept().

tsapi TSVConn TSHttpConnectTransparent ( struct sockaddr const *  client_addr,
struct sockaddr const *  server_addr 
)

Allows the plugin to initiate a transparent http connection.

This operates identically to TSHttpConnect except that it is treated as an intercepted transparent connection by the session and transaction state machines.

Parameters:
client_addr the address that the resulting connection will be seen as coming from
server_addr the address that the resulting connection will be seen as attempting to connect to when intercepted
vc will be set to point to the new TSVConn on success.
tsapi TSVConn TSHttpConnectWithPluginId ( struct sockaddr const *  addr,
char const *  tag,
int64_t  id 
)

Allows the plugin to initiate an http connection.

The TSVConn the plugin receives as the result of successful operates identically to one created through TSNetConnect. Aside from allowing the plugin to set the client ip and port for logging, the functionality of TSHttpConnect() is identical to connecting to localhost on the proxy port with TSNetConnect(). TSHttpConnect() is more efficient than TSNetConnect() to localhost since it avoids the overhead of passing the data through the operating system.

This returns a VConn that connected to the transaction.

Parameters:
addr Target address of the origin server.
tag A logging tag that can be accessed via the pitag field. May be NULL.
id A logging id that can be access via the piid field.

Referenced by FetchSM::httpConnect(), and TSHttpConnect().

tsapi int TSHttpCurrentActiveClientConnectionsGet ( void   ) 

Definition at line 5952 of file InkAPI.cc.

References http_current_active_client_connections_stat, and HTTP_READ_DYN_SUM.

tsapi int TSHttpCurrentCacheConnectionsGet ( void   ) 

Definition at line 5976 of file InkAPI.cc.

References http_current_cache_connections_stat, and HTTP_READ_DYN_SUM.

tsapi int TSHttpCurrentClientConnectionsGet ( void   ) 

Definition at line 5943 of file InkAPI.cc.

References http_current_client_connections_stat, and HTTP_READ_DYN_SUM.

tsapi int TSHttpCurrentIdleClientConnectionsGet ( void   ) 
tsapi int TSHttpCurrentServerConnectionsGet ( void   ) 

Definition at line 5985 of file InkAPI.cc.

References http_current_server_connections_stat, and HTTP_READ_GLOBAL_DYN_SUM.

tsapi const char* TSHttpEventNameLookup ( TSEvent  event  ) 

Return a string respresentation for a TSEvent value.

This is useful for plugin debugging.

Parameters:
event the value of this TSHttpHookID
Returns:
the string representation of the event

Definition at line 8623 of file InkAPI.cc.

References HttpDebugNames::get_event_name().

Referenced by SDK_API_DEBUG_NAME_LOOKUPS().

tsapi TSReturnCode TSHttpHdrClone ( TSMBuffer  dest_bufp,
TSMBuffer  src_bufp,
TSMLoc  src_hdr,
TSMLoc locp 
)
tsapi TSReturnCode TSHttpHdrCopy ( TSMBuffer  dest_bufp,
TSMLoc  dest_offset,
TSMBuffer  src_bufp,
TSMLoc  src_offset 
)

Copies the contents of the HTTP header located at src_loc within src_bufp to the HTTP header located at dest_loc within dest_bufp.

TSHttpHdrCopy() works correctly even if src_bufp and dest_bufp point to different marshal buffers. Make sure that you create the destination HTTP header before copying into it.

Note: TSHttpHdrCopy() appends the port number to the domain of the URL portion of the header. For example, a copy of http://www.example.com appears as http://www.example.com:80 in the destination buffer.

Parameters:
dest_bufp marshal buffer to contain the copied header.
dest_offset location of the copied header.
src_bufp marshal buffer containing the source header.
src_offset location of the source header.

Definition at line 3515 of file InkAPI.cc.

References HDR_HEAP_OBJ_HTTP_HEADER, http_hdr_copy_onto(), isWriteable(), HTTPHdrImpl::m_polarity, HdrHeapObjImpl::m_type, sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), TS_SUCCESS, and TSHttpHdrTypeSet().

Referenced by SDK_API_TSHttpHdr().

tsapi TSMLoc TSHttpHdrCreate ( TSMBuffer  bufp  ) 
tsapi void TSHttpHdrDestroy ( TSMBuffer  bufp,
TSMLoc  offset 
)

Destroys the HTTP header located at hdr_loc within the marshal buffer bufp.

Do not forget to release the handle hdr_loc with a call to TSHandleMLocRelease().

Definition at line 3472 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), and TS_SUCCESS.

Referenced by SDK_API_TSHttpHdr().

tsapi int TSHttpHdrLengthGet ( TSMBuffer  bufp,
TSMLoc  offset 
)
tsapi const char* TSHttpHdrMethodGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)
tsapi TSReturnCode TSHttpHdrMethodSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)
tsapi TSParseResult TSHttpHdrParseReq ( TSHttpParser  parser,
TSMBuffer  bufp,
TSMLoc  offset,
const char **  start,
const char *  end 
)

Parses an HTTP request header.

The HTTP header must have already been created, and must reside inside the marshal buffer bufp. The start argument points to the current position of the string buffer being parsed. The end argument points to one byte after the end of the buffer to be parsed. On return, TSHttpHdrParseReq() modifies start to point past the last character parsed.

It is possible to parse an HTTP request header a single byte at a time using repeated calls to TSHttpHdrParseReq(). As long as an error does not occur, the TSHttpHdrParseReq() function will consume that single byte and ask for more.

Parameters:
parser parses the HTTP header.
bufp marshal buffer containing the HTTP header to be parsed.
offset location of the HTTP header within bufp.
start both an input and output. On input, it points to the current position of the string buffer being parsed. On return, start is modified to point past the last character parsed.
end points to one byte after the end of the buffer to be parsed.
Returns:
status of the parse:
  • TS_PARSE_ERROR means there was a parsing error.
  • TS_PARSE_DONE means that the end of the header was reached (the parser encountered a "\r\n\r\n" pattern).
  • TS_PARSE_CONT means that parsing of the header stopped because the parser reached the end of the buffer (large headers can span multiple buffers).

Definition at line 3583 of file InkAPI.cc.

References HDR_HEAP_OBJ_HTTP_HEADER, ink_assert, isWriteable(), HTTPHdr::m_http, HdrHeapObjImpl::m_type, HTTPHdr::parse_req(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_null_ptr(), SET_HTTP_HDR, TS_HTTP_TYPE_REQUEST, TS_SUCCESS, and TSHttpHdrTypeSet().

Referenced by SDK_API_TSHttpHdrParse().

tsapi TSParseResult TSHttpHdrParseResp ( TSHttpParser  parser,
TSMBuffer  bufp,
TSMLoc  offset,
const char **  start,
const char *  end 
)
tsapi void TSHttpHdrPrint ( TSMBuffer  bufp,
TSMLoc  offset,
TSIOBuffer  iobufp 
)
tsapi const char* TSHttpHdrReasonGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)
tsapi const char* TSHttpHdrReasonLookup ( TSHttpStatus  status  ) 

Definition at line 3874 of file InkAPI.cc.

References http_hdr_reason_lookup().

Referenced by SDK_API_TSHttpHdr().

tsapi TSReturnCode TSHttpHdrReasonSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)
tsapi TSHttpStatus TSHttpHdrStatusGet ( TSMBuffer  bufp,
TSMLoc  offset 
)
tsapi TSReturnCode TSHttpHdrStatusSet ( TSMBuffer  bufp,
TSMLoc  offset,
TSHttpStatus  status 
)
tsapi TSHttpType TSHttpHdrTypeGet ( TSMBuffer  bufp,
TSMLoc  offset 
)
tsapi TSReturnCode TSHttpHdrTypeSet ( TSMBuffer  bufp,
TSMLoc  offset,
TSHttpType  type 
)
tsapi TSReturnCode TSHttpHdrUrlGet ( TSMBuffer  bufp,
TSMLoc  offset,
TSMLoc locp 
)
tsapi TSReturnCode TSHttpHdrUrlSet ( TSMBuffer  bufp,
TSMLoc  offset,
TSMLoc  url 
)
tsapi int TSHttpHdrVersionGet ( TSMBuffer  bufp,
TSMLoc  offset 
)
tsapi TSReturnCode TSHttpHdrVersionSet ( TSMBuffer  bufp,
TSMLoc  offset,
int  ver 
)
tsapi void TSHttpHookAdd ( TSHttpHookID  id,
TSCont  contp 
)
tsapi const char* TSHttpHookNameLookup ( TSHttpHookID  hook  ) 

Return a string respresentation for a TSHttpHookID value.

This is useful for plugin debugging.

Parameters:
hook the value of this TSHttpHookID
Returns:
the string representation of the hook ID

Definition at line 8617 of file InkAPI.cc.

References HttpDebugNames::get_api_hook_name().

Referenced by SDK_API_DEBUG_NAME_LOOKUPS().

tsapi TSReturnCode TSHttpIsInternalRequest ( TSHttpTxn  txnp  ) 
tsapi TSReturnCode TSHttpIsInternalSession ( TSHttpSsn  ssnp  ) 
tsapi void TSHttpParserClear ( TSHttpParser  parser  ) 
tsapi TSHttpParser TSHttpParserCreate ( void   ) 

Definition at line 3432 of file InkAPI.cc.

References ats_malloc(), and http_parser_init().

Referenced by SDK_API_TSHttpHdrParse().

tsapi void TSHttpParserDestroy ( TSHttpParser  parser  ) 
tsapi TSAction TSHttpSchedule ( TSCont  contp,
TSHttpTxn  txnp,
TSHRTime  timeout 
)
tsapi const char* TSHttpServerStateNameLookup ( TSServerState  state  ) 

Return a string respresentation for a TSServerState value.

This is useful for plugin debugging.

Parameters:
state the value of this TSServerState
Returns:
the string representation of the state

Definition at line 8611 of file InkAPI.cc.

References HttpDebugNames::get_server_state_name().

Referenced by SDK_API_DEBUG_NAME_LOOKUPS().

tsapi void* TSHttpSsnArgGet ( TSHttpSsn  ssnp,
int  arg_idx 
)
tsapi void TSHttpSsnArgSet ( TSHttpSsn  ssnp,
int  arg_idx,
void *  arg 
)
tsapi struct sockaddr const* TSHttpSsnClientAddrGet ( TSHttpSsn  ssnp  )  [read]
tsapi TSReturnCode TSHttpSsnClientFdGet ( TSHttpSsn  ssnp,
int *  fdp 
)
tsapi int TSHttpSsnDebugGet ( TSHttpSsn  ssnp,
int *  on 
)

Returns the transaction specific debugging flag for this client session.

Parameters:
txnp Client session to check.
Returns:
1 if enabled, 0 otherwise.
tsapi void TSHttpSsnDebugSet ( TSHttpSsn  ssnp,
int  on 
)

Set the session specific debugging flag for this client session.

When turned on, internal debug messages related to this session and all transactions in the session will be written even if the debug tag isn't on.

Parameters:
ssnp Client session to change.
on set to 1 to turn on, 0 to turn off.

Definition at line 5736 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_http_ssn(), and TS_SUCCESS.

tsapi void TSHttpSsnHookAdd ( TSHttpSsn  ssnp,
TSHttpHookID  id,
TSCont  contp 
)
tsapi struct sockaddr const* TSHttpSsnIncomingAddrGet ( TSHttpSsn  ssnp  )  [read]
tsapi void TSHttpSsnReenable ( TSHttpSsn  ssnp,
TSEvent  event 
)
tsapi void* TSHttpSsnSSLConnectionGet ( TSHttpSsn  ssnp  ) 

Get SSL object of this session.

Retrieves the SSL object of the SSL connection.

Returns:
SSL object of this session

Definition at line 5173 of file InkAPI.cc.

References HttpClientSession::get_netvc(), sdk_assert, sdk_sanity_check_null_ptr(), SSLNetVConnection::ssl, and TS_SUCCESS.

tsapi int TSHttpSsnTransactionCount ( TSHttpSsn  ssnp  ) 
tsapi TSReturnCode TSHttpTxnAborted ( TSHttpTxn  txnp  ) 

Check if transaction was aborted (due client/server errors etc.

)

Returns:
1 if transaction was aborted

Definition at line 5074 of file InkAPI.cc.

References HttpTransact::ABORTED, HttpTransact::State::current, sdk_assert, sdk_sanity_check_txn(), HttpTransact::State::squid_codes, SQUID_LOG_ERR_CLIENT_ABORT, SQUID_LOG_TCP_SWAPFAIL, HttpSM::t_state, and TS_SUCCESS.

tsapi void TSHttpTxnActiveTimeoutSet ( TSHttpTxn  txnp,
int  timeout 
)

timeout is in msec overrides as proxy.config.http.transaction_active_timeout_out

Definition at line 4978 of file InkAPI.cc.

References HttpTransact::State::api_txn_active_timeout_value, sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi void* TSHttpTxnArgGet ( TSHttpTxn  txnp,
int  arg_idx 
)
tsapi void TSHttpTxnArgSet ( TSHttpTxn  txnp,
int  arg_idx,
void *  arg 
)
tsapi int TSHttpTxnBackgroundFillStarted ( TSHttpTxn  txnp  ) 
tsapi TSReturnCode TSHttpTxnCachedReqGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi TSReturnCode TSHttpTxnCachedRespGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi TSReturnCode TSHttpTxnCachedRespModifiableGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi TSReturnCode TSHttpTxnCacheLookupStatusGet ( TSHttpTxn  txnp,
int *  lookup_status 
)
tsapi TSReturnCode TSHttpTxnCacheLookupStatusSet ( TSHttpTxn  txnp,
int  cachelookup 
)
tsapi TSReturnCode TSHttpTxnCacheLookupUrlGet ( TSHttpTxn  txnp,
TSMBuffer  bufp,
TSMLoc  obj 
)
tsapi struct sockaddr const* TSHttpTxnClientAddrGet ( TSHttpTxn  txnp  )  [read]

Get client address for transaction txnp.

Retrieves the socket address of the remote client that has connected to Traffic Server for transaction txnp. The return structure is the generic socket address storage in order to be address-family agnostic. The user of this function can then go on to do the appropriate thing with the type specified in the ss_family field of the structure whether that be for IPv4, IPv6, or any other address family.

Returns:
Client address for connection to client in transaction txnp.

Definition at line 5203 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_txn(), TS_SUCCESS, TSHttpSsnClientAddrGet(), and TSHttpTxnSsnGet().

Referenced by checkHttpTxnClientAddrGet(), and checkHttpTxnClientIPGet().

tsapi TSReturnCode TSHttpTxnClientFdGet ( TSHttpTxn  txnp,
int *  fdp 
)
tsapi void TSHttpTxnClientIncomingPortSet ( TSHttpTxn  txnp,
int  port 
)
tsapi TSReturnCode TSHttpTxnClientPacketMarkSet ( TSHttpTxn  txnp,
int  mark 
)

Change packet firewall mark for the client side connection.

Note:
The change takes effect immediately
Returns:
TS_SUCCESS if the client connection was modified

Definition at line 5322 of file InkAPI.cc.

References NetVConnection::apply_options(), HttpClientSession::get_netvc(), NetVConnection::options, NetVCOptions::packet_mark, sdk_assert, sdk_sanity_check_txn(), TS_SUCCESS, and HttpSM::ua_session.

tsapi TSReturnCode TSHttpTxnClientPacketTosSet ( TSHttpTxn  txnp,
int  tos 
)

Change packet TOS for the client side connection.

Note:
The change takes effect immediately
TOS is deprecated and replaced by DSCP, this is still used to set DSCP however the first 2 bits of this value will be ignored as they now belong to the ECN field.
Returns:
TS_SUCCESS if the client connection was modified

Definition at line 5364 of file InkAPI.cc.

References NetVConnection::apply_options(), HttpClientSession::get_netvc(), NetVConnection::options, NetVCOptions::packet_tos, sdk_assert, sdk_sanity_check_txn(), TS_SUCCESS, and HttpSM::ua_session.

tsapi int64_t TSHttpTxnClientReqBodyBytesGet ( TSHttpTxn  txnp  ) 
tsapi TSReturnCode TSHttpTxnClientReqGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi int TSHttpTxnClientReqHdrBytesGet ( TSHttpTxn  txnp  ) 
tsapi int64_t TSHttpTxnClientRespBodyBytesGet ( TSHttpTxn  txnp  ) 
tsapi TSReturnCode TSHttpTxnClientRespGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi int TSHttpTxnClientRespHdrBytesGet ( TSHttpTxn  txnp  ) 
tsapi TSReturnCode TSHttpTxnConfigFind ( const char *  name,
int  length,
TSOverridableConfigKey conf,
TSRecordDataType type 
)
tsapi TSReturnCode TSHttpTxnConfigFloatGet ( TSHttpTxn  txnp,
TSOverridableConfigKey  conf,
TSMgmtFloat value 
)
tsapi TSReturnCode TSHttpTxnConfigFloatSet ( TSHttpTxn  txnp,
TSOverridableConfigKey  conf,
TSMgmtFloat  value 
)
tsapi TSReturnCode TSHttpTxnConfigIntGet ( TSHttpTxn  txnp,
TSOverridableConfigKey  conf,
TSMgmtInt value 
)
tsapi TSReturnCode TSHttpTxnConfigIntSet ( TSHttpTxn  txnp,
TSOverridableConfigKey  conf,
TSMgmtInt  value 
)
tsapi TSReturnCode TSHttpTxnConfigStringGet ( TSHttpTxn  txnp,
TSOverridableConfigKey  conf,
const char **  value,
int *  length 
)
tsapi TSReturnCode TSHttpTxnConfigStringSet ( TSHttpTxn  txnp,
TSOverridableConfigKey  conf,
const char *  value,
int  length 
)
tsapi void TSHttpTxnConnectTimeoutSet ( TSHttpTxn  txnp,
int  timeout 
)

timeout is in msec overrides as proxy.config.http.connect_attempts_timeout

Definition at line 4991 of file InkAPI.cc.

References HttpTransact::State::api_txn_connect_timeout_value, sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi int TSHttpTxnDebugGet ( TSHttpTxn  txnp  ) 

Returns the transaction specific debugging flag for this transaction.

Parameters:
txnp transaction to check.
Returns:
1 if enabled, 0 otherwise.

Definition at line 5729 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi void TSHttpTxnDebugSet ( TSHttpTxn  txnp,
int  on 
)

Set the transaction specific debugging flag for this transaction.

When turned on, internal debug messages related to this transaction will be written even if the debug tag isn't on.

Parameters:
txnp transaction to change.
on set to 1 to turn on, 0 to turn off.

Definition at line 5722 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi void TSHttpTxnDNSTimeoutSet ( TSHttpTxn  txnp,
int  timeout 
)

timeout is in msec overrides as proxy.config.dns.lookup_timeout

Definition at line 5004 of file InkAPI.cc.

References HttpTransact::State::api_txn_dns_timeout_value, sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi char* TSHttpTxnEffectiveUrlStringGet ( TSHttpTxn  txnp,
int *  length 
)

Get the effective URL for the transaction.

The effective URL is the URL taking in to account both the explicit URL in the request and the HOST field.

A possibly non-null terminated string is returned.

Note:
The returned string is allocated and must be freed by the caller after use with TSfree.
Parameters:
length String length return, may be NULL.

Definition at line 4571 of file InkAPI.cc.

References HttpTransact::State::hdr_info, sdk_assert, sdk_sanity_check_null_ptr(), sdk_sanity_check_txn(), HttpSM::t_state, and TS_SUCCESS.

tsapi void TSHttpTxnErrorBodySet ( TSHttpTxn  txnp,
char *  buf,
size_t  buflength,
char *  mimetype 
)

Sets an error type body to a transaction.

Note that both string arguments must be allocated with TSmalloc() or TSstrdup(). The mimetype argument is optional, if not provided it defaults to "text/html". Sending an emptry string would prevent setting a content type header (but that is not adviced).

Parameters:
txnp HTTP transaction whose parent proxy to get.
buf The body message (must be heap allocated).
buflength Length of the body message.
mimetype The MIME type to set the response to (can be NULL, but must be heap allocated if non-NULL).

Definition at line 5407 of file InkAPI.cc.

References ats_free(), HttpTransact::State::free_internal_msg_buffer(), HttpTransact::State::internal_msg_buffer, HttpTransact::State::internal_msg_buffer_fast_allocator_size, HttpTransact::State::internal_msg_buffer_size, HttpTransact::State::internal_msg_buffer_type, sdk_assert, sdk_sanity_check_txn(), HttpSM::t_state, and TS_SUCCESS.

Referenced by ssn_handler().

tsapi TSReturnCode TSHttpTxnFollowRedirect ( TSHttpTxn  txnp,
int  on 
)

This API informs the core to try to follow redirections (e.g.

301 responses. The new URL would be provided in the standard Location header.

Parameters:
txnp the transaction pointer
on turn this on or off (0 or 1)
Returns:
TS_SUCCESS if it succeeded

Definition at line 7137 of file InkAPI.cc.

References HttpSM::enable_redirection, sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi void TSHttpTxnHookAdd ( TSHttpTxn  txnp,
TSHttpHookID  id,
TSCont  contp 
)
tsapi struct sockaddr const* TSHttpTxnIncomingAddrGet ( TSHttpTxn  txnp  )  [read]

Get the incoming address.

Note:
The pointer is valid only for the current callback. Clients that need to keep the value across callbacks must maintain their own storage.
Returns:
Local address of the client connection for transaction txnp.

Definition at line 5224 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_txn(), TS_SUCCESS, TSHttpSsnIncomingAddrGet(), and TSHttpTxnSsnGet().

Referenced by checkHttpTxnIncomingAddrGet().

tsapi void TSHttpTxnIntercept ( TSCont  contp,
TSHttpTxn  txnp 
)

Allows a plugin take over the servicing of the request as though it was the origin server.

contp will be sent TS_EVENT_NET_ACCEPT. The edata passed with TS_NET_EVENT_ACCEPT is an TSVConn just as it would be for a normal accept. The plugin must act as if it is an http server and read the http request and body off the TSVConn and send an http response header and body.

TSHttpTxnIntercept() must be called be called from only TS_HTTP_READ_REQUEST_HOOK. Using TSHttpTxnIntercept will bypass the Traffic Server cache. If response sent by the plugin should be cached, use TSHttpTxnServerIntercept() instead. TSHttpTxnIntercept() primary use is allow plugins to serve data about their functioning directly.

TSHttpTxnIntercept() must only be called once per transaction.

Parameters:
contp continuation called to handle the interception.
txnp transaction to be intercepted.

Definition at line 6379 of file InkAPI.cc.

References PluginVCCore::alloc(), Continuation::mutex, HttpSM::plugin_tunnel, HttpSM::plugin_tunnel_type, sdk_assert, sdk_sanity_check_continuation(), sdk_sanity_check_null_ptr(), sdk_sanity_check_txn(), PluginVCCore::set_accept_cont(), and TS_SUCCESS.

Referenced by cont_test_handler().

tsapi int TSHttpTxnIsCacheable ( TSHttpTxn  txnp,
TSMBuffer  request,
TSMBuffer  response 
)

Test whether a request / response header pair would be cacheable under the current configuration.

This would typically be used in TS_HTTP_READ_RESPONSE_HDR_HOOK, when you have both the client request and server response ready.

Parameters:
txnp the transaction pointer
request the client request header. If NULL, use the transactions client request.
response the server response header. If NULL, use the transactions origin response.
Returns:
1 if the request / response is cacheable, 0 otherwise

Definition at line 8583 of file InkAPI.cc.

References HttpTransact::State::hdr_info, HttpTransact::is_response_cacheable(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_txn(), HttpSM::t_state, TS_SUCCESS, and HTTPHdr::valid().

tsapi TSReturnCode TSHttpTxnMilestoneGet ( TSHttpTxn  txnp,
TSMilestonesType  milestone,
TSHRTime time 
)

Return the particular milestone timer for the transaction.

If 0 is returned, it means the transaction has not yet reached that milestone. Asking for an "unknown" milestone is an error.

Parameters:
txnp the transaction pointer
milestone the requested milestone timer was created.
time a pointer to a TSHRTime where we will store the timer
Returns:
TS_SUCCESS if the milestone is supported, TS_ERROR otherwise
tsapi struct sockaddr const* TSHttpTxnNextHopAddrGet ( TSHttpTxn  txnp  )  [read]

Get the next hop address.

Note:
The pointer is valid only for the current callback. Clients that need to keep the value across callbacks must maintain their own storage.
Returns:
The address of the next hop for transaction txnp.

Return zero if the server structure is not yet constructed.

Definition at line 5288 of file InkAPI.cc.

References HttpTransact::State::current, sdk_assert, sdk_sanity_check_txn(), HttpSM::t_state, and TS_SUCCESS.

Referenced by checkHttpTxnNextHopIPGet().

tsapi void TSHttpTxnNoActivityTimeoutSet ( TSHttpTxn  txnp,
int  timeout 
)

timeout is in msec overrides as proxy.config.http.transaction_no_activity_timeout_out

Definition at line 5019 of file InkAPI.cc.

References HttpTransact::State::api_txn_no_activity_timeout_value, sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi TSReturnCode TSHttpTxnOutgoingAddrSet ( TSHttpTxn  txnp,
struct sockaddr const *  addr 
)
tsapi TSReturnCode TSHttpTxnOutgoingTransparencySet ( TSHttpTxn  txnp,
int  flag 
)
tsapi TSReturnCode TSHttpTxnParentProxyGet ( TSHttpTxn  txnp,
char **  hostname,
int *  port 
)

Retrieves the parent proxy hostname and port, if parent proxying is enabled.

If parent proxying is not enabled, TSHttpTxnParentProxyGet() sets hostname to NULL and port to -1.

Parameters:
txnp HTTP transaction whose parent proxy to get.
hostname of the parent proxy.
port parent proxy's port.

Definition at line 5449 of file InkAPI.cc.

References HttpTransact::State::api_info, _HttpApiInfo::parent_proxy_name, _HttpApiInfo::parent_proxy_port, sdk_assert, sdk_sanity_check_txn(), HttpSM::t_state, and TS_SUCCESS.

Referenced by checkHttpTxnParentProxy().

tsapi void TSHttpTxnParentProxySet ( TSHttpTxn  txnp,
char *  hostname,
int  port 
)

Sets the parent proxy name and port.

The string hostname is copied into the TSHttpTxn; you can modify or delete the string after calling TSHttpTxnParentProxySet().

Parameters:
txnp HTTP transaction whose parent proxy to set.
hostname parent proxy host name string.
port parent proxy port to set.

Definition at line 5462 of file InkAPI.cc.

References HttpTransact::State::api_info, HttpTransact::State::arena, _HttpApiInfo::parent_proxy_name, _HttpApiInfo::parent_proxy_port, sdk_assert, sdk_sanity_check_null_ptr(), sdk_sanity_check_txn(), Arena::str_store(), HttpSM::t_state, and TS_SUCCESS.

Referenced by checkHttpTxnParentProxy().

tsapi TSReturnCode TSHttpTxnPristineUrlGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc url_loc 
)
tsapi TSReturnCode TSHttpTxnPrivateSessionSet ( TSHttpTxn  txnp,
int  private_session 
)
tsapi int64_t TSHttpTxnPushedRespBodyBytesGet ( TSHttpTxn  txnp  ) 
tsapi int TSHttpTxnPushedRespHdrBytesGet ( TSHttpTxn  txnp  ) 
tsapi int TSHttpTxnRedirectRetries ( TSHttpTxn  txnp  ) 

Return the number of redirection retries we have done.

This starts off at zero, and can be used to select different URLs based on which attempt this is. This can be useful for example when providing a list of URLs to try, and do so in order until one succeeds.

Parameters:
txnp the transaction pointer
Returns:
the redirect try count

Definition at line 7213 of file InkAPI.cc.

References HttpSM::redirection_tries, sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi const char* TSHttpTxnRedirectUrlGet ( TSHttpTxn  txnp,
int *  url_len_ptr 
)

Return the current (if set) redirection URL string.

This is still owned by the core, and must not be free'd.

Parameters:
txnp the transaction pointer
url_len_ptr a pointer to where the URL length is to be stored
Returns:
the url string

Definition at line 7195 of file InkAPI.cc.

References HttpSM::redirect_url, HttpSM::redirect_url_len, sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

Referenced by TSRedirectUrlGet().

tsapi void TSHttpTxnRedirectUrlSet ( TSHttpTxn  txnp,
const char *  url,
const int  url_len 
)

This is a generalization of the TSHttpTxnFollowRedirect(), but gives finer control over the behavior.

Instead of using the Location: header for the new destination, this API takes the new URL as a parameter. Calling this API transfers the ownership of the URL from the plugin to the core, so you must make sure it is heap allocated, and that you do not free it.

Calling this API implicitly also enables the "Follow Redirect" feature, so there is no rason to call TSHttpTxnFollowRedirect() as well.

Parameters:
txnp the transaction pointer
url a heap allocated string with the URL
url_len the length of the URL

Definition at line 7149 of file InkAPI.cc.

References ats_free(), HttpSM::enable_redirection, HttpSM::redirect_url, HttpSM::redirect_url_len, sdk_assert, sdk_sanity_check_null_ptr(), sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi void TSHttpTxnReenable ( TSHttpTxn  txnp,
TSEvent  event 
)

Notifies the HTTP transaction txnp that the plugin is finished processing the current hook.

The plugin tells the transaction to either continue (TS_EVENT_HTTP_CONTINUE) or stop (TS_EVENT_HTTP_ERROR).

You must always reenable the HTTP transaction after the processing of each transaction event. However, never reenable twice. Reenabling twice is a serious error.

Parameters:
txnp transaction to be reenabled.
event tells the transaction how to continue:

  • TS_EVENT_HTTP_CONTINUE, which means that the transaction should continue.
  • TS_EVENT_HTTP_ERROR which terminates the transaction and sends an error to the client if no response has already been sent.

Definition at line 5517 of file InkAPI.cc.

References ET_NET, eventProcessor, Continuation::mutex, MUTEX_TRY_LOCK, REGULAR, EventProcessor::schedule_imm(), sdk_assert, sdk_sanity_check_txn(), HttpSM::state_api_callback(), this_ethread(), TS_SUCCESS, and EThread::tt.

Referenced by altinfo_hook_handler(), cache_hook_handler(), cont_test_handler(), mytest_handler(), PrefetchPlugin(), ssn_handler(), and transform_hook_handler().

tsapi void TSHttpTxnReqCacheableSet ( TSHttpTxn  txnp,
int  flag 
)
tsapi void TSHttpTxnRespCacheableSet ( TSHttpTxn  txnp,
int  flag 
)
tsapi struct sockaddr const* TSHttpTxnServerAddrGet ( TSHttpTxn  txnp  )  [read]

Get the origin server address.

Note:
The pointer is valid only for the current callback. Clients that need to keep the value across callbacks must maintain their own storage.
Returns:
The address of the origin server for transaction txnp.

Definition at line 5233 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_txn(), HttpTransact::State::server_info, HttpSM::t_state, and TS_SUCCESS.

Referenced by checkHttpTxnServerIPGet().

tsapi TSReturnCode TSHttpTxnServerAddrSet ( TSHttpTxn  txnp,
struct sockaddr const *  addr 
)

Set the origin server address.

This must be invoked before the origin server address is looked up. If called no lookup is done, the address addr is used instead.

Returns:
TS_SUCCESS if the origin server address is set, TS_ERROR otherwise.
Parameters:
addr Address for origin server.

Definition at line 5242 of file InkAPI.cc.

References HttpTransact::State::api_server_addr_set, ats_ip_copy(), ats_ip_port_cast(), sdk_assert, sdk_sanity_check_txn(), HttpTransact::State::server_info, HttpSM::t_state, and TS_SUCCESS.

tsapi void TSHttpTxnServerIntercept ( TSCont  contp,
TSHttpTxn  txnp 
)

Allows a plugin take over the servicing of the request as though it was the origin server.

In the event a request needs to be made to the server for transaction txnp, contp will be sent TS_EVENT_NET_ACCEPT. The edata passed with TS_NET_EVENT_ACCEPT is an TSVConn just as it would be for a normal accept. The plugin must act as if it is an http server and read the http request and body off the TSVConn and send an http response header and body.

TSHttpTxnInterceptServer() must be not be called after the connection to the server has taken place. The last hook last hook in that TSHttpTxnIntercept() can be called from is TS_HTTP_READ_CACHE_HDR_HOOK. If a connection to the server is not necessary, contp is not called.

The response from the plugin is cached subject to standard and configured http caching rules. Should the plugin wish the response not be cached, the plugin must use appropriate http response headers to prevent caching. The primary purpose of TSHttpTxnInterceptServer() is allow plugins to provide gateways to other protocols or to allow to plugin to it's own transport for the next hop to the server. TSHttpTxnInterceptServer() overrides parent cache configuration.

TSHttpTxnInterceptServer() must only be called once per transaction.

Parameters:
contp continuation called to handle the interception
txnp transaction to be intercepted.

Definition at line 6362 of file InkAPI.cc.

References PluginVCCore::alloc(), Continuation::mutex, HttpSM::plugin_tunnel, HttpSM::plugin_tunnel_type, sdk_assert, sdk_sanity_check_continuation(), sdk_sanity_check_null_ptr(), sdk_sanity_check_txn(), PluginVCCore::set_accept_cont(), and TS_SUCCESS.

Referenced by cont_test_handler().

tsapi TSReturnCode TSHttpTxnServerPacketMarkSet ( TSHttpTxn  txnp,
int  mark 
)

Change packet firewall mark for the server side connection.

Note:
The change takes effect immediately, if no OS connection has been made, then this sets the mark that will be used IF an OS connection is established
Returns:
TS_SUCCESS if the (future?) server connection was modified

Definition at line 5341 of file InkAPI.cc.

References NetVConnection::apply_options(), HttpServerSession::get_netvc(), HttpClientSession::get_server_session(), NetVConnection::options, NetVCOptions::packet_mark, sdk_assert, sdk_sanity_check_txn(), TS_CONFIG_NET_SOCK_PACKET_MARK_OUT, TS_SUCCESS, TSHttpTxnConfigIntSet(), and HttpSM::ua_session.

tsapi TSReturnCode TSHttpTxnServerPacketTosSet ( TSHttpTxn  txnp,
int  tos 
)

Change packet TOS for the server side connection.

Note:
The change takes effect immediately, if no OS connection has been made, then this sets the mark that will be used IF an OS connection is established
TOS is deprecated and replaced by DSCP, this is still used to set DSCP however the first 2 bits of this value will be ignored as they now belong to the ECN field.
Returns:
TS_SUCCESS if the (future?) server connection was modified

Definition at line 5383 of file InkAPI.cc.

References NetVConnection::apply_options(), HttpServerSession::get_netvc(), HttpClientSession::get_server_session(), NetVConnection::options, NetVCOptions::packet_tos, sdk_assert, sdk_sanity_check_txn(), TS_CONFIG_NET_SOCK_PACKET_TOS_OUT, TS_SUCCESS, TSHttpTxnConfigIntSet(), and HttpSM::ua_session.

tsapi int64_t TSHttpTxnServerReqBodyBytesGet ( TSHttpTxn  txnp  ) 
tsapi TSReturnCode TSHttpTxnServerReqGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi int TSHttpTxnServerReqHdrBytesGet ( TSHttpTxn  txnp  ) 
tsapi int64_t TSHttpTxnServerRespBodyBytesGet ( TSHttpTxn  txnp  ) 
tsapi TSReturnCode TSHttpTxnServerRespGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi int TSHttpTxnServerRespHdrBytesGet ( TSHttpTxn  txnp  ) 
tsapi TSReturnCode TSHttpTxnServerRespNoStoreSet ( TSHttpTxn  txnp,
int  flag 
)

Set flag indicating whether or not to cache the server response for given TSHttpTxn.

Note:
This should be done in the HTTP_READ_RESPONSE_HDR_HOOK or earlier.
If TSHttpTxnRespCacheableSet() is not working the way you expect, this may be the function you should use instead.
Parameters:
txnp The transaction whose server response you do not want to store.
flag Set 0 to allow storing and 1 to disable storing.
Returns:
TS_SUCCESS.

Definition at line 5028 of file InkAPI.cc.

References HttpTransact::State::api_server_response_no_store, sdk_assert, sdk_sanity_check_txn(), and TS_SUCCESS.

tsapi TSServerState TSHttpTxnServerStateGet ( TSHttpTxn  txnp  ) 
tsapi void TSHttpTxnSetHttpRetStatus ( TSHttpTxn  txnp,
TSHttpStatus  http_retstatus 
)
tsapi TSHttpSsn TSHttpTxnSsnGet ( TSHttpTxn  txnp  ) 
tsapi void TSHttpTxnTransformedRespCache ( TSHttpTxn  txnp,
int  on 
)
tsapi TSReturnCode TSHttpTxnTransformRespGet ( TSHttpTxn  txnp,
TSMBuffer bufp,
TSMLoc offset 
)
tsapi void TSHttpTxnUntransformedRespCache ( TSHttpTxn  txnp,
int  on 
)
tsapi const char* TSInstallDirGet ( void   ) 

Gets the path of the directory in which Traffic Server is installed.

Use this function to specify the location of files that the plugin uses.

Returns:
pointer to Traffic Server install directory.

Definition at line 1715 of file InkAPI.cc.

References Layout::get(), and Layout::prefix.

Referenced by SDK_API_TSfopen(), and SDK_API_TSPluginDirGet().

tsapi TSIOBufferBlock TSIOBufferBlockNext ( TSIOBufferBlock  blockp  ) 
tsapi int64_t TSIOBufferBlockReadAvail ( TSIOBufferBlock  blockp,
TSIOBufferReader  readerp 
)
tsapi const char* TSIOBufferBlockReadStart ( TSIOBufferBlock  blockp,
TSIOBufferReader  readerp,
int64_t *  avail 
)
tsapi int64_t TSIOBufferBlockWriteAvail ( TSIOBufferBlock  blockp  ) 
tsapi char* TSIOBufferBlockWriteStart ( TSIOBufferBlock  blockp,
int64_t *  avail 
)
tsapi int64_t TSIOBufferCopy ( TSIOBuffer  bufp,
TSIOBufferReader  readerp,
int64_t  length,
int64_t  offset 
)
tsapi TSIOBuffer TSIOBufferCreate ( void   ) 
tsapi void TSIOBufferDestroy ( TSIOBuffer  bufp  ) 
tsapi void TSIOBufferProduce ( TSIOBuffer  bufp,
int64_t  nbytes 
)
tsapi TSIOBufferReader TSIOBufferReaderAlloc ( TSIOBuffer  bufp  ) 
tsapi int64_t TSIOBufferReaderAvail ( TSIOBufferReader  readerp  ) 
tsapi TSIOBufferReader TSIOBufferReaderClone ( TSIOBufferReader  readerp  ) 
tsapi void TSIOBufferReaderConsume ( TSIOBufferReader  readerp,
int64_t  nbytes 
)
tsapi void TSIOBufferReaderFree ( TSIOBufferReader  readerp  ) 
tsapi TSIOBufferBlock TSIOBufferReaderStart ( TSIOBufferReader  readerp  ) 
tsapi TSIOBuffer TSIOBufferSizedCreate ( TSIOBufferSizeIndex  index  ) 

Creates a new TSIOBuffer of the specified size.

With this function, you can create smaller buffers than the 32K buffer created by TSIOBufferCreate(). In some situations using smaller buffers can improve performance.

Parameters:
index size of the new TSIOBuffer to be created.
new TSIOBuffer of the specified size.

Definition at line 499 of file InkIOCoreAPI.cc.

References new_MIOBuffer, sdk_assert, sdk_sanity_check_iocore_structure(), TS_IOBUFFER_SIZE_INDEX_128, TS_IOBUFFER_SIZE_INDEX_32K, and TS_SUCCESS.

Referenced by SDK_API_TSIOBufferCopy(), SDK_API_TSIOBufferProduce(), SDK_API_TSIOBufferReaderClone(), SDK_API_TSIOBufferReaderConsume(), and SDK_API_TSIOBufferStart().

tsapi TSIOBufferBlock TSIOBufferStart ( TSIOBuffer  bufp  ) 
tsapi int64_t TSIOBufferWaterMarkGet ( TSIOBuffer  bufp  ) 

The watermark of an TSIOBuffer is the minimum number of bytes of data that have to be in the buffer before calling back any continuation that has initiated a read operation on this buffer.

TSIOBufferWaterMarkGet() will provide the size of the watermark, in bytes, for a specified TSIOBuffer.

Parameters:
bufp buffer whose watermark the function gets.

Definition at line 677 of file InkIOCoreAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), TS_SUCCESS, and MIOBuffer::water_mark.

Referenced by SDK_API_TSIOBufferCreate().

tsapi void TSIOBufferWaterMarkSet ( TSIOBuffer  bufp,
int64_t  water_mark 
)

The watermark of an TSIOBuffer is the minimum number of bytes of data that have to be in the buffer before calling back any continuation that has initiated a read operation on this buffer.

As a writer feeds data into the TSIOBuffer, no readers are called back until the amount of data reaches the watermark. Setting a watermark can improve performance because it avoids frequent callbacks to read small amounts of data. TSIOBufferWaterMarkSet() assigns a watermark to a particular TSIOBuffer.

Parameters:
bufp buffer whose water mark the function sets.
water_mark watermark setting, as a number of bytes.

Definition at line 686 of file InkIOCoreAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), TS_SUCCESS, and MIOBuffer::water_mark.

Referenced by SDK_API_TSIOBufferCreate().

tsapi int64_t TSIOBufferWrite ( TSIOBuffer  bufp,
const void *  buf,
int64_t  length 
)

Writes length bytes of data contained in the string buf to the TSIOBuffer bufp.

Returns the number of bytes of data successfully written to the TSIOBuffer.

Parameters:
bufp is the TSIOBuffer to write into.
buf string to write into the TSIOBuffer.
length of the string buf.
Returns:
length of data successfully copied into the buffer, in bytes.

Definition at line 549 of file InkIOCoreAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), sdk_sanity_check_null_ptr(), TS_SUCCESS, and MIOBuffer::write().

Referenced by SDK_API_TSIOBufferBlockNext(), SDK_API_TSIOBufferBlockReadAvail(), SDK_API_TSIOBufferCopy(), and spdy_send_callback().

tsapi int TSIsDebugTagSet ( const char *  t  ) 

Definition at line 6749 of file InkAPI.cc.

References diags, DiagsTagType_Debug, and Diags::on().

tsapi void TSLifecycleHookAdd ( TSLifecycleHookID  id,
TSCont  contp 
)
tsapi TSMBuffer TSMBufferCreate ( void   ) 

Creates a new marshal buffer and initializes the reference count to 1.

Definition at line 1893 of file InkAPI.cc.

References HdrHeapSDKHandle::m_heap, new_HdrHeap(), sdk_assert, sdk_sanity_check_mbuffer(), and TS_SUCCESS.

Referenced by SDK_API_TSHttpHdr(), SDK_API_TSHttpHdrParse(), SDK_API_TSMimeHdrField(), SDK_API_TSMimeHdrParse(), SDK_API_TSUrl(), and SDK_API_TSUrlParse().

tsapi TSReturnCode TSMBufferDestroy ( TSMBuffer  bufp  ) 

Ignores the reference count and destroys the marshal buffer bufp.

The internal data buffer associated with the marshal buffer is also destroyed if the marshal buffer allocated it.

Parameters:
bufp marshal buffer to be destroyed.

Definition at line 1906 of file InkAPI.cc.

References HdrHeap::destroy(), isWriteable(), HdrHeapSDKHandle::m_heap, sdk_assert, sdk_sanity_check_mbuffer(), and TS_SUCCESS.

Referenced by SDK_API_TSHttpHdr(), SDK_API_TSHttpHdrParse(), SDK_API_TSMimeHdrField(), SDK_API_TSMimeHdrParse(), SDK_API_TSUrl(), and SDK_API_TSUrlParse().

tsapi TSReturnCode TSMgmtCounterGet ( const char *  var_name,
TSMgmtCounter result 
)

Definition at line 4168 of file InkAPI.cc.

References REC_ERR_OKAY, RecGetRecordCounter(), and TS_SUCCESS.

Referenced by SDK_API_TSMgmtGet().

tsapi TSReturnCode TSMgmtFloatGet ( const char *  var_name,
TSMgmtFloat result 
)

Definition at line 4174 of file InkAPI.cc.

References REC_ERR_OKAY, RecGetRecordFloat(), and TS_SUCCESS.

Referenced by SDK_API_TSMgmtGet().

tsapi TSReturnCode TSMgmtIntCreate ( TSRecordType  rec_type,
const char *  name,
TSMgmtInt  data_default,
TSRecordUpdateType  update_type,
TSRecordCheckType  check_type,
const char *  check_regex,
TSRecordAccessType  access_type 
)

Definition at line 8493 of file InkAPI.cc.

References REC_ERR_OKAY, RecRegisterConfigInt(), and TS_RECORDCHECK_NULL.

tsapi TSReturnCode TSMgmtIntGet ( const char *  var_name,
TSMgmtInt result 
)

Definition at line 4162 of file InkAPI.cc.

References REC_ERR_OKAY, RecGetRecordInt(), and TS_SUCCESS.

Referenced by SDK_API_TSMgmtGet(), and TSMgmtConfigIntSet().

tsapi TSReturnCode TSMgmtStringCreate ( TSRecordType  rec_type,
const char *  name,
const TSMgmtString  data_default,
TSRecordUpdateType  update_type,
TSRecordCheckType  check_type,
const char *  check_regex,
TSRecordAccessType  access_type 
)

Definition at line 8479 of file InkAPI.cc.

References REC_ERR_OKAY, RecRegisterConfigString(), and TS_RECORDCHECK_NULL.

tsapi TSReturnCode TSMgmtStringGet ( const char *  var_name,
TSMgmtString result 
)

Definition at line 4180 of file InkAPI.cc.

References RecGetRecordString_Xmalloc().

Referenced by SDK_API_TSMgmtGet().

tsapi void TSMgmtUpdateRegister ( TSCont  contp,
const char *  plugin_name 
)
tsapi TSReturnCode TSMimeHdrClone ( TSMBuffer  dest_bufp,
TSMBuffer  src_bufp,
TSMLoc  src_hdr,
TSMLoc locp 
)

Copies a specified MIME header to a specified marshal buffer, and returns the location of the copied MIME header within the destination marshal buffer.

Unlike TSMimeHdrCopy(), you do not have to create the destination MIME header before cloning. Release the returned TSMLoc handle with a call to TSHandleMLocRelease().

Parameters:
dest_bufp destination marshal buffer.
src_bufp source marshal buffer.
src_hdr location of the source MIME header.
locp where to store the location of the copied MIME header.

Definition at line 2428 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), isWriteable(), mime_hdr_clone(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), sdk_sanity_check_null_ptr(), and TS_SUCCESS.

tsapi TSReturnCode TSMimeHdrCopy ( TSMBuffer  dest_bufp,
TSMLoc  dest_offset,
TSMBuffer  src_bufp,
TSMLoc  src_offset 
)

Copies the contents of the MIME header located at src_loc within src_bufp to the MIME header located at dest_loc within dest_bufp.

TSMimeHdrCopy() works correctly even if src_bufp and dest_bufp point to different marshal buffers. Important: you must create the destination MIME header before copying into it--use TSMimeHdrCreate().

Parameters:
dest_bufp is the destination marshal buffer.
dest_offset 
src_bufp is the source marshal buffer.
src_offset 

Definition at line 2456 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), isWriteable(), mime_hdr_copy_onto(), mime_hdr_fields_clear(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrParse().

tsapi TSReturnCode TSMimeHdrCreate ( TSMBuffer  bufp,
TSMLoc locp 
)

Creates a new MIME header within bufp.

Release with a call to TSHandleMLocRelease().

Parameters:
bufp marshal buffer to contain the new MIME header.
locp buffer pointer to contain the MLoc

Definition at line 2392 of file InkAPI.cc.

References isWriteable(), mime_hdr_create(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_null_ptr(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrField(), and SDK_API_TSMimeHdrParse().

tsapi TSReturnCode TSMimeHdrDestroy ( TSMBuffer  bufp,
TSMLoc  offset 
)

Destroys the MIME header located at hdr_loc within bufp.

Parameters:
bufp marshal buffer containing the MIME header to destroy.
offset location of the MIME header.

Definition at line 2408 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), isWriteable(), mime_hdr_destroy(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSHttpHdrParse(), SDK_API_TSMimeHdrField(), and SDK_API_TSMimeHdrParse().

tsapi TSReturnCode TSMimeHdrFieldAppend ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)

Returns the TSMLoc location of a specified MIME field from within the MIME header located at hdr.

The retrieved_str parameter specifies which field to retrieve. For each MIME field in the MIME header, a pointer comparison is done between the field name and retrieved_str. This is a much quicker retrieval function than TSMimeHdrFieldFind() since it obviates the need for a string comparison. However, retrieved_str must be one of the predefined field names of the form TS_MIME_FIELD_XXX for the call to succeed. Release the returned TSMLoc handle with a call to TSHandleMLocRelease().

Parameters:
bufp marshal buffer containing the MIME field.
hdr location of the MIME header containing the field.
retrieved_str specifies the field to retrieve. Must be one of the predefined field names of the form TS_MIME_FIELD_XXX.
Returns:
location of the requested MIME field. If the requested field cannot be found, returns 0.

Definition at line 2685 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), MIMEFieldSDKHandle::field_ptr, ink_assert, isWriteable(), MIMEField::m_ptr_name, memcpy, MIMEFieldSDKHandle::mh, mime_field_create(), mime_hdr_field_attach(), sdk_assert, sdk_sanity_check_field_handle(), sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrField(), and SDK_API_TSMimeHdrParse().

tsapi TSReturnCode TSMimeHdrFieldClone ( TSMBuffer  dest_bufp,
TSMLoc  dest_hdr,
TSMBuffer  src_bufp,
TSMLoc  src_hdr,
TSMLoc  src_field,
TSMLoc locp 
)
tsapi TSReturnCode TSMimeHdrFieldCopy ( TSMBuffer  dest_bufp,
TSMLoc  dest_hdr,
TSMLoc  dest_field,
TSMBuffer  src_bufp,
TSMLoc  src_hdr,
TSMLoc  src_field 
)
tsapi TSReturnCode TSMimeHdrFieldCopyValues ( TSMBuffer  dest_bufp,
TSMLoc  dest_hdr,
TSMLoc  dest_field,
TSMBuffer  src_bufp,
TSMLoc  src_hdr,
TSMLoc  src_field 
)
tsapi TSReturnCode TSMimeHdrFieldCreate ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc locp 
)
tsapi TSReturnCode TSMimeHdrFieldCreateNamed ( TSMBuffer  bufp,
TSMLoc  mh_mloc,
const char *  name,
int  name_len,
TSMLoc locp 
)
tsapi TSReturnCode TSMimeHdrFieldDestroy ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)

Destroys the MIME field located at field within bufp.

You must release the TSMLoc field with a call to TSHandleMLocRelease().

Parameters:
bufp contains the MIME field to be destroyed.
hdr location of the parent header containing the field to be destroyed. This could be the location of a MIME header or HTTP header.
field location of the field to be destroyed.

Definition at line 2761 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), MIMEFieldSDKHandle::field_ptr, ink_assert, ink_release_assert, isWriteable(), MIMEFieldSDKHandle::mh, mime_hdr_field_delete(), sdk_assert, sdk_sanity_check_field_handle(), sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrField().

tsapi TSMLoc TSMimeHdrFieldFind ( TSMBuffer  bufp,
TSMLoc  hdr,
const char *  name,
int  length 
)

Retrieves the TSMLoc location of a specified MIME field from within the MIME header located at hdr.

The name and length parameters specify which field to retrieve. For each MIME field in the MIME header, a case insensitive string comparison is done between the field name and name. If TSMimeHdrFieldFind() cannot find the requested field, it returns TS_NULL_MLOC. Release the returned TSMLoc handle with a call to TSHandleMLocRelease().

Parameters:
bufp marshal buffer containing the MIME header field to find.
hdr location of the MIME header containing the field.
name of the field to retrieve.
length string length of the string name. If length is -1, then name is assumed to be null-terminated.
Returns:
location of the requested MIME field. If the field could not be found, returns TS_NULL_MLOC.

Definition at line 2662 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), MIMEFieldSDKHandle::field_ptr, mime_hdr_field_find(), sdk_alloc_field_handle(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), sdk_sanity_check_null_ptr(), TS_NULL_MLOC, and TS_SUCCESS.

Referenced by get_request_id(), SDK_API_TSMimeHdrField(), SDK_API_TSMimeHdrParse(), and transform_hook_handler().

tsapi TSMLoc TSMimeHdrFieldGet ( TSMBuffer  bufp,
TSMLoc  hdr,
int  idx 
)

Retrieves the location of a specified MIME field within the MIME header located at hdr_loc within bufp.

The idx parameter specifies which field to retrieve. The fields are numbered from 0 to TSMimeHdrFieldsCount(bufp, hdr_loc) - 1. If idx does not lie within that range then TSMimeHdrFieldGet returns 0. Release the returned handle with a call to TSHandleMLocRelease.

Parameters:
bufp marshal buffer containing the MIME header.
hdr location of the MIME header.
idx index of the field to get with base at 0.
Returns:
location of the specified MIME field.

Definition at line 2642 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), MIMEFieldSDKHandle::field_ptr, mime_hdr_field_get(), sdk_alloc_field_handle(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), TS_NULL_MLOC, and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrField(), SDK_API_TSMimeHdrParse(), and SpdyNV::SpdyNV().

tsapi int TSMimeHdrFieldLengthGet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)
tsapi const char* TSMimeHdrFieldNameGet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int *  length 
)
tsapi TSReturnCode TSMimeHdrFieldNameSet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
const char *  name,
int  length 
)
tsapi TSMLoc TSMimeHdrFieldNext ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)
tsapi TSMLoc TSMimeHdrFieldNextDup ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)
tsapi TSReturnCode TSMimeHdrFieldRemove ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)

Removes the MIME field located at field within bufp from the header located at hdr within bufp.

If the specified field cannot be found in the list of fields associated with the header then nothing is done.

Note: removing the field does not destroy the field, it only detaches the field, hiding it from the printed output. The field can be reattached with a call to TSMimeHdrFieldAppend(). If you do not use the detached field you should destroy it with a call to TSMimeHdrFieldDestroy() and release the handle field with a call to TSHandleMLocRelease().

Parameters:
bufp contains the MIME field to remove.
hdr location of the header containing the MIME field to be removed. This header could be an HTTP header or MIME header.
field is the location of the field to remove.

Definition at line 2735 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), MIMEFieldSDKHandle::field_ptr, ink_assert, isWriteable(), MIMEFieldSDKHandle::mh, mime_hdr_field_detach(), sdk_assert, sdk_sanity_check_field_handle(), sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrParse().

tsapi TSReturnCode TSMimeHdrFieldsClear ( TSMBuffer  bufp,
TSMLoc  offset 
)

Removes and destroys all the MIME fields within the MIME header located at hdr_loc within the marshal buffer bufp.

Parameters:
bufp marshal buffer containing the MIME header.
offset location of the MIME header.

Definition at line 2548 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), isWriteable(), mime_hdr_fields_clear(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrField().

tsapi int TSMimeHdrFieldsCount ( TSMBuffer  bufp,
TSMLoc  offset 
)

Returns a count of the number of MIME fields within the MIME header located at hdr_loc within the marshal buffer bufp.

Parameters:
bufp marshal buffer containing the MIME header.
offset location of the MIME header within bufp.
Returns:
number of MIME fields within the MIME header located at hdr_loc.

Definition at line 2564 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), mime_hdr_fields_count(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrField(), and SpdyNV::SpdyNV().

tsapi TSReturnCode TSMimeHdrFieldValueAppend ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
const char *  value,
int  length 
)
tsapi time_t TSMimeHdrFieldValueDateGet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)
tsapi TSReturnCode TSMimeHdrFieldValueDateInsert ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
time_t  value 
)
tsapi TSReturnCode TSMimeHdrFieldValueDateSet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
time_t  value 
)
tsapi TSReturnCode TSMimeHdrFieldValueDelete ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx 
)
tsapi int64_t TSMimeHdrFieldValueInt64Get ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx 
)
tsapi TSReturnCode TSMimeHdrFieldValueInt64Set ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
int64_t  value 
)
tsapi int TSMimeHdrFieldValueIntGet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx 
)
tsapi TSReturnCode TSMimeHdrFieldValueIntInsert ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
int  value 
)
tsapi TSReturnCode TSMimeHdrFieldValueIntSet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
int  value 
)
tsapi TSReturnCode TSMimeHdrFieldValuesClear ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)

Modified the string value passed from an empty string ("") to NULL. An empty string is also considered to be a token. The correct value of the field after this function should be NULL.

Definition at line 3061 of file InkAPI.cc.

References MIMEFieldSDKHandle::field_ptr, isWriteable(), MIMEFieldSDKHandle::mh, mime_field_value_set(), sdk_assert, sdk_sanity_check_field_handle(), sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrField(), and TSMimeHdrFieldValueDateInsert().

tsapi int TSMimeHdrFieldValuesCount ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field 
)
tsapi const char* TSMimeHdrFieldValueStringGet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
int *  value_len_ptr 
)
tsapi TSReturnCode TSMimeHdrFieldValueStringInsert ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
const char *  value,
int  length 
)
tsapi TSReturnCode TSMimeHdrFieldValueStringSet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
const char *  value,
int  length 
)
tsapi unsigned int TSMimeHdrFieldValueUintGet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx 
)
tsapi TSReturnCode TSMimeHdrFieldValueUintInsert ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
unsigned int  value 
)
tsapi TSReturnCode TSMimeHdrFieldValueUintSet ( TSMBuffer  bufp,
TSMLoc  hdr,
TSMLoc  field,
int  idx,
unsigned int  value 
)
tsapi int TSMimeHdrLengthGet ( TSMBuffer  bufp,
TSMLoc  offset 
)

Calculates the length of the MIME header located at hdr_loc if it were returned as a string.

This the length of the MIME header in its unparsed form.

Parameters:
bufp marshal buffer containing the MIME header.
offset location of the MIME header.
Returns:
string length of the MIME header located at hdr_loc.

Definition at line 2537 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), mime_hdr_length_get(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrParse(), and SpdyNV::SpdyNV().

tsapi TSParseResult TSMimeHdrParse ( TSMimeParser  parser,
TSMBuffer  bufp,
TSMLoc  offset,
const char **  start,
const char *  end 
)

Parses a MIME header.

The MIME header must have already been allocated and both bufp and hdr_loc must point within that header. It is possible to parse a MIME header a single byte at a time using repeated calls to TSMimeHdrParse(). As long as an error does not occur, TSMimeHdrParse() consumes each single byte and asks for more.

Parameters:
parser parses the specified MIME header.
bufp marshal buffer containing the MIME header to be parsed.
offset 
start both an input and output. On input, the start argument points to the current position of the buffer being parsed. On return, start is modified to point past the last character parsed.
end points to one byte after the end of the buffer.
Returns:
One of 3 possible int values:
  • TS_PARSE_ERROR if there is a parsing error.
  • TS_PARSE_DONE is returned when a "\r\n\r\n" pattern is encountered, indicating the end of the header.
  • TS_PARSE_CONT is returned if parsing of the header stopped because the end of the buffer was reached.

Definition at line 2518 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), isWriteable(), mime_parser_parse(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), sdk_sanity_check_null_ptr(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrParse().

tsapi void TSMimeHdrPrint ( TSMBuffer  bufp,
TSMLoc  offset,
TSIOBuffer  iobufp 
)

Formats the MIME header located at hdr_loc within bufp into the TSIOBuffer iobufp.

Parameters:
bufp marshal buffer containing the header to be copied to an TSIOBuffer.
offset 
iobufp target TSIOBuffer.

Definition at line 2486 of file InkAPI.cc.

References _hdr_mloc_to_mime_hdr_impl(), MIOBuffer::add_block(), IOBufferBlock::end(), MIOBuffer::fill(), MIOBuffer::get_current_block(), mime_hdr_print(), sdk_assert, sdk_sanity_check_http_hdr_handle(), sdk_sanity_check_iocore_structure(), sdk_sanity_check_mbuffer(), sdk_sanity_check_mime_hdr_handle(), TS_SUCCESS, and IOBufferBlock::write_avail().

Referenced by convert_mime_hdr_to_string().

tsapi void TSMimeParserClear ( TSMimeParser  parser  ) 

Clears the specified MIME parser so that it can be used again.

Parameters:
parser to be cleared.

Definition at line 2368 of file InkAPI.cc.

References mime_parser_clear(), sdk_assert, sdk_sanity_check_mime_parser(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrParse().

tsapi TSMimeParser TSMimeParserCreate ( void   ) 

Creates a MIME parser.

The parser's data structure contains information about the header being parsed. A single MIME parser can be used multiple times, though not simultaneously. Before being used again, the parser must be cleared by calling TSMimeParserClear().

Definition at line 2359 of file InkAPI.cc.

References ats_malloc(), and mime_parser_init().

Referenced by SDK_API_TSMimeHdrParse().

tsapi void TSMimeParserDestroy ( TSMimeParser  parser  ) 

Destroys the specified MIME parser and frees the associated memory.

Parameters:
parser to destroy.

Definition at line 2376 of file InkAPI.cc.

References ats_free(), mime_parser_clear(), sdk_assert, sdk_sanity_check_mime_parser(), and TS_SUCCESS.

Referenced by SDK_API_TSMimeHdrParse().

tsapi TSMutex TSMutexCreate ( void   ) 
tsapi void TSMutexLock ( TSMutex  mutexp  ) 
tsapi TSReturnCode TSMutexLockTry ( TSMutex  mutexp  ) 
tsapi void TSMutexUnlock ( TSMutex  mutexp  ) 
tsapi TSAction TSNetAccept ( TSCont  contp,
int  port,
int  domain,
int  accept_threads 
)
tsapi TSReturnCode TSNetAcceptNamedProtocol ( TSCont  contp,
const char *  protocol 
)

Listen on all SSL ports for connections for the specified protocol name.

TSNetAcceptNamedProtocol registers the specified protocol for all statically configured TLS ports. When a client using the TLS Next Protocol Negotiation extension negotiates the requested protocol, TrafficServer will route the request to the given handler. Note that the protocol is not registered on ports opened by other plugins.

The event and data provided to the handler are the same as for TSNetAccept(). If a connection is successfully accepted, the event code will be TS_EVENT_NET_ACCEPT and the event data will be a valid TSVConn bound to the accepted connection.

Neither contp nor protocol are copied. They must remain valid for the lifetime of the plugin.

TSNetAcceptNamedProtocol fails if the requested protocol cannot be registered on all of the configured TLS ports. If it fails, the protocol will not be registered on any ports (ie.. no partial failure).

Definition at line 6522 of file InkAPI.cc.

tsapi TSAction TSNetConnect ( TSCont  contp,
struct sockaddr const *  to 
)

Opens a network connection to the host specified by ip on the port specified by port.

If the connection is successfully opened, contp is called back with the event TS_EVENT_NET_CONNECT and the new network vconnection will be passed in the event data parameter. If the connection is not successful, contp is called back with the event TS_EVENT_NET_CONNECT_FAILED.

Note: on Solaris, it is possible to receive TS_EVENT_NET_CONNECT even if the connection failed, because of the implementation of network sockets in the underlying operating system. There is an exception: if a plugin tries to open a connection to a port on its own host machine, then TS_EVENT_NET_CONNECT is sent only if the connection is successfully opened. In general, however, your plugin needs to look for an TS_EVENT_VCONN_WRITE_READY to be sure that the connection is successfully opened.

Returns:
something allows you to check if the connection is complete, or cancel the attempt to connect.
Parameters:
contp continuation that is called back when the attempted net connection either succeeds or fails.
to Address to which to connect.

Referenced by SDK_API_TSNetVConn(), SDK_API_TSPortDescriptor(), and synclient_txn_send_request().

tsapi struct sockaddr const* TSNetVConnLocalAddrGet ( TSVConn  vc  )  [read]
tsapi struct sockaddr const* TSNetVConnRemoteAddrGet ( TSVConn  vc  )  [read]
tsapi const char* TSPluginDirGet ( void   ) 

Gets the path of the plugin directory relative to the Traffic Server install directory.

For example, to open the file "config_ui.txt" in the plugin directory:

      TSfopen("TSPluginInstallDirGet()/TSPluginDirGet()/config_ui.txt");
Returns:
pointer to plugin directory relative to Traffic Server install directory.

Definition at line 1737 of file InkAPI.cc.

References ats_free(), ink_strlcpy(), PATH_NAME_MAX, plugin_dir, and RecConfigReadPrefixPath().

Referenced by plugin_init(), remap_load_plugin(), and SDK_API_TSPluginDirGet().

tsapi TSReturnCode TSPluginRegister ( TSSDKVersion  sdk_version,
TSPluginRegistrationInfo plugin_info 
)

This function registers your plugin with a particular version of Traffic Server SDK.

Use this function to make sure that the Traffic Server version currently running also supports your plugin. See the SDK sample code for usage.

Parameters:
sdk_version earliest version of the Traffic Server SDK that supports your plugin.
plugin_info contains registration information about your plugin. See TSPluginRegistrationInfo.
Returns:
TS_ERROR if the plugin registration failed.

Definition at line 1757 of file InkAPI.cc.

References ats_strdup, PluginRegInfo::plugin_name, plugin_reg_current, PluginRegInfo::plugin_registered, PLUGIN_SDK_VERSION_3_0, PLUGIN_SDK_VERSION_4_0, sdk_assert, sdk_sanity_check_null_ptr(), PluginRegInfo::sdk_version, PluginRegInfo::support_email, TS_SUCCESS, and PluginRegInfo::vendor_name.

tsapi TSReturnCode TSPortDescriptorAccept ( TSPortDescriptor  ,
TSCont   
)

Start listening on the given port descriptor.

If a connection is successfully accepted, the TS_EVENT_NET_ACCEPT is delivered to the continuation. The event data will be a valid TSVConn bound to the accepted connection.

Definition at line 8541 of file InkAPI.cc.

References HttpProxyPort::isSSL(), HttpProxyPort::m_fd, NetProcessor::main_accept(), make_net_accept_options(), netProcessor, sslNetProcessor, and TS_SUCCESS.

Referenced by SDK_API_TSPortDescriptor().

tsapi TSPortDescriptor TSPortDescriptorParse ( const char *  descriptor  ) 

Create a new port from the string specification used by the proxy.config.http.server_ports configuration value.

Definition at line 8528 of file InkAPI.cc.

References HttpProxyPort::processOptions().

Referenced by SDK_API_TSPortDescriptor().

tsapi void TSRecordDump ( int  rec_type,
TSRecordDumpCb  callback,
void *  edata 
)

Definition at line 7489 of file InkAPI.cc.

References RecDumpRecords().

tsapi TS_DEPRECATED const char* TSRedirectUrlGet ( TSHttpTxn  txnp,
int *  url_len_ptr 
)

Definition at line 7207 of file InkAPI.cc.

References TSHttpTxnRedirectUrlGet().

tsapi TS_DEPRECATED void TSRedirectUrlSet ( TSHttpTxn  txnp,
const char *  url,
const int  url_len 
)
tsapi void TSSkipRemappingSet ( TSHttpTxn  txnp,
int  flag 
)
tsapi int TSStatCreate ( const char *  the_name,
TSRecordDataType  the_type,
TSStatPersistence  persist,
TSStatSync  sync 
)
tsapi TSReturnCode TSStatFindName ( const char *  name,
int *  idp 
)
tsapi void TSStatIntDecrement ( int  the_stat,
TSMgmtInt  amount 
)

Definition at line 6701 of file InkAPI.cc.

References RecDecrRawStat().

tsapi TSMgmtInt TSStatIntGet ( int  the_stat  ) 

Definition at line 6707 of file InkAPI.cc.

References RecGetGlobalRawStatSum().

tsapi void TSStatIntIncrement ( int  the_stat,
TSMgmtInt  amount 
)

Definition at line 6695 of file InkAPI.cc.

References RecIncrRawStat().

tsapi void TSStatIntSet ( int  the_stat,
TSMgmtInt  value 
)

Definition at line 6716 of file InkAPI.cc.

References RecSetGlobalRawStatSum().

tsapi TSReturnCode TSStringPercentDecode ( const char *  str,
size_t  str_len,
char *  dst,
size_t  dst_size,
size_t *  length 
)

Perform percent-decoding of the string in the buffer, writing to the output buffer.

The source and destination can be the same, in which case they overwrite. The decoded string is always guaranteed to be no longer than the source string.

Parameters:
str the string to decode (and possibly write to).
str_len length of the input string (or 0).
dst output buffer (can be the same as src).
dst_len size of the output buffer.
length amount of data written to the destination buffer.

Definition at line 2306 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_null_ptr(), TS_SUCCESS, and unescape_str().

Referenced by SDK_API_ENCODING().

tsapi TSReturnCode TSStringPercentEncode ( const char *  str,
int  str_len,
char *  dst,
size_t  dst_size,
size_t *  length,
const unsigned char *  map 
)

Perform percent-encoding of the string in the buffer, storing the new string in the destination buffer.

The length parameter will be set to the new (encoded) string length, or 0 if the encoding failed.

Parameters:
str the string buffer to encode.
str_len length of the string buffer.
dst destination buffer.
dst_size size of the destination buffer.
length amount of data written to the destination buffer.
map optional (can be NULL) map of characters to encode.

Definition at line 2280 of file InkAPI.cc.

References LogUtils::escapify_url(), sdk_assert, sdk_sanity_check_null_ptr(), and TS_SUCCESS.

Referenced by SDK_API_ENCODING(), and TSUrlPercentEncode().

tsapi TSReturnCode TSTextLogObjectCreate ( const char *  filename,
int  mode,
TSTextLogObject new_log_obj 
)

Creates a new custom log file that your plugin can write to.

You can design the fields and inputs to the log file using the TSTextLogObjectWrite() function. The logs you create are treated like ordinary logs; they are rolled if log rolling is enabled. (Log collation is not supported though).

Parameters:
filename new log file being created. The new log file is created in the logs directory. You can specify a path to a subdirectory within the log directory, e.g. subdir/filename, but make sure you create the subdirectory first. If you do not specify a file name extension, the extension ".log" is automatically added.
mode is one (or both) of the following:

  • TS_LOG_MODE_ADD_TIMESTAMP Whenever the plugin makes a log entry using TSTextLogObjectWrite (see below), it prepends the entry with a timestamp.
  • TS_LOG_MODE_DO_NOT_RENAME This means that if there is a filename conflict, Traffic Server should not attempt to rename the custom log. The consequence of a name conflict is that the custom log will simply not be created, e.g. suppose you call:
                log = TSTextLogObjectCreate("squid" , mode, NULL, &error);
    
    If mode is TS_LOG_MODE_DO_NOT_RENAME, you will NOT get a new log (you'll get a null pointer) if squid.log already exists. If mode is not TS_LOG_MODE_DO_NOT_RENAME, Traffic Server tries to rename the log to a new name (it will try squid_1.log).
new_log_obj new custom log file.
Returns:
error code:
  • TS_LOG_ERROR_NO_ERROR No error; the log object has been created successfully.
  • TS_LOG_ERROR_OBJECT_CREATION Log object not created. This error is rare and would most likely be caused by the system running out of memory.
  • TS_LOG_ERROR_FILENAME_CONFLICTS You get this error if mode = TS_LOG_MODE_DO_NOT_RENAME, and if there is a naming conflict. The log object is not created.
  • TS_LOG_ERROR_FILE_ACCESS Log object not created because of a file access problem (for example, no write permission to the logging directory, or a specified subdirectory for the log file does not exist).

Definition at line 6783 of file InkAPI.cc.

References Log::config, LogConfig::log_object_manager, LogObjectManager::manage_api_object(), LogObjectManager::NO_FILENAME_CONFLICTS, sdk_assert, sdk_sanity_check_null_ptr(), TS_LOG_MODE_ADD_TIMESTAMP, TS_LOG_MODE_DO_NOT_RENAME, TS_LOG_MODE_INVALID_FLAG, and TS_SUCCESS.

Referenced by SDK_API_TSTextLog().

tsapi TSReturnCode TSTextLogObjectDestroy ( TSTextLogObject  the_object  ) 

Destroys a log object and releases the memory allocated to it.

Use this call if you are done with the log.

Parameters:
the_object custom log to be destroyed.

Definition at line 6857 of file InkAPI.cc.

References Log::config, sdk_assert, sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

Referenced by log_test_handler().

tsapi TSReturnCode tsapi void TSTextLogObjectFlush ( TSTextLogObject  the_object  ) 

This immediately flushes the contents of the log write buffer for the_object to disk.

Use this call only if you want to make sure that log entries are flushed immediately. This call has a performance cost. Traffic Server flushes the log buffer automatically about every 1 second.

Parameters:
the_object custom log file whose write buffer is to be flushed.

Definition at line 6849 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

Referenced by SDK_API_TSTextLog().

tsapi void TSTextLogObjectHeaderSet ( TSTextLogObject  the_object,
const char *  header 
)

Set log header.

Definition at line 6868 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

tsapi TSReturnCode TSTextLogObjectRollingEnabledSet ( TSTextLogObject  the_object,
int  rolling_enabled 
)

Enable/disable rolling.

Parameters:
rolling_enabled a valid proxy.config.log.rolling_enabled value.

Definition at line 6876 of file InkAPI.cc.

References LogRollingEnabledIsValid(), sdk_assert, sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

tsapi void TSTextLogObjectRollingIntervalSecSet ( TSTextLogObject  the_object,
int  rolling_interval_sec 
)

Set the rolling interval.

Definition at line 6889 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

tsapi void TSTextLogObjectRollingOffsetHrSet ( TSTextLogObject  the_object,
int  rolling_offset_hr 
)

Set the rolling offset.

rolling_offset_hr specifies the hour (between 0 and 23) when log rolling should take place.

Definition at line 6897 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

tsapi TSReturnCode TSTextLogObjectWrite ( TSTextLogObject  the_object,
const char *  format,
  ... 
)

Writes a printf-style formatted statement to an TSTextLogObject (a plugin custom log).

Parameters:
the_object log object to write to. You must first create this object with TSTextLogObjectCreate().
format printf-style formatted statement to be printed.
... parameters in the formatted statement. A newline is automatically added to the end.
Returns:
one of the following errors:
  • TS_LOG_ERROR_NO_ERROR Means that the write was successful.
  • TS_LOG_ERROR_LOG_SPACE_EXHAUSTED Means that Traffic Server ran out of disk space for logs. If you see this error you might want to roll logs more often.
  • TS_LOG_ERROR_INTERNAL_ERROR Indicates some internal problem with a log entry (such as an entry larger than the size of the log write buffer). This error is very unusual.

Referenced by SDK_API_TSTextLog().

tsapi TSThread TSThreadCreate ( TSThreadFunc  func,
void *  data 
)
tsapi void TSThreadDestroy ( TSThread  thread  ) 

Definition at line 160 of file InkIOCoreAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

Referenced by pthread_start_func().

tsapi TSThread TSThreadInit ( void   ) 

Definition at line 143 of file InkIOCoreAPI.cc.

References Thread::set_specific().

Referenced by pthread_start_func().

tsapi TSThread TSThreadSelf ( void   ) 

Definition at line 169 of file InkIOCoreAPI.cc.

References this_ethread().

Referenced by SDK_API_TSThread(), and thread_create_handler().

tsapi const char* TSTrafficServerVersionGet ( void   ) 

Gets the version of Traffic Server currently running.

Use this function to make sure that the plugin version and Traffic Server version are compatible. See the SDK sample code for usage.

Returns:
pointer to version of Traffic Server running the plugin.

Definition at line 1727 of file InkAPI.cc.

References traffic_server_version.

Referenced by SDK_API_TSTrafficServerVersionGet().

int TSTrafficServerVersionGetMajor ( void   ) 

Get the major version of Traffic Server currently running.

This is the same as the first element of the string returned by TSTrafficServerVersionGet

Returns:
The major version as an integer.

Definition at line 1732 of file InkAPI.cc.

References ts_major_version.

int TSTrafficServerVersionGetMinor ( void   ) 

Get the minor version of Traffic Server currently running.

This is the same as the second element of the string returned by TSTrafficServerVersionGet

Returns:
The minor version as an integer.

Definition at line 1733 of file InkAPI.cc.

References ts_minor_version.

int TSTrafficServerVersionGetPatch ( void   ) 

Get the patch version of Traffic Server currently running.

This is the same as the third element of the string returned by TSTrafficServerVersionGet

Returns:
The patch version as an integer.

Definition at line 1734 of file InkAPI.cc.

References ts_patch_version.

tsapi TSVConn TSTransformCreate ( TSEventFunc  event_funcp,
TSHttpTxn  txnp 
)

Definition at line 6341 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_txn(), TS_SUCCESS, TSContMutexGet(), and TSVConnCreate().

Referenced by transform_add().

tsapi TSVConn TSTransformOutputVConnGet ( TSVConn  connp  ) 
tsapi TSReturnCode TSUrlClone ( TSMBuffer  dest_bufp,
TSMBuffer  src_bufp,
TSMLoc  src_url,
TSMLoc locp 
)

Copies the URL located at src_url within src_bufp to a URL location within the marshal buffer dest_bufp, and returns the TSMLoc location of the copied URL.

Unlike TSUrlCopy(), you do not have to create the destination URL before cloning. Release the returned TSMLoc handle with a call to TSHandleMLocRelease().

Parameters:
dest_bufp marshal buffer containing the cloned URL.
src_bufp marshal buffer containing the URL to be cloned.
src_url location of the URL to be cloned, within the marshal buffer src_bufp.
locp pointer to a TSMLoc to store the MLoc into.

Definition at line 1951 of file InkAPI.cc.

References isWriteable(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_null_ptr(), sdk_sanity_check_url_handle(), TS_SUCCESS, and url_copy().

Referenced by SDK_API_TSUrl().

tsapi TSReturnCode TSUrlCopy ( TSMBuffer  dest_bufp,
TSMLoc  dest_offset,
TSMBuffer  src_bufp,
TSMLoc  src_offset 
)

Copies the contents of the URL at location src_loc within the marshal buffer src_bufp to the location dest_loc within the marshal buffer dest_bufp.

TSUrlCopy() works correctly even if src_bufp and dest_bufp point to different marshal buffers. Important: create the destination URL before copying into it. Use TSUrlCreate().

Parameters:
dest_bufp marshal buffer to contain the copied URL.
dest_offset location of the URL to be copied.
src_bufp marshal buffer containing the source URL.
src_offset location of the source URL within src_bufp.

Definition at line 1974 of file InkAPI.cc.

References isWriteable(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_url_handle(), TS_SUCCESS, and url_copy_onto().

Referenced by SDK_API_TSUrl().

tsapi TSReturnCode TSUrlCreate ( TSMBuffer  bufp,
TSMLoc locp 
)

Creates a new URL within the marshal buffer bufp.

Returns a location for the URL within the marshal buffer.

Parameters:
bufp marshal buffer containing the new URL.
locp pointer to a TSMLoc to store the MLoc into.

Definition at line 1931 of file InkAPI.cc.

References isWriteable(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_null_ptr(), TS_SUCCESS, and url_create().

Referenced by SDK_API_TSHttpHdr(), SDK_API_TSUrl(), and SDK_API_TSUrlParse().

tsapi TS_DEPRECATED TSReturnCode TSUrlDestroy ( TSMBuffer  bufp,
TSMLoc  offset 
)

Destroys the URL located at url_loc within the marshal buffer bufp.

Do not forget to release the TSMLoc url_loc with a call to TSHandleMLocRelease().

Parameters:
bufp marshal buffer containing the URL to be destroyed.
offset location of the URL to be destroyed.
Deprecated:
There is no reason to destroy the URL, just release the marshal buffers.

Should be removed for v5.0.0

Definition at line 1945 of file InkAPI.cc.

tsapi int TSUrlFtpTypeGet ( TSMBuffer  bufp,
TSMLoc  offset 
)

Retrieves the FTP type of the URL located at url_loc within bufp.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
Returns:
FTP type of the URL.

Definition at line 2208 of file InkAPI.cc.

References HdrHeapSDKHandle::m_heap, URL::m_url_impl, sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_url_handle(), TS_SUCCESS, and URL::type_get().

Referenced by SDK_API_TSUrl().

tsapi TSReturnCode TSUrlFtpTypeSet ( TSMBuffer  bufp,
TSMLoc  offset,
int  type 
)

Sets the FTP type portion of the URL located at url_loc within bufp to the value type.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL to modify.
type new FTP type for the URL.

Definition at line 2220 of file InkAPI.cc.

References isWriteable(), HdrHeapSDKHandle::m_heap, URL::m_url_impl, sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_url_handle(), TS_SUCCESS, and URL::type_set().

Referenced by SDK_API_TSUrl().

tsapi const char* TSUrlHostGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Retrieves the host portion of the URL located at url_loc within bufp.

Note: the returned string is not guaranteed to be null-terminated.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
length of the returned string.
Returns:
Host portion of the URL.

Definition at line 2150 of file InkAPI.cc.

References URL::host_get(), and URLPartGet().

Referenced by SDK_API_TSHttpHdr(), and SDK_API_TSUrl().

tsapi TSReturnCode TSUrlHostSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)

Sets the host portion of the URL at url_loc to the string value.

If length is -1 then TSUrlHostSet() assumes that value is null-terminated. Otherwise, the length of the string value is taken to be length. The string is copied to within bufp, so you can modify or delete value after calling TSUrlHostSet().

Parameters:
bufp marshal buffer containing the URL to modify.
offset location of the URL.
value new host name for the URL.
length string length of the new host name of the URL.

Definition at line 2156 of file InkAPI.cc.

References URL::host_set(), and URLPartSet().

Referenced by SDK_API_TSHttpHdr(), and SDK_API_TSUrl().

tsapi const char* TSUrlHttpFragmentGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Retrieves the HTTP fragment portion of the URL located at url_loc within bufp.

The length of the returned string is in the length argument. Note: the returned string is not guaranteed to be null-terminated.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
length of the returned string.
Returns:
HTTP fragment portion of the URL.

Definition at line 2267 of file InkAPI.cc.

References URL::fragment_get(), and URLPartGet().

Referenced by SDK_API_TSUrl().

tsapi TSReturnCode TSUrlHttpFragmentSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)

Sets the HTTP fragment portion of the URL located at url_loc within bufp to value.

If length is -1, the string value is assumed to be null-terminated; otherwise, the length of value is taken to be length. TSUrlHttpFragmentSet() copies the string to within bufp, so you can modify or delete value after calling TSUrlHttpFragmentSet().

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL within bufp.
value new HTTP fragment string for the URL.
length of the new HTTP query string.

Definition at line 2273 of file InkAPI.cc.

References URL::fragment_set(), and URLPartSet().

Referenced by SDK_API_TSUrl().

tsapi const char* TSUrlHttpParamsGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Retrieves the HTTP params portion of the URL located at url_loc within bufp.

The length of the returned string is in the length argument. Note: the returned string is not guaranteed to be null-terminated.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
length of the returned string.
Returns:
HTTP params portion of the URL.

Definition at line 2243 of file InkAPI.cc.

References URL::params_get(), and URLPartGet().

Referenced by SDK_API_TSUrl().

tsapi TSReturnCode TSUrlHttpParamsSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)

Sets the HTTP params portion of the URL located at url_loc within bufp to the string value.

If length is -1 that TSUrlHttpParamsSet() assumes that value is null-terminated. Otherwise, the length of the string value is taken to be length. TSUrlHttpParamsSet() copies the string to within bufp, so you can modify or delete value after calling TSUrlHttpParamsSet().

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
value HTTP params string to set in the URL.
length string length of the new HTTP params value.

Definition at line 2249 of file InkAPI.cc.

References URL::params_set(), and URLPartSet().

Referenced by SDK_API_TSUrl().

tsapi const char* TSUrlHttpQueryGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Retrieves the HTTP query portion of the URL located at url_loc within bufp.

The length of the returned string is in the length argument. Note: the returned string is not guaranteed to be null-terminated.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
length of the returned string.
Returns:
HTTP query portion of the URL.

Definition at line 2255 of file InkAPI.cc.

References URL::query_get(), and URLPartGet().

Referenced by SDK_API_TSUrl().

tsapi TSReturnCode TSUrlHttpQuerySet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)

Sets the HTTP query portion of the URL located at url_loc within bufp to value.

If length is -1, the string value is assumed to be null-terminated; otherwise, the length of value is taken to be length. TSUrlHttpQuerySet() copies the string to within bufp, so you can modify or delete value after calling TSUrlHttpQuerySet().

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL within bufp.
value new HTTP query string for the URL.
length of the new HTTP query string.

Definition at line 2261 of file InkAPI.cc.

References URL::query_set(), and URLPartSet().

Referenced by SDK_API_TSUrl().

tsapi int TSUrlLengthGet ( TSMBuffer  bufp,
TSMLoc  offset 
)

Calculates the length of the URL located at url_loc within the marshal buffer bufp if it were returned as a string.

This length is the same as the length returned by TSUrlStringGet().

Parameters:
bufp marshal buffer containing the URL whose length you want.
offset location of the URL within the marshal buffer bufp.
Returns:
string length of the URL.

Definition at line 2051 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_url_handle(), TS_SUCCESS, and url_length_get().

Referenced by SDK_API_TSUrl().

tsapi TSParseResult TSUrlParse ( TSMBuffer  bufp,
TSMLoc  offset,
const char **  start,
const char *  end 
)

Parses a URL.

The start pointer is both an input and an output parameter and marks the start of the URL to be parsed. After a successful parse, the start pointer equals the end pointer. The end pointer must be one byte after the last character you want to parse. The URL parsing routine assumes that everything between start and end is part of the URL. It is up to higher level parsing routines, such as TSHttpHdrParseReq(), to determine the actual end of the URL. Returns TS_PARSE_ERROR if an error occurs, otherwise TS_PARSE_DONE is returned to indicate success.

Parameters:
bufp marshal buffer containing the URL to be parsed.
offset location of the URL to be parsed.
start points to the start of the URL to be parsed AND at the end of a successful parse it will equal the end pointer.
end must be one byte after the last character.
Returns:
TS_PARSE_ERROR or TS_PARSE_DONE.

Definition at line 2032 of file InkAPI.cc.

References isWriteable(), HdrHeapSDKHandle::m_heap, URL::m_url_impl, URL::parse(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_null_ptr(), sdk_sanity_check_url_handle(), TS_SUCCESS, and url_clear().

Referenced by SDK_API_TSUrlParse().

tsapi const char* TSUrlPasswordGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Retrieves the password portion of the URL located at url_loc within bufp.

TSUrlPasswordGet() places the length of the returned string in the length argument. Note: the returned string is not guaranteed to be null-terminated.

Parameters:
bufp marshal buffer containing the URL.
offset 
length of the returned password string.
Returns:
password portion of the URL.

Definition at line 2138 of file InkAPI.cc.

References URL::password_get(), and URLPartGet().

Referenced by SDK_API_TSUrl().

tsapi TSReturnCode TSUrlPasswordSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)

Sets the password portion of the URL located at url_loc within bufp to the string value.

If length is -1 then TSUrlPasswordSet() assumes that value is null-terminated. Otherwise, the length of value is taken to be length. TSUrlPasswordSet() copies the string to within bufp, so it is okay to modify or delete value after calling TSUrlPasswordSet().

Parameters:
bufp marshal buffer containing the URL.
offset 
value new password.
length of the new password.

Definition at line 2144 of file InkAPI.cc.

References URL::password_set(), and URLPartSet().

Referenced by SDK_API_TSUrl().

tsapi const char* TSUrlPathGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Retrieves the path portion of the URL located at url_loc within bufp.

TSUrlPathGet() places the length of the returned string in the length argument. Note: the returned string is not guaranteed to be null-terminated.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
length of the returned string.
Returns:
path portion of the URL.

Definition at line 2194 of file InkAPI.cc.

References URL::path_get(), and URLPartGet().

Referenced by SDK_API_TSHttpHdr(), and SDK_API_TSUrl().

tsapi TSReturnCode TSUrlPathSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)

Sets the path portion of the URL located at url_loc within bufp to the string value.

If length is -1 then TSUrlPathSet() assumes that value is null-terminated. Otherwise, the length of the value is taken to be length. TSUrlPathSet() copies the string into bufp, so you can modify or delete value after calling TSUrlPathSet().

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
value new path string for the URL.
length of the new path string.

Definition at line 2200 of file InkAPI.cc.

References URL::path_set(), and URLPartSet().

Referenced by SDK_API_TSHttpHdr(), and SDK_API_TSUrl().

tsapi TSReturnCode TSUrlPercentEncode ( TSMBuffer  bufp,
TSMLoc  offset,
char *  dst,
size_t  dst_size,
size_t *  length,
const unsigned char *  map 
)

Similar to TSStringPercentEncode(), but works on a URL object.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL within bufp.
dst destination buffer.
dst_size size of the destination buffer.
length amount of data written to the destination buffer.
map optional (can be NULL) map of characters to encode.

Definition at line 2329 of file InkAPI.cc.

References ats_free(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_url_handle(), TS_SUCCESS, TSStringPercentEncode(), and url_string_get().

tsapi int TSUrlPortGet ( TSMBuffer  bufp,
TSMLoc  offset 
)

Retrieves the port portion of the URL located at url_loc.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
Returns:
port portion of the URL.

Definition at line 2162 of file InkAPI.cc.

References HdrHeapSDKHandle::m_heap, URL::m_url_impl, URL::port_get(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_url_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSHttpHdr(), and SDK_API_TSUrl().

tsapi TSReturnCode TSUrlPortSet ( TSMBuffer  bufp,
TSMLoc  offset,
int  port 
)

Sets the port portion of the URL located at url_loc.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
port new port setting for the URL.

Definition at line 2175 of file InkAPI.cc.

References isWriteable(), HdrHeapSDKHandle::m_heap, URL::m_url_impl, URL::port_set(), sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_url_handle(), and TS_SUCCESS.

Referenced by SDK_API_TSHttpHdr(), and SDK_API_TSUrl().

tsapi void TSUrlPrint ( TSMBuffer  bufp,
TSMLoc  offset,
TSIOBuffer  iobufp 
)

Formats a URL stored in an TSMBuffer into an TSIOBuffer.

Parameters:
bufp marshal buffer contain the URL to be printed.
offset location of the URL within bufp.
iobufp destination TSIOBuffer for the URL.

Definition at line 1997 of file InkAPI.cc.

References MIOBuffer::add_block(), IOBufferBlock::end(), MIOBuffer::fill(), MIOBuffer::get_current_block(), HdrHeapSDKHandle::m_heap, URL::m_url_impl, URL::print(), sdk_assert, sdk_sanity_check_iocore_structure(), sdk_sanity_check_mbuffer(), sdk_sanity_check_url_handle(), TS_SUCCESS, and IOBufferBlock::write_avail().

Referenced by test_url_print().

tsapi const char* TSUrlSchemeGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Retrieves the scheme portion of the URL located at url_loc within the marshal buffer bufp.

TSUrlSchemeGet() places the length of the string in the length argument. If the length is NULL then no attempt is made to dereference it.

Parameters:
bufp marshal buffer storing the URL.
offset location of the URL within bufp.
length length of the returned string.
Returns:
The scheme portion of the URL, as a string.

Definition at line 2112 of file InkAPI.cc.

References URL::scheme_get(), and URLPartGet().

Referenced by SDK_API_TSHttpHdr(), and SDK_API_TSUrl().

tsapi TSReturnCode TSUrlSchemeSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)

Sets the scheme portion of the URL located at url_loc within the marshal buffer bufp to the string value.

If length is -1 then TSUrlSchemeSet() assumes that value is null-terminated. Otherwise, the length of the string value is taken to be length. TSUrlSchemeSet() copies the string to within bufp, so it is OK to modify or delete value after calling TSUrlSchemeSet().

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
value value to set the URL's scheme to.
length string stored in value.

Definition at line 2118 of file InkAPI.cc.

References URL::scheme_set(), and URLPartSet().

Referenced by SDK_API_TSHttpHdr(), and SDK_API_TSUrl().

tsapi char* TSUrlStringGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Constructs a string representation of the URL located at url_loc within bufp.

TSUrlStringGet() stores the length of the allocated string in the parameter length. This is the same length that TSUrlLengthGet() returns. The returned string is allocated by a call to TSmalloc(). It should be freed by a call to TSfree(). The length parameter must present, providing storage for the URL string length value. Note: To get the effective URL from a request, use the alternative TSHttpTxnEffectiveUrlStringGet API.

Parameters:
bufp marshal buffer containing the URL you want to get.
offset location of the URL within bufp.
length string length of the URL.
Returns:
The URL as a string.

Definition at line 2061 of file InkAPI.cc.

References sdk_assert, sdk_sanity_check_mbuffer(), sdk_sanity_check_null_ptr(), sdk_sanity_check_url_handle(), TS_SUCCESS, and url_string_get().

Referenced by SDK_API_TSUrl(), and SDK_API_TSUrlParse().

tsapi const char* TSUrlUserGet ( TSMBuffer  bufp,
TSMLoc  offset,
int *  length 
)

Retrieves the user portion of the URL located at url_loc within bufp.

Note: the returned string is not guaranteed to be null-terminated.

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL.
length length of the returned string.
Returns:
user portion of the URL.

Definition at line 2126 of file InkAPI.cc.

References URLPartGet(), and URL::user_get().

Referenced by SDK_API_TSUrl().

tsapi TSReturnCode TSUrlUserSet ( TSMBuffer  bufp,
TSMLoc  offset,
const char *  value,
int  length 
)

Sets the user portion of the URL located at url_loc within bufp to the string value.

If length is -1 then TSUrlUserSet() assumes that value is null-terminated. Otherwise, the length of the string value is taken to be length. TSUrlUserSet() copies the string to within bufp, so it is OK to modify or delete value after calling TSUrlUserSet().

Parameters:
bufp marshal buffer containing the URL.
offset location of the URL whose user is to be set.
value holds the new user name.
length string length of value.

Definition at line 2132 of file InkAPI.cc.

References URLPartSet(), and URL::user_set().

Referenced by SDK_API_TSUrl().

tsapi void TSVConnAbort ( TSVConn  connp,
int  error 
)
tsapi void TSVConnActiveTimeoutCancel ( TSVConn  connp  ) 
tsapi void TSVConnActiveTimeoutSet ( TSVConn  connp,
TSHRTime  timeout 
)
tsapi int64_t TSVConnCacheObjectSizeGet ( TSVConn  connp  ) 
tsapi void TSVConnClose ( TSVConn  connp  ) 
tsapi int TSVConnClosedGet ( TSVConn  connp  ) 
tsapi TSVConn TSVConnCreate ( TSEventFunc  event_funcp,
TSMutex  mutexp 
)
tsapi TSVConn TSVConnFdCreate ( int  fd  ) 
tsapi void TSVConnInactivityTimeoutCancel ( TSVConn  connp  ) 
tsapi void TSVConnInactivityTimeoutSet ( TSVConn  connp,
TSHRTime  timeout 
)
tsapi TSVIO TSVConnRead ( TSVConn  connp,
TSCont  contp,
TSIOBuffer  bufp,
int64_t  nbytes 
)
tsapi TSVIO TSVConnReadVIOGet ( TSVConn  connp  ) 
tsapi void TSVConnShutdown ( TSVConn  connp,
int  read,
int  write 
)
tsapi TSVIO TSVConnWrite ( TSVConn  connp,
TSCont  contp,
TSIOBufferReader  readerp,
int64_t  nbytes 
)
tsapi TSVIO TSVConnWriteVIOGet ( TSVConn  connp  ) 
tsapi TSIOBuffer TSVIOBufferGet ( TSVIO  viop  ) 
tsapi TSCont TSVIOContGet ( TSVIO  viop  ) 
tsapi TSMutex TSVIOMutexGet ( TSVIO  viop  ) 

Definition at line 337 of file InkIOCoreAPI.cc.

References VIO::mutex, sdk_assert, sdk_sanity_check_iocore_structure(), and TS_SUCCESS.

Referenced by cache_handler().

tsapi int64_t TSVIONBytesGet ( TSVIO  viop  ) 
tsapi void TSVIONBytesSet ( TSVIO  viop,
int64_t  nbytes 
)
tsapi int64_t TSVIONDoneGet ( TSVIO  viop  ) 
tsapi void TSVIONDoneSet ( TSVIO  viop,
int64_t  ndone 
)
tsapi int64_t TSVIONTodoGet ( TSVIO  viop  ) 
tsapi TSIOBufferReader TSVIOReaderGet ( TSVIO  viop  ) 
tsapi void TSVIOReenable ( TSVIO  viop  ) 
tsapi TSVConn TSVIOVConnGet ( TSVIO  viop  ) 

Definition at line 328 of file InkIOCoreAPI.cc.

References sdk_assert, sdk_sanity_check_iocore_structure(), TS_SUCCESS, and VIO::vc_server.

Referenced by cache_handler().


Variable Documentation

tsapi void tsapi void int diags_on_for_plugins

Definition at line 48 of file Diags.cc.

Referenced by Diags::Diags().