-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared_functions_netfpga.h
72 lines (57 loc) · 1.97 KB
/
shared_functions_netfpga.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* * FILE NAME: shared_functions_netfpga.h
* * HEADER FILE FOR shared_functions_netfpga.c
* * CREATED BY: RICK W. WALLEN
* * DATE CREATED: SEPTEMBER.29.2014
* * DATE LAST MOD: SEPTEMBER.29.2014
* * ___________
* * | |
* * [[|___________|]]
* * \___________/
* * __|[ ]||||[ ]|__
* * \_| # |||| # |_/
* * ___ ===Jeep=== ___
* * |\/\| '' '' |\/\|
* * |/\/| |/\/|
* * |_\_| |_\_|
* */
/**********************************************************************/
/*
* * MODIFIED LOG:
* * <date>-<description>
* * September.29.2014-Adapted from
* */
/**********************************************************************/
#ifndef _SHARED_FUNCTIONS_NETFPGA_
#define _SHARED_FUNCTIONS_NETFPGA_ 1
#include "dns_netfpga.h"
/* FUNCTION PROTOTYPES */
/* F(X) PUT QUERY IN STRING TO SEND UDP */
int qryToStr(char *dest, DnsQuery *org1, char *org2, int *offset);
/* F(X) PULL QUERY FROM STRING IN UDP */
int strToQry(char *org, DnsQuery *dest1, char *dest2, int *offset);
/* F(X) PUT HEADER IN STRING TO SEND UDP */
int hdrToStr(char *dest, DnsHeader *org);
/* F(X) PUT STRING TO HEADER FROM UDP */
int strToHdr(char *org, DnsHeader *dest);
/* F(X) CONVERT DNS NAME FROM STD NOTATION TO QUERY NOTATION PER UNIVERSAL USE*/
int conDnsNameToSend(char *org, char *dest);
/*F(X) CONVERT DNS NAME FROM QUERY TO STD NOTATION */
void conDnsNameToPars(char *org, char *dest);
/*F(X) CONVERT DNS FLAGS TO 16BIT INT */
int flagsToU16I(DnsHdrFlags fg, uint16_t *hdr);
/*F(X) CONVERT 16 BIT INT FLAG INTO DNS FLAGS */
int u16IToFlags(DnsHdrFlags *fg, uint16_t hdr);
/* F(X) TO CHECK NUMERIC */
int myisdigit(char chk);
/* F(X) TO CHECK ALPHABIT */
int myisalpha(char chk);
/* F(X) TO CHECK ALPHA-NUMERIC */
int myisalnum(char chk);
/* F(X) TO CHANGE CHAR TO UPPERCASE */
char mytoupper(char chk);
/*F(X) PRINT DNS HEADER */
//void printHdr(DnsHeader hdr);
/*F(X) PRINT RESOURCE RECORD*/
//void printResRec(RR *rec);
#endif //end if shared_functions.h