init ems server code
This commit is contained in:
77
src/accountMgr/c_program/ftpsend/Makefile
Normal file
77
src/accountMgr/c_program/ftpsend/Makefile
Normal file
@@ -0,0 +1,77 @@
|
||||
#/bin/sh
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-g -Wall -I/usr/local/mysql/include
|
||||
CFLAGS.ES=-g -Wall -I/usr/include/mariadb
|
||||
|
||||
COMPILE.c=$(CC) $(CFLAGS)
|
||||
COMPILE.c.ES=$(CC) $(CFLAGS.ES)
|
||||
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
LINK.c.ES=$(CC) $(CFLAGS.ES)
|
||||
|
||||
LINKFLAG=-L../../../omcLib/c_program/omcLib -lomcLib \
|
||||
-L../../../omcLib/c_program/ftp -lftp \
|
||||
-L/usr/local/mysql/lib -lmariadbclient -lz
|
||||
|
||||
|
||||
LINKFLAG.ES=-L../../../omcLib/c_program/omcLib -lomcLib \
|
||||
-L../../../omcLib/c_program/ftp -lftp \
|
||||
-L../../../../plat/snmp/lib -lsnmp \
|
||||
-L../../../../plat/sccp/lib -lsccp \
|
||||
-L../../../../plat/iptrans/lib -liptrans \
|
||||
-L../../../../plat/debug/lib -ldebug \
|
||||
-L../../../../plat/public/lib -lpublic \
|
||||
-L/usr/lib/mysql -lmariadbclient -lz \
|
||||
|
||||
PROGS=ftpSend
|
||||
FTPSEND_OBJ = ftpsend.o
|
||||
FTPSEND_OBJ.ES = ftpsend.o.ES
|
||||
|
||||
default: linuxES
|
||||
|
||||
all:
|
||||
@echo " **** Compiling $(PROGS) ****"
|
||||
@echo "make clean -- Delete the target files"
|
||||
@echo "make linux72 -- Generate target files for Redhat Linux 72"
|
||||
@echo "make linuxES -- Generate target files for Redhat Linux ES"
|
||||
|
||||
linux72: $(FTPSEND_OBJ)
|
||||
@cd ../../../omcLib/c_program/ftp; make linux72; cd ..
|
||||
@cd ../../../accountMgr/c_program/ftpsend;
|
||||
@echo Linking $(PROGS)
|
||||
@$(LINK.c) -o $(PROGS) $(FTPSEND_OBJ) $(LINKFLAG) -lm
|
||||
ar r libftpsend.a $(FTPSEND_OBJ)
|
||||
# rm -rf *.o
|
||||
# rm -rf *bak
|
||||
# rm -rf *~
|
||||
# cp -f $(PROGS) ../../../bin
|
||||
# cp -f $(PROGS) /usr/local/omc/bin/
|
||||
|
||||
linuxES: $(FTPSEND_OBJ.ES)
|
||||
@cd ../../../omcLib/c_program/ftp; make linuxES; cd ..
|
||||
@cd ../../../accountMgr/c_program/ftpsend;
|
||||
@echo Linking $(PROGS)
|
||||
@$(LINK.c.ES) -o $(PROGS) $(FTPSEND_OBJ) $(LINKFLAG.ES) -lm
|
||||
ar r libftpsend.a $(FTPSEND_OBJ)
|
||||
|
||||
installbin: linuxES
|
||||
cp -f $(PROGS) ../../../../bin/
|
||||
|
||||
installomc: linuxES
|
||||
cp -f $(PROGS) /usr/local/omc/bin/
|
||||
|
||||
installall: installbin installomc
|
||||
|
||||
ftpsend.o:ftpsend.c
|
||||
$(COMPILE.c) -c ftpsend.c
|
||||
|
||||
ftpsend.o.ES:ftpsend.c
|
||||
$(COMPILE.c.ES) -c ftpsend.c
|
||||
|
||||
clean:
|
||||
rm -f *.o *.a $(PROGS)
|
||||
@cd ../../../omcLib/c_program/ftp; rm -f *.o *.a; cd ..
|
||||
@cd ../../../accountMgr/c_program/ftpsend; rm -f *.o *.a; cd ..
|
||||
|
||||
|
||||
1062
src/accountMgr/c_program/ftpsend/ftpsend.c
Normal file
1062
src/accountMgr/c_program/ftpsend/ftpsend.c
Normal file
File diff suppressed because it is too large
Load Diff
32
src/accountMgr/c_program/ftpsend/ftpsend.h
Normal file
32
src/accountMgr/c_program/ftpsend/ftpsend.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef ftpsend_H_
|
||||
#define ftpsend_H_
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "../../../../plat/public/src/include/pub_include.h"
|
||||
#include "../../../omcLib/c_program/omcLib/omcLib.h"
|
||||
#include "../../../../plat/snmp/src/include/snmp.h"
|
||||
|
||||
|
||||
#define MAX_FILE_TRANSFER_NUM 32
|
||||
#define WAIT_TIME 60
|
||||
#define INFO_UPDATE_TIME 60
|
||||
|
||||
|
||||
/* The information of the file transfer object */
|
||||
typedef struct FileTransfer
|
||||
{
|
||||
char srcDir[128];
|
||||
char dstDir[128];
|
||||
char dstIP[16];
|
||||
char filter[16];
|
||||
char logName[32];
|
||||
char logPass[32];
|
||||
int curFileIndex;
|
||||
int waitTime;
|
||||
}FileTransfer;
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
8
src/accountMgr/c_program/ftpsend/run
Normal file
8
src/accountMgr/c_program/ftpsend/run
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
make clean
|
||||
sleep 1
|
||||
make linuxES
|
||||
sleep 1
|
||||
./ftpSend
|
||||
|
||||
Reference in New Issue
Block a user