It seems that what you want here is set the source variable dependent on an IP address.
You want to avoid a big switch statement in code. Correct me if I'm wrong.
I usually handle these kind of cases with a database table that has the cases I need and the value that goes with it.
ID IPFrom IPTo Source
1 192.168.1.0 192.168.1.0 0.0.0.0
3 165.133.22.1 165.133.22.1 0.0.0.0
2 192.000.1.1 192.000.1.9 0.0.0.0
Etc.
Then write a piece of code (or an SP) that checks if the IP (ipsrc) is between any of the IPFrom and IPTo and get the correct Source value for it. Possibly IPTo could be NULL for the first two rows (whatever you like, it's your design).
The upside is that you do not have a huge switch statement and also that if IP addresses change or get added all you have to do is change or add an IP range to your database table.
Hopefully this is any use to you :)