On 7/26/16, Lubomir Rintel <[email protected]> wrote: > On Tue, 2016-07-12 at 17:57 +0530, Atul Anand wrote: >> libnm-core has been expanded to include proxy settings which clients >> like nm-connection-editor use to configure proxy in PacRunner. It >> offers three modes i.e 'none', 'auto' and 'manual' and according take >> data to configure PacRunner. The modes matches on the PacRunner side >> too. >> > >> @@ -751,6 +756,14 @@ _normalize_ip_config (NMConnection *self, >> GHashTable *parameters) >> * to fail. But if no IP4 setting was specified, >> assume the caller was just >> * being lazy. >> */ >> + if (!s_proxy) { >> + setting = nm_setting_proxy_new (); >> + >> + g_object_set (setting, >> + NM_SETTING_PROXY_METHOD, >> NM_SETTING_PROXY_METHOD_NONE, >> + NULL); >> + nm_connection_add_setting (self, setting); >> + } > > I'm not sure if it makes sense to create proxy settings here. Do they > always need to be present? > > If yes, please adjust the tests and the comment. >
As suggested , new patch never creates NMSettingProxy object automatically unless someone initialize using "nmcli connection modify <con-name> proxy.method none/auto/manual" and then add other properties according to modes ex: .... modify <con-name> proxy.pac-url "http://pac.url.com/wpad.dat" when mode is auto, ....modify <con-name> proxy.no-proxy-for "*domain1 *domain2*" when mode is manual etc. However on adding new connection via nm-connection-editor NMSettingProxy is always created along with IPxSettings. I've not a precise idea to differentiate a connection valid for proxying (although it always depends on IPxSetting for getting domains ) If we don't want to see NMSettingProxy appear always on adding new connection via nm-c-e it would be matter of adding few more lines to : gboolean connection_supports_proxy (NMConnection *connection) { NMSettingConnection *s_con; g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); /* Same Stuff as IP4 */ s_con = nm_connection_get_setting_connection (connection); return (nm_setting_connection_get_slave_type (s_con) == NULL); } in connection-editor/connection-helpers.c Thanks. >> --- a/libnm/libnm.ver >> +++ b/libnm/libnm.ver >> @@ -1066,6 +1066,23 @@ libnm_1_2_4 { >> libnm_1_4_0 { >> global: >> nm_device_team_get_config; >> + nm_connection_get_setting_proxy; >> + nm_setting_proxy_get_type; >> + nm_setting_proxy_new; >> + nm_setting_proxy_get_method; >> + nm_setting_proxy_get_http_proxy; >> + nm_setting_proxy_get_http_port; >> + nm_setting_proxy_get_http_default; >> + nm_setting_proxy_get_ssl_proxy; >> + nm_setting_proxy_get_ssl_port; >> + nm_setting_proxy_get_ftp_proxy; >> + nm_setting_proxy_get_ftp_port; >> + nm_setting_proxy_get_socks_proxy; >> + nm_setting_proxy_get_socks_port; >> + nm_setting_proxy_get_socks_version_5; >> + nm_setting_proxy_get_pac_script; >> + nm_setting_proxy_get_no_proxy_for; >> + nm_setting_proxy_get_pac_url; >> nm_setting_connection_get_stable_id; >> nm_setting_ip6_config_get_token; >> nm_setting_ip_config_get_dns_priority; > > Please also add nm_setting_proxy_method_get_type(); mkenums creates the > glib type for the NMSettingProxyMethod typedef and it's needed at least > to generate the introspection data. > _______________________________________________ networkmanager-list mailing list [email protected] https://mail.gnome.org/mailman/listinfo/networkmanager-list
