/// Attempts to look up a scope_id's index. If an index could not be found, or the
/// string `name` is not a compatible CString (containing an interior null byte),
/// will return 0.
Attempts to look up a scope_id's index. If an index could not be found, or the
string `name` is not a compatible CString (containing an interior null byte),
will return 0.
Attempts to look up a scope_id ' s index . If an index could not be found or the string ` name ` is not a compatible CString ( containing an interior null byte ) will return 0 .
pub fn name_to_scope_id(name: &str) -> u32 {
    match CString::new(name) {
        Ok(s) => unsafe { libc::if_nametoindex(s.as_ptr()) },
        Err(_) => 0,
    }
}
pub fn name_to_scope_id ( name : & str ) -> u32 { match CString :: new ( name ) { Ok ( s ) => unsafe { libc :: if_nametoindex ( s . as_ptr ( ) ) } , Err ( _ ) => 0 , } }
Attempts to look up a scope_id's index.
Attempts to look up a scope_id ' s index .
name
&str