In RFC 2328 it mentions that link-state information of all Loopback interfaces and all interfaces with network mask as /32 (host ip addresses) are advertised as stub network type. Now what about the cases where a interface with /24 mask is connected to a network and this is the only router interface connected to that network. Technically these are also stub networks right? So how does OSPF determine these /24 interface links as stub or not? Will it look for a OSPF neighbor-ship via that /24 interface and decide if that is a stub network? If that is the case what will be the decision for cases where there is another router connected the same network but doesn't run OSPF.
I hope the question is clear hence have not added any diagrams in case anyone needs some clarification please let me know i'll add diagrams to explain my question.
Making long question short:- While generating Router LSAs how does OSPF decide to choose the link-type(p2p, stub, transit, Virtual-link) ?