Changeset 87393 in vbox for trunk/src/VBox/NetworkServices/NAT
- Timestamp:
- Jan 23, 2021 12:02:01 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp
r87386 r87393 175 175 static int logInit(int argc, char **argv); 176 176 177 void usage(){ /** @todo should be implemented */ }; 177 virtual void usage() { /** @todo should be implemented */ }; 178 virtual int parseOpt(int rc, const RTGETOPTUNION& getOptVal); 179 178 180 int run(); 179 181 virtual int init(void); 180 virtual int parseOpt(int rc, const RTGETOPTUNION& getOptVal);181 182 /* VBoxNetNAT always needs Main */ 182 183 virtual bool isMainNeeded() const { return true; } … … 273 274 m_ProxyOptions.nameservers = NULL; 274 275 } 276 } 277 278 279 /** 280 * Hook into the option processing. 281 * 282 * Called by VBoxNetBaseService::parseArgs() for options that are not 283 * recognized by the base class. 284 */ 285 int VBoxNetLwipNAT::parseOpt(int rc, const RTGETOPTUNION& Val) 286 { 287 switch (rc) 288 { 289 case 'p': 290 case 'P': 291 { 292 NATSERVICEPORTFORWARDRULE Rule; 293 VECNATSERVICEPF& rules = (rc == 'P'? 294 m_vecPortForwardRule6 295 : m_vecPortForwardRule4); 296 297 fDontLoadRulesOnStartup = true; 298 299 RT_ZERO(Rule); 300 301 int rc2 = netPfStrToPf(Val.psz, (rc == 'P'), &Rule.Pfr); 302 RT_NOREF_PV(rc2); 303 rules.push_back(Rule); 304 return VINF_SUCCESS; 305 } 306 default:; 307 } 308 return VERR_NOT_FOUND; 275 309 } 276 310 … … 1004 1038 1005 1039 1006 int VBoxNetLwipNAT::parseOpt(int rc, const RTGETOPTUNION& Val)1007 {1008 switch (rc)1009 {1010 case 'p':1011 case 'P':1012 {1013 NATSERVICEPORTFORWARDRULE Rule;1014 VECNATSERVICEPF& rules = (rc == 'P'?1015 m_vecPortForwardRule61016 : m_vecPortForwardRule4);1017 1018 fDontLoadRulesOnStartup = true;1019 1020 RT_ZERO(Rule);1021 1022 int rc2 = netPfStrToPf(Val.psz, (rc == 'P'), &Rule.Pfr);1023 RT_NOREF_PV(rc2);1024 rules.push_back(Rule);1025 return VINF_SUCCESS;1026 }1027 default:;1028 }1029 return VERR_NOT_FOUND;1030 }1031 1032 1033 1040 int VBoxNetLwipNAT::processFrame(void *pvFrame, size_t cbFrame) 1034 1041 {
Note:
See TracChangeset
for help on using the changeset viewer.