-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
f = open('') | ||
|
||
p_lid = [[] for i in range(100)] | ||
g_pool = [[] for i in range(100)] | ||
linking = [[] for i in range(10)] | ||
flag=False | ||
|
||
|
||
#confの文字列が変わったら崩れるプログラムなのがイマイチ | ||
for row in f: | ||
split_row = row.split() | ||
#10.1 lid 99 | ||
if "lid" in split_row and "link" not in split_row: | ||
p_lid[int(split_row[2])].append(split_row[0])#lidの番号の位置にpアド「複数」入れる | ||
|
||
#pool10 g-address 111.1 | ||
if "g-address" in row: | ||
g_pool[int(split_row[0][4:])].append(split_row[2])#poolの番号の位置にgアド | ||
|
||
#pool-group 01 | ||
if "pool-group" in split_row: | ||
group_num = int(split_row[1]) | ||
|
||
#Member pool10 | ||
if "Member" in split_row: | ||
linking[group_num].append(split_row[1][4:])#group番号の位置にpool番号 | ||
|
||
#link lid 99 | ||
if "link lid" in row: | ||
previous_s_row = split_row | ||
flag=True | ||
|
||
#pool-group 01 | ||
if flag and "pool-group" in split_row: | ||
for p_ad in p_lid[int(previous_s_row[2])]: | ||
g_pool[int(linking[int(split_row[1])][0])].append(p_ad) | ||
#[g,p,p,p]となる | ||
|
||
f.close() | ||
|
||
|
||
|
||
for num in linking: | ||
if num == []: | ||
continue | ||
num = int(num[0]) | ||
|
||
print("global addressは" + g_pool[num][0] ) | ||
for i in range(1,len(g_pool[num])): | ||
print("|private addressは" + g_pool[num][i] ) |