Skip to content

Commit a9a3f18

Browse files
Expand Flow Table to store more information
Additional data is being stored: 1. The Router's Address 2. The Router's Port 3. The Routers forwarding Address 4. The Routers forwarding Port Part 3 and 4 allow the Router to query the Switcher and get the IP and Port for where to send a client message to.
1 parent e5165f0 commit a9a3f18

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Server/src/Switcher.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Switcher.on('error', (err) => {
1616
* Format of Flow Table - Hardcoded Data
1717
*
1818
* Parameter 1: Router
19-
* Parameter 2: [ In, Out ]
20-
* */
19+
* Parameter 2: [ In, Out, address, port, forwardAddress, forwardPort ]
20+
* */
2121
let FlowTable = new Map<String, String[]>([
22-
["R1", ["E1", "R2"]],
23-
["R2", ["R1", "R3"]],
24-
["R3", ["R2", "E2"]],
22+
["R1", ["E1", "R2", "", "", "", ""]],
23+
["R2", ["R1", "R3", "", "", "", ""]],
24+
["R3", ["R2", "E2", "", "", "", ""]],
2525
]);
2626

2727
let receivingClient = { ip: "", port: 0 };

0 commit comments

Comments
 (0)