Electroneum
Loading...
Searching...
No Matches
pythonmod_utils.h File Reference
#include "util/module.h"
Include dependency graph for pythonmod_utils.h:

Go to the source code of this file.

Functions

int storeQueryInCache (struct module_qstate *qstate, struct query_info *qinfo, struct reply_info *msgrep, int is_referral)
void invalidateQueryInCache (struct module_qstate *qstate, struct query_info *qinfo)
int createResponse (struct module_qstate *qstate, sldns_buffer *pkt)
void reply_addr2str (struct comm_reply *reply, char *dest, int maxlen)
void delegpt_addr_addr2str (struct delegpt_addr *target, char *dest, int maxlen)

Detailed Description

Utility functions for the python module that perform stores and loads and conversions.

Definition in file pythonmod_utils.h.

Function Documentation

◆ createResponse()

int createResponse ( struct module_qstate * qstate,
sldns_buffer * pkt )

Create response according to the ldns packet content

This function fills qstate.return_msg up with data of a given packet

Parameters
qstatemodule environment
pkta sldns_buffer which contains sldns_packet data
Returns
0 on failure, out of memory or parse error.

◆ delegpt_addr_addr2str()

void delegpt_addr_addr2str ( struct delegpt_addr * target,
char * dest,
int maxlen )

◆ invalidateQueryInCache()

void invalidateQueryInCache ( struct module_qstate * qstate,
struct query_info * qinfo )

Invalidate the message associated with query_info stored in message cache.

This function invalidates the record in message cache associated with the given query only if such a record exists.

Parameters
qstatemodule environment
qinfoquery info, the query for which answer is stored.

◆ reply_addr2str()

void reply_addr2str ( struct comm_reply * reply,
char * dest,
int maxlen )

Convert reply->addr to string

Parameters
replycomm reply with address in it.
destdestination string.
maxlenlength of string buffer.

◆ storeQueryInCache()

int storeQueryInCache ( struct module_qstate * qstate,
struct query_info * qinfo,
struct reply_info * msgrep,
int is_referral )

Store the reply_info and query_info pair in message cache (qstate->msg_cache)

Parameters
qstatemodule environment
qinfoquery info, the query for which answer is stored.
msgrepreply in dns_msg
is_referralIf true, then the given message to be stored is a referral. The cache implementation may use this as a hint. It will store only the RRsets, not the message.
Returns
0 on alloc error (out of memory).