cpip6edif.c
กก
int markerx (char *in, int in_len, struct searchresult_t *searchresult)
Mark the passing packages in if there is any keyword matched. The length of in is denoted by in_len, and the search result will be put in searchresult. The function will return the number of keyword found in this package.
int wrapedip(struct searchresult_t *searchresult, int currentpk, int nextheader, char *in, int in_len, char *out)
EDIP encapsulation for in, the output will be out in char structure. in_len is the length of in. searchresult is a pointer pointing to the buffer where the result of marking is stored. currentpk denotes the sequence of current packages in the data stream it belongs to. nextheader denotes the what type the payload is in this package.
int mysendstream(char *streamtosend, char *filename, int streamlen, struct shmbuffcp_t *shmbuffcp)
mysendstream is designed to send the stream stored in buffer streamtosend with its file name denoted by filename. The stream length is denoted by streamlen. shmbuffcp is a shmbuffcp_t structure, which is a sender's buffer shared by CP sender (cpsenderedif.c). In this case, mysendstream produces the IPv6 packages and store them in shmbuffcp, while cpsenderedif takes out the IPv6 packages from shmbuffcp one by one and wrap them with IPv4 header and send them through IPv4 network. mysendstream will use markerx, wrapedip and functions from common.h.
int main(int argc, char **argv)
argv is supposed to be the AR's IP address in text format.
กก