Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gdut-drcom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
gdut-drcom
Commits
da947aa9
Commit
da947aa9
authored
Nov 09, 2016
by
chenhaowen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bytes order of ar71xx/brcm63xx
parent
a20a6282
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
Makefile
Makefile
+1
-1
src/Makefile
src/Makefile
+1
-1
src/auth.c
src/auth.c
+13
-10
No files found.
Makefile
View file @
da947aa9
...
...
@@ -6,7 +6,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_NAME
:=
gdut-drcom
# Version: 1.0-1
PKG_VERSION
:=
1.5
PKG_RELEASE
:=
5
PKG_RELEASE
:=
5
b
PKG_MAINTAINER
:=
CHW
# PKG_SOURCE_URL:=
define
Package/gdut-drcom
...
...
src/Makefile
View file @
da947aa9
#CC:=gcc
CFLAGS
+=
-Wall
-DDEBUG
-DVERSION
=
\"
1.5-5
\"
CFLAGS
+=
-Wall
-DDEBUG
-DVERSION
=
\"
1.5-5
b
\"
objects
=
gdut-drcom.o config.o auth.o
...
...
src/auth.c
View file @
da947aa9
...
...
@@ -4,6 +4,9 @@
#include <stdlib.h>
#include <stdint.h>
#include <sys/time.h>
#include <time.h>
#include <endian.h>
#ifdef WIN32
#include <winsock2.h>
typedef
int
socklen_t
;
...
...
@@ -62,7 +65,7 @@ static int make_keep_alive2_pkt2(uint8_t *buf, uint8_t cnt, uint8_t *flag,\
static
void
gen_ka1_checksum
(
uint8_t
*
checksum
,
uint8_t
*
seed
,
uint8_t
mode
);
static
void
gen_ka2_checksum
(
uint8_t
*
data
,
int
len
,
uint8_t
*
checksum
);
static
int32_t
drcomCRC32
(
char
*
data
,
int
len
);
static
uint32_t
drcomCRC32
(
uint8_t
*
data
,
int
len
);
static
void
print_as_hex
(
uint8_t
*
buf
,
int
len
);
/****local functions****/
...
...
@@ -326,13 +329,13 @@ static void print_as_hex(uint8_t *buf, int len)
fflush
(
stdout
);
}
static
int32_t
drcomCRC32
(
char
*
data
,
int
len
)
static
uint32_t
drcomCRC32
(
uint8_t
*
data
,
int
len
)
{
in
t
ret
=
0
;
uint32_
t
ret
=
0
;
int
i
;
for
(
i
=
0
;
i
<
len
;
i
+=
4
)
{
ret
^=
*
(
in
t
*
)(
data
+
i
);
ret
^=
*
(
uint32_
t
*
)(
data
+
i
);
ret
&=
0xffffffff
;
}
return
ret
;
...
...
@@ -390,15 +393,15 @@ static int make_keep_alive1_pkt2(uint8_t *buf, uint8_t *seed,\
index
+=
4
;
/**/
int32_t
temp_num
;
temp_num
=
20000711
;
memcpy
(
buf
+
index
,
(
char
*
)
&
temp_num
,
4
);
temp_num
=
htole32
(
20000711
)
;
memcpy
(
buf
+
index
,
(
uint8_t
*
)
&
temp_num
,
4
);
index
+=
4
;
temp_num
=
126
;
memcpy
(
buf
+
index
,
(
char
*
)
&
temp_num
,
4
);
temp_num
=
htole32
(
126
)
;
memcpy
(
buf
+
index
,
(
uint8_t
*
)
&
temp_num
,
4
);
index
+=
4
;
temp_num
=
(
drcomCRC32
(
buf
,
index
)
*
19680126
)
&
0xffffffff
;
temp_num
=
htole32
(
le32toh
(
drcomCRC32
(
buf
,
index
)
)
*
19680126
)
&
0xffffffff
;
index
-=
8
;
memcpy
(
buf
+
index
,
(
char
*
)
&
temp_num
,
4
);
memcpy
(
buf
+
index
,
(
uint8_t
*
)
&
temp_num
,
4
);
index
+=
4
;
memcpy
(
buf
+
index
,
"
\x00\x00\x00\x00
"
,
4
);
index
+=
4
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment