Mac下关于->您不能拷贝项目“”,因为它的名称太长或包括的字符在目的宗卷上无效。<-的删除

本文介绍了一种通过Mac终端彻底清空废纸篓的方法。首先打开终端并输入特定命令,然后从废纸篓中选取所有项目并将其拖拽至终端窗口内,最后执行命令即可完成清空。
  1. 打开 Terminal 应用程序。
  2. 键入: sudo rm -rf
    注意:在“-rf”后键入一个空格。没有空格该命令将不能执行。在步骤 6 之前请不要按下 Return 键。
  3. 打开您的“废纸篓”。
  4. 从“编辑”菜单中选择“全选”。
  5. 将“废纸篓”中的所有内容都拖到 Terminal 窗口中。这将会使 Terminal 窗口自动填入您的“废纸篓”中的每个条目的名称及位置。
  6. 按下 Return 键。
int rtdDhcpServerAddTempBind(struct client_id *cid, int htype, char *haddr, int haddr_len, DHCP_SERVER_IP ipAddr, struct in_addr subnet, char *poolName, struct dhcp_binding *outBd,BOOL fromMlag) { struct dhcp_binding *binding = NULL; struct hash_member *head = NULL; //DHCP_SERVER_POOL poolParam={}; if (haddr == NULL) { return ERR_BAD_PARAM; } PFM_ENSURE_RET_VAL(poolName, ERR_NO_ERROR); //APPL_IF_ERR_RET(rtdDhcpsPoolGet(poolName,&poolParam )); DHCP_SERVER_RTD_LOCK(); /* * Read binding information from entries with the following format: * idtype:id:subnet:htype:haddr:"expire_date":resource_name */ DBG_DHCP_VRF("ADD TEMP BIND"); if (nbind < DHCPS_IP_MAX_NUM && availreslist == NULL) { nbind = DHCPS_IP_MAX_NUM; rtdDhcpServerGarbageCollect(); } /* Create linked list element. */ head = availreslist; if (availreslist != NULL) { availreslist = availreslist->next; head->next = bindlist; bindlist = head; binding = (struct dhcp_binding *)(head->data); binding->bindtype = AUTO_BIND_TYPE; //binding->ip_addr.ip.s_addr = ipAddr.s_addr; //strncpy(binding->ip_addr.vrfName,poolParam.vrfName,DHCP_VRF_NAME_LEN); COPY_DHCP_SERVER_IP(binding->ip_addr,ipAddr); /* flag set to 0 means not used */ binding->flag = FREE_ENTRY; binding->fromMlag=fromMlag; /* read client identifier value */ memcpy(&binding->cid, cid, sizeof(binding->cid)); /* read subnet number of client */ binding->cid.subnet = subnet; strncpy(binding->cid.vrfName,ipAddr.vrfName,DHCP_VRF_NAME_LEN); /* read hardware address type (e.g. "1" for 10 MB ethernet). */ binding->haddr.htype = htype; /* read client hardware address */ binding->haddr.hlen = haddr_len; memcpy(binding->haddr.haddr, haddr, haddr_len); /* read expiration time for lease */ binding->expire_epoch = 0; /* read expiration time for lease */ binding->temp_epoch = 0; /* if(dhcpsMsgIn.isRxUpMlag) { binding->fromMlag=TRUE; } else { binding->fromMlag=FALSE; } */ if (poolName) { snprintf(binding->poolName, DHCPS_POOLNAME_LEN + 1, "%s", poolName); } hash_del(&cidhashtable, binding->cid.id, binding->cid.idlen, bindcidcmp_not_manual, &binding->cid, free_bind); if ((hash_ins(&cidhashtable, binding->cid.id, binding->cid.idlen, bindcidcmp_not_manual, &binding->cid, binding) < 0)) { head = bindlist; if (bindlist) { bindlist = bindlist->next; } if (head) { head->next = availreslist; } availreslist = head; DHCP_SERVER_RTD_UNLOCK(); return ERR_BAD_PARAM; } hash_del(&iphashtable, (char *)&binding->ip_addr.ip.s_addr, sizeof(UINT32), resipcmp_not_manual, &binding->ip_addr, free_element); if (hash_ins(&iphashtable, (char *)&binding->ip_addr.ip.s_addr, sizeof(UINT32), resipcmp_not_manual, &binding->ip_addr, binding) < 0) { hash_del(&cidhashtable, binding->cid.id, binding->cid.idlen, resipcmp_not_manual, &binding->cid, free_bind); head = bindlist; if (bindlist) { bindlist = bindlist->next; } if (head) { head->next = availreslist; } availreslist = head; DHCP_SERVER_RTD_UNLOCK(); return ERR_BAD_PARAM; } //add_reslist_node(binding); } DBG_DHCP_MLAG("add a temp entry."); _printBinding(*binding); DBG_DHCP_VRF("add client identifier to hash table ok."); if (binding) { _turnoff_bind(binding, TEMP_ENTRY); if (outBd) { memcpy(outBd, binding, sizeof(struct dhcp_binding)); } } else/* binding 为空,添加临时绑定失败 */ { DHCP_SERVER_RTD_UNLOCK(); return ERR_DHCP_SERVER_ADD_TEMP_BIND; } DHCP_SERVER_RTD_UNLOCK(); return ERR_NO_ERROR; } 分析以上代码
07-03
static int dmpKernelNetIfCmdSet(DAL_NETIF_ENTRY *pEntryRecieve, DAL_NETIF_ENTRY_FLAG_E netifFlag, DAL_NETIF_DHCP_FLAG_E dhcpFlag) { if (pEntryRecieve == NULL) { return; } /* 缓存中的entry */ DAL_NETIF_ENTRY entryFind = {}; /* 最后操作的entry */ DAL_NETIF_ENTRY entry2Set = {}; DAL_NETIF_KERNEL_FLAG kernelFlag = 0; /* 找不到,为新增条目 */ if (dalNetIfEntryGetByIfId(pEntryRecieve->if_id, &entryFind) != ERR_NO_ERROR) { /* 填充key */ memcpy(&entry2Set.if_id, &pEntryRecieve->if_id, sizeof(IF_ID)); snprintf(entry2Set.vrfName, sizeof(entry2Set.vrfName), DEFAULT_VRF_NAME); kernelFlag |= DAL_NETIF_KERNEL_FLAG_NEW; } else { memcpy(&entry2Set, &entryFind, sizeof(DAL_NETIF_ENTRY)); } if (DAL_NETIF_ENTRY_FLAG_NONE == flag && DAL_NETIF_ENTRY_FLAG_DNSNONE == dhcpflag) { goto done; } /* 删除 */ if (flag & DAL_NETIF_ENTRY_FLAG_DEL) { /* 如果没找到直接返回,找到了才删除(kernelflag new为false) */ if (!(kernelFlag & DAL_NETIF_KERNEL_FLAG_NEW)) { /* IPV4 设置为FALSE */ hiNetIfIpv4RouteEnableSet(entry2Set.vlanId, FALSE); /* IPV6 设置为FALSE */ hiNetIfIpv6RouteEnableSet(entry2Set.vlanId, FALSE); kernelFlag |= DAL_NETIF_KERNEL_FLAG_DEL; dalNetIfKernelHandle(&entry2Set, kernelFlag); dalNetIfEntryDel(&entry2Set); } goto done; } if (flag & DAL_NETIF_ENTRY_FLAG_VLANID) { entry2Set.vlanId = pEntryRecieve->vlanId; } if (flag & DAL_NETIF_ENTRY_FLAG_MAC) { /* mac变更 */ if (0 != memcmp(pEntryRecieve->mac, entry2Set.mac, MAC_ADDR_SIZE)) { memcpy(entry2Set.mac, pEntryRecieve->mac, MAC_ADDR_SIZE); kernelFlag |= DAL_NETIF_KERNEL_FLAG_MAC_SET; } } if (flag & DAL_NETIF_ENTRY_FLAG_IFX) { entry2Set.ifindex = pEntryRecieve->ifindex; } if (flag & DAL_NETIF_ENTRY_FLAG_SUBIFTYPE) { entry2Set.subType = pEntryRecieve->subType; } if (flag & DAL_NETIF_ENTRY_FLAG_LINKSTATUS) { /* 如果iftype为需要在dmp侧判断linkstatus的类型 */ /* 理论上讲,上层不会下发这几个类型的linkstatus字段 */ /* 如果是从dal数据库恢复linkstatus状态(master->slave) */ if (FALSE == dalNetIfLinkScanFilter(entry2Set.if_id) || flag & DAL_NETIF_ENTRY_FLAG_RELOAD) { entry2Set.linkStatus = pEntryRecieve->linkStatus; /* 设置上kernel flag,直接在kernelhandle中处理 */ kernelFlag |= DAL_NETIF_KERNEL_FLAG_LINK_SET; } } if (flag & DAL_NETIF_ENTRY_FLAG_ADMINSTATUS) { /* 涉及到初始化问题,加上new flag判断 */ if ((kernelFlag & DAL_NETIF_KERNEL_FLAG_NEW) || (entry2Set.adminStatus != pEntryRecieve->adminStatus)) { DBG("recieve status: %d", pEntryRecieve->adminStatus); entry2Set.adminStatus = pEntryRecieve->adminStatus; /* admin set flag仅管理口使用,netIF其他接口走linkscan逻辑 */ kernelFlag |= DAL_NETIF_KERNEL_FLAG_ADMIN_SET; } } if (flag & DAL_NETIF_ENTRY_FLAG_IPV4MODE) { entry2Set.ipv4Mode = pEntryRecieve->ipv4Mode; } if (flag & DAL_NETIF_ENTRY_FLAG_IPV4EN) { /* 涉及到初始化问题,加上new flag判断 */ if ((kernelFlag & DAL_NETIF_KERNEL_FLAG_NEW) || entry2Set.ipv4En != pEntryRecieve->ipv4En) { entry2Set.ipv4En = !!pEntryRecieve->ipv4En; hiNetIfIpv4RouteEnableSet(entry2Set.vlanId, entry2Set.ipv4En); } } if (flag & DAL_NETIF_ENTRY_FLAG_IPV6EN) { /* 涉及到初始化问题,加上new flag判断 */ if ((kernelFlag & DAL_NETIF_KERNEL_FLAG_NEW) || entry2Set.ipv6En != pEntryRecieve->ipv6En) { entry2Set.ipv6En = !!pEntryRecieve->ipv6En; hiNetIfIpv6RouteEnableSet(entry2Set.vlanId, entry2Set.ipv6En); kernelFlag |= DAL_NETIF_KERNEL_FLAG_IPV6_EN; } } if (flag & DAL_NETIF_ENTRY_FLAG_VRFID) { entry2Set.vrfId = pEntryRecieve->vrfId; } if (flag & DAL_NETIF_ENTRY_FLAG_VRFNAME) { if (0 != strncmp(entry2Set.vrfName, pEntryRecieve->vrfName, VRF_NAME_LEN)) { snprintf(entry2Set.vrfName, sizeof(entry2Set.vrfName), pEntryRecieve->vrfName); kernelFlag |= DAL_NETIF_KERNEL_FLAG_VRF_SET; } } if (flag & DAL_NETIF_ENTRY_FLAG_SLAACEN) { entry2Set.slaacEn = pEntryRecieve->slaacEn; } if (flag & DAL_NETIF_ENTRY_FLAG_DHCP6EN) { entry2Set.dhcp6En = pEntryRecieve->dhcp6En; } if (flag & DAL_NETIF_ENTRY_FLAG_LINKLOCALMODE) { entry2Set.linklocalMode = pEntryRecieve->linklocalMode; } if (flag & DAL_NETIF_ENTRY_FLAG_LINKLOCALADDR) { if (0 != memcmp(&entry2Set.linklocalAddr, &pEntryRecieve->linklocalAddr, sizeof(IF_ADDR))) { memcpy(&entry2Set.linklocalAddr, &pEntryRecieve->linklocalAddr, sizeof(IF_ADDR)); kernelFlag |= DAL_NETIF_KERNEL_FLAG_LINKLOCAL_SET; } } if (flag & DAL_NETIF_ENTRY_FLAG_PARENTNAME) { snprintf(entry2Set.parentName, sizeof(entry2Set.parentName), pEntryRecieve->parentName); } if (flag & DAL_NETIF_ENTRY_FLAG_KERNELNAME) { snprintf(entry2Set.kernelName, sizeof(entry2Set.kernelName), pEntryRecieve->kernelName); } if (flag & DAL_NETIF_ENTRY_FLAG_LOCALADDR) { snprintf(entry2Set.localAddr, sizeof(entry2Set.localAddr), pEntryRecieve->localAddr); } if (flag & DAL_NETIF_ENTRY_FLAG_REMOTEADDR) { snprintf(entry2Set.remoteAddr, sizeof(entry2Set.remoteAddr), pEntryRecieve->remoteAddr); } if (flag & DAL_NETIF_ENTRY_FLAG_GROUPADDR) { snprintf(entry2Set.groupAddr, sizeof(entry2Set.groupAddr), pEntryRecieve->groupAddr); } if (flag & DAL_NETIF_ENTRY_FLAG_TTL) { entry2Set.ttl = pEntryRecieve->ttl; } if (flag & DAL_NETIF_ENTRY_FLAG_VNI) { entry2Set.vni = pEntryRecieve->vni; } if (flag & DAL_NETIF_ENTRY_FLAG_DSTPORT) { entry2Set.dstport = pEntryRecieve->dstport; } if (dhcpflag & DAL_NETIF_ENTRY_FLAG_DNS4PRI) { snprintf(entry2Set.dns4Pri, sizeof(entry2Set.dns4Pri), pEntryRecieve->dns4Pri); } if (dhcpflag & DAL_NETIF_ENTRY_FLAG_DNS4SEC) { snprintf(entry2Set.dns4Sec, sizeof(entry2Set.dns4Sec), pEntryRecieve->dns4Sec); } if (dhcpflag & DAL_NETIF_ENTRY_FLAG_DNS6PRI) { snprintf(entry2Set.dns6Pri, sizeof(entry2Set.dns6Pri), pEntryRecieve->dns6Pri); } if (dhcpflag & DAL_NETIF_ENTRY_FLAG_DNS6SEC) { snprintf(entry2Set.dns6Pri, sizeof(entry2Set.dns6Sec), pEntryRecieve->dns6Sec); } /* 只有管理vlan配置的dns可以生效 */ if (entry2Set.if_id.ifType == NETIF_TYPE_VLAN && entry2Set.if_id.ifData.vlanId == 1) { if (IS_DNS4_SET(dhcpflag)) { dalNetIfThreadSaveDnsServerAddr(entry2Set.dns4Pri, entry2Set.dns4Sec); } if (IS_DNS6_SET(dhcpflag)) { dalNetIfThreadSaveDns6ServerAddr(entry2Set.dns6Pri, entry2Set.dns6Sec); } } /* 先更新缓存 */ dalNetIfEntryAdd(&entry2Set); /* 配置内核 */ if (entry2Set.if_id.ifType == NETIF_TYPE_MGMT) { dalMgmtPortIfKernelHandle(&entry2Set, kernelFlag); } else if (entry2Set.if_id.ifType != NETIF_TYPE_NONE) { /* TODO:后续vxlan,vrrp等整合后,需要更细分处理 */ dalNetIfKernelHandle(&entry2Set, kernelFlag); /* 目前只有netif需要操作,后续vrrp可以集成一起 */ if (entry2Set.if_id.ifType == NETIF_TYPE_PORT_CHANNEL || entry2Set.if_id.ifType == NETIF_TYPE_ROUTED_PORT || entry2Set.if_id.ifType == NETIF_TYPE_VLAN) { /* 这里不判断linkstatus写mac了,在linkscan那边操作 */ if (INVALID_VRF_ID != entry2Set.vrfId && entry2Set.vrfName[0] != '\0') { UINT32 hwVrfId = INVALID_VRF_ID; VRF_ID_TO_HW_VRF_ID(entry2Set.vrfId, hwVrfId); DBG("vlanid = %d ! vrfId = %d ! hwVrfId = %d !", entry2Set.vlanId, entry2Set.vrfId, hwVrfId); hiNetIfAddVrf(entry2Set.vlanId, hwVrfId); } } } /* 至少保证配置能下到内核 */ APPL_ENSURE_RET(dalNetIfL2CacheInitCheck()); /* dalNetIfLinkScanFilter为TRUE则通过netiflinkscan判断接口状态 */ dalNetIfLinkScanTrigger(entry2Set.if_id); done: /* 释放 */ dalNetIfFree(pMsg); return ERR_NO_ERROR; } 把这段代码优化一下
最新发布
07-18
static int drv_cmd_set_suspend_mode(struct wlan_hdd_link_info *link_info, 3270 struct hdd_context *hdd_ctx, 3271 uint8_t *command, 3272 uint8_t command_len, 3273 struct hdd_priv_data *priv_data) 3274 { 3275 struct hdd_adapter *adapter = link_info->adapter; 3276 int errno; 3277 uint8_t *value = command; 3278 QDF_STATUS status; 3279 uint8_t idle_monitor; 3280 struct wlan_objmgr_vdev *vdev; 3281 3282 if (QDF_STA_MODE != adapter->device_mode) { 3283 hdd_debug("Non-STA interface"); 3284 return 0; 3285 } 3286 3287 /* Move pointer to ahead of SETSUSPENDMODE<delimiter> */ 3288 value = value + SIZE_OF_SETSUSPENDMODE + 1; 3289 3290 /* Convert the value from ascii to integer */ 3291 errno = kstrtou8(value, 10, &idle_monitor); 3292 if (errno < 0) { 3293 /* 3294 * If the input value is greater than max value of datatype, 3295 * then also kstrtou8 fails 3296 */ 3297 hdd_err("Range validation failed"); 3298 return -EINVAL; 3299 } 3300 3301 hdd_debug("idle_monitor:%d, configure apf per screen state = %d", 3302 idle_monitor, 3303 ucfg_pmo_is_configure_apf_per_screen_state(hdd_ctx->psoc)); 3304 3305 if (sme_get_dhcp_status(hdd_ctx->mac_handle, link_info->vdev_id)) { 3306 hdd_nofl_debug("DHCP in progress. Ignore SETSUSPEND command"); 3307 return 0; 3308 } 3309 3310 if (ucfg_pmo_is_configure_apf_per_screen_state(hdd_ctx->psoc)) { 3311 if (idle_monitor == 0) { 3312 hdd_disable_active_apf_mode(link_info); 3313 adapter->enable_active_apf_mode = false; 3314 } else if (idle_monitor == 1) { 3315 vdev = hdd_objmgr_get_vdev_by_user(link_info, 3316 WLAN_OSIF_ID); 3317 if (!vdev) { 3318 hdd_err("vdev is NULL"); 3319 return -EINVAL; 3320 } 3321 3322 if (ucfg_cm_is_vdev_connected(vdev)) { 3323 hdd_enable_active_apf_mode(link_info); 3324 adapter->enable_active_apf_mode = false; 3325 } else { 3326 hdd_debug("vdev:%d not in connected state", 3327 link_info->vdev_id); 3328 adapter->enable_active_apf_mode = true; 3329 } 3330 3331 hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_ID); 3332 } 3333 } 3334 3335 status = ucfg_pmo_tgt_psoc_send_idle_roam_suspend_mode(hdd_ctx->psoc, 3336 idle_monitor); 3337 if (QDF_IS_STATUS_ERROR(status)) { 3338 hdd_debug("Send suspend mode to fw failed"); 3339 return -EINVAL; 3340 } 3341 return 0; 3342 }解析一下这段Java代码,分析并添加详细注释
06-18
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值