<listitem><para>passiveUsers (8) — параметр, описывающий количество «замороженных» абонентов;</para></listitem>
<listitem><para>creditUsers (9) — параметр, описывающий количество абонентов с положительным кредитом;</para></listitem>
<listitem><para>freeMbUsers (10) — параметр, описывающий количество абонентов с неизрасходованными «бесплатными мегабайтами»;</para></listitem>
- <listitem><para>tariffChangeUsers (11) — параметр, описывающий количество абонентов у которых с началом месяца будет изменен тариф.</para></listitem>
+ <listitem><para>tariffChangeUsers (11) — параметр, описывающий количество абонентов у которых с началом месяца будет изменен тариф;</para></listitem>
+ <listitem><para>activeUsers (12) — параметр, описывающий количество абонентов у которых имеется посчитанный трафик за сессию.</para></listitem>
</itemizedlist>
</listitem>
<listitem><para>tariffs (2) — секция, содержащая параметры относящиеся к тарифам:</para>
| +-- -R-- Integer32 creditUsers(9)
| +-- -R-- Integer32 freeMbUsers(10)
| +-- -R-- Integer32 tariffChangeUsers(11)
+ | +-- -R-- Integer32 activeUsers(12)
|
+--tariffs(2)
| |
--- /dev/null
+book/*html
char * paddr;
IP_MASK im;
std::vector<std::string> ipMask;
-std::string err;
if (ipsStr.empty())
{
return ips;
strIp = strtok(str, "/");
if (strIp == NULL)
{
- err = "Incorrect IP address " + ipsStr;
return ips;
}
strMask = strtok(NULL, "/");
im.ip = inet_addr(strIp);
if (im.ip == INADDR_NONE)
{
- err = "Incorrect IP address: " + std::string(strIp);
return ips;
}
int m = 0;
if (str2x(strMask, m) != 0)
{
- err = "Incorrect mask: " + std::string(strMask);
return ips;
}
im.mask = m;
if (im.mask > 32)
{
- err = "Incorrect mask: " + std::string(strMask);
return ips;
}
if ((im.ip & ips.CalcMask(im.mask)) != im.ip)
{
- err = "Address does'n match mask: " + std::string(strIp) + "/" + std::string(strMask);
return ips;
}
}
const std::string & msg)
{
const PRIV * priv = admin->GetPriv();
-std::string adm_login = admin->GetLogin();
-std::string adm_ip = admin->GetIPStr();
if ((priv->userConf && !isStat) ||
(priv->userStat && isStat) ||
#define __VERSION_H__
// Stargazer version
-#define SERVER_VERSION "2.408-rc2"
+#define SERVER_VERSION "2.408"
#endif
$(MAKE) -C $(DIR_LIBSRC)
@>deps ;\
for file in $(SRCS); do\
- echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
- printf '%b\n' '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? -eq 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+ fi;\
done
6) OS=bsd5;;
7) OS=bsd7;;
8) OS=bsd7;;
+ 9) OS=bsd7;;
*) OS=unknown;;
esac
MAKE="gmake"
$(MAKE) -C $(DIR_LIBSRC)
@>deps ;\
for file in $(SRCS); do\
- echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
- printf '%b\n' '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? -eq 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+ fi;\
done
6) OS=bsd5;;
7) OS=bsd7;;
8) OS=bsd7;;
+ 9) OS=bsd7;;
*) OS=unknown;;
esac
MAKE="gmake"
install-data:
# Install etc
- mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/stargazer
- install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/stargazer/rscriptd.conf
+ mkdir -m $(DIR_MODE) -p $(PREFIX)/etc/rscriptd
+ install -m $(DATA_MODE) -o $(OWNER) ./rscriptd.conf $(PREFIX)/etc/rscriptd/rscriptd.conf
uninstall: uninstall-bin uninstall-data
uninstall-data:
# Uninstall etc
- rm -f $(PREFIX)/etc/stragazer/rscriptd.conf
+ rm -f $(PREFIX)/etc/rscriptd/rscriptd.conf
ifneq ($(MAKECMDGOALS),distclean)
$(MAKE) -C $(DIR_LIBSRC)
@>deps ;\
for file in $(SRCS); do\
- echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
- printf '%b\n' '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? -eq 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+ fi;\
done
6) OS=bsd5;;
7) OS=bsd7;;
8) OS=bsd7;;
+ 9) OS=bsd7;;
*) OS=unknown;;
esac
MAKE="gmake"
--- /dev/null
+css.h
+sgauth
deps: $(SRCS) ../../Makefile.conf sgauth.css
$(MAKE) -C $(DIR_LIBSRC)
@>deps ;\
- ./make_css.sh
+ ./make_css.sh ;\
for file in $(SRCS); do\
- echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
- printf '%b\n' '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? -eq 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+ fi;\
done
6) OS=bsd5;;
7) OS=bsd7;;
8) OS=bsd7;;
+ 9) OS=bsd7;;
*) OS=unknown;;
esac
MAKE="gmake"
$(MAKE) -C $(DIR_LIBSRC)
@>deps ;\
for file in $(SRCS); do\
- echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
- printf '%b\n' '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? -eq 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+ fi;\
done
6) OS=bsd5;;
7) OS=bsd7;;
8) OS=bsd7;;
+ 9) OS=bsd7;;
*) OS=unknown;;
esac
MAKE="gmake"
$(MAKE) -C $(DIR_LIBSRC)
@>deps ;\
for file in $(SRCS); do\
- echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
- printf '%b\n' '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? -eq 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+ fi;\
done
6) OS=bsd5;;
7) OS=bsd7;;
8) OS=bsd7;;
+ 9) OS=bsd7;;
*) OS=unknown;;
esac
MAKE="gmake"
if (XML_Parse(parser, n->c_str(), len, done) == XML_STATUS_ERROR)
{
- char s[128];
- printf(s, "Parse error at line %d:\n%s\n",
+ printf("Parse error at line %d:\n%s\n",
XML_GetCurrentLineNumber(parser),
XML_ErrorString(XML_GetErrorCode(parser)));
exit(UNKNOWN_ERR_CODE);
$(MAKE) -C $(DIR_LIBSRC)
@>deps ;\
for file in $(SRCS); do\
- echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
- printf '%b\n' '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? -eq 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+ fi;\
done
6) OS=bsd5;;
7) OS=bsd7;;
8) OS=bsd7;;
+ 9) OS=bsd7;;
*) OS=unknown;;
esac
MAKE="gmake"
if (XML_Parse(parser, n->c_str(), len, done) == XML_STATUS_ERROR)
{
- char s[128];
- printf(s, "Parse error at line %d: %s",
+ printf("Parse error at line %d: %s",
XML_GetCurrentLineNumber(parser),
XML_ErrorString(XML_GetErrorCode(parser)));
return st_xml_parse_error;
ln -sf ../conf-available.d/mod_ia.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_ia.conf
ln -sf ../conf-available.d/mod_ping.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_ping.conf
ln -sf ../conf-available.d/mod_sg.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_sg.conf
+ ln -sf ../conf-available.d/store_files.conf $(PREFIX)/etc/stargazer/conf-enabled.d/store_files.conf
ifeq ($(OS),linux)
ln -sf ../conf-available.d/mod_cap_ether.conf $(PREFIX)/etc/stargazer/conf-enabled.d/mod_cap_ether.conf
$(MAKE) -C $(DIR_LIBSRC)
@>deps ;\
for file in $(SRCS); do\
- echo "`$(CC) $(CXXFLAGS) -MM $$file` Makefile ../../Makefile.conf" >> deps ;\
- printf '%b\n' '\t$$(CC) -c $$< $(CXXFLAGS)' >> deps ;\
+ echo "$$file" | grep ".c$$" > /dev/null;\
+ if [ $$? -eq 0 ];\
+ then\
+ echo "`$(CC) $(CFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CC) $(CFLAGS) -c $$<' >> deps ;\
+ else\
+ echo "`$(CXX) $(CXXFLAGS) -MM $$file` Makefile" >> deps ;\
+ printf '%b\n' '\t$$(CXX) $(CXXFLAGS) -c $$<' >> deps ;\
+ fi;\
done
6) OS=bsd5;;
7) OS=bsd7;;
8) OS=bsd7;;
+ 9) OS=bsd7;;
*) OS=unknown;;
esac
ETC_DIR="./inst/freebsd/etc/stargazer"
struct DIVERT_DATA {
int sock;
short int port;
-unsigned char buffer[BUFF_LEN];
char iface[10];
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int BPF_CAP_SETTINGS::ParseSettings(const MODULE_SETTINGS & s)
{
-std::string ifaces;
-
iface.erase(iface.begin(), iface.end());
if (s.moduleParams.empty())
sigfillset(&signalSet);
pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
-ETHER_CAP * dc = (ETHER_CAP *)d;
+ETHER_CAP * dc = static_cast<ETHER_CAP *>(d);
dc->isRunning = true;
struct ETH_IP
{
std::string cookie = paramList.getString(0);
std::string tariff = paramList.getString(1);
-std::string enc;
paramList.verifyEnd(2);
ADMIN_INFO adminInfo;
void USER_HELPER::GetUserInfo(xmlrpc_c::value * info,
bool hidePassword)
{
-std::string enc;
-
std::map<std::string, xmlrpc_c::value> structVal;
structVal["result"] = xmlrpc_c::value_boolean(true);
{
std::string cookie = paramList.getString(0);
std::string login = paramList.getString(1);
-std::string enc;
paramList.verifyEnd(2);
std::map<std::string, xmlrpc_c::value> structVal;
{
std::string cookie = paramList.getString(0);
std::string login = paramList.getString(1);
-std::string enc;
paramList.verifyEnd(2);
ADMIN_INFO adminInfo;
{
std::string cookie = paramList.getString(0);
std::string login = paramList.getString(1);
-std::string enc;
paramList.verifyEnd(2);
ADMIN_INFO adminInfo;
xmlrpc_c::value * const retvalPtr)
{
std::string cookie = paramList.getString(0);
-std::string enc;
paramList.verifyEnd(1);
std::map<std::string, xmlrpc_c::value> structVal;
std::string cookie = paramList.getString(0);
std::string login = paramList.getString(1);
xmlrpc_c::value_struct info(paramList.getStruct(2));
-std::string enc;
paramList.verifyEnd(3);
ADMIN_INFO adminInfo;
std::string login = paramList.getString(1);
double amount = paramList.getDouble(2);
std::string comment = IconvString(paramList.getString(3), "UTF-8", "KOI8-R");
-std::string enc;
paramList.verifyEnd(4);
ADMIN_INFO adminInfo;
std::string login = paramList.getString(1);
double cash = paramList.getDouble(2);
std::string comment = IconvString(paramList.getString(3), "UTF-8", "KOI8-R");
-std::string enc;
paramList.verifyEnd(4);
ADMIN_INFO adminInfo;
std::string tariff = paramList.getString(2);
bool delayed = paramList.getBoolean(3);
std::string comment = IconvString(paramList.getString(4), "UTF-8", "KOI8-R");
-std::string enc;
paramList.verifyEnd(5);
ADMIN_INFO adminInfo;
if (u->GetProperty().nextTariff.Set(tariff,
admin,
login,
- store))
+ store,
+ comment))
{
u->WriteConf();
*retvalPtr = xmlrpc_c::value_boolean(true);
if (u->GetProperty().tariffName.Set(tariff,
admin,
login,
- store))
+ store,
+ comment))
{
u->ResetNextTariff();
u->WriteConf();
//-----------------------------------------------------------------------------
int MYSQL_STORE::MysqlQuery(const char* sQuery,MYSQL * sock) const
{
- int ret,i;
+ int ret;
if( (ret = mysql_query(sock,sQuery)) )
{
- for(i=0; i<RepitTimes; i++)
+ for(int i=0; i<RepitTimes; i++)
{
if( (ret = mysql_query(sock,sQuery)) )
;//need to send error result
pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
printfd(__FILE__, "=====================| pid: %d |===================== \n", getpid());
-USERS_IMPL * us = (USERS_IMPL*) d;
+USERS_IMPL * us = static_cast<USERS_IMPL *>(d);
struct tm t;
time_t tt = stgTime;
--- /dev/null
+*.d
+tests