@@ -44,50 +44,6 @@ public bool TrySupernet(IPNetwork2 network2, [NotNullWhen(true)] out IPNetwork2?
4444 return InternalSupernet ( true , this , network2 , out supernet ) ;
4545 }
4646
47- /// <summary>
48- /// Supernet two consecutive cidr equal subnet into a single one
49- /// 192.168.0.0/24 + 192.168.1.0/24 = 192.168.0.0/23
50- /// 10.1.0.0/16 + 10.0.0.0/16 = 10.0.0.0/15
51- /// 192.168.0.0/24 + 192.168.0.0/25 = 192.168.0.0/24.
52- /// </summary>
53- /// <param name="network1">The first network.</param>
54- /// <param name="network2">The second network.</param>
55- /// <returns>A super netted IP Network.</returns>
56- public static IPNetwork2 Supernet ( IPNetwork2 network1 , IPNetwork2 network2 )
57- {
58- if ( ! InternalSupernet ( false , network1 , network2 , out IPNetwork2 ? supernet ) )
59- {
60- throw new ArgumentException ( "Failed to supernet networks." , nameof ( network2 ) ) ;
61- }
62-
63- return supernet ;
64- }
65-
66- /// <summary>
67- /// Try to supernet two consecutive cidr equal subnet into a single one
68- /// 192.168.0.0/24 + 192.168.1.0/24 = 192.168.0.0/23
69- /// 10.1.0.0/16 + 10.0.0.0/16 = 10.0.0.0/15
70- /// 192.168.0.0/24 + 192.168.0.0/25 = 192.168.0.0/24.
71- /// </summary>
72- /// <param name="network1">The first network.</param>
73- /// <param name="network2">The second network.</param>
74- /// <param name="supernet">The resulting IPNetwork.</param>
75- /// <returns>true if network1 and network2 were super netted successfully; otherwise, false.</returns>
76- public static bool TrySupernet ( IPNetwork2 network1 , IPNetwork2 network2 , [ NotNullWhen ( true ) ] out IPNetwork2 ? supernet )
77- {
78- if ( network1 == null )
79- {
80- throw new ArgumentNullException ( nameof ( network1 ) ) ;
81- }
82-
83- if ( network2 == null )
84- {
85- throw new ArgumentNullException ( nameof ( network2 ) ) ;
86- }
87-
88- return InternalSupernet ( true , network1 , network2 , out supernet ) ;
89- }
90-
9147 /// <summary>
9248 /// Attempts to merge two adjacent IP networks with equal CIDR values into a single supernet.
9349 /// </summary>
0 commit comments