forked from pjsip/pjproject
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial release of nat64 module by Vitold (#74)
* initial release of nat64 module by Vitold * reworked naming, fixes * potential fix for build system * reworked infrastructure for pjnat64 module * ios build import fix and removed not-needed debug flag * fixes to nat64 module, patching R-URI, contact rewrite * pr review fixes * feedback changes * Update NAT64 module --------- Co-authored-by: Vitold Sedyshev <[email protected]>
- Loading branch information
1 parent
9d41209
commit 07cc148
Showing
6 changed files
with
1,556 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
|
||
include ../../build.mak | ||
include ../../version.mak | ||
include $(PJDIR)/build/common.mak | ||
|
||
export LIBDIR := ../lib | ||
export BINDIR := ../bin | ||
|
||
RULES_MAK := $(PJDIR)/build/rules.mak | ||
|
||
PJLIB_LIB:=../../pjlib/lib/libpj-$(TARGET_NAME)$(LIBEXT) | ||
PJSIP_LIB:=../../pjsip/lib/libpjsip-$(TARGET_NAME)$(LIBEXT) | ||
PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-$(TARGET_NAME)$(LIBEXT) | ||
#PJSIP_SIMPLE_LIB := | ||
#PJSIP_UA_LIB := | ||
#PJSUA_LIB_LIB := | ||
#PJSUA2_LIB_LIB := | ||
|
||
export PJNAT64_LIB:=libpjnat64-$(TARGET_NAME)$(LIBEXT) | ||
|
||
ifeq ($(PJ_SHARED_LIBRARIES),) | ||
else | ||
export PJNAT64_SONAME := libpjnat64.$(SHLIB_SUFFIX) | ||
export PJNAT64_SHLIB := $(PJNAT64_SONAME).$(PJ_VERSION_MAJOR) | ||
endif | ||
|
||
############################################################################### | ||
# Gather all flags. | ||
# | ||
export _CFLAGS := $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \ | ||
$(CFLAGS) $(CC_INC)../include \ | ||
$(CC_INC)../../pjlib/include \ | ||
$(CC_INC)../../pjsip/include \ | ||
$(CC_INC)../../pjlib-util/include \ | ||
$(CC_INC)../../pjnath/include \ | ||
$(CC_INC)../../pjmedia/include | ||
export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \ | ||
$(HOST_CXXFLAGS) $(CXXFLAGS) | ||
export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \ | ||
$(APP_LDFLAGS) $(LDFLAGS) | ||
|
||
############################################################################### | ||
# Defines for building PJNAT64 library | ||
# | ||
export PJNAT64_SRCDIR = ../src/pjnat64 | ||
export PJNAT64_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ | ||
pj-nat64.o | ||
export PJNAT64_CFLAGS += $(_CFLAGS) | ||
export PJNAT64_CXXFLAGS += $(_CXXFLAGS) | ||
export PJNAT64_LDFLAGS += $(PJLIB_LDLIB) $(PJSIP_LDLIB) $(PJMEDIA_LDLIB) $(_LDFLAGS) | ||
|
||
############################################################################### | ||
# Main entry | ||
|
||
TARGETS := $(PJNAT64_LIB) $(PJNAT64_SONAME) | ||
|
||
all: $(TARGETS) | ||
|
||
lib: $(TARGETS) | ||
|
||
doc: | ||
|
||
dep: depend | ||
distclean: realclean | ||
|
||
.PHONY: all dep depend clean realclean distclean | ||
.PHONY: $(TARGETS) | ||
.PHONY: $(PJNAT64_LIB) $(PJNAT64_SONAME) | ||
|
||
pjnat64: $(PJNAT64_LIB) | ||
$(PJNAT64_SONAME): $(PJNAT64_LIB) | ||
$(PJNAT64_LIB) $(PJNAT64_SONAME): $(PJLIB_LIB) $(PJLIB_SONAME) $(PJSIP_LIB) $(PJSIP_SONAME) $(PJMEDIA_LIB) $(PJMEDIA_SONAME) | ||
$(MAKE) -f $(RULES_MAK) APP=PJNAT64 app=pjnat64 $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) | ||
|
||
.PHONY: pjnat64.ko | ||
pjnat64.ko: | ||
echo Making $@ | ||
$(MAKE) -f $(RULES_MAK) APP=PJNAT64 app=pjnat64 $(subst /,$(HOST_PSEP),$(LIBDIR)/$@) | ||
|
||
clean: | ||
$(MAKE) -f $(RULES_MAK) APP=PJNAT64 app=pjnat64 $@ | ||
|
||
realclean: | ||
$(subst @@,$(subst /,$(HOST_PSEP),.pjnat64-$(TARGET_NAME).depend),$(HOST_RMR)) | ||
$(MAKE) -f $(RULES_MAK) APP=PJNAT64 app=pjnat64 $@ | ||
|
||
depend: | ||
$(MAKE) -f $(RULES_MAK) APP=PJNAT64 app=pjnat64 $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#ifndef PJ_NAT64_H_ | ||
#define PJ_NAT64_H_ | ||
|
||
PJ_BEGIN_DECL | ||
|
||
/** | ||
* Enable nat64 rewriting module. | ||
* | ||
*/ | ||
pj_status_t pj_nat64_enable_rewrite_module(); | ||
|
||
/** | ||
* Disable rewriting module, for instance when on a ipv4 network | ||
* | ||
*/ | ||
pj_status_t pj_nat64_disable_rewrite_module(); | ||
|
||
/** | ||
* Enable/disable all IPv6 rewriting module options | ||
* | ||
*/ | ||
void pj_nat64_set_enable(pj_bool_t yesno); | ||
|
||
/** | ||
* Set HPBX server IPv4 address | ||
* | ||
**/ | ||
void pj_nat64_set_server_addr(pj_str_t *addr, int port); | ||
|
||
/** | ||
* Set HPBX server IPv6 address | ||
* | ||
**/ | ||
void pj_nat64_set_server_addr6(pj_str_t *addr, int port); | ||
|
||
/** | ||
* Set account IPv4 address | ||
* | ||
**/ | ||
void pj_nat64_set_client_addr(pj_str_t *addr, int port); | ||
|
||
/** | ||
* Set account IPv6 address | ||
* | ||
**/ | ||
void pj_nat64_set_client_addr6(pj_str_t *addr, int port); | ||
|
||
/** Dump maps | ||
* | ||
**/ | ||
void pj_nat64_dump(); | ||
|
||
/** | ||
* Debug options | ||
* | ||
*/ | ||
void pj_nat64_set_debug(pj_bool_t yesno); | ||
|
||
PJ_END_DECL | ||
|
||
#endif |
Oops, something went wrong.