(self, remote_ssh, remote_ftp)
| 435 | remote_ftp.put(self.configuration_file_path + "/" + filename, filename) |
| 436 | |
| 437 | def generate_conf(self, remote_ssh, remote_ftp): |
| 438 | if self.intra_routing != "OSPF" and self.intra_routing != "ospf": |
| 439 | return False |
| 440 | if os.path.exists(self.configuration_file_path + "/" + self.file_path + |
| 441 | "/conf/bird-" + |
| 442 | str(self.orbit_number * self.sat_number) + "-" + |
| 443 | str(len(self.GS_lat_long))) == True: |
| 444 | osstr = "rm -f " + self.configuration_file_path+"/"+self.file_path+"/conf/bird-" + \ |
| 445 | str(self.orbit_number*self.sat_number) + "-" + str(len(self.GS_lat_long)) + "/*" |
| 446 | os.system(osstr) |
| 447 | sn_remote_cmd(remote_ssh, "mkdir ~/" + self.file_path + "/conf") |
| 448 | sn_remote_cmd( |
| 449 | remote_ssh, "mkdir ~/" + self.file_path + "/conf/bird-" + |
| 450 | str(self.orbit_number * self.sat_number) + "-" + |
| 451 | str(len(self.GS_lat_long))) |
| 452 | else: |
| 453 | os.makedirs(self.configuration_file_path + "/" + self.file_path + |
| 454 | "/conf/bird-" + |
| 455 | str(self.orbit_number * self.sat_number) + "-" + |
| 456 | str(len(self.GS_lat_long))) |
| 457 | sn_remote_cmd(remote_ssh, "mkdir ~/" + self.file_path + "/conf") |
| 458 | sn_remote_cmd( |
| 459 | remote_ssh, "mkdir ~/" + self.file_path + "/conf/bird-" + |
| 460 | str(self.orbit_number * self.sat_number) + "-" + |
| 461 | str(len(self.GS_lat_long))) |
| 462 | path = self.configuration_file_path + "/" + self.file_path + "/delay/1.txt" |
| 463 | matrix = sn_get_param(path) |
| 464 | num_backbone = self.orbit_number * self.sat_number + len( |
| 465 | self.GS_lat_long) |
| 466 | error = True |
| 467 | for i in range(len(self.AS)): |
| 468 | if len(self.AS[i]) != 1: |
| 469 | for ID in range(self.AS[i][0], self.AS[i][1] + 1): |
| 470 | Q = [] |
| 471 | error = self.compute_conf( |
| 472 | self.orbit_number * self.sat_number, |
| 473 | self.hello_interval, self.AS[i][0], self.AS[i][1], ID, |
| 474 | Q, num_backbone, matrix) |
| 475 | self.print_conf(self.orbit_number * self.sat_number, |
| 476 | len(self.GS_lat_long), ID, Q, remote_ftp) |
| 477 | else: # one node in one AS |
| 478 | ID = self.AS[i][0] |
| 479 | Q = [] |
| 480 | Q.append( |
| 481 | "log \"/var/log/bird.log\" { debug, trace, info, remote, warning, error, auth, fatal, bug };" |
| 482 | ) |
| 483 | Q.append("debug protocols all;") |
| 484 | Q.append("protocol device {") |
| 485 | Q.append("}") |
| 486 | Q.append(" protocol direct {") |
| 487 | Q.append(" disabled; # Disable by default") |
| 488 | Q.append(" ipv4; # Connect to default IPv4 table") |
| 489 | Q.append(" ipv6; # ... and to default IPv6 table") |
| 490 | Q.append("}") |
| 491 | Q.append("protocol kernel {") |
| 492 | Q.append( |
| 493 | " ipv4 { # Connect protocol to IPv4 table by channel") |
| 494 | Q.append( |
no test coverage detected