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
8210ef96
Commit
8210ef96
authored
Nov 21, 2016
by
chenhaowen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: compile option of dll
parent
23350d10
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
6 deletions
+33
-6
src/Makefile
src/Makefile
+12
-6
src/config.c
src/config.c
+18
-0
src/config.h
src/config.h
+3
-0
No files found.
src/Makefile
View file @
8210ef96
#CC:=gcc
#CC:=gcc
CFLAGS
+=
-Wall
-DDEBUG
-DVERSION
=
\"
1.6-0
\"
CFLAGS
+=
-Wall
-
fPIC
-
DDEBUG
-DVERSION
=
\"
1.6-0
\"
objects
=
gdut-drcom.o
config.o auth.o
objects
=
config.o auth.o
all
:
gdut-drcom
all
:
gdut-drcom
@
echo
gdut-drcom
@
echo
gdut-drcom
...
@@ -21,11 +21,17 @@ endif
...
@@ -21,11 +21,17 @@ endif
ifeq
($(LANG),)
ifeq
($(LANG),)
LIBS
+=
-lws2_32
LIBS
+=
-lws2_32
DLLNAME
=
gdut-drcom.dll
else
DLLNAME
=
gdut-drcom.so
endif
endif
gdut-drcom
:
$(objects)
gdut-drcom
:
$(objects)
gdut-drcom.o
$(CC)
*
.o
-o
gdut-drcom
$(CFLAGS)
$(LIBS)
$(CC)
*
.o
-o
gdut-drcom
$(CFLAGS)
$(LIBS)
dll
:
$(objects)
$(CC)
-shared
$(objects)
-o
$(DLLNAME)
$(CFLAGS)
$(LIBS)
gdut-drcom.o
:
gdut-drcom.c
gdut-drcom.o
:
gdut-drcom.c
$(CC)
$(CFLAGS)
-c
$<
$(CC)
$(CFLAGS)
-c
$<
...
@@ -35,12 +41,12 @@ auth.o: auth.c config.h
...
@@ -35,12 +41,12 @@ auth.o: auth.c config.h
$(CC)
$(CFLAGS)
-c
$<
$(CC)
$(CFLAGS)
-c
$<
md5.o md4.o sha1.o
:
md5.o md4.o sha1.o
:
$(CC)
-c
crypt/
*
.c
$(CC)
-c
crypt/
*
.c
$(CFLAGS)
.PHONY
:
clean
.PHONY
:
clean
clean
:
clean
:
ifeq
($(LANG),)
ifeq
($(LANG),)
del gdut-drcom.exe
*
.o
del gdut-drcom.exe
*
.o
*
.dll
else
else
$(RM)
gdut-drcom
*
.o
$(RM)
gdut-drcom
*
.o
*
.so
endif
endif
src/config.c
View file @
8210ef96
...
@@ -21,6 +21,24 @@ static int parse_line(char *buf, int size);
...
@@ -21,6 +21,24 @@ static int parse_line(char *buf, int size);
static
void
strstrip
(
char
*
s
,
char
*
chars
);
static
void
strstrip
(
char
*
s
,
char
*
chars
);
/* locale functions */
/* locale functions */
void
set_remote_ip
(
char
*
ip
,
int
len
)
{
memcpy
(
drcom_config
.
remote_ip
,
ip
,
len
);
printf
(
"set remote_ip = %s
\n
"
,
drcom_config
.
remote_ip
);
}
void
set_keep_alive1_flag
(
char
*
flag
,
int
len
)
{
sscanf
(
flag
,
"%02hhx"
,
&
drcom_config
.
keep_alive1_flag
);
printf
(
"set keep_alive1_flag = %02hhx
\n
"
,
drcom_config
.
keep_alive1_flag
);
}
void
set_enable_crypt
(
int
enable
)
{
drcom_config
.
enable_crypt
=
enable
;
printf
(
"set enable_crypt = %d
\n
"
,
enable
);
}
int
parse_config
(
char
*
conf_file_name
)
int
parse_config
(
char
*
conf_file_name
)
{
{
// char conf_file_name[256] = "/etc/gdut-drcom.conf";
// char conf_file_name[256] = "/etc/gdut-drcom.conf";
...
...
src/config.h
View file @
8210ef96
...
@@ -17,5 +17,8 @@ struct config_s {
...
@@ -17,5 +17,8 @@ struct config_s {
extern
struct
config_s
drcom_config
;
extern
struct
config_s
drcom_config
;
int
parse_config
(
char
*
conf_file_name
);
int
parse_config
(
char
*
conf_file_name
);
void
set_remote_ip
(
char
*
ip
,
int
len
);
void
set_keep_alive1_flag
(
char
*
flag
,
int
len
);
void
set_enable_crypt
(
int
enable
);
#endif //__CONFIG_H__
#endif //__CONFIG_H__
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