aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorDavid M. Syzdek <david.syzdek@acsalaska.com>2020-01-31 11:11:00 -0900
committerDavid M. Syzdek <david.syzdek@acsalaska.com>2020-01-31 11:11:12 -0900
commit8ef68393418d90991a93498e08a33199be96cc9d (patch)
treeedecb17d42bf0d7fbb18ae0b34ee5ceaef254181 /src
parent0b981713a8f51e9f60b036418f1c4d1ad1e6a593 (diff)
downloadakcom-udpecho-8ef68393418d90991a93498e08a33199be96cc9d.tar.gz
akcom-udpecho-8ef68393418d90991a93498e08a33199be96cc9d.tar.bz2
akcom-udpecho-8ef68393418d90991a93498e08a33199be96cc9d.tar.xz
akcom-udpecho-8ef68393418d90991a93498e08a33199be96cc9d.zip
Creating common header
Diffstat (limited to 'src')
-rw-r--r--src/akcom-udpecho.c20
-rw-r--r--src/akcom-udpecho.h109
-rw-r--r--src/akcom-udpechod.c20
3 files changed, 113 insertions, 36 deletions
diff --git a/src/akcom-udpecho.c b/src/akcom-udpecho.c
index b5111b9..4001d71 100644
--- a/src/akcom-udpecho.c
+++ b/src/akcom-udpecho.c
@@ -79,6 +79,8 @@
79#include <signal.h> 79#include <signal.h>
80#include <poll.h> 80#include <poll.h>
81 81
82#include "akcom-udpecho.h"
83
82 84
83/////////////////// 85///////////////////
84// // 86// //
@@ -105,24 +107,6 @@
105///////////////// 107/////////////////
106#pragma mark - Datatypes 108#pragma mark - Datatypes
107 109
108union my_sa
109{
110 struct sockaddr sa;
111 struct sockaddr_in sin;
112 struct sockaddr_in6 sin6;
113 struct sockaddr_storage ss;
114};
115
116
117struct udp_echo_plus
118{
119 uint32_t req_sn;
120 uint32_t res_sn;
121 uint32_t recv_time;
122 uint32_t reply_time;
123 uint32_t failures;
124};
125
126 110
127///////////////// 111/////////////////
128// // 112// //
diff --git a/src/akcom-udpecho.h b/src/akcom-udpecho.h
new file mode 100644
index 0000000..9851ed2
--- /dev/null
+++ b/src/akcom-udpecho.h
@@ -0,0 +1,109 @@
1/*
2 * Alaska Communications UDP Echo Tools
3 * Copyright (C) 2020 Alaska Communications
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * 3. Neither the name of the copyright holder nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32#ifndef _AKCOM_UDP_ECHO_H
33#define _AKCOM_UDP_ECHO_H 1
34
35///////////////
36// //
37// Headers //
38// //
39///////////////
40#pragma mark - Headers
41
42
43///////////////////
44// //
45// Definitions //
46// //
47///////////////////
48#pragma mark - Definitions
49
50#ifndef PACKAGE_NAME
51#define PACKAGE_NAME "akcom-udpecho"
52#endif
53#ifndef PACKAGE_VERSION
54#define PACKAGE_VERSION "0.0"
55#endif
56
57
58/////////////////
59// //
60// Datatypes //
61// //
62/////////////////
63#pragma mark - Datatypes
64
65union my_sa
66{
67 struct sockaddr sa;
68 struct sockaddr_in sin;
69 struct sockaddr_in6 sin6;
70 struct sockaddr_storage ss;
71};
72
73
74struct udp_echo_plus
75{
76 uint32_t req_sn;
77 uint32_t res_sn;
78 uint32_t recv_time;
79 uint32_t reply_time;
80 uint32_t failures;
81};
82
83
84/////////////////
85// //
86// Variables //
87// //
88/////////////////
89#pragma mark - Variables
90
91
92//////////////////
93// //
94// Prototypes //
95// //
96//////////////////
97#pragma mark - Prototypes
98
99
100/////////////////
101// //
102// Functions //
103// //
104/////////////////
105#pragma mark - Functions
106
107
108#endif
109/* end of header file */
diff --git a/src/akcom-udpechod.c b/src/akcom-udpechod.c
index 6b8071e..f7abb0f 100644
--- a/src/akcom-udpechod.c
+++ b/src/akcom-udpechod.c
@@ -81,6 +81,8 @@
81#include <pwd.h> 81#include <pwd.h>
82#include <grp.h> 82#include <grp.h>
83 83
84#include "akcom-udpecho.h"
85
84 86
85/////////////////// 87///////////////////
86// // 88// //
@@ -114,24 +116,6 @@
114///////////////// 116/////////////////
115#pragma mark - Datatypes 117#pragma mark - Datatypes
116 118
117union my_sa
118{
119 struct sockaddr sa;
120 struct sockaddr_in sin;
121 struct sockaddr_in6 sin6;
122 struct sockaddr_storage ss;
123};
124
125
126struct udp_echo_plus
127{
128 uint32_t req_sn;
129 uint32_t res_sn;
130 uint32_t recv_time;
131 uint32_t reply_time;
132 uint32_t failures;
133};
134
135 119
136///////////////// 120/////////////////
137// // 121// //