Skip to content

Commit

Permalink
Merge pull request #9 from Montimage/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
nhnghia authored Sep 9, 2021
2 parents f2d8b2b + e8337a3 commit d9f4cef
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ SYS_NAME = $(shell uname -s)
SYS_VERSION = $(shell uname -p)

#name of package file
ZIP_NAME ?= 5greplay-$(VERSION)_$(GIT_VERSION)_$(SYS_NAME)_$(SYS_VERSION).tar.gz
ZIP_NAME ?= 5greplay-$(VERSION)_$(SYS_NAME)_$(SYS_VERSION).tar.gz
DIST_NAME ?= 5greplay-$(VERSION)

dist: sample-rules
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guide/quickstart/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ The executable versions of 5Greplay are avaiable at [https://github.com/Montimag
# Install wget to be able to download 5Greplay
sudo apt update && sudo apt install -y wget
# Download 5Greplay, version 0.0.1
wget https://github.com/Montimage/5GReplay/releases/download/v0.0.1/5greplay-0.0.1_03501eb_Linux_x86_64.tar.gz
wget https://github.com/Montimage/5GReplay/releases/download/v0.0.1/5greplay-0.0.1_Linux_x86_64.tar.gz
# Decompress 5Greplay
tar -xzf 5greplay-0.0.1_03501eb_Linux_x86_64.tar.gz
tar -xzf 5greplay-0.0.1_Linux_x86_64.tar.gz
# View 5Greplay's parameter
cd 5greplay-0.0.1
./5greplay -h
Expand Down
7 changes: 6 additions & 1 deletion docs/docs/tutorial/replay-open5gs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ In this tutorial, we use executable version of 5Greplay. Further information abo
```bash
sudo apt update && sudo apt install -y wget
# Download 5Greplay, version 0.0.1
wget https://github.com/Montimage/5GReplay/releases/download/v0.0.1/5greplay-0.0.1_03501eb_Linux_x86_64.tar.gz
wget https://github.com/Montimage/5GReplay/releases/download/v0.0.1/5greplay-0.0.1_Linux_x86_64.tar.gz
# Decompress 5Greplay
tar -xzf 5greplay-0.0.1_03501eb_Linux_x86_64.tar.gz
# View 5Greplay's parameter
cd 5greplay-0.0.1
./5greplay replay -h
```

# Install open5Gs
Expand All @@ -29,3 +30,7 @@ sudo apt install open5gs

# Replay 5G traffic

```bash
# Download pcap file
wget https://github.com/Montimage/5GReplay/raw/main/docs/docs/tutorial/replay-open5gs/5g-sa.pcap

File renamed without changes.
7 changes: 0 additions & 7 deletions examples/example1_ngap_smc/readme.md

This file was deleted.

1 change: 1 addition & 0 deletions src/engine/configure.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,6 @@ size_t conf_parse_list( const char *string, char ***proto_lst );
int conf_validate( config_t *conf );

bool conf_parse_input_mode( int *result, const char *string );
bool conf_parse_forward_default_action(int *result, const char *value);

#endif /* SRC_LIB_CONFIGURE_H_ */
17 changes: 17 additions & 0 deletions src/engine/configure_override.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ const char* conf_validate_data_value( const identity_t *ident, const char *data_
return error_reason;
}
break;
case CONF_ATT__FORWARD__DEFAULT:
if( conf_parse_forward_default_action( &enum_val, data_value ) )
return NULL;
else{
snprintf( error_reason, sizeof( error_reason), "Unexpected value [%s] for [%s]", data_value, ident->ident );
return error_reason;
}
break;
//#ifdef SECURITY_MODULE
// case CONF_ATT__SECURITY__INGORE_REMAIN_FLOW:
// if( conf_parse_security_ignore_mode( &enum_val, data_value ) )
Expand Down Expand Up @@ -114,6 +122,15 @@ static inline bool _override_element_by_ident( config_t *conf, const identity_t
}
log_write( LOG_INFO, "Overridden value of configuration parameter '%s' by '%d'", ident->ident, enum_val );
return true;
case CONF_ATT__FORWARD__DEFAULT:
if( conf_parse_forward_default_action( &enum_val, value_str ) )
*((int *)field_ptr) = enum_val;
else{
log_write( LOG_INFO, "Unexpected value [%s] for [%s]", value_str, ident->ident );
return false;
}
log_write( LOG_INFO, "Overridden value of configuration parameter '%s' by '%d'", ident->ident, enum_val );
return true;
default:
break;
}
Expand Down
1 change: 1 addition & 0 deletions src/engine/configure_override.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ DECLARE_CONF_ATT(
(CONF_ATT__FORWARD__OUTPUT_NIC,"forward.output-nic", &conf->forward->output_nic, CHAR_STAR),
(CONF_ATT__FORWARD__SNAP_LEN, "forward.snap-len", &conf->forward->snap_len, UINT16_T),
(CONF_ATT__FORWARD__NB_COPIES, "forward.nb-copies", &conf->forward->nb_copies, UINT32_T),
(CONF_ATT__FORWARD__DEFAULT, "forward.default", &conf->forward->default_action, UINT32_T),
(CONF_ATT__FORWARD__PROMISC, "forward.promisc", &conf->forward->promisc, UINT16_T)
)

Expand Down

0 comments on commit d9f4cef

Please sign in to comment.