(ip_string: PyUtf8StrRef, vm: &VirtualMachine)
| 2648 | |
| 2649 | #[pyfunction] |
| 2650 | fn inet_aton(ip_string: PyUtf8StrRef, vm: &VirtualMachine) -> PyResult<Vec<u8>> { |
| 2651 | ip_string |
| 2652 | .as_str() |
| 2653 | .parse::<Ipv4Addr>() |
| 2654 | .map(|ip_addr| Vec::<u8>::from(ip_addr.octets())) |
| 2655 | .map_err(|_| { |
| 2656 | vm.new_os_error("illegal IP address string passed to inet_aton".to_owned()) |
| 2657 | }) |
| 2658 | } |
| 2659 | |
| 2660 | #[pyfunction] |
| 2661 | fn inet_ntoa(packed_ip: ArgBytesLike, vm: &VirtualMachine) -> PyResult<PyStrRef> { |
nothing calls this directly
no test coverage detected